[antlr-interest] How to differentiate between ML_COMMENT and JAVADOC?
a_j_key
a_j_key at yahoo.com
Tue May 20 01:33:23 PDT 2003
Hi!
I've tried the examples from antlr/doc and I'm stuck with following:
I got the rules:
JAVADOC_OPEN: "/**" {selector.push("doclexer");}ML_COMMENT
: "/*"
(options {generateAmbigWarnings=false;}
:{ LA(2)!='/' }? '*'
| '\r' '\n' {newline();}
| '\r' {newline();}
| '\n' {newline();}
| ~('*'|'\n'|'\r')
)*
"*/"
{$setType(Token.SKIP);}
;
(both taken from the java.g/javadoc.g).
Now, the lexer doesn't recognize Javadoc and runs into ml_comment...
Could someone give me a hint?
Second question: In my main method, how can I use filter and selector
in one parser? Do I need two parsers?
Thank you in advance,
A.J.Key
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list