[antlr-interest] Switching between different lexers from within parser

Remi Koutcherawy remi.koutcherawy at wanadoo.fr
Mon Jan 28 13:30:50 PST 2002


> What about a Main_Parser with a larger lookahead or syntactic predicates
> which makes the Main_Lexer consume characters which were intended for B_Lexer?

Seems to work OK, ANTLR behave well.
The Main_lexer may look ahead, but rewind before passing control to sub_lexer.
There are overlap of token between lexers that does not matter.

The tricky stuff with exceptions did not proof to be a good solution : cancel it.
I am still looking for a way to return from a sub_lexer matching an optionnal end token.

Rémi


 

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



More information about the antlr-interest mailing list