Hello,
I have lexer rules for comments something like this:
SINGLELINE: '//' ~[\r\n]* NEWLINE -> channel(HIDDEN);
MULTILINE: '/*' .+? '*/' -> channel(HIDDEN);
WS: [ \r\n\t]+ -> channel(HIDDEN);
NEWLINE: '\r'? '\n';
However, my parser listener is rejecting the parse of the following:
syntax = 'proto2' ; // cf7679b2-dd90-421b-95e4-9f5f9b74c29d
With the following message:
System.InvalidOperationException : line 1, column 25, symbol '/': mismatched input '/' expecting {<EOF>, 'enum', ';', 'extend', 'import', 'message', 'option', 'package'}
With the root Proto rule:
proto: syntaxDecl ( importDecl | packageDecl | optionDecl | topLevelDef | emptyDecl )* EOF;
Somehow not seeing comments prior to EOF? How do I convince the lexer/parser rules to skip the comments prior to EOF?
Cheers,
Michael Powell