Hi Sohail,
> How would you define a lexer to tokenize the following so that the
> grammar rules use EOL?
> x = y // some comment
> // some comment
> x = y
Maybe this works:
COMMENT : "//" (~('\r'|'\n'))+ {$setType(Token.SKIP);}
;
EOL : ('\r')? '\n' {newline();}
;
Best regards,
Lars
--
http://semagia.com