Files
alejo ba5971a788
build / linux-clang (push) Canceled after 0s
build / linux-gcc (push) Canceled after 0s
build / macos-clang (push) Canceled after 0s
build / windows-mingw (push) Canceled after 0s
build / windows-msvc (push) Canceled after 0s
Add project files
2026-10-07 00:25:24 -03:00

19 lines
439 B
ANTLR

// Lexer and parser in separate files.
// antlrlab examples/split/CalcLexer.g4 examples/split/CalcParser.g4 examples/split/input.txt
lexer grammar CalcLexer;
PLUS : '+' ;
MINUS : '-' ;
STAR : '*' ;
SLASH : '/' ;
LPAREN : '(' ;
RPAREN : ')' ;
ASSIGN : '=' ;
SEMI : ';' ;
NUMBER : [0-9]+ ('.' [0-9]+)? ;
IDENT : [a-zA-Z_] [a-zA-Z_0-9]* ;
LINE_COMMENT : '//' ~[\r\n]* -> channel(HIDDEN) ;
WS : [ \t\r\n]+ -> skip ;