-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommonTestLanguageLexer.g4
More file actions
42 lines (37 loc) · 1.09 KB
/
commonTestLanguageLexer.g4
File metadata and controls
42 lines (37 loc) · 1.09 KB
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
42
lexer grammar commonTestLanguageLexer;
fragment Lowercase : [a-z] ;
fragment Uppercase : [A-Z] ;
fragment Digit : [0-9];
Whitespace : (' ' | '\t') -> skip;
Newline : ('\n' | '\r' '\n'?) -> skip;
/*Comment : '//' ~Newline* Newline -> skip;*/
Defer : 'defer' ;
Func : 'Func' ;
If : 'if' ;
Then : 'then' ;
Else : 'else' ;
For : 'for' ;
From : 'from';
To : 'to';
In : 'in' ;
By : 'by' ;
Reverse : 'reverse' ;
Var : 'var' ;
Slash : '/' ;
Star : '*' ;
Plus : '+' ;
Minus : '-' ;
LessOrEqual : '<=' ;
Less : '<' ;
GreaterOrEqual : '>=' ;
Greater : '>' ;
Equal : '=' ;
NotEqual : '!=' ;
Negation : '!' ;
Or : '|' ;
And : '&' ;
Xor : '^' ;
Type : Uppercase (Lowercase | Uppercase | '_')* ;
Id : Lowercase (Lowercase | Uppercase | '_')* ;
Integer : Digit+ ;
Float : (Digit+ '.' Digit*) | (Digit* '.' Digit+) ;