[antlr-interest] Re: Handling delimeter separated lists

Jason jasonriz at yahoo.com
Fri Mar 12 15:38:20 PST 2004


> foo_list returns [List l = new ArrayList()] :
> { String f = null; }
> f=foo { l.add(f); } (COMMA f=foo { l.add(f); } )*
> ;
> 
> foo returns [String val = null] :
> foo:FOO { val = foo.getText(); }
> ;
> 
> 
> Hope this helps...
> 
Chris,

Thanks, this solves my problem; I'm glad I asked.  I
didn't realize you could sneak that action into the
midst of the subrule.  I knew there had to be an
easier way.  Thanks again.

-jason

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list