[antlr-interest] How to conditionnally ignore tokens in Parser

coleste2003 coleste2003 at yahoo.ca
Mon Feb 9 07:32:37 PST 2004


Hi,

I'm using ANTLR to update java files, replacing certain methods with regenerated ones. 
Currently, the operation cuts everything between the METHO_DEF and the next "field". This 
eats any comment in-between and doesn't behave nicely when the method is the last field 
of the class.

{Writing this, the solution came: keep the RCURLY to remember the proper position.}

I know the Lexer can SKIP or filter unwanted tokens, a stream could discard or hide them. 
But can the Parser ignore certain tokens most of the time and process them only in certain 
rules? Is there a way for a rule to pull out hidden tokens and process them?




 
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