-
Notifications
You must be signed in to change notification settings - Fork 0
/
RLTokens.g4
51 lines (46 loc) · 941 Bytes
/
RLTokens.g4
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
43
44
45
46
47
48
49
50
51
lexer grammar RLTokens;
WS: [ \n\t]+ -> skip;
COMMENT: '//' .*? '\n' -> skip;
INLINECOMMENT: '/*' .*? '*/' -> skip;
LET: 'give';
ASSIGN: 'up';
FUN: 'gonna';
THEN: 'then';
IF: 'andifuaskmehowimfeeling';
ELSE: 'wheneveryouneedsomebody';
RETURNOP: 'whenigivemy';
RETURNCL: 'itwillbecompletely';
WHILE: 'togetherforeverwith';
TRY: 'thereaintnomistaking';
CATCH: 'iftheyevergetudown';
IMPORTOP: 'weknowthe';
IMPORTCL: 'andwe\'regonnaplayit';
BREAK: 'desertu';
CONTINUE: 'runaround';
PRINT: 'ijustwannatelluhowimfeeling';
GT: 'greaterthan';
LT: 'lessthan';
GE: 'greaterthanequalto';
LE: 'lessthanequalto';
EQ: 'is';
NE: 'aint';
AND: 'and';
OR: 'or';
NOT: 'not';
PLUS: '+';
MINUS: '-';
MULT: '*';
DIV: '/';
MOD: '%';
POW: '^';
LPAREN: '(';
RPAREN: ')';
LBRACE: '{';
RBRACE: '}';
LBRACKET: '[';
RBRACKET: ']';
COMMA: ',';
QUOTES: '"' | '\'';
ID: [a-zA-Z_][a-zA-Z0-9_]*;
NUMCONST: [0-9]+ ('.' [0-9]+)?;
STRINGCONST: '"' .*? '"' | '\'' .*? '\'';