[11 - Antlr Builder] Add other changes

This commit is contained in:
2020-06-10 09:52:37 +02:00
parent 4a304d4955
commit ff8fbbec83
42 changed files with 136 additions and 4546 deletions

View File

@@ -0,0 +1,68 @@
T__22=22
T__23=23
T__24=24
T__25=25
T__26=26
T__27=27
T__28=28
T__29=29
T__30=30
T__31=31
T__32=32
T__33=33
T__34=34
T__35=35
T__36=36
T__37=37
T__38=38
T__39=39
T__40=40
T__41=41
T__42=42
T__43=43
T__44=44
DECL=4
DECLIST=5
ESCAPE=6
EXPR=7
FLOATCONST=8
ID=9
INTCONST=10
MODIFIER=11
PROGRAM=12
STAT=13
STATLIST=14
STRINGCONST=15
TYPE=16
UDIVIDE=17
UMINUS=18
UMULTIPLY=19
UPLUS=20
WS=21
'('=22
')'=23
'*'=19
'+'=20
'-'=18
'.'=24
'/'=17
':'=25
':='=26
';'=27
'<'=28
'='=29
'>'=30
'begin'=31
'else'=32
'end'=33
'float'=34
'for'=35
'if'=36
'int'=37
'print'=38
'program'=39
'read print'=40
'read'=41
'string'=42
'then'=43
'while'=44

View File

@@ -86,7 +86,6 @@ expr2: expr3 (op='*' | op='/') expr -> ^($op expr3 expr)
expr3: op='-' num=number -> ^(UMINUS[op,"UMINUS"] $num)
| number | STRINGCONST | '('! expr^ ')'!;
// Conditions and comparison
compOp: '<' | '>' | '=';
cond: expr cond2;
cond2: compOp expr;