CAP/TP02/demo_files/ex1/Example1.g4
Emma Nardino ff5f2319ec Add TPO2
2024-09-23 11:04:28 +02:00

10 lines
251 B
ANTLR

//define a lexical analyser called Example1
lexer grammar Example1;
OP : '+'| '*' | '-' | '/' ;
DIGIT : [0-9] ;
LETTER : [A-Za-z] ;
ID : LETTER (LETTER | DIGIT)* ; // match idents
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines