[14 - Optimization] Add XOptimizer and fix most of the tests
This commit is contained in:
@@ -91,6 +91,7 @@ public class AntlrXCompiler {
|
||||
XTypeCheck typeCheck = new XTypeCheck(new CommonTreeNodeStream(xTreeAdaptor, tree));
|
||||
CommonTree typeCheckedTree = typeCheck.program().getTree();
|
||||
|
||||
// Optimizer
|
||||
|
||||
|
||||
// X to Java
|
||||
|
||||
@@ -15,6 +15,8 @@ options {
|
||||
}
|
||||
|
||||
@members {
|
||||
private SymbolTable symbols = SymbolTable.getInstance();
|
||||
|
||||
private String addString(String first, String last) {
|
||||
return first.substring(0, first.length()-1)+last.substring(1);
|
||||
}
|
||||
@@ -57,7 +59,39 @@ options {
|
||||
|
||||
}
|
||||
|
||||
bottomup: uminus | mult_zero_one | calc;
|
||||
|
||||
bottomup: ;
|
||||
uminus:
|
||||
^(UMINUS x=INTCONST) -> INTCONST["-" + $x.text]
|
||||
| ^(UMINUS x=FLOATCONST) -> FLOATCONST["-" + $x.text]
|
||||
;
|
||||
|
||||
mult_zero_one:
|
||||
^('*' x=INTCONST y=ID) { $x.text.equals("0") || $x.text.equals("1") }?
|
||||
-> { $x.text.equals("0") }? INTCONST["0"]
|
||||
-> $y
|
||||
| ^('*' x=ID y=INTCONST) { $y.text.equals("0") || $y.text.equals("1") }?
|
||||
-> { $y.text.equals("0") }? INTCONST["0"]
|
||||
-> $x
|
||||
| ^('*' x=^(('+' | '-' | '*' | '/') .* .*) y=INTCONST)
|
||||
{ $y.text.equals("0") || $y.text.equals("1") }?
|
||||
-> { $y.text.equals("0") }? INTCONST["0"]
|
||||
-> $x
|
||||
| ^('*' x=INTCONST y=^(('+' | '-' | '*' | '/') .* .*))
|
||||
{ $y.text.equals("0") || $y.text.equals("1") }?
|
||||
-> { $y.text.equals("0") }? INTCONST["0"]
|
||||
-> $x
|
||||
;
|
||||
|
||||
calc:
|
||||
^(op=('+' | '-' | '*' | '/') x=INTCONST y=FLOATCONST)
|
||||
-> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))]
|
||||
| ^(op=('+' | '-' | '*' | '/') x=FLOATCONST y=FLOATCONST)
|
||||
-> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))]
|
||||
| ^(op=('+' | '-' | '*' | '/') x=FLOATCONST y=INTCONST)
|
||||
-> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))]
|
||||
| ^(op=('+' | '-' | '*' | '/') x=INTCONST y=INTCONST)
|
||||
-> INTCONST[opInt($x.text, $y.text, $op.text.charAt(0))]
|
||||
| ^(op='+' x=STRINGCONST y=STRINGCONST) -> STRINGCONST[addString($x.text, $y.text)]
|
||||
;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,6 @@ STRINGCONST=16
|
||||
UMINUS=17
|
||||
WS=18
|
||||
ZERO=19
|
||||
T__46=46
|
||||
PLUS=23
|
||||
'('=20
|
||||
')'=21
|
||||
@@ -68,4 +67,3 @@ PLUS=23
|
||||
'string'=43
|
||||
'then'=44
|
||||
'while'=45
|
||||
'todo'=46
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $ANTLR 3.5.2 C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g 2020-06-13 19:14:21
|
||||
// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g 2020-06-17 10:44:01
|
||||
|
||||
package de.dhbw.compiler.antlrxcompiler;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class XTypeCheck extends TreeParser {
|
||||
return adaptor;
|
||||
}
|
||||
@Override public String[] getTokenNames() { return XTypeCheck.tokenNames; }
|
||||
@Override public String getGrammarFileName() { return "C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g"; }
|
||||
@Override public String getGrammarFileName() { return "/Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g"; }
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "decl"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:29:1: decl : ( ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? ) );
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:29:1: decl : ( ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? ) );
|
||||
public final XTypeCheck.decl_return decl() throws RecognitionException {
|
||||
XTypeCheck.decl_return retval = new XTypeCheck.decl_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -142,7 +142,7 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree ID6_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:29:5: ( ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:29:5: ( ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? ) | ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? ) )
|
||||
int alt7=3;
|
||||
int LA7_0 = input.LA(1);
|
||||
if ( (LA7_0==DECL) ) {
|
||||
@@ -219,7 +219,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:30:5: ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:30:5: ^( DECL ID type= 'int' (read= 'read' )? (print= 'print' )? )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -251,7 +251,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
adaptor.addChild(root_1, type_tree);
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:30:30: (read= 'read' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:30:30: (read= 'read' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
if ( (LA1_0==42) ) {
|
||||
@@ -259,7 +259,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:30:30: read= 'read'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:30:30: read= 'read'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
read=(XTree)match(input,42,FOLLOW_42_in_decl91);
|
||||
@@ -273,7 +273,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
}
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:30:44: (print= 'print' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:30:44: (print= 'print' )?
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
if ( (LA2_0==40) ) {
|
||||
@@ -281,7 +281,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:30:44: print= 'print'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:30:44: print= 'print'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
print=(XTree)match(input,40,FOLLOW_40_in_decl96);
|
||||
@@ -305,7 +305,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:32:5: ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:32:5: ^( DECL ID type= 'float' (read= 'read' )? (print= 'print' )? )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -337,7 +337,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
adaptor.addChild(root_1, type_tree);
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:32:32: (read= 'read' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:32:32: (read= 'read' )?
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
if ( (LA3_0==42) ) {
|
||||
@@ -345,7 +345,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:32:32: read= 'read'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:32:32: read= 'read'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
read=(XTree)match(input,42,FOLLOW_42_in_decl121);
|
||||
@@ -359,7 +359,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
}
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:32:46: (print= 'print' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:32:46: (print= 'print' )?
|
||||
int alt4=2;
|
||||
int LA4_0 = input.LA(1);
|
||||
if ( (LA4_0==40) ) {
|
||||
@@ -367,7 +367,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:32:46: print= 'print'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:32:46: print= 'print'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
print=(XTree)match(input,40,FOLLOW_40_in_decl126);
|
||||
@@ -391,7 +391,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:34:5: ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:34:5: ^( DECL ID type= 'string' (read= 'read' )? (print= 'print' )? )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -423,7 +423,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
adaptor.addChild(root_1, type_tree);
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:34:33: (read= 'read' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:34:33: (read= 'read' )?
|
||||
int alt5=2;
|
||||
int LA5_0 = input.LA(1);
|
||||
if ( (LA5_0==42) ) {
|
||||
@@ -431,7 +431,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:34:33: read= 'read'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:34:33: read= 'read'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
read=(XTree)match(input,42,FOLLOW_42_in_decl151);
|
||||
@@ -445,7 +445,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
}
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:34:47: (print= 'print' )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:34:47: (print= 'print' )?
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
if ( (LA6_0==40) ) {
|
||||
@@ -453,7 +453,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:34:47: print= 'print'
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:34:47: print= 'print'
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
print=(XTree)match(input,40,FOLLOW_40_in_decl156);
|
||||
@@ -501,7 +501,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "decllist"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:38:1: decllist : ^( DECLLIST ( decl )* ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:38:1: decllist : ^( DECLLIST ( decl )* ) ;
|
||||
public final XTypeCheck.decllist_return decllist() throws RecognitionException {
|
||||
XTypeCheck.decllist_return retval = new XTypeCheck.decllist_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -518,8 +518,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree DECLLIST7_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:38:9: ( ^( DECLLIST ( decl )* ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:38:17: ^( DECLLIST ( decl )* )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:38:9: ( ^( DECLLIST ( decl )* ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:38:17: ^( DECLLIST ( decl )* )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -538,7 +538,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
if ( input.LA(1)==Token.DOWN ) {
|
||||
match(input, Token.DOWN, null);
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:38:28: ( decl )*
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:38:28: ( decl )*
|
||||
loop8:
|
||||
while (true) {
|
||||
int alt8=2;
|
||||
@@ -549,7 +549,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:38:28: decl
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:38:28: decl
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
pushFollow(FOLLOW_decl_in_decllist185);
|
||||
@@ -598,7 +598,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "expr"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:40:1: expr : ( ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr ) | ^(op= UMINUS e= expr ) | INTCONST | FLOATCONST | STRINGCONST | ID );
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:40:1: expr : ( ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr ) | ^(op= UMINUS e= expr ) | INTCONST | FLOATCONST | STRINGCONST | ID );
|
||||
public final XTypeCheck.expr_return expr() throws RecognitionException {
|
||||
XTypeCheck.expr_return retval = new XTypeCheck.expr_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -625,7 +625,7 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree ID12_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:40:5: ( ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr ) | ^(op= UMINUS e= expr ) | INTCONST | FLOATCONST | STRINGCONST | ID )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:40:5: ( ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr ) | ^(op= UMINUS e= expr ) | INTCONST | FLOATCONST | STRINGCONST | ID )
|
||||
int alt9=6;
|
||||
switch ( input.LA(1) ) {
|
||||
case 22:
|
||||
@@ -668,7 +668,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:41:5: ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:41:5: ^(op= ( '+' | '-' | '/' | '*' ) left= expr right= expr )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -730,7 +730,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:55:7: ^(op= UMINUS e= expr )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:55:7: ^(op= UMINUS e= expr )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -765,7 +765,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:56:7: INTCONST
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:56:7: INTCONST
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -781,7 +781,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:57:7: FLOATCONST
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:57:7: FLOATCONST
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -797,7 +797,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:58:7: STRINGCONST
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:58:7: STRINGCONST
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -813,7 +813,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:59:7: ID
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:59:7: ID
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -860,7 +860,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "assignstat"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:69:1: assignstat : ^(op= ':=' ID e= expr ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:69:1: assignstat : ^(op= ':=' ID e= expr ) ;
|
||||
public final XTypeCheck.assignstat_return assignstat() throws RecognitionException {
|
||||
XTypeCheck.assignstat_return retval = new XTypeCheck.assignstat_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -879,8 +879,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree ID13_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:69:11: ( ^(op= ':=' ID e= expr ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:70:5: ^(op= ':=' ID e= expr )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:69:11: ( ^(op= ':=' ID e= expr ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:70:5: ^(op= ':=' ID e= expr )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -962,7 +962,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "cond"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:92:1: cond : ^(op= ( '<' | '>' | '=' ) left= expr right= expr ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:92:1: cond : ^(op= ( '<' | '>' | '=' ) left= expr right= expr ) ;
|
||||
public final XTypeCheck.cond_return cond() throws RecognitionException {
|
||||
XTypeCheck.cond_return retval = new XTypeCheck.cond_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -980,8 +980,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree op_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:92:5: ( ^(op= ( '<' | '>' | '=' ) left= expr right= expr ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:93:5: ^(op= ( '<' | '>' | '=' ) left= expr right= expr )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:92:5: ( ^(op= ( '<' | '>' | '=' ) left= expr right= expr ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:93:5: ^(op= ( '<' | '>' | '=' ) left= expr right= expr )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1062,7 +1062,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "condstat"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:106:1: condstat : ^(op= 'if' cond stat ( stat )? ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:106:1: condstat : ^(op= 'if' cond stat ( stat )? ) ;
|
||||
public final XTypeCheck.condstat_return condstat() throws RecognitionException {
|
||||
XTypeCheck.condstat_return retval = new XTypeCheck.condstat_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1081,8 +1081,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree op_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:106:9: ( ^(op= 'if' cond stat ( stat )? ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:106:13: ^(op= 'if' cond stat ( stat )? )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:106:9: ( ^(op= 'if' cond stat ( stat )? ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:106:13: ^(op= 'if' cond stat ( stat )? )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1114,7 +1114,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
adaptor.addChild(root_1, stat15.getTree());
|
||||
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:106:33: ( stat )?
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:106:33: ( stat )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
if ( (LA10_0==STATLIST||LA10_0==28||(LA10_0 >= 37 && LA10_0 <= 38)||LA10_0==45) ) {
|
||||
@@ -1122,7 +1122,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:106:33: stat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:106:33: stat
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
pushFollow(FOLLOW_stat_in_condstat442);
|
||||
@@ -1167,7 +1167,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "whilestat"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:108:1: whilestat : ^( 'while' cond stat ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:108:1: whilestat : ^( 'while' cond stat ) ;
|
||||
public final XTypeCheck.whilestat_return whilestat() throws RecognitionException {
|
||||
XTypeCheck.whilestat_return retval = new XTypeCheck.whilestat_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1185,8 +1185,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree string_literal17_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:108:10: ( ^( 'while' cond stat ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:108:13: ^( 'while' cond stat )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:108:10: ( ^( 'while' cond stat ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:108:13: ^( 'while' cond stat )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1249,7 +1249,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "forstat"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:109:1: forstat : ^( 'for' assignstat cond assignstat stat ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:109:1: forstat : ^( 'for' assignstat cond assignstat stat ) ;
|
||||
public final XTypeCheck.forstat_return forstat() throws RecognitionException {
|
||||
XTypeCheck.forstat_return retval = new XTypeCheck.forstat_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1269,8 +1269,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree string_literal20_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:109:8: ( ^( 'for' assignstat cond assignstat stat ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:109:13: ^( 'for' assignstat cond assignstat stat )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:109:8: ( ^( 'for' assignstat cond assignstat stat ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:109:13: ^( 'for' assignstat cond assignstat stat )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1347,7 +1347,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "stat"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:1: stat : ( assignstat | condstat | whilestat | forstat | statlist );
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:1: stat : ( assignstat | condstat | whilestat | forstat | statlist );
|
||||
public final XTypeCheck.stat_return stat() throws RecognitionException {
|
||||
XTypeCheck.stat_return retval = new XTypeCheck.stat_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1366,7 +1366,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:5: ( assignstat | condstat | whilestat | forstat | statlist )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:5: ( assignstat | condstat | whilestat | forstat | statlist )
|
||||
int alt11=5;
|
||||
switch ( input.LA(1) ) {
|
||||
case 28:
|
||||
@@ -1401,7 +1401,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:13: assignstat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:13: assignstat
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1416,7 +1416,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:26: condstat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:26: condstat
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1431,7 +1431,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:37: whilestat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:37: whilestat
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1446,7 +1446,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:49: forstat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:49: forstat
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1461,7 +1461,7 @@ public class XTypeCheck extends TreeParser {
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:111:59: statlist
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:111:59: statlist
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1500,7 +1500,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "statlist"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:113:1: statlist : ^( STATLIST ( stat )* ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:113:1: statlist : ^( STATLIST ( stat )* ) ;
|
||||
public final XTypeCheck.statlist_return statlist() throws RecognitionException {
|
||||
XTypeCheck.statlist_return retval = new XTypeCheck.statlist_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1517,8 +1517,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree STATLIST30_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:113:9: ( ^( STATLIST ( stat )* ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:113:13: ^( STATLIST ( stat )* )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:113:9: ( ^( STATLIST ( stat )* ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:113:13: ^( STATLIST ( stat )* )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
@@ -1537,7 +1537,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
if ( input.LA(1)==Token.DOWN ) {
|
||||
match(input, Token.DOWN, null);
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:113:24: ( stat )*
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:113:24: ( stat )*
|
||||
loop12:
|
||||
while (true) {
|
||||
int alt12=2;
|
||||
@@ -1548,7 +1548,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:113:24: stat
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:113:24: stat
|
||||
{
|
||||
_last = (XTree)input.LT(1);
|
||||
pushFollow(FOLLOW_stat_in_statlist518);
|
||||
@@ -1597,7 +1597,7 @@ public class XTypeCheck extends TreeParser {
|
||||
|
||||
|
||||
// $ANTLR start "program"
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:115:1: program : ^( 'program' ID decllist statlist ) ;
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:115:1: program : ^( 'program' ID decllist statlist ) ;
|
||||
public final XTypeCheck.program_return program() throws RecognitionException {
|
||||
XTypeCheck.program_return retval = new XTypeCheck.program_return();
|
||||
retval.start = input.LT(1);
|
||||
@@ -1617,8 +1617,8 @@ public class XTypeCheck extends TreeParser {
|
||||
XTree ID33_tree=null;
|
||||
|
||||
try {
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:115:8: ( ^( 'program' ID decllist statlist ) )
|
||||
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XTypeCheck.g:115:13: ^( 'program' ID decllist statlist )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:115:8: ( ^( 'program' ID decllist statlist ) )
|
||||
// /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.g:115:13: ^( 'program' ID decllist statlist )
|
||||
{
|
||||
root_0 = (XTree)adaptor.nil();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user