[antlr-interest] C++ TokenStreamSelector

John Reid j.reid at mail.cryst.bbk.ac.uk
Thu Feb 15 08:37:27 PST 2007


Ric Klaren wrote:
> The problem is that antlr uses a recursive descent parser. E.g. the
> call stack of the various parser rules is significant and might have
> to be rewound depending on a number of factors. If you mix in guessing
> mode then things get tricky.
I don't need any guessing to span pushes and pops of the lexer.

> If you're using AST's: Is it an option to pass the tricky bits with
> the delimiters as big chunk to the parser? And then deal with what
> they are in a tree parser ? (E.g. refine the generated AST in an extra
> pass, the good old divide and conquer) Or alternatively use a small
> extra lexer (and maybe even parser) to parse the string with the chunk
> when you encounter them and then built an AST.
I'm going to implement separate lexers (and possibly parsers).

Thanks for your help,
John.



More information about the antlr-interest mailing list