Code:
lexer grammar RedTeaLexer;
//=> Operators
LSHIFT : '<<';
RSHIFT : '>>';
TERNTHEN : '~?';
TERNELSE : '~:';
DOR : '||';
DAND : '&&';
INCR : '++';
DECR : '--';
MPOW : '**';
FLDEV : '//';
DEXCL : '!!';
EQUAL : '==';
DEQUAL : '!=';
GEQUAL : '>=';
LEQUAL : '<=';
LAMBDA : '=>';
DOT : '.';
COMMA : ',';
SEMICOLON : ';';
COLON : ':';
EQUALS : '=';
ADD : '+';
SUBTRACT : '-';
MULTIPLY : '*';
DEVIDE : '/';
HASH : '#';
PR : '%';
ETA : '@';
EXCL : '!';
CARET : '^';
AND : '&';
OR : '|';
GTHAN : '>';
LTHAN : '<';
QUES : '?';
TIDLE : '~';
LPR : '(';
RPR : ')';
LBRT : '[';
RBRT : ']';
LBRC : '{';
RBRC : '}';
//=> Types and Common stuff
fragment ESC : '\\' .;
STRING : '"' ( ESC | ~[\\"\r\n] )* '"' | '\'' ( ESC | ~[\\'\r\n] )* '\'';
SYMBOL : '`' ( ESC | ~[\\`\r\n] )* '`';
NUMBER : [0-9]+;
HEX : '0x' [0-9]+;
//=> Keywords
BOOLEAN : 'true' | 'false';
DECL : 'var' | 'let' | 'const';
ACCESS : 'public' | 'private' | 'protected';
BUILTIN : 'Int' | 'String' | 'Symbol' | 'Boolean' | 'Float';
//=> Other
INDENTIFIER : [A-Za-z_][A-Za-z0-9_]*;
NEWLINE : '\r\n' | 'r' | '\n' ;
WHITESPACE : [\t ] -> skip;
COMMENT : '#-' .*;
BIGCOMS : '#(';
BIGCOME : ')#';
Errors in C# source code:
CS0115 'RedTeaLexer.ChannelNames': no suitable method found to override
Line: 106
CS1729 'Lexer' does not contain a constructor that takes 3 arguments
Line: 68
CS1729 'LexerATNSimulator' does not contain a constructor that takes 4 arguments
Line: 70
@CreatorVilius It appears that you are using the command line code generator from antlr.org with the Antlr4.Runtime NuGet package. This is not supported; you need to use a matching pair for generating and executing code:
Oh, thanks.
Most helpful comment
@CreatorVilius It appears that you are using the command line code generator from antlr.org with the Antlr4.Runtime NuGet package. This is not supported; you need to use a matching pair for generating and executing code: