Posted By:
Jose_Carlos
Posted On:
Sunday, March 14, 2004 08:51 AM
I tried to run the sample to detect multiple-line comments with the code that is presented in an ANTLR tutorial: // multiple-line comments ML_COMMENT : ""/*"" ( { LA(2)!='/' }? '*' | (' '|"" ""|' ') { newline(); } | ~('*'|' '|"" ""|' ') )* ""*/"" { $setType(Token.SKIP); } ; but the version 2.7.2 gives the following error: subrule cannot be inverted. only subroules of the form (T1|T2|T3....) or ('C'1|'C2'|'C3'.....)can be inverted. What could be a solution to that problem? regards jc
More>>
I tried to run the sample to detect multiple-line comments with the code that is presented in an ANTLR tutorial:
// multiple-line comments
ML_COMMENT
: ""/*""
( { LA(2)!='/' }? '*'
| ('
'|""
""|'
') { newline(); }
| ~('*'|'
'|""
""|'
')
)*
""*/""
{ $setType(Token.SKIP); }
;
but the version 2.7.2 gives the following error:
subrule cannot be inverted. only subroules of the form (T1|T2|T3....) or ('C'1|'C2'|'C3'.....)can be inverted.
What could be a solution to that problem?
regards
jc
<<Less