diff --git a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/AntlrXCompiler.java b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/AntlrXCompiler.java index 300e1e0..51cf9b3 100644 --- a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/AntlrXCompiler.java +++ b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/AntlrXCompiler.java @@ -91,8 +91,9 @@ public class AntlrXCompiler { XTypeCheck typeCheck = new XTypeCheck(new CommonTreeNodeStream(xTreeAdaptor, tree)); CommonTree typeCheckedTree = typeCheck.program().getTree(); + // Optimizer + - // X to Java XtoJava javaConverter = new XtoJava(new CommonTreeNodeStream(xTreeAdaptor, typeCheckedTree)); StringTemplate template = (StringTemplate) javaConverter.program().getTemplate(); diff --git a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g index 9ef5949..5b3a3a8 100644 --- a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g +++ b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g @@ -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)] + ; diff --git a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.java b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.java index 343cc0d..adc8599 100644 --- a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.java +++ b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.java @@ -1,185 +1,1888 @@ -// $ANTLR 3.5.2 C:\\Users\\eisenbiegler\\Dropbox\\workspace_cc\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XOptimizer.g 2019-05-23 12:03:27 - - package de.dhbw.compiler.antlrxcompiler; - - -import org.antlr.runtime.*; -import org.antlr.runtime.tree.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; - - -@SuppressWarnings("all") -public class XOptimizer extends TreeRewriter { - public static final String[] tokenNames = new String[] { - "", "", "", "", "COMMENT", "DECL", "DECLLIST", - "DIGIT", "FLOATCONST", "ID", "INTCONST", "INVALID", "LETTER", "OTHER", - "POSDIGIT", "STATLIST", "STRINGCONST", "UMINUS", "WS", "ZERO", "'('", - "')'", "'*'", "'+'", "'-'", "'.'", "'/'", "':'", "':='", "';'", "'<'", - "'='", "'>'", "'begin'", "'else'", "'end'", "'float'", "'for'", "'if'", - "'int'", "'print'", "'program'", "'read'", "'string'", "'then'", "'while'", - "'todo'" - }; - public static final int EOF=-1; - public static final int T__20=20; - public static final int T__21=21; - public static final int T__22=22; - public static final int T__23=23; - public static final int T__24=24; - public static final int T__25=25; - public static final int T__26=26; - public static final int T__27=27; - public static final int T__28=28; - public static final int T__29=29; - public static final int T__30=30; - public static final int T__31=31; - public static final int T__32=32; - public static final int T__33=33; - public static final int T__34=34; - public static final int T__35=35; - public static final int T__36=36; - public static final int T__37=37; - public static final int T__38=38; - public static final int T__39=39; - public static final int T__40=40; - public static final int T__41=41; - public static final int T__42=42; - public static final int T__43=43; - public static final int T__44=44; - public static final int T__45=45; - public static final int COMMENT=4; - public static final int DECL=5; - public static final int DECLLIST=6; - public static final int DIGIT=7; - public static final int FLOATCONST=8; - public static final int ID=9; - public static final int INTCONST=10; - public static final int INVALID=11; - public static final int LETTER=12; - public static final int OTHER=13; - public static final int POSDIGIT=14; - public static final int STATLIST=15; - public static final int STRINGCONST=16; - public static final int UMINUS=17; - public static final int WS=18; - public static final int ZERO=19; - public static final int T__46=46; - public static final int PLUS=23; - - // delegates - public TreeRewriter[] getDelegates() { - return new TreeRewriter[] {}; - } - - // delegators - - - public XOptimizer(TreeNodeStream input) { - this(input, new RecognizerSharedState()); - } - public XOptimizer(TreeNodeStream input, RecognizerSharedState state) { - super(input, state); - } - - protected TreeAdaptor adaptor = new CommonTreeAdaptor(); - - public void setTreeAdaptor(TreeAdaptor adaptor) { - this.adaptor = adaptor; - } - public TreeAdaptor getTreeAdaptor() { - return adaptor; - } - @Override public String[] getTokenNames() { return XOptimizer.tokenNames; } - @Override public String getGrammarFileName() { return "C:\\Users\\eisenbiegler\\Dropbox\\workspace_cc\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XOptimizer.g"; } - - - private String addString(String first, String last) { - return first.substring(0, first.length()-1)+last.substring(1); - } - - private String opInt(String first, String last, char op) { - int firstValue = 0; - int lastValue = 0; - try { - firstValue = Integer.parseInt(first); - lastValue = Integer.parseInt(last); - } catch (Exception e) { - e.printStackTrace(); - } - switch (op) { - case '+': return Integer.toString(firstValue+lastValue); - case '-': return Integer.toString(firstValue-lastValue); - case '*': return Integer.toString(firstValue*lastValue); - case '/': return Integer.toString(firstValue/lastValue); - default: return ""; - } - } - - private String opFloat(String first, String last, char op) { - double firstValue = 0.0; - double lastValue = 0.0; - try { - firstValue = Double.parseDouble(first); - lastValue = Double.parseDouble(last); - } catch (Exception e) { - e.printStackTrace(); - } - switch (op) { - case '+': return Double.toString(firstValue+lastValue); - case '-': return Double.toString(firstValue-lastValue); - case '*': return Double.toString(firstValue*lastValue); - case '/': return Double.toString(firstValue/lastValue); - default: return ""; - } - } - - - - public static class bottomup_return extends TreeRuleReturnScope { - XTree tree; - @Override - public XTree getTree() { return tree; } - }; - - - // $ANTLR start "bottomup" - // C:\\Users\\eisenbiegler\\Dropbox\\workspace_cc\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XOptimizer.g:61:1: bottomup :; - @Override - public final XOptimizer.bottomup_return bottomup() throws RecognitionException { - XOptimizer.bottomup_return retval = new XOptimizer.bottomup_return(); - retval.start = input.LT(1); - - XTree root_0 = null; - - XTree _first_0 = null; - XTree _last = null; - - - try { - // C:\\Users\\eisenbiegler\\Dropbox\\workspace_cc\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XOptimizer.g:61:9: () - // C:\\Users\\eisenbiegler\\Dropbox\\workspace_cc\\CC-Praxis-Antlr X Uebersetzer-Leer\\src\\de\\dhbw\\compiler\\antlrxcompiler\\XOptimizer.g:61:11: - { - if ( state.backtracking==1 ) { - retval.tree = _first_0; - if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) - retval.tree = (XTree)adaptor.getParent(retval.tree); - } - - } - - } - finally { - // do for sure before leaving - } - return retval; - } - // $ANTLR end "bottomup" - - // Delegated rules - - - -} +// $ANTLR 3.5.2 /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g 2020-06-17 11:48:22 + + package de.dhbw.compiler.antlrxcompiler; + + +import org.antlr.runtime.*; +import org.antlr.runtime.tree.*; +import java.util.Stack; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; + + +@SuppressWarnings("all") +public class XOptimizer extends TreeRewriter { + public static final String[] tokenNames = new String[] { + "", "", "", "", "COMMENT", "DECL", "DECLLIST", + "DIGIT", "FLOATCONST", "ID", "INTCONST", "INVALID", "LETTER", "OTHER", + "POSDIGIT", "STATLIST", "STRINGCONST", "UMINUS", "WS", "ZERO", "'('", + "')'", "'*'", "'+'", "'-'", "'.'", "'/'", "':'", "':='", "';'", "'<'", + "'='", "'>'", "'begin'", "'else'", "'end'", "'float'", "'for'", "'if'", + "'int'", "'print'", "'program'", "'read'", "'string'", "'then'", "'while'" + }; + public static final int EOF=-1; + public static final int T__20=20; + public static final int T__21=21; + public static final int T__22=22; + public static final int T__23=23; + public static final int T__24=24; + public static final int T__25=25; + public static final int T__26=26; + public static final int T__27=27; + public static final int T__28=28; + public static final int T__29=29; + public static final int T__30=30; + public static final int T__31=31; + public static final int T__32=32; + public static final int T__33=33; + public static final int T__34=34; + public static final int T__35=35; + public static final int T__36=36; + public static final int T__37=37; + public static final int T__38=38; + public static final int T__39=39; + public static final int T__40=40; + public static final int T__41=41; + public static final int T__42=42; + public static final int T__43=43; + public static final int T__44=44; + public static final int T__45=45; + public static final int COMMENT=4; + public static final int DECL=5; + public static final int DECLLIST=6; + public static final int DIGIT=7; + public static final int FLOATCONST=8; + public static final int ID=9; + public static final int INTCONST=10; + public static final int INVALID=11; + public static final int LETTER=12; + public static final int OTHER=13; + public static final int POSDIGIT=14; + public static final int STATLIST=15; + public static final int STRINGCONST=16; + public static final int UMINUS=17; + public static final int WS=18; + public static final int ZERO=19; + public static final int PLUS=23; + + // delegates + public TreeRewriter[] getDelegates() { + return new TreeRewriter[] {}; + } + + // delegators + + + public XOptimizer(TreeNodeStream input) { + this(input, new RecognizerSharedState()); + } + public XOptimizer(TreeNodeStream input, RecognizerSharedState state) { + super(input, state); + } + + protected TreeAdaptor adaptor = new CommonTreeAdaptor(); + + public void setTreeAdaptor(TreeAdaptor adaptor) { + this.adaptor = adaptor; + } + public TreeAdaptor getTreeAdaptor() { + return adaptor; + } + @Override public String[] getTokenNames() { return XOptimizer.tokenNames; } + @Override public String getGrammarFileName() { return "/Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g"; } + + + private SymbolTable symbols = SymbolTable.getInstance(); + + private String addString(String first, String last) { + return first.substring(0, first.length()-1)+last.substring(1); + } + + private String opInt(String first, String last, char op) { + int firstValue = 0; + int lastValue = 0; + try { + firstValue = Integer.parseInt(first); + lastValue = Integer.parseInt(last); + } catch (Exception e) { + e.printStackTrace(); + } + switch (op) { + case '+': return Integer.toString(firstValue+lastValue); + case '-': return Integer.toString(firstValue-lastValue); + case '*': return Integer.toString(firstValue*lastValue); + case '/': return Integer.toString(firstValue/lastValue); + default: return ""; + } + } + + private String opFloat(String first, String last, char op) { + double firstValue = 0.0; + double lastValue = 0.0; + try { + firstValue = Double.parseDouble(first); + lastValue = Double.parseDouble(last); + } catch (Exception e) { + e.printStackTrace(); + } + switch (op) { + case '+': return Double.toString(firstValue+lastValue); + case '-': return Double.toString(firstValue-lastValue); + case '*': return Double.toString(firstValue*lastValue); + case '/': return Double.toString(firstValue/lastValue); + default: return ""; + } + } + + + + public static class bottomup_return extends TreeRuleReturnScope { + XTree tree; + @Override + public XTree getTree() { return tree; } + }; + + + // $ANTLR start "bottomup" + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:62:1: bottomup : ( uminus | mult_zero_one | calc ); + @Override + public final XOptimizer.bottomup_return bottomup() throws RecognitionException { + XOptimizer.bottomup_return retval = new XOptimizer.bottomup_return(); + retval.start = input.LT(1); + + XTree root_0 = null; + + XTree _first_0 = null; + XTree _last = null; + + + TreeRuleReturnScope uminus1 =null; + TreeRuleReturnScope mult_zero_one2 =null; + TreeRuleReturnScope calc3 =null; + + + try { + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:62:9: ( uminus | mult_zero_one | calc ) + int alt1=3; + switch ( input.LA(1) ) { + case UMINUS: + { + alt1=1; + } + break; + case 22: + { + int LA1_2 = input.LA(2); + if ( (LA1_2==DOWN) ) { + switch ( input.LA(3) ) { + case INTCONST: + { + int LA1_5 = input.LA(4); + if ( (LA1_5==ID) ) { + alt1=2; + } + else if ( (LA1_5==FLOATCONST||LA1_5==INTCONST) ) { + alt1=3; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 1, 5, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case ID: + { + alt1=2; + } + break; + case FLOATCONST: + { + alt1=3; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 1, 4, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 1, 2, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case 23: + case 24: + case 26: + { + alt1=3; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 1, 0, input); + throw nvae; + } + switch (alt1) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:62:11: uminus + { + _last = (XTree)input.LT(1); + pushFollow(FOLLOW_uminus_in_bottomup73); + uminus1=uminus(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==1 ) + + if ( _first_0==null ) _first_0 = (XTree)uminus1.getTree(); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:62:20: mult_zero_one + { + _last = (XTree)input.LT(1); + pushFollow(FOLLOW_mult_zero_one_in_bottomup77); + mult_zero_one2=mult_zero_one(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==1 ) + + if ( _first_0==null ) _first_0 = (XTree)mult_zero_one2.getTree(); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:62:36: calc + { + _last = (XTree)input.LT(1); + pushFollow(FOLLOW_calc_in_bottomup81); + calc3=calc(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==1 ) + + if ( _first_0==null ) _first_0 = (XTree)calc3.getTree(); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "bottomup" + + + public static class uminus_return extends TreeRuleReturnScope { + XTree tree; + @Override + public XTree getTree() { return tree; } + }; + + + // $ANTLR start "uminus" + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:64:1: uminus : ( ^( UMINUS x= INTCONST ) -> INTCONST[\"-\" + $x.text] | ^( UMINUS x= FLOATCONST ) -> FLOATCONST[\"-\" + $x.text] ); + public final XOptimizer.uminus_return uminus() throws RecognitionException { + XOptimizer.uminus_return retval = new XOptimizer.uminus_return(); + retval.start = input.LT(1); + + XTree root_0 = null; + + XTree _first_0 = null; + XTree _last = null; + + + XTree x=null; + XTree UMINUS4=null; + XTree UMINUS5=null; + + XTree x_tree=null; + XTree UMINUS4_tree=null; + XTree UMINUS5_tree=null; + RewriteRuleNodeStream stream_UMINUS=new RewriteRuleNodeStream(adaptor,"token UMINUS"); + RewriteRuleNodeStream stream_FLOATCONST=new RewriteRuleNodeStream(adaptor,"token FLOATCONST"); + RewriteRuleNodeStream stream_INTCONST=new RewriteRuleNodeStream(adaptor,"token INTCONST"); + + try { + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:64:7: ( ^( UMINUS x= INTCONST ) -> INTCONST[\"-\" + $x.text] | ^( UMINUS x= FLOATCONST ) -> FLOATCONST[\"-\" + $x.text] ) + int alt2=2; + int LA2_0 = input.LA(1); + if ( (LA2_0==UMINUS) ) { + int LA2_1 = input.LA(2); + if ( (LA2_1==DOWN) ) { + int LA2_2 = input.LA(3); + if ( (LA2_2==INTCONST) ) { + alt2=1; + } + else if ( (LA2_2==FLOATCONST) ) { + alt2=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 2, 2, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 2, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 2, 0, input); + throw nvae; + } + + switch (alt2) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:65:5: ^( UMINUS x= INTCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + _last = (XTree)input.LT(1); + UMINUS4=(XTree)match(input,UMINUS,FOLLOW_UMINUS_in_uminus93); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_UMINUS.add(UMINUS4); + + if ( state.backtracking==1 ) + if ( _first_0==null ) _first_0 = UMINUS4; + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_uminus97); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(x); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: INTCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 65:26: -> INTCONST[\"-\" + $x.text] + { + adaptor.addChild(root_0, (XTree)adaptor.create(INTCONST, "-" + (x!=null?x.getText():null))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:66:5: ^( UMINUS x= FLOATCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + _last = (XTree)input.LT(1); + UMINUS5=(XTree)match(input,UMINUS,FOLLOW_UMINUS_in_uminus110); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_UMINUS.add(UMINUS5); + + if ( state.backtracking==1 ) + if ( _first_0==null ) _first_0 = UMINUS5; + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,FLOATCONST,FOLLOW_FLOATCONST_in_uminus114); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_FLOATCONST.add(x); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: FLOATCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 66:28: -> FLOATCONST[\"-\" + $x.text] + { + adaptor.addChild(root_0, (XTree)adaptor.create(FLOATCONST, "-" + (x!=null?x.getText():null))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "uminus" + + + public static class mult_zero_one_return extends TreeRuleReturnScope { + XTree tree; + @Override + public XTree getTree() { return tree; } + }; + + + // $ANTLR start "mult_zero_one" + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:69:1: mult_zero_one : ( ^( '*' x= INTCONST y= ID ) {...}? -> { $x.text.equals(\"0\") }? INTCONST[\"0\"] -> $y| ^( '*' x= ID y= INTCONST ) {...}? -> { $y.text.equals(\"0\") }? INTCONST[\"0\"] -> $x); + public final XOptimizer.mult_zero_one_return mult_zero_one() throws RecognitionException { + XOptimizer.mult_zero_one_return retval = new XOptimizer.mult_zero_one_return(); + retval.start = input.LT(1); + + XTree root_0 = null; + + XTree _first_0 = null; + XTree _last = null; + + + XTree x=null; + XTree y=null; + XTree char_literal6=null; + XTree char_literal7=null; + + XTree x_tree=null; + XTree y_tree=null; + XTree char_literal6_tree=null; + XTree char_literal7_tree=null; + RewriteRuleNodeStream stream_22=new RewriteRuleNodeStream(adaptor,"token 22"); + RewriteRuleNodeStream stream_ID=new RewriteRuleNodeStream(adaptor,"token ID"); + RewriteRuleNodeStream stream_INTCONST=new RewriteRuleNodeStream(adaptor,"token INTCONST"); + + try { + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:69:14: ( ^( '*' x= INTCONST y= ID ) {...}? -> { $x.text.equals(\"0\") }? INTCONST[\"0\"] -> $y| ^( '*' x= ID y= INTCONST ) {...}? -> { $y.text.equals(\"0\") }? INTCONST[\"0\"] -> $x) + int alt3=2; + int LA3_0 = input.LA(1); + if ( (LA3_0==22) ) { + int LA3_1 = input.LA(2); + if ( (LA3_1==DOWN) ) { + int LA3_2 = input.LA(3); + if ( (LA3_2==INTCONST) ) { + alt3=1; + } + else if ( (LA3_2==ID) ) { + alt3=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 3, 2, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 3, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 3, 0, input); + throw nvae; + } + + switch (alt3) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:70:5: ^( '*' x= INTCONST y= ID ) {...}? + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + _last = (XTree)input.LT(1); + char_literal6=(XTree)match(input,22,FOLLOW_22_in_mult_zero_one135); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(char_literal6); + + if ( state.backtracking==1 ) + if ( _first_0==null ) _first_0 = char_literal6; + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_mult_zero_one139); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,ID,FOLLOW_ID_in_mult_zero_one143); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_ID.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + if ( !(( (x!=null?x.getText():null).equals("0") || (x!=null?x.getText():null).equals("1") )) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "mult_zero_one", " $x.text.equals(\"0\") || $x.text.equals(\"1\") "); + } + // AST REWRITE + // elements: y, INTCONST + // token labels: y + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleNodeStream stream_y=new RewriteRuleNodeStream(adaptor,"token y",y); + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 71:5: -> { $x.text.equals(\"0\") }? INTCONST[\"0\"] + if ( (x!=null?x.getText():null).equals("0") ) { + adaptor.addChild(root_0, (XTree)adaptor.create(INTCONST, "0")); + } + + else // 72:5: -> $y + { + adaptor.addChild(root_0, stream_y.nextNode()); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:73:5: ^( '*' x= ID y= INTCONST ) {...}? + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + _last = (XTree)input.LT(1); + char_literal7=(XTree)match(input,22,FOLLOW_22_in_mult_zero_one173); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(char_literal7); + + if ( state.backtracking==1 ) + if ( _first_0==null ) _first_0 = char_literal7; + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,ID,FOLLOW_ID_in_mult_zero_one177); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_ID.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_mult_zero_one181); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + if ( !(( (y!=null?y.getText():null).equals("0") || (y!=null?y.getText():null).equals("1") )) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "mult_zero_one", " $y.text.equals(\"0\") || $y.text.equals(\"1\") "); + } + // AST REWRITE + // elements: x, INTCONST + // token labels: x + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleNodeStream stream_x=new RewriteRuleNodeStream(adaptor,"token x",x); + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 74:5: -> { $y.text.equals(\"0\") }? INTCONST[\"0\"] + if ( (y!=null?y.getText():null).equals("0") ) { + adaptor.addChild(root_0, (XTree)adaptor.create(INTCONST, "0")); + } + + else // 75:5: -> $x + { + adaptor.addChild(root_0, stream_x.nextNode()); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "mult_zero_one" + + + public static class calc_return extends TreeRuleReturnScope { + XTree tree; + @Override + public XTree getTree() { return tree; } + }; + + + // $ANTLR start "calc" + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:78:1: 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)] ); + public final XOptimizer.calc_return calc() throws RecognitionException { + XOptimizer.calc_return retval = new XOptimizer.calc_return(); + retval.start = input.LT(1); + + XTree root_0 = null; + + XTree _first_0 = null; + XTree _last = null; + + + XTree op=null; + XTree x=null; + XTree y=null; + + XTree op_tree=null; + XTree x_tree=null; + XTree y_tree=null; + RewriteRuleNodeStream stream_22=new RewriteRuleNodeStream(adaptor,"token 22"); + RewriteRuleNodeStream stream_23=new RewriteRuleNodeStream(adaptor,"token 23"); + RewriteRuleNodeStream stream_STRINGCONST=new RewriteRuleNodeStream(adaptor,"token STRINGCONST"); + RewriteRuleNodeStream stream_24=new RewriteRuleNodeStream(adaptor,"token 24"); + RewriteRuleNodeStream stream_FLOATCONST=new RewriteRuleNodeStream(adaptor,"token FLOATCONST"); + RewriteRuleNodeStream stream_26=new RewriteRuleNodeStream(adaptor,"token 26"); + RewriteRuleNodeStream stream_INTCONST=new RewriteRuleNodeStream(adaptor,"token INTCONST"); + + try { + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:78:5: ( ^(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)] ) + int alt8=5; + switch ( input.LA(1) ) { + case 23: + { + int LA8_1 = input.LA(2); + if ( (LA8_1==DOWN) ) { + switch ( input.LA(3) ) { + case STRINGCONST: + { + alt8=5; + } + break; + case INTCONST: + { + int LA8_8 = input.LA(4); + if ( (LA8_8==FLOATCONST) ) { + alt8=1; + } + else if ( (LA8_8==INTCONST) ) { + alt8=4; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 8, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case FLOATCONST: + { + int LA8_9 = input.LA(4); + if ( (LA8_9==FLOATCONST) ) { + alt8=2; + } + else if ( (LA8_9==INTCONST) ) { + alt8=3; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 9, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 5, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 8, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case 24: + { + int LA8_2 = input.LA(2); + if ( (LA8_2==DOWN) ) { + int LA8_6 = input.LA(3); + if ( (LA8_6==INTCONST) ) { + int LA8_8 = input.LA(4); + if ( (LA8_8==FLOATCONST) ) { + alt8=1; + } + else if ( (LA8_8==INTCONST) ) { + alt8=4; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 8, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + else if ( (LA8_6==FLOATCONST) ) { + int LA8_9 = input.LA(4); + if ( (LA8_9==FLOATCONST) ) { + alt8=2; + } + else if ( (LA8_9==INTCONST) ) { + alt8=3; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 9, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 6, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 8, 2, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case 22: + { + int LA8_3 = input.LA(2); + if ( (LA8_3==DOWN) ) { + int LA8_6 = input.LA(3); + if ( (LA8_6==INTCONST) ) { + int LA8_8 = input.LA(4); + if ( (LA8_8==FLOATCONST) ) { + alt8=1; + } + else if ( (LA8_8==INTCONST) ) { + alt8=4; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 8, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + else if ( (LA8_6==FLOATCONST) ) { + int LA8_9 = input.LA(4); + if ( (LA8_9==FLOATCONST) ) { + alt8=2; + } + else if ( (LA8_9==INTCONST) ) { + alt8=3; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 9, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 6, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 8, 3, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + case 26: + { + int LA8_4 = input.LA(2); + if ( (LA8_4==DOWN) ) { + int LA8_6 = input.LA(3); + if ( (LA8_6==INTCONST) ) { + int LA8_8 = input.LA(4); + if ( (LA8_8==FLOATCONST) ) { + alt8=1; + } + else if ( (LA8_8==INTCONST) ) { + alt8=4; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 8, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + else if ( (LA8_6==FLOATCONST) ) { + int LA8_9 = input.LA(4); + if ( (LA8_9==FLOATCONST) ) { + alt8=2; + } + else if ( (LA8_9==INTCONST) ) { + alt8=3; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 4 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 9, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) { + input.consume(); + } + NoViableAltException nvae = + new NoViableAltException("", 8, 6, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 8, 4, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 8, 0, input); + throw nvae; + } + switch (alt8) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:5: ^(op= ( '+' | '-' | '*' | '/' ) x= INTCONST y= FLOATCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:10: ( '+' | '-' | '*' | '/' ) + int alt4=4; + switch ( input.LA(1) ) { + case 23: + { + alt4=1; + } + break; + case 24: + { + alt4=2; + } + break; + case 22: + { + alt4=3; + } + break; + case 26: + { + alt4=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 4, 0, input); + throw nvae; + } + switch (alt4) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:11: '+' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,23,FOLLOW_23_in_calc222); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_23.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:17: '-' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,24,FOLLOW_24_in_calc226); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_24.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:23: '*' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,22,FOLLOW_22_in_calc230); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 4 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:79:29: '/' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,26,FOLLOW_26_in_calc234); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_26.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + + } + + if ( state.backtracking==1 ) + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_calc239); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,FLOATCONST,FOLLOW_FLOATCONST_in_calc243); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_FLOATCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: FLOATCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 80:5: -> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))] + { + adaptor.addChild(root_0, (XTree)adaptor.create(FLOATCONST, opFloat((x!=null?x.getText():null), (y!=null?y.getText():null), (op!=null?op.getText():null).charAt(0)))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:5: ^(op= ( '+' | '-' | '*' | '/' ) x= FLOATCONST y= FLOATCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:10: ( '+' | '-' | '*' | '/' ) + int alt5=4; + switch ( input.LA(1) ) { + case 23: + { + alt5=1; + } + break; + case 24: + { + alt5=2; + } + break; + case 22: + { + alt5=3; + } + break; + case 26: + { + alt5=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 5, 0, input); + throw nvae; + } + switch (alt5) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:11: '+' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,23,FOLLOW_23_in_calc263); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_23.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:17: '-' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,24,FOLLOW_24_in_calc267); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_24.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:23: '*' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,22,FOLLOW_22_in_calc271); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 4 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:81:29: '/' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,26,FOLLOW_26_in_calc275); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_26.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + + } + + if ( state.backtracking==1 ) + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,FLOATCONST,FOLLOW_FLOATCONST_in_calc280); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_FLOATCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,FLOATCONST,FOLLOW_FLOATCONST_in_calc284); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_FLOATCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: FLOATCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 82:5: -> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))] + { + adaptor.addChild(root_0, (XTree)adaptor.create(FLOATCONST, opFloat((x!=null?x.getText():null), (y!=null?y.getText():null), (op!=null?op.getText():null).charAt(0)))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:5: ^(op= ( '+' | '-' | '*' | '/' ) x= FLOATCONST y= INTCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:10: ( '+' | '-' | '*' | '/' ) + int alt6=4; + switch ( input.LA(1) ) { + case 23: + { + alt6=1; + } + break; + case 24: + { + alt6=2; + } + break; + case 22: + { + alt6=3; + } + break; + case 26: + { + alt6=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 6, 0, input); + throw nvae; + } + switch (alt6) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:11: '+' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,23,FOLLOW_23_in_calc304); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_23.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:17: '-' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,24,FOLLOW_24_in_calc308); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_24.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:23: '*' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,22,FOLLOW_22_in_calc312); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 4 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:83:29: '/' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,26,FOLLOW_26_in_calc316); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_26.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + + } + + if ( state.backtracking==1 ) + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,FLOATCONST,FOLLOW_FLOATCONST_in_calc321); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_FLOATCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_calc325); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: FLOATCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 84:5: -> FLOATCONST[opFloat($x.text, $y.text, $op.text.charAt(0))] + { + adaptor.addChild(root_0, (XTree)adaptor.create(FLOATCONST, opFloat((x!=null?x.getText():null), (y!=null?y.getText():null), (op!=null?op.getText():null).charAt(0)))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 4 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:5: ^(op= ( '+' | '-' | '*' | '/' ) x= INTCONST y= INTCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:10: ( '+' | '-' | '*' | '/' ) + int alt7=4; + switch ( input.LA(1) ) { + case 23: + { + alt7=1; + } + break; + case 24: + { + alt7=2; + } + break; + case 22: + { + alt7=3; + } + break; + case 26: + { + alt7=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + throw nvae; + } + switch (alt7) { + case 1 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:11: '+' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,23,FOLLOW_23_in_calc345); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_23.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 2 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:17: '-' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,24,FOLLOW_24_in_calc349); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_24.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 3 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:23: '*' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,22,FOLLOW_22_in_calc353); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_22.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + case 4 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:85:29: '/' + { + _last = (XTree)input.LT(1); + op=(XTree)match(input,26,FOLLOW_26_in_calc357); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_26.add(op); + + if ( state.backtracking==1 ) { + retval.tree = _first_0; + if ( adaptor.getParent(retval.tree)!=null && adaptor.isNil( adaptor.getParent(retval.tree) ) ) + retval.tree = (XTree)adaptor.getParent(retval.tree); + } + + } + break; + + } + + if ( state.backtracking==1 ) + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_calc362); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,INTCONST,FOLLOW_INTCONST_in_calc366); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_INTCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: INTCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 86:5: -> INTCONST[opInt($x.text, $y.text, $op.text.charAt(0))] + { + adaptor.addChild(root_0, (XTree)adaptor.create(INTCONST, opInt((x!=null?x.getText():null), (y!=null?y.getText():null), (op!=null?op.getText():null).charAt(0)))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + case 5 : + // /Users/kreis/git/gitea.humenius.me/dhbw-compilerbau/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.g:87:5: ^(op= '+' x= STRINGCONST y= STRINGCONST ) + { + _last = (XTree)input.LT(1); + { + XTree _save_last_1 = _last; + XTree _first_1 = null; + _last = (XTree)input.LT(1); + op=(XTree)match(input,23,FOLLOW_23_in_calc385); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_23.add(op); + + if ( state.backtracking==1 ) + if ( _first_0==null ) _first_0 = op; + match(input, Token.DOWN, null); if (state.failed) return retval; + _last = (XTree)input.LT(1); + x=(XTree)match(input,STRINGCONST,FOLLOW_STRINGCONST_in_calc389); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_STRINGCONST.add(x); + + _last = (XTree)input.LT(1); + y=(XTree)match(input,STRINGCONST,FOLLOW_STRINGCONST_in_calc393); if (state.failed) return retval; + + if ( state.backtracking==1 ) stream_STRINGCONST.add(y); + + match(input, Token.UP, null); if (state.failed) return retval; + _last = _save_last_1; + } + + + // AST REWRITE + // elements: STRINGCONST + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==1 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (XTree)adaptor.nil(); + // 87:43: -> STRINGCONST[addString($x.text, $y.text)] + { + adaptor.addChild(root_0, (XTree)adaptor.create(STRINGCONST, addString((x!=null?x.getText():null), (y!=null?y.getText():null)))); + } + + + retval.tree = (XTree)adaptor.rulePostProcessing(root_0); + input.replaceChildren(adaptor.getParent(retval.start), + adaptor.getChildIndex(retval.start), + adaptor.getChildIndex(_last), + retval.tree); + } + + } + break; + + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "calc" + + // Delegated rules + + + + public static final BitSet FOLLOW_uminus_in_bottomup73 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_mult_zero_one_in_bottomup77 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_calc_in_bottomup81 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_UMINUS_in_uminus93 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_INTCONST_in_uminus97 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_UMINUS_in_uminus110 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_FLOATCONST_in_uminus114 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_22_in_mult_zero_one135 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_INTCONST_in_mult_zero_one139 = new BitSet(new long[]{0x0000000000000200L}); + public static final BitSet FOLLOW_ID_in_mult_zero_one143 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_22_in_mult_zero_one173 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_ID_in_mult_zero_one177 = new BitSet(new long[]{0x0000000000000400L}); + public static final BitSet FOLLOW_INTCONST_in_mult_zero_one181 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_23_in_calc222 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_24_in_calc226 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_22_in_calc230 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_26_in_calc234 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_INTCONST_in_calc239 = new BitSet(new long[]{0x0000000000000100L}); + public static final BitSet FOLLOW_FLOATCONST_in_calc243 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_23_in_calc263 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_24_in_calc267 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_22_in_calc271 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_26_in_calc275 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_FLOATCONST_in_calc280 = new BitSet(new long[]{0x0000000000000100L}); + public static final BitSet FOLLOW_FLOATCONST_in_calc284 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_23_in_calc304 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_24_in_calc308 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_22_in_calc312 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_26_in_calc316 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_FLOATCONST_in_calc321 = new BitSet(new long[]{0x0000000000000400L}); + public static final BitSet FOLLOW_INTCONST_in_calc325 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_23_in_calc345 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_24_in_calc349 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_22_in_calc353 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_26_in_calc357 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_INTCONST_in_calc362 = new BitSet(new long[]{0x0000000000000400L}); + public static final BitSet FOLLOW_INTCONST_in_calc366 = new BitSet(new long[]{0x0000000000000008L}); + public static final BitSet FOLLOW_23_in_calc385 = new BitSet(new long[]{0x0000000000000004L}); + public static final BitSet FOLLOW_STRINGCONST_in_calc389 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_STRINGCONST_in_calc393 = new BitSet(new long[]{0x0000000000000008L}); +} diff --git a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.tokens b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.tokens index c292af2..7213970 100644 --- a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.tokens +++ b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XOptimizer.tokens @@ -1,71 +1,69 @@ -T__20=20 -T__21=21 -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 -T__45=45 -COMMENT=4 -DECL=5 -DECLLIST=6 -DIGIT=7 -FLOATCONST=8 -ID=9 -INTCONST=10 -INVALID=11 -LETTER=12 -OTHER=13 -POSDIGIT=14 -STATLIST=15 -STRINGCONST=16 -UMINUS=17 -WS=18 -ZERO=19 -T__46=46 -PLUS=23 -'('=20 -')'=21 -'*'=22 -'+'=23 -'-'=24 -'.'=25 -'/'=26 -':'=27 -':='=28 -';'=29 -'<'=30 -'='=31 -'>'=32 -'begin'=33 -'else'=34 -'end'=35 -'float'=36 -'for'=37 -'if'=38 -'int'=39 -'print'=40 -'program'=41 -'read'=42 -'string'=43 -'then'=44 -'while'=45 -'todo'=46 +T__20=20 +T__21=21 +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 +T__45=45 +COMMENT=4 +DECL=5 +DECLLIST=6 +DIGIT=7 +FLOATCONST=8 +ID=9 +INTCONST=10 +INVALID=11 +LETTER=12 +OTHER=13 +POSDIGIT=14 +STATLIST=15 +STRINGCONST=16 +UMINUS=17 +WS=18 +ZERO=19 +PLUS=23 +'('=20 +')'=21 +'*'=22 +'+'=23 +'-'=24 +'.'=25 +'/'=26 +':'=27 +':='=28 +';'=29 +'<'=30 +'='=31 +'>'=32 +'begin'=33 +'else'=34 +'end'=35 +'float'=36 +'for'=37 +'if'=38 +'int'=39 +'print'=40 +'program'=41 +'read'=42 +'string'=43 +'then'=44 +'while'=45 diff --git a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.java b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.java index 0d29ee8..cfdd665 100644 --- a/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.java +++ b/CC-Praxis-Antlr X Uebersetzer-Leer/src/de/dhbw/compiler/antlrxcompiler/XTypeCheck.java @@ -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();