[antlr-interest] Multiple Lexers/Parsers
salmir
salmir19 at yahoo.com
Mon Aug 31 09:12:51 PDT 2009
Hi,
I'm writing a grammar which needs more than one lexer (token scope). I
just found a document from ANTLR 2 documents which explains using
"selector" for this purpose.
Is this approach still valid for ANTLR 3? and should I make different files for different lexers?
When there are more than one parser, what happens to the AST? how can I use rewrite rules?
For example, in the following example, how can I add this rewrite rule -> ^('javadoc' content)
javadoc
: JAVADOC_OPEN
{
// create a parser to handle the javadoc comment
JavaDocParser jdocparser =
new JavaDocParser(getInputState());
jdocparser.content(); // go parse the comment
}
JAVADOC_CLOSE ;
Regards
- Salmir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090831/4dae35e9/attachment.html
More information about the antlr-interest
mailing list