[antlr-interest] Re: referencing the lexer context from the parser
lgcraymer
lgc at mail1.jpl.nasa.gov
Thu Mar 11 16:20:00 PST 2004
--- In antlr-interest at yahoogroups.com, "Jerry Dy" <jerrydy at s...> wrote:
> Does it make sense to access this inTable variable from my parser? If
> so, how is it done? Thanks!
Best advice here is "don't". The problem is lookahead: if k>1, the lexer state may have changed by the time you look at a token.
This also makes for fragile code. Usually, when you feel the urge to tie the lexer to the parser in this way it is time to ask "Am I trying
to do too much in the lexer?" and expect to hear "yes" echoing back.
--Loring
> -Jerry
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