CAP/TP02/demo_files/ex1/Example1.g4

10 lines
251 B
Plaintext
Raw Normal View History

2024-09-23 11:04:28 +02:00
//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