-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Description
Welcome to another "Oh geezus!"
"-> Channel(HIDDEN)" appears to work for target Java (or at least, it compiles). But, for CSharp it does not: the Antlr 4.9.3 tool generates a lexer with a reference to "_channel", which is private in the CSharp runtime. The interesting thing to note is that "-> channel(HIDDEN)" works for both Java and CSharp, but there is no code generated that references "_channel" or a setter of the channel in the runtime. It seems to be handled in a completely different manner, likely in the generated tables.
The code that handles uppercase Channel should probably be ripped out.
// Template generated code from trgen 0.14.1
grammar Arith;
file_ : expression (SEMI expression)* EOF;
expression : expression POW expression | expression (TIMES | DIV) expression | expression (PLUS | MINUS) expression | LPAREN expression RPAREN | (PLUS | MINUS)* atom ;
atom : scientific | variable ;
scientific : SCIENTIFIC_NUMBER ;
variable : VARIABLE ;
VARIABLE : VALID_ID_START VALID_ID_CHAR* ;
SCIENTIFIC_NUMBER : NUMBER (E SIGN? UNSIGNED_INTEGER)? ;
LPAREN : '(' ;
RPAREN : ')' ;
PLUS : '+' ;
MINUS : '-' ;
TIMES : '*' ;
DIV : '/' ;
GT : '>' ;
LT : '<' ;
EQ : '=' ;
POINT : '.' ;
POW : '^' ;
SEMI : ';' ;
WS : [ \r\n\t] + -> channel(HIDDEN) ;
COMMENT : '//' ~[\n\r]* -> Channel(HIDDEN);
fragment VALID_ID_START : ('a' .. 'z') | ('A' .. 'Z') | '_' ;
fragment VALID_ID_CHAR : VALID_ID_START | ('0' .. '9') ;
fragment NUMBER : ('0' .. '9') + ('.' ('0' .. '9') +)? ;
fragment UNSIGNED_INTEGER : ('0' .. '9')+ ;
fragment E : 'E' | 'e' ;
fragment SIGN : ('+' | '-') ;
Metadata
Metadata
Assignees
Labels
No labels