summaryrefslogtreecommitdiff
path: root/Homework/cs5300/project-three/out/production/p3-parser/data/TinyLexer.tokens
blob: ad6b2a7505da27443321ccfc5a456b7c5fb034d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// DO NOT MODIFY THIS FILE.
//
// This file describes the tokens that will be available to the parser
// that uses the grammar described in Tiny.cfg.

lexer grammar TinyLexer;

IF : 'if' ;
THEN : 'then' ;
ELSE : 'else' ;
END : 'end' ;
REPEAT : 'repeat' ;
UNTIL : 'until' ;
READ : 'read' ;
WRITE : 'write' ;
OPAREN : '(' ;
CPAREN : ')' ;

PLUS: '+' ;
MINUS: '-' ;
MULTIPLY: '*' ;
DIVIDE: '/' ;
LT: '<' ;
EQUAL: '=' ;

NUM : DIGIT+ ;
ID : LETTER+ ;

COMMENT
  :   ( '//' ~[\r\n]* '\r'? '\n'
      | '/*' .*? '*/'
      ) -> skip
  ;

WS
  :  (' ' | '\t' | '\n' | '\r' | '\f')+ -> skip
  ; 

fragment LETTER : ('a'..'z' | 'A'..'Z');
fragment DIGIT  : ('0'..'9');