[stringtemplate-interest] ST 3.2 question, passing params through iteration

Terence Parr parrt at cs.usfca.edu
Thu May 3 17:48:57 PDT 2012


That is soooo weird. OH! if you are using angle bracket lexer, that must mean you are using v3. v3 needs you to name those arguments I think.
T
On May 3, 2012, at 3:04 PM, Monty Zukowski wrote:

> I am actually using the angle bracket lexer, don't know if that should
> make a difference:
> 
> <outputs:{it | <outputMethod(it, parentName)>};separator="\n">
> 
> 
> action parse error in group sdk-php line 59; template context is
> [PHPChoreography anonymous]
> line 1:1: unexpected token: outputMethod
> 
> Monty
> 
> On Thu, May 3, 2012 at 7:54 AM, Terence Parr <parrt at cs.usfca.edu> wrote:
>> Hi Monty. hmm…this is correct:
>> 
>>> $outputs:{it | $outputMethod(it, parentName)$};separator="\n"$
>> 
>> what is the error?  have you tried (it, …)?
>> 
>> Ter
>> On May 2, 2012, at 2:41 PM, Monty Zukowski wrote:
>> 
>>> I've got a list called outputs, and I want to have the outputMethod()
>>> applied to it, but I have another attribute from the enclosing
>>> template I would like to pass to each invocation of outputMethod.
>>> 
>>> The template to call is like this:
>>> 
>>> outputMethod(var, parentName)::=<<
>>> ...
>>>>> 
>>> 
>>> I'm trying to invoke it over the outputs list:
>>> 
>>> $outputs:{it | $outputMethod(it, parentName)$};separator="\n"$
>>> 
>>> or
>>> 
>>> $outputs, parentName:{it | $outputMethod(it, parentName)$};separator="\n">
>>> 
>>> 
>>> I can't figure out the correct syntax for this.  I've tried a number
>>> of different things.  Any ideas?
>>> 
>>> Thanks,
>>> 
>>> Monty
>>> _______________________________________________
>>> stringtemplate-interest mailing list
>>> stringtemplate-interest at antlr.org
>>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>> 



More information about the stringtemplate-interest mailing list