Im just starting to learn string template and ive come across the example shown here:
group simple;
vardef(type,name) ::= "<type> <name>;"
method(type,name,args) ::= <<
<type> <name>(<args; separator=",">) {
<statements; separator="\n">
}
>>
What I want to do is pass in a stringtemplate as an argument to the method stringtemplate as follows:
statements(function, arguments) ::= <<
<function>(<arguments; separator=",">);
>>
method(type,name,args, <statements> ) ::= <<
<type> <name>(<args; separator=",">) {
<statements; separator="\n">
}
>>
However that didnt work out so im guessing its not possible to pass stringtemplates to stringtemplates? Then how does statements get populated?
I get the following error when I attempt this:
mytemplate.stg 14:26: invalid character '<'
mytemplate.stg 14:36: invalid character '>'