Hi Christian:

> Is there a way to iterate over a string template in reverse order?

Until Ter implements list reverse, you might try something like this to apply a 
template to a list in reverse order:

----------------------------------
maintemplate(arg1) ::= <<
<rev(arg1)>
>>

rev(argR) ::= <<
<usefultemplate(last(argR))>
<if(trunc(argR))>
<rev(trunc(argR))>
<endif>
>>

usefultemplate(argA) ::= <<
SomethingUseful: <argA>
>>
-----------------------------------

Basically, template rev() applies your useful template to the last() item in 
the list, and recurses on the remainder of the list, stopping when the list is 
empty.

-- Graham



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to