[antlr-interest] how to let parser control lexer state.

femtowin1 femtowin1 at gmail.com
Thu Apr 26 23:25:06 PDT 2007


Hi all, in antlr3, can parser control lexer state
and decide how lexer lexing? some grammar has ambiguity
decided upon by parser knowledge.
  for ruby grammar <<
x << 1
test
1
if x is a variable, then << is shift operator,
otherwise it is a heredoc. so lexing must know
from the symbol table whether x has been defined
beforehand. But current antlrv3 implementation,
lexer lexing to a constant token stream, and feed
it into parser, so can't achieve this effect.
______________________________________
Sent from my www.pageflakes.com startpage


More information about the antlr-interest mailing list