2576 lines
87 KiB
Java
2576 lines
87 KiB
Java
// $ANTLR 3.5.2 C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g 2020-06-03 14:37:29
|
|
package de.dhbw.compiler.antlrxparser;
|
|
|
|
import org.antlr.runtime.*;
|
|
import java.util.Stack;
|
|
import java.util.List;
|
|
import java.util.ArrayList;
|
|
import java.util.Map;
|
|
import java.util.HashMap;
|
|
|
|
import org.antlr.runtime.tree.*;
|
|
|
|
|
|
@SuppressWarnings("all")
|
|
public class XParser extends Parser {
|
|
public static final String[] tokenNames = new String[] {
|
|
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "DECL", "DECLLIST", "DIGIT", "ESCAPE",
|
|
"EXPR", "FLOATCONST", "ID", "INTCONST", "INVALID", "MODIFIER", "PROGRAM",
|
|
"STAT", "STATLIST", "STRINGCONST", "TYPE", "UMINUS", "WS", "'('", "')'",
|
|
"'*'", "'+'", "'-'", "'.'", "'/'", "':'", "':='", "';'", "'<'", "'='",
|
|
"'>'", "'begin'", "'else'", "'end'", "'float'", "'for'", "'if'", "'int'",
|
|
"'print'", "'program'", "'read'", "'string'", "'then'", "'while'"
|
|
};
|
|
public static final int EOF=-1;
|
|
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 T__46=46;
|
|
public static final int DECL=4;
|
|
public static final int DECLLIST=5;
|
|
public static final int DIGIT=6;
|
|
public static final int ESCAPE=7;
|
|
public static final int EXPR=8;
|
|
public static final int FLOATCONST=9;
|
|
public static final int ID=10;
|
|
public static final int INTCONST=11;
|
|
public static final int INVALID=12;
|
|
public static final int MODIFIER=13;
|
|
public static final int PROGRAM=14;
|
|
public static final int STAT=15;
|
|
public static final int STATLIST=16;
|
|
public static final int STRINGCONST=17;
|
|
public static final int TYPE=18;
|
|
public static final int UMINUS=19;
|
|
public static final int WS=20;
|
|
|
|
// delegates
|
|
public Parser[] getDelegates() {
|
|
return new Parser[] {};
|
|
}
|
|
|
|
// delegators
|
|
|
|
|
|
public XParser(TokenStream input) {
|
|
this(input, new RecognizerSharedState());
|
|
}
|
|
public XParser(TokenStream 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 XParser.tokenNames; }
|
|
@Override public String getGrammarFileName() { return "C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g"; }
|
|
|
|
|
|
public static class program_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "program"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:62:1: program : 'program' ^ ID ';' ! decllist statlist '.' ! EOF !;
|
|
public final XParser.program_return program() throws RecognitionException {
|
|
XParser.program_return retval = new XParser.program_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal1=null;
|
|
Token ID2=null;
|
|
Token char_literal3=null;
|
|
Token char_literal6=null;
|
|
Token EOF7=null;
|
|
ParserRuleReturnScope decllist4 =null;
|
|
ParserRuleReturnScope statlist5 =null;
|
|
|
|
CommonTree string_literal1_tree=null;
|
|
CommonTree ID2_tree=null;
|
|
CommonTree char_literal3_tree=null;
|
|
CommonTree char_literal6_tree=null;
|
|
CommonTree EOF7_tree=null;
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:62:8: ( 'program' ^ ID ';' ! decllist statlist '.' ! EOF !)
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:62:17: 'program' ^ ID ';' ! decllist statlist '.' ! EOF !
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
string_literal1=(Token)match(input,42,FOLLOW_42_in_program464); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
string_literal1_tree = (CommonTree)adaptor.create(string_literal1);
|
|
root_0 = (CommonTree)adaptor.becomeRoot(string_literal1_tree, root_0);
|
|
}
|
|
|
|
ID2=(Token)match(input,ID,FOLLOW_ID_in_program467); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
ID2_tree = (CommonTree)adaptor.create(ID2);
|
|
adaptor.addChild(root_0, ID2_tree);
|
|
}
|
|
|
|
char_literal3=(Token)match(input,30,FOLLOW_30_in_program469); if (state.failed) return retval;
|
|
pushFollow(FOLLOW_decllist_in_program472);
|
|
decllist4=decllist();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, decllist4.getTree());
|
|
|
|
pushFollow(FOLLOW_statlist_in_program474);
|
|
statlist5=statlist();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, statlist5.getTree());
|
|
|
|
char_literal6=(Token)match(input,26,FOLLOW_26_in_program476); if (state.failed) return retval;
|
|
EOF7=(Token)match(input,EOF,FOLLOW_EOF_in_program479); if (state.failed) return retval;
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "program"
|
|
|
|
|
|
public static class decllist_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "decllist"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:1: decllist : ( decl )* -> ^( DECLLIST ( decl )* ) ;
|
|
public final XParser.decllist_return decllist() throws RecognitionException {
|
|
XParser.decllist_return retval = new XParser.decllist_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
ParserRuleReturnScope decl8 =null;
|
|
|
|
RewriteRuleSubtreeStream stream_decl=new RewriteRuleSubtreeStream(adaptor,"rule decl");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:9: ( ( decl )* -> ^( DECLLIST ( decl )* ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:17: ( decl )*
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:17: ( decl )*
|
|
loop1:
|
|
while (true) {
|
|
int alt1=2;
|
|
int LA1_0 = input.LA(1);
|
|
if ( (LA1_0==ID||LA1_0==41||LA1_0==43) ) {
|
|
alt1=1;
|
|
}
|
|
|
|
switch (alt1) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:17: decl
|
|
{
|
|
pushFollow(FOLLOW_decl_in_decllist494);
|
|
decl8=decl();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_decl.add(decl8.getTree());
|
|
}
|
|
break;
|
|
|
|
default :
|
|
break loop1;
|
|
}
|
|
}
|
|
|
|
// AST REWRITE
|
|
// elements: decl
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 65:23: -> ^( DECLLIST ( decl )* )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:26: ^( DECLLIST ( decl )* )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DECLLIST, "DECLLIST"), root_1);
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:65:37: ( decl )*
|
|
while ( stream_decl.hasNext() ) {
|
|
adaptor.addChild(root_1, stream_decl.nextTree());
|
|
}
|
|
stream_decl.reset();
|
|
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "decllist"
|
|
|
|
|
|
public static class decl_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "decl"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:1: decl : ( modifier )? ID ':' type ';' -> ^( DECL ( modifier )? ID type ) ;
|
|
public final XParser.decl_return decl() throws RecognitionException {
|
|
XParser.decl_return retval = new XParser.decl_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token ID10=null;
|
|
Token char_literal11=null;
|
|
Token char_literal13=null;
|
|
ParserRuleReturnScope modifier9 =null;
|
|
ParserRuleReturnScope type12 =null;
|
|
|
|
CommonTree ID10_tree=null;
|
|
CommonTree char_literal11_tree=null;
|
|
CommonTree char_literal13_tree=null;
|
|
RewriteRuleTokenStream stream_28=new RewriteRuleTokenStream(adaptor,"token 28");
|
|
RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
|
|
RewriteRuleTokenStream stream_30=new RewriteRuleTokenStream(adaptor,"token 30");
|
|
RewriteRuleSubtreeStream stream_modifier=new RewriteRuleSubtreeStream(adaptor,"rule modifier");
|
|
RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:5: ( ( modifier )? ID ':' type ';' -> ^( DECL ( modifier )? ID type ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:17: ( modifier )? ID ':' type ';'
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:17: ( modifier )?
|
|
int alt2=2;
|
|
int LA2_0 = input.LA(1);
|
|
if ( (LA2_0==41||LA2_0==43) ) {
|
|
alt2=1;
|
|
}
|
|
switch (alt2) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:17: modifier
|
|
{
|
|
pushFollow(FOLLOW_modifier_in_decl520);
|
|
modifier9=modifier();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_modifier.add(modifier9.getTree());
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
ID10=(Token)match(input,ID,FOLLOW_ID_in_decl523); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_ID.add(ID10);
|
|
|
|
char_literal11=(Token)match(input,28,FOLLOW_28_in_decl525); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_28.add(char_literal11);
|
|
|
|
pushFollow(FOLLOW_type_in_decl527);
|
|
type12=type();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_type.add(type12.getTree());
|
|
char_literal13=(Token)match(input,30,FOLLOW_30_in_decl529); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_30.add(char_literal13);
|
|
|
|
// AST REWRITE
|
|
// elements: ID, type, modifier
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 66:43: -> ^( DECL ( modifier )? ID type )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:46: ^( DECL ( modifier )? ID type )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(DECL, "DECL"), root_1);
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:66:53: ( modifier )?
|
|
if ( stream_modifier.hasNext() ) {
|
|
adaptor.addChild(root_1, stream_modifier.nextTree());
|
|
}
|
|
stream_modifier.reset();
|
|
|
|
adaptor.addChild(root_1, stream_ID.nextNode());
|
|
adaptor.addChild(root_1, stream_type.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "decl"
|
|
|
|
|
|
public static class modifier_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "modifier"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:1: modifier : ( 'read' ( 'print' )? | 'read' | 'print' );
|
|
public final XParser.modifier_return modifier() throws RecognitionException {
|
|
XParser.modifier_return retval = new XParser.modifier_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal14=null;
|
|
Token string_literal15=null;
|
|
Token string_literal16=null;
|
|
Token string_literal17=null;
|
|
|
|
CommonTree string_literal14_tree=null;
|
|
CommonTree string_literal15_tree=null;
|
|
CommonTree string_literal16_tree=null;
|
|
CommonTree string_literal17_tree=null;
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:9: ( 'read' ( 'print' )? | 'read' | 'print' )
|
|
int alt4=3;
|
|
int LA4_0 = input.LA(1);
|
|
if ( (LA4_0==43) ) {
|
|
int LA4_1 = input.LA(2);
|
|
if ( (synpred4_X()) ) {
|
|
alt4=1;
|
|
}
|
|
else if ( (synpred5_X()) ) {
|
|
alt4=2;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
int nvaeMark = input.mark();
|
|
try {
|
|
input.consume();
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 4, 1, input);
|
|
throw nvae;
|
|
} finally {
|
|
input.rewind(nvaeMark);
|
|
}
|
|
}
|
|
|
|
}
|
|
else if ( (LA4_0==41) ) {
|
|
alt4=3;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 4, 0, input);
|
|
throw nvae;
|
|
}
|
|
|
|
switch (alt4) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:17: 'read' ( 'print' )?
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
string_literal14=(Token)match(input,43,FOLLOW_43_in_modifier554); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
string_literal14_tree = (CommonTree)adaptor.create(string_literal14);
|
|
adaptor.addChild(root_0, string_literal14_tree);
|
|
}
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:24: ( 'print' )?
|
|
int alt3=2;
|
|
int LA3_0 = input.LA(1);
|
|
if ( (LA3_0==41) ) {
|
|
alt3=1;
|
|
}
|
|
switch (alt3) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:24: 'print'
|
|
{
|
|
string_literal15=(Token)match(input,41,FOLLOW_41_in_modifier556); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
string_literal15_tree = (CommonTree)adaptor.create(string_literal15);
|
|
adaptor.addChild(root_0, string_literal15_tree);
|
|
}
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:35: 'read'
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
string_literal16=(Token)match(input,43,FOLLOW_43_in_modifier561); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
string_literal16_tree = (CommonTree)adaptor.create(string_literal16);
|
|
adaptor.addChild(root_0, string_literal16_tree);
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 3 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:44: 'print'
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
string_literal17=(Token)match(input,41,FOLLOW_41_in_modifier565); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
string_literal17_tree = (CommonTree)adaptor.create(string_literal17);
|
|
adaptor.addChild(root_0, string_literal17_tree);
|
|
}
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "modifier"
|
|
|
|
|
|
public static class type_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "type"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:68:1: type : ( 'int' | 'float' | 'string' );
|
|
public final XParser.type_return type() throws RecognitionException {
|
|
XParser.type_return retval = new XParser.type_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token set18=null;
|
|
|
|
CommonTree set18_tree=null;
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:68:5: ( 'int' | 'float' | 'string' )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
set18=input.LT(1);
|
|
if ( input.LA(1)==37||input.LA(1)==40||input.LA(1)==44 ) {
|
|
input.consume();
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set18));
|
|
state.errorRecovery=false;
|
|
state.failed=false;
|
|
}
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
throw mse;
|
|
}
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "type"
|
|
|
|
|
|
public static class statlist_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "statlist"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:1: statlist : 'begin' ( stat ';' )* 'end' -> ^( STATLIST ( stat )* ) ;
|
|
public final XParser.statlist_return statlist() throws RecognitionException {
|
|
XParser.statlist_return retval = new XParser.statlist_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal19=null;
|
|
Token char_literal21=null;
|
|
Token string_literal22=null;
|
|
ParserRuleReturnScope stat20 =null;
|
|
|
|
CommonTree string_literal19_tree=null;
|
|
CommonTree char_literal21_tree=null;
|
|
CommonTree string_literal22_tree=null;
|
|
RewriteRuleTokenStream stream_34=new RewriteRuleTokenStream(adaptor,"token 34");
|
|
RewriteRuleTokenStream stream_36=new RewriteRuleTokenStream(adaptor,"token 36");
|
|
RewriteRuleTokenStream stream_30=new RewriteRuleTokenStream(adaptor,"token 30");
|
|
RewriteRuleSubtreeStream stream_stat=new RewriteRuleSubtreeStream(adaptor,"rule stat");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:9: ( 'begin' ( stat ';' )* 'end' -> ^( STATLIST ( stat )* ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:17: 'begin' ( stat ';' )* 'end'
|
|
{
|
|
string_literal19=(Token)match(input,34,FOLLOW_34_in_statlist603); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_34.add(string_literal19);
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:25: ( stat ';' )*
|
|
loop5:
|
|
while (true) {
|
|
int alt5=2;
|
|
int LA5_0 = input.LA(1);
|
|
if ( (LA5_0==ID||LA5_0==34||(LA5_0 >= 38 && LA5_0 <= 39)||LA5_0==46) ) {
|
|
alt5=1;
|
|
}
|
|
|
|
switch (alt5) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:26: stat ';'
|
|
{
|
|
pushFollow(FOLLOW_stat_in_statlist606);
|
|
stat20=stat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_stat.add(stat20.getTree());
|
|
char_literal21=(Token)match(input,30,FOLLOW_30_in_statlist608); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_30.add(char_literal21);
|
|
|
|
}
|
|
break;
|
|
|
|
default :
|
|
break loop5;
|
|
}
|
|
}
|
|
|
|
string_literal22=(Token)match(input,36,FOLLOW_36_in_statlist612); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_36.add(string_literal22);
|
|
|
|
// AST REWRITE
|
|
// elements: stat
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 71:43: -> ^( STATLIST ( stat )* )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:46: ^( STATLIST ( stat )* )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(STATLIST, "STATLIST"), root_1);
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:71:57: ( stat )*
|
|
while ( stream_stat.hasNext() ) {
|
|
adaptor.addChild(root_1, stream_stat.nextTree());
|
|
}
|
|
stream_stat.reset();
|
|
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "statlist"
|
|
|
|
|
|
public static class stat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "stat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:1: stat : ( assignstat | condstat | whilestat | forstat | statlist );
|
|
public final XParser.stat_return stat() throws RecognitionException {
|
|
XParser.stat_return retval = new XParser.stat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
ParserRuleReturnScope assignstat23 =null;
|
|
ParserRuleReturnScope condstat24 =null;
|
|
ParserRuleReturnScope whilestat25 =null;
|
|
ParserRuleReturnScope forstat26 =null;
|
|
ParserRuleReturnScope statlist27 =null;
|
|
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:5: ( assignstat | condstat | whilestat | forstat | statlist )
|
|
int alt6=5;
|
|
switch ( input.LA(1) ) {
|
|
case ID:
|
|
{
|
|
alt6=1;
|
|
}
|
|
break;
|
|
case 39:
|
|
{
|
|
alt6=2;
|
|
}
|
|
break;
|
|
case 46:
|
|
{
|
|
alt6=3;
|
|
}
|
|
break;
|
|
case 38:
|
|
{
|
|
alt6=4;
|
|
}
|
|
break;
|
|
case 34:
|
|
{
|
|
alt6=5;
|
|
}
|
|
break;
|
|
default:
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 6, 0, input);
|
|
throw nvae;
|
|
}
|
|
switch (alt6) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:17: assignstat
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_assignstat_in_stat637);
|
|
assignstat23=assignstat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, assignstat23.getTree());
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:30: condstat
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_condstat_in_stat641);
|
|
condstat24=condstat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, condstat24.getTree());
|
|
|
|
}
|
|
break;
|
|
case 3 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:41: whilestat
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_whilestat_in_stat645);
|
|
whilestat25=whilestat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, whilestat25.getTree());
|
|
|
|
}
|
|
break;
|
|
case 4 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:53: forstat
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_forstat_in_stat649);
|
|
forstat26=forstat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, forstat26.getTree());
|
|
|
|
}
|
|
break;
|
|
case 5 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:72:63: statlist
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_statlist_in_stat653);
|
|
statlist27=statlist();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, statlist27.getTree());
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "stat"
|
|
|
|
|
|
public static class assignstat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "assignstat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:73:1: assignstat : ID ':=' expr -> ^( ':=' ID expr ) ;
|
|
public final XParser.assignstat_return assignstat() throws RecognitionException {
|
|
XParser.assignstat_return retval = new XParser.assignstat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token ID28=null;
|
|
Token string_literal29=null;
|
|
ParserRuleReturnScope expr30 =null;
|
|
|
|
CommonTree ID28_tree=null;
|
|
CommonTree string_literal29_tree=null;
|
|
RewriteRuleTokenStream stream_29=new RewriteRuleTokenStream(adaptor,"token 29");
|
|
RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID");
|
|
RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:73:11: ( ID ':=' expr -> ^( ':=' ID expr ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:73:17: ID ':=' expr
|
|
{
|
|
ID28=(Token)match(input,ID,FOLLOW_ID_in_assignstat663); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_ID.add(ID28);
|
|
|
|
string_literal29=(Token)match(input,29,FOLLOW_29_in_assignstat665); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_29.add(string_literal29);
|
|
|
|
pushFollow(FOLLOW_expr_in_assignstat667);
|
|
expr30=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_expr.add(expr30.getTree());
|
|
// AST REWRITE
|
|
// elements: ID, expr, 29
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 73:30: -> ^( ':=' ID expr )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:73:33: ^( ':=' ID expr )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_29.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_ID.nextNode());
|
|
adaptor.addChild(root_1, stream_expr.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "assignstat"
|
|
|
|
|
|
public static class condstat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "condstat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:1: condstat : 'if' cond 'then' stat ( condElseStat )? -> ^( 'if' cond stat ( condElseStat )? ) ;
|
|
public final XParser.condstat_return condstat() throws RecognitionException {
|
|
XParser.condstat_return retval = new XParser.condstat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal31=null;
|
|
Token string_literal33=null;
|
|
ParserRuleReturnScope cond32 =null;
|
|
ParserRuleReturnScope stat34 =null;
|
|
ParserRuleReturnScope condElseStat35 =null;
|
|
|
|
CommonTree string_literal31_tree=null;
|
|
CommonTree string_literal33_tree=null;
|
|
RewriteRuleTokenStream stream_45=new RewriteRuleTokenStream(adaptor,"token 45");
|
|
RewriteRuleTokenStream stream_39=new RewriteRuleTokenStream(adaptor,"token 39");
|
|
RewriteRuleSubtreeStream stream_stat=new RewriteRuleSubtreeStream(adaptor,"rule stat");
|
|
RewriteRuleSubtreeStream stream_condElseStat=new RewriteRuleSubtreeStream(adaptor,"rule condElseStat");
|
|
RewriteRuleSubtreeStream stream_cond=new RewriteRuleSubtreeStream(adaptor,"rule cond");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:9: ( 'if' cond 'then' stat ( condElseStat )? -> ^( 'if' cond stat ( condElseStat )? ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:17: 'if' cond 'then' stat ( condElseStat )?
|
|
{
|
|
string_literal31=(Token)match(input,39,FOLLOW_39_in_condstat689); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_39.add(string_literal31);
|
|
|
|
pushFollow(FOLLOW_cond_in_condstat691);
|
|
cond32=cond();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_cond.add(cond32.getTree());
|
|
string_literal33=(Token)match(input,45,FOLLOW_45_in_condstat693); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_45.add(string_literal33);
|
|
|
|
pushFollow(FOLLOW_stat_in_condstat695);
|
|
stat34=stat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_stat.add(stat34.getTree());
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:39: ( condElseStat )?
|
|
int alt7=2;
|
|
int LA7_0 = input.LA(1);
|
|
if ( (LA7_0==35) ) {
|
|
int LA7_1 = input.LA(2);
|
|
if ( (synpred13_X()) ) {
|
|
alt7=1;
|
|
}
|
|
}
|
|
switch (alt7) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:39: condElseStat
|
|
{
|
|
pushFollow(FOLLOW_condElseStat_in_condstat697);
|
|
condElseStat35=condElseStat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_condElseStat.add(condElseStat35.getTree());
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
// AST REWRITE
|
|
// elements: cond, 39, stat, condElseStat
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 74:53: -> ^( 'if' cond stat ( condElseStat )? )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:56: ^( 'if' cond stat ( condElseStat )? )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_39.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_cond.nextTree());
|
|
adaptor.addChild(root_1, stream_stat.nextTree());
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:73: ( condElseStat )?
|
|
if ( stream_condElseStat.hasNext() ) {
|
|
adaptor.addChild(root_1, stream_condElseStat.nextTree());
|
|
}
|
|
stream_condElseStat.reset();
|
|
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "condstat"
|
|
|
|
|
|
public static class condElseStat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "condElseStat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:75:1: condElseStat : 'else' stat -> ^( 'else' stat ) ;
|
|
public final XParser.condElseStat_return condElseStat() throws RecognitionException {
|
|
XParser.condElseStat_return retval = new XParser.condElseStat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal36=null;
|
|
ParserRuleReturnScope stat37 =null;
|
|
|
|
CommonTree string_literal36_tree=null;
|
|
RewriteRuleTokenStream stream_35=new RewriteRuleTokenStream(adaptor,"token 35");
|
|
RewriteRuleSubtreeStream stream_stat=new RewriteRuleSubtreeStream(adaptor,"rule stat");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:75:13: ( 'else' stat -> ^( 'else' stat ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:75:17: 'else' stat
|
|
{
|
|
string_literal36=(Token)match(input,35,FOLLOW_35_in_condElseStat720); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_35.add(string_literal36);
|
|
|
|
pushFollow(FOLLOW_stat_in_condElseStat722);
|
|
stat37=stat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_stat.add(stat37.getTree());
|
|
// AST REWRITE
|
|
// elements: 35, stat
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 75:29: -> ^( 'else' stat )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:75:32: ^( 'else' stat )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_35.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_stat.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "condElseStat"
|
|
|
|
|
|
public static class whilestat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "whilestat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:76:1: whilestat : 'while' '(' cond ')' stat -> ^( 'while' cond stat ) ;
|
|
public final XParser.whilestat_return whilestat() throws RecognitionException {
|
|
XParser.whilestat_return retval = new XParser.whilestat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal38=null;
|
|
Token char_literal39=null;
|
|
Token char_literal41=null;
|
|
ParserRuleReturnScope cond40 =null;
|
|
ParserRuleReturnScope stat42 =null;
|
|
|
|
CommonTree string_literal38_tree=null;
|
|
CommonTree char_literal39_tree=null;
|
|
CommonTree char_literal41_tree=null;
|
|
RewriteRuleTokenStream stream_22=new RewriteRuleTokenStream(adaptor,"token 22");
|
|
RewriteRuleTokenStream stream_46=new RewriteRuleTokenStream(adaptor,"token 46");
|
|
RewriteRuleTokenStream stream_21=new RewriteRuleTokenStream(adaptor,"token 21");
|
|
RewriteRuleSubtreeStream stream_stat=new RewriteRuleSubtreeStream(adaptor,"rule stat");
|
|
RewriteRuleSubtreeStream stream_cond=new RewriteRuleSubtreeStream(adaptor,"rule cond");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:76:10: ( 'while' '(' cond ')' stat -> ^( 'while' cond stat ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:76:17: 'while' '(' cond ')' stat
|
|
{
|
|
string_literal38=(Token)match(input,46,FOLLOW_46_in_whilestat741); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_46.add(string_literal38);
|
|
|
|
char_literal39=(Token)match(input,21,FOLLOW_21_in_whilestat743); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_21.add(char_literal39);
|
|
|
|
pushFollow(FOLLOW_cond_in_whilestat745);
|
|
cond40=cond();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_cond.add(cond40.getTree());
|
|
char_literal41=(Token)match(input,22,FOLLOW_22_in_whilestat747); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_22.add(char_literal41);
|
|
|
|
pushFollow(FOLLOW_stat_in_whilestat749);
|
|
stat42=stat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_stat.add(stat42.getTree());
|
|
// AST REWRITE
|
|
// elements: cond, stat, 46
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 76:43: -> ^( 'while' cond stat )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:76:46: ^( 'while' cond stat )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_46.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_cond.nextTree());
|
|
adaptor.addChild(root_1, stream_stat.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "whilestat"
|
|
|
|
|
|
public static class forstat_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "forstat"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:77:1: forstat : 'for' '(' assignstat ';' cond ';' assignstat ')' stat -> ^( 'for' assignstat cond assignstat stat ) ;
|
|
public final XParser.forstat_return forstat() throws RecognitionException {
|
|
XParser.forstat_return retval = new XParser.forstat_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token string_literal43=null;
|
|
Token char_literal44=null;
|
|
Token char_literal46=null;
|
|
Token char_literal48=null;
|
|
Token char_literal50=null;
|
|
ParserRuleReturnScope assignstat45 =null;
|
|
ParserRuleReturnScope cond47 =null;
|
|
ParserRuleReturnScope assignstat49 =null;
|
|
ParserRuleReturnScope stat51 =null;
|
|
|
|
CommonTree string_literal43_tree=null;
|
|
CommonTree char_literal44_tree=null;
|
|
CommonTree char_literal46_tree=null;
|
|
CommonTree char_literal48_tree=null;
|
|
CommonTree char_literal50_tree=null;
|
|
RewriteRuleTokenStream stream_22=new RewriteRuleTokenStream(adaptor,"token 22");
|
|
RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");
|
|
RewriteRuleTokenStream stream_30=new RewriteRuleTokenStream(adaptor,"token 30");
|
|
RewriteRuleTokenStream stream_21=new RewriteRuleTokenStream(adaptor,"token 21");
|
|
RewriteRuleSubtreeStream stream_stat=new RewriteRuleSubtreeStream(adaptor,"rule stat");
|
|
RewriteRuleSubtreeStream stream_cond=new RewriteRuleSubtreeStream(adaptor,"rule cond");
|
|
RewriteRuleSubtreeStream stream_assignstat=new RewriteRuleSubtreeStream(adaptor,"rule assignstat");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:77:8: ( 'for' '(' assignstat ';' cond ';' assignstat ')' stat -> ^( 'for' assignstat cond assignstat stat ) )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:77:17: 'for' '(' assignstat ';' cond ';' assignstat ')' stat
|
|
{
|
|
string_literal43=(Token)match(input,38,FOLLOW_38_in_forstat772); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_38.add(string_literal43);
|
|
|
|
char_literal44=(Token)match(input,21,FOLLOW_21_in_forstat774); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_21.add(char_literal44);
|
|
|
|
pushFollow(FOLLOW_assignstat_in_forstat776);
|
|
assignstat45=assignstat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_assignstat.add(assignstat45.getTree());
|
|
char_literal46=(Token)match(input,30,FOLLOW_30_in_forstat778); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_30.add(char_literal46);
|
|
|
|
pushFollow(FOLLOW_cond_in_forstat780);
|
|
cond47=cond();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_cond.add(cond47.getTree());
|
|
char_literal48=(Token)match(input,30,FOLLOW_30_in_forstat782); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_30.add(char_literal48);
|
|
|
|
pushFollow(FOLLOW_assignstat_in_forstat784);
|
|
assignstat49=assignstat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_assignstat.add(assignstat49.getTree());
|
|
char_literal50=(Token)match(input,22,FOLLOW_22_in_forstat786); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_22.add(char_literal50);
|
|
|
|
pushFollow(FOLLOW_stat_in_forstat788);
|
|
stat51=stat();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_stat.add(stat51.getTree());
|
|
// AST REWRITE
|
|
// elements: cond, stat, assignstat, 38, assignstat
|
|
// token labels:
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 78:17: -> ^( 'for' assignstat cond assignstat stat )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:78:20: ^( 'for' assignstat cond assignstat stat )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_38.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_assignstat.nextTree());
|
|
adaptor.addChild(root_1, stream_cond.nextTree());
|
|
adaptor.addChild(root_1, stream_assignstat.nextTree());
|
|
adaptor.addChild(root_1, stream_stat.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "forstat"
|
|
|
|
|
|
public static class number_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "number"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:81:1: number : ( INTCONST | FLOATCONST );
|
|
public final XParser.number_return number() throws RecognitionException {
|
|
XParser.number_return retval = new XParser.number_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token set52=null;
|
|
|
|
CommonTree set52_tree=null;
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:81:7: ( INTCONST | FLOATCONST )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
set52=input.LT(1);
|
|
if ( input.LA(1)==FLOATCONST||input.LA(1)==INTCONST ) {
|
|
input.consume();
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set52));
|
|
state.errorRecovery=false;
|
|
state.failed=false;
|
|
}
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
throw mse;
|
|
}
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "number"
|
|
|
|
|
|
public static class expr_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "expr"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:1: expr : ( expr2 (op= '+' |op= '-' ) expr -> ^( $op expr2 expr ) | expr2 );
|
|
public final XParser.expr_return expr() throws RecognitionException {
|
|
XParser.expr_return retval = new XParser.expr_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token op=null;
|
|
ParserRuleReturnScope expr253 =null;
|
|
ParserRuleReturnScope expr54 =null;
|
|
ParserRuleReturnScope expr255 =null;
|
|
|
|
CommonTree op_tree=null;
|
|
RewriteRuleTokenStream stream_24=new RewriteRuleTokenStream(adaptor,"token 24");
|
|
RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
|
|
RewriteRuleSubtreeStream stream_expr2=new RewriteRuleSubtreeStream(adaptor,"rule expr2");
|
|
RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:5: ( expr2 (op= '+' |op= '-' ) expr -> ^( $op expr2 expr ) | expr2 )
|
|
int alt9=2;
|
|
switch ( input.LA(1) ) {
|
|
case 25:
|
|
{
|
|
int LA9_1 = input.LA(2);
|
|
if ( (synpred16_X()) ) {
|
|
alt9=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt9=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case FLOATCONST:
|
|
case INTCONST:
|
|
{
|
|
int LA9_2 = input.LA(2);
|
|
if ( (synpred16_X()) ) {
|
|
alt9=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt9=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case STRINGCONST:
|
|
{
|
|
int LA9_3 = input.LA(2);
|
|
if ( (synpred16_X()) ) {
|
|
alt9=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt9=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 21:
|
|
{
|
|
int LA9_4 = input.LA(2);
|
|
if ( (synpred16_X()) ) {
|
|
alt9=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt9=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
default:
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 9, 0, input);
|
|
throw nvae;
|
|
}
|
|
switch (alt9) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:13: expr2 (op= '+' |op= '-' ) expr
|
|
{
|
|
pushFollow(FOLLOW_expr2_in_expr846);
|
|
expr253=expr2();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_expr2.add(expr253.getTree());
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:19: (op= '+' |op= '-' )
|
|
int alt8=2;
|
|
int LA8_0 = input.LA(1);
|
|
if ( (LA8_0==24) ) {
|
|
alt8=1;
|
|
}
|
|
else if ( (LA8_0==25) ) {
|
|
alt8=2;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 8, 0, input);
|
|
throw nvae;
|
|
}
|
|
|
|
switch (alt8) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:20: op= '+'
|
|
{
|
|
op=(Token)match(input,24,FOLLOW_24_in_expr851); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_24.add(op);
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:29: op= '-'
|
|
{
|
|
op=(Token)match(input,25,FOLLOW_25_in_expr857); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_25.add(op);
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
pushFollow(FOLLOW_expr_in_expr860);
|
|
expr54=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_expr.add(expr54.getTree());
|
|
// AST REWRITE
|
|
// elements: op, expr, expr2
|
|
// token labels: op
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleTokenStream stream_op=new RewriteRuleTokenStream(adaptor,"token op",op);
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 82:45: -> ^( $op expr2 expr )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:48: ^( $op expr2 expr )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_op.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_expr2.nextTree());
|
|
adaptor.addChild(root_1, stream_expr.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:83:15: expr2
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_expr2_in_expr890);
|
|
expr255=expr2();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, expr255.getTree());
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "expr"
|
|
|
|
|
|
public static class expr2_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "expr2"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:1: expr2 : ( expr3 (op= '*' |op= '/' ) expr -> ^( $op expr3 expr ) | expr3 );
|
|
public final XParser.expr2_return expr2() throws RecognitionException {
|
|
XParser.expr2_return retval = new XParser.expr2_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token op=null;
|
|
ParserRuleReturnScope expr356 =null;
|
|
ParserRuleReturnScope expr57 =null;
|
|
ParserRuleReturnScope expr358 =null;
|
|
|
|
CommonTree op_tree=null;
|
|
RewriteRuleTokenStream stream_23=new RewriteRuleTokenStream(adaptor,"token 23");
|
|
RewriteRuleTokenStream stream_27=new RewriteRuleTokenStream(adaptor,"token 27");
|
|
RewriteRuleSubtreeStream stream_expr3=new RewriteRuleSubtreeStream(adaptor,"rule expr3");
|
|
RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:6: ( expr3 (op= '*' |op= '/' ) expr -> ^( $op expr3 expr ) | expr3 )
|
|
int alt11=2;
|
|
switch ( input.LA(1) ) {
|
|
case 25:
|
|
{
|
|
int LA11_1 = input.LA(2);
|
|
if ( (synpred18_X()) ) {
|
|
alt11=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt11=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case FLOATCONST:
|
|
case INTCONST:
|
|
{
|
|
int LA11_2 = input.LA(2);
|
|
if ( (synpred18_X()) ) {
|
|
alt11=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt11=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case STRINGCONST:
|
|
{
|
|
int LA11_3 = input.LA(2);
|
|
if ( (synpred18_X()) ) {
|
|
alt11=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt11=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 21:
|
|
{
|
|
int LA11_4 = input.LA(2);
|
|
if ( (synpred18_X()) ) {
|
|
alt11=1;
|
|
}
|
|
else if ( (true) ) {
|
|
alt11=2;
|
|
}
|
|
|
|
}
|
|
break;
|
|
default:
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 11, 0, input);
|
|
throw nvae;
|
|
}
|
|
switch (alt11) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:13: expr3 (op= '*' |op= '/' ) expr
|
|
{
|
|
pushFollow(FOLLOW_expr3_in_expr2901);
|
|
expr356=expr3();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_expr3.add(expr356.getTree());
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:19: (op= '*' |op= '/' )
|
|
int alt10=2;
|
|
int LA10_0 = input.LA(1);
|
|
if ( (LA10_0==23) ) {
|
|
alt10=1;
|
|
}
|
|
else if ( (LA10_0==27) ) {
|
|
alt10=2;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 10, 0, input);
|
|
throw nvae;
|
|
}
|
|
|
|
switch (alt10) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:20: op= '*'
|
|
{
|
|
op=(Token)match(input,23,FOLLOW_23_in_expr2906); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_23.add(op);
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:29: op= '/'
|
|
{
|
|
op=(Token)match(input,27,FOLLOW_27_in_expr2912); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_27.add(op);
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
pushFollow(FOLLOW_expr_in_expr2915);
|
|
expr57=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_expr.add(expr57.getTree());
|
|
// AST REWRITE
|
|
// elements: expr3, op, expr
|
|
// token labels: op
|
|
// rule labels: retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleTokenStream stream_op=new RewriteRuleTokenStream(adaptor,"token op",op);
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 84:45: -> ^( $op expr3 expr )
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:48: ^( $op expr3 expr )
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot(stream_op.nextNode(), root_1);
|
|
adaptor.addChild(root_1, stream_expr3.nextTree());
|
|
adaptor.addChild(root_1, stream_expr.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:85:15: expr3
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_expr3_in_expr2945);
|
|
expr358=expr3();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, expr358.getTree());
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "expr2"
|
|
|
|
|
|
public static class expr3_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "expr3"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:86:1: expr3 : (op= '-' num= number -> ^( UMINUS[op,\"UMINUS\"] $num) | number | STRINGCONST | '(' ! expr ^ ')' !);
|
|
public final XParser.expr3_return expr3() throws RecognitionException {
|
|
XParser.expr3_return retval = new XParser.expr3_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token op=null;
|
|
Token STRINGCONST60=null;
|
|
Token char_literal61=null;
|
|
Token char_literal63=null;
|
|
ParserRuleReturnScope num =null;
|
|
ParserRuleReturnScope number59 =null;
|
|
ParserRuleReturnScope expr62 =null;
|
|
|
|
CommonTree op_tree=null;
|
|
CommonTree STRINGCONST60_tree=null;
|
|
CommonTree char_literal61_tree=null;
|
|
CommonTree char_literal63_tree=null;
|
|
RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
|
|
RewriteRuleSubtreeStream stream_number=new RewriteRuleSubtreeStream(adaptor,"rule number");
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:86:6: (op= '-' num= number -> ^( UMINUS[op,\"UMINUS\"] $num) | number | STRINGCONST | '(' ! expr ^ ')' !)
|
|
int alt12=4;
|
|
switch ( input.LA(1) ) {
|
|
case 25:
|
|
{
|
|
alt12=1;
|
|
}
|
|
break;
|
|
case FLOATCONST:
|
|
case INTCONST:
|
|
{
|
|
alt12=2;
|
|
}
|
|
break;
|
|
case STRINGCONST:
|
|
{
|
|
alt12=3;
|
|
}
|
|
break;
|
|
case 21:
|
|
{
|
|
alt12=4;
|
|
}
|
|
break;
|
|
default:
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 12, 0, input);
|
|
throw nvae;
|
|
}
|
|
switch (alt12) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:86:13: op= '-' num= number
|
|
{
|
|
op=(Token)match(input,25,FOLLOW_25_in_expr3958); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_25.add(op);
|
|
|
|
pushFollow(FOLLOW_number_in_expr3962);
|
|
num=number();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) stream_number.add(num.getTree());
|
|
// AST REWRITE
|
|
// elements: num
|
|
// token labels:
|
|
// rule labels: num, retval
|
|
// token list labels:
|
|
// rule list labels:
|
|
// wildcard labels:
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = root_0;
|
|
RewriteRuleSubtreeStream stream_num=new RewriteRuleSubtreeStream(adaptor,"rule num",num!=null?num.getTree():null);
|
|
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
|
|
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
// 86:45: -> ^( UMINUS[op,\"UMINUS\"] $num)
|
|
{
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:86:48: ^( UMINUS[op,\"UMINUS\"] $num)
|
|
{
|
|
CommonTree root_1 = (CommonTree)adaptor.nil();
|
|
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UMINUS, op, "UMINUS"), root_1);
|
|
adaptor.addChild(root_1, stream_num.nextTree());
|
|
adaptor.addChild(root_0, root_1);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
retval.tree = root_0;
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:87:15: number
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_number_in_expr31002);
|
|
number59=number();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, number59.getTree());
|
|
|
|
}
|
|
break;
|
|
case 3 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:87:24: STRINGCONST
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
STRINGCONST60=(Token)match(input,STRINGCONST,FOLLOW_STRINGCONST_in_expr31006); if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) {
|
|
STRINGCONST60_tree = (CommonTree)adaptor.create(STRINGCONST60);
|
|
adaptor.addChild(root_0, STRINGCONST60_tree);
|
|
}
|
|
|
|
}
|
|
break;
|
|
case 4 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:87:38: '(' ! expr ^ ')' !
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
char_literal61=(Token)match(input,21,FOLLOW_21_in_expr31010); if (state.failed) return retval;
|
|
pushFollow(FOLLOW_expr_in_expr31013);
|
|
expr62=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) root_0 = (CommonTree)adaptor.becomeRoot(expr62.getTree(), root_0);
|
|
char_literal63=(Token)match(input,22,FOLLOW_22_in_expr31016); if (state.failed) return retval;
|
|
}
|
|
break;
|
|
|
|
}
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "expr3"
|
|
|
|
|
|
public static class compOp_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "compOp"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:90:1: compOp : ( '<' | '>' | '=' );
|
|
public final XParser.compOp_return compOp() throws RecognitionException {
|
|
XParser.compOp_return retval = new XParser.compOp_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
Token set64=null;
|
|
|
|
CommonTree set64_tree=null;
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:90:7: ( '<' | '>' | '=' )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
set64=input.LT(1);
|
|
if ( (input.LA(1) >= 31 && input.LA(1) <= 33) ) {
|
|
input.consume();
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set64));
|
|
state.errorRecovery=false;
|
|
state.failed=false;
|
|
}
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return retval;}
|
|
MismatchedSetException mse = new MismatchedSetException(null,input);
|
|
throw mse;
|
|
}
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "compOp"
|
|
|
|
|
|
public static class cond_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "cond"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:91:1: cond : expr cond2 ;
|
|
public final XParser.cond_return cond() throws RecognitionException {
|
|
XParser.cond_return retval = new XParser.cond_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
ParserRuleReturnScope expr65 =null;
|
|
ParserRuleReturnScope cond266 =null;
|
|
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:91:5: ( expr cond2 )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:91:13: expr cond2
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_expr_in_cond1049);
|
|
expr65=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, expr65.getTree());
|
|
|
|
pushFollow(FOLLOW_cond2_in_cond1051);
|
|
cond266=cond2();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, cond266.getTree());
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "cond"
|
|
|
|
|
|
public static class cond2_return extends ParserRuleReturnScope {
|
|
CommonTree tree;
|
|
@Override
|
|
public CommonTree getTree() { return tree; }
|
|
};
|
|
|
|
|
|
// $ANTLR start "cond2"
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:92:1: cond2 : compOp expr ;
|
|
public final XParser.cond2_return cond2() throws RecognitionException {
|
|
XParser.cond2_return retval = new XParser.cond2_return();
|
|
retval.start = input.LT(1);
|
|
|
|
CommonTree root_0 = null;
|
|
|
|
ParserRuleReturnScope compOp67 =null;
|
|
ParserRuleReturnScope expr68 =null;
|
|
|
|
|
|
try {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:92:6: ( compOp expr )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:92:13: compOp expr
|
|
{
|
|
root_0 = (CommonTree)adaptor.nil();
|
|
|
|
|
|
pushFollow(FOLLOW_compOp_in_cond21062);
|
|
compOp67=compOp();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, compOp67.getTree());
|
|
|
|
pushFollow(FOLLOW_expr_in_cond21064);
|
|
expr68=expr();
|
|
state._fsp--;
|
|
if (state.failed) return retval;
|
|
if ( state.backtracking==0 ) adaptor.addChild(root_0, expr68.getTree());
|
|
|
|
}
|
|
|
|
retval.stop = input.LT(-1);
|
|
|
|
if ( state.backtracking==0 ) {
|
|
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
|
|
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
reportError(re);
|
|
recover(input,re);
|
|
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
|
|
}
|
|
finally {
|
|
// do for sure before leaving
|
|
}
|
|
return retval;
|
|
}
|
|
// $ANTLR end "cond2"
|
|
|
|
// $ANTLR start synpred4_X
|
|
public final void synpred4_X_fragment() throws RecognitionException {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:17: ( 'read' ( 'print' )? )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:17: 'read' ( 'print' )?
|
|
{
|
|
match(input,43,FOLLOW_43_in_synpred4_X554); if (state.failed) return;
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:24: ( 'print' )?
|
|
int alt13=2;
|
|
int LA13_0 = input.LA(1);
|
|
if ( (LA13_0==41) ) {
|
|
alt13=1;
|
|
}
|
|
switch (alt13) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:24: 'print'
|
|
{
|
|
match(input,41,FOLLOW_41_in_synpred4_X556); if (state.failed) return;
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
// $ANTLR end synpred4_X
|
|
|
|
// $ANTLR start synpred5_X
|
|
public final void synpred5_X_fragment() throws RecognitionException {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:35: ( 'read' )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:67:35: 'read'
|
|
{
|
|
match(input,43,FOLLOW_43_in_synpred5_X561); if (state.failed) return;
|
|
|
|
}
|
|
|
|
}
|
|
// $ANTLR end synpred5_X
|
|
|
|
// $ANTLR start synpred13_X
|
|
public final void synpred13_X_fragment() throws RecognitionException {
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:39: ( condElseStat )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:74:39: condElseStat
|
|
{
|
|
pushFollow(FOLLOW_condElseStat_in_synpred13_X697);
|
|
condElseStat();
|
|
state._fsp--;
|
|
if (state.failed) return;
|
|
|
|
}
|
|
|
|
}
|
|
// $ANTLR end synpred13_X
|
|
|
|
// $ANTLR start synpred16_X
|
|
public final void synpred16_X_fragment() throws RecognitionException {
|
|
Token op=null;
|
|
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:13: ( expr2 (op= '+' |op= '-' ) expr )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:13: expr2 (op= '+' |op= '-' ) expr
|
|
{
|
|
pushFollow(FOLLOW_expr2_in_synpred16_X846);
|
|
expr2();
|
|
state._fsp--;
|
|
if (state.failed) return;
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:19: (op= '+' |op= '-' )
|
|
int alt14=2;
|
|
int LA14_0 = input.LA(1);
|
|
if ( (LA14_0==24) ) {
|
|
alt14=1;
|
|
}
|
|
else if ( (LA14_0==25) ) {
|
|
alt14=2;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 14, 0, input);
|
|
throw nvae;
|
|
}
|
|
|
|
switch (alt14) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:20: op= '+'
|
|
{
|
|
op=(Token)match(input,24,FOLLOW_24_in_synpred16_X851); if (state.failed) return;
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:82:29: op= '-'
|
|
{
|
|
op=(Token)match(input,25,FOLLOW_25_in_synpred16_X857); if (state.failed) return;
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
pushFollow(FOLLOW_expr_in_synpred16_X860);
|
|
expr();
|
|
state._fsp--;
|
|
if (state.failed) return;
|
|
|
|
}
|
|
|
|
}
|
|
// $ANTLR end synpred16_X
|
|
|
|
// $ANTLR start synpred18_X
|
|
public final void synpred18_X_fragment() throws RecognitionException {
|
|
Token op=null;
|
|
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:13: ( expr3 (op= '*' |op= '/' ) expr )
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:13: expr3 (op= '*' |op= '/' ) expr
|
|
{
|
|
pushFollow(FOLLOW_expr3_in_synpred18_X901);
|
|
expr3();
|
|
state._fsp--;
|
|
if (state.failed) return;
|
|
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:19: (op= '*' |op= '/' )
|
|
int alt15=2;
|
|
int LA15_0 = input.LA(1);
|
|
if ( (LA15_0==23) ) {
|
|
alt15=1;
|
|
}
|
|
else if ( (LA15_0==27) ) {
|
|
alt15=2;
|
|
}
|
|
|
|
else {
|
|
if (state.backtracking>0) {state.failed=true; return;}
|
|
NoViableAltException nvae =
|
|
new NoViableAltException("", 15, 0, input);
|
|
throw nvae;
|
|
}
|
|
|
|
switch (alt15) {
|
|
case 1 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:20: op= '*'
|
|
{
|
|
op=(Token)match(input,23,FOLLOW_23_in_synpred18_X906); if (state.failed) return;
|
|
|
|
}
|
|
break;
|
|
case 2 :
|
|
// C:\\Development\\Schule\\Compilerbau\\CC-Praxis-Antlr Parser fuer X-Leer\\src/de/dhbw/compiler/antlrxparser/X.g:84:29: op= '/'
|
|
{
|
|
op=(Token)match(input,27,FOLLOW_27_in_synpred18_X912); if (state.failed) return;
|
|
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
pushFollow(FOLLOW_expr_in_synpred18_X915);
|
|
expr();
|
|
state._fsp--;
|
|
if (state.failed) return;
|
|
|
|
}
|
|
|
|
}
|
|
// $ANTLR end synpred18_X
|
|
|
|
// Delegated rules
|
|
|
|
public final boolean synpred16_X() {
|
|
state.backtracking++;
|
|
int start = input.mark();
|
|
try {
|
|
synpred16_X_fragment(); // can never throw exception
|
|
} catch (RecognitionException re) {
|
|
System.err.println("impossible: "+re);
|
|
}
|
|
boolean success = !state.failed;
|
|
input.rewind(start);
|
|
state.backtracking--;
|
|
state.failed=false;
|
|
return success;
|
|
}
|
|
public final boolean synpred5_X() {
|
|
state.backtracking++;
|
|
int start = input.mark();
|
|
try {
|
|
synpred5_X_fragment(); // can never throw exception
|
|
} catch (RecognitionException re) {
|
|
System.err.println("impossible: "+re);
|
|
}
|
|
boolean success = !state.failed;
|
|
input.rewind(start);
|
|
state.backtracking--;
|
|
state.failed=false;
|
|
return success;
|
|
}
|
|
public final boolean synpred13_X() {
|
|
state.backtracking++;
|
|
int start = input.mark();
|
|
try {
|
|
synpred13_X_fragment(); // can never throw exception
|
|
} catch (RecognitionException re) {
|
|
System.err.println("impossible: "+re);
|
|
}
|
|
boolean success = !state.failed;
|
|
input.rewind(start);
|
|
state.backtracking--;
|
|
state.failed=false;
|
|
return success;
|
|
}
|
|
public final boolean synpred4_X() {
|
|
state.backtracking++;
|
|
int start = input.mark();
|
|
try {
|
|
synpred4_X_fragment(); // can never throw exception
|
|
} catch (RecognitionException re) {
|
|
System.err.println("impossible: "+re);
|
|
}
|
|
boolean success = !state.failed;
|
|
input.rewind(start);
|
|
state.backtracking--;
|
|
state.failed=false;
|
|
return success;
|
|
}
|
|
public final boolean synpred18_X() {
|
|
state.backtracking++;
|
|
int start = input.mark();
|
|
try {
|
|
synpred18_X_fragment(); // can never throw exception
|
|
} catch (RecognitionException re) {
|
|
System.err.println("impossible: "+re);
|
|
}
|
|
boolean success = !state.failed;
|
|
input.rewind(start);
|
|
state.backtracking--;
|
|
state.failed=false;
|
|
return success;
|
|
}
|
|
|
|
|
|
|
|
public static final BitSet FOLLOW_42_in_program464 = new BitSet(new long[]{0x0000000000000400L});
|
|
public static final BitSet FOLLOW_ID_in_program467 = new BitSet(new long[]{0x0000000040000000L});
|
|
public static final BitSet FOLLOW_30_in_program469 = new BitSet(new long[]{0x00000A0400000400L});
|
|
public static final BitSet FOLLOW_decllist_in_program472 = new BitSet(new long[]{0x0000000400000000L});
|
|
public static final BitSet FOLLOW_statlist_in_program474 = new BitSet(new long[]{0x0000000004000000L});
|
|
public static final BitSet FOLLOW_26_in_program476 = new BitSet(new long[]{0x0000000000000000L});
|
|
public static final BitSet FOLLOW_EOF_in_program479 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_decl_in_decllist494 = new BitSet(new long[]{0x00000A0000000402L});
|
|
public static final BitSet FOLLOW_modifier_in_decl520 = new BitSet(new long[]{0x0000000000000400L});
|
|
public static final BitSet FOLLOW_ID_in_decl523 = new BitSet(new long[]{0x0000000010000000L});
|
|
public static final BitSet FOLLOW_28_in_decl525 = new BitSet(new long[]{0x0000112000000000L});
|
|
public static final BitSet FOLLOW_type_in_decl527 = new BitSet(new long[]{0x0000000040000000L});
|
|
public static final BitSet FOLLOW_30_in_decl529 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_43_in_modifier554 = new BitSet(new long[]{0x0000020000000002L});
|
|
public static final BitSet FOLLOW_41_in_modifier556 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_43_in_modifier561 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_41_in_modifier565 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_34_in_statlist603 = new BitSet(new long[]{0x000040D400000400L});
|
|
public static final BitSet FOLLOW_stat_in_statlist606 = new BitSet(new long[]{0x0000000040000000L});
|
|
public static final BitSet FOLLOW_30_in_statlist608 = new BitSet(new long[]{0x000040D400000400L});
|
|
public static final BitSet FOLLOW_36_in_statlist612 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_assignstat_in_stat637 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_condstat_in_stat641 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_whilestat_in_stat645 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_forstat_in_stat649 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_statlist_in_stat653 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_ID_in_assignstat663 = new BitSet(new long[]{0x0000000020000000L});
|
|
public static final BitSet FOLLOW_29_in_assignstat665 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_assignstat667 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_39_in_condstat689 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_cond_in_condstat691 = new BitSet(new long[]{0x0000200000000000L});
|
|
public static final BitSet FOLLOW_45_in_condstat693 = new BitSet(new long[]{0x000040C400000400L});
|
|
public static final BitSet FOLLOW_stat_in_condstat695 = new BitSet(new long[]{0x0000000800000002L});
|
|
public static final BitSet FOLLOW_condElseStat_in_condstat697 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_35_in_condElseStat720 = new BitSet(new long[]{0x000040C400000400L});
|
|
public static final BitSet FOLLOW_stat_in_condElseStat722 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_46_in_whilestat741 = new BitSet(new long[]{0x0000000000200000L});
|
|
public static final BitSet FOLLOW_21_in_whilestat743 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_cond_in_whilestat745 = new BitSet(new long[]{0x0000000000400000L});
|
|
public static final BitSet FOLLOW_22_in_whilestat747 = new BitSet(new long[]{0x000040C400000400L});
|
|
public static final BitSet FOLLOW_stat_in_whilestat749 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_38_in_forstat772 = new BitSet(new long[]{0x0000000000200000L});
|
|
public static final BitSet FOLLOW_21_in_forstat774 = new BitSet(new long[]{0x0000000000000400L});
|
|
public static final BitSet FOLLOW_assignstat_in_forstat776 = new BitSet(new long[]{0x0000000040000000L});
|
|
public static final BitSet FOLLOW_30_in_forstat778 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_cond_in_forstat780 = new BitSet(new long[]{0x0000000040000000L});
|
|
public static final BitSet FOLLOW_30_in_forstat782 = new BitSet(new long[]{0x0000000000000400L});
|
|
public static final BitSet FOLLOW_assignstat_in_forstat784 = new BitSet(new long[]{0x0000000000400000L});
|
|
public static final BitSet FOLLOW_22_in_forstat786 = new BitSet(new long[]{0x000040C400000400L});
|
|
public static final BitSet FOLLOW_stat_in_forstat788 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr2_in_expr846 = new BitSet(new long[]{0x0000000003000000L});
|
|
public static final BitSet FOLLOW_24_in_expr851 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_25_in_expr857 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_expr860 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr2_in_expr890 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr3_in_expr2901 = new BitSet(new long[]{0x0000000008800000L});
|
|
public static final BitSet FOLLOW_23_in_expr2906 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_27_in_expr2912 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_expr2915 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr3_in_expr2945 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_25_in_expr3958 = new BitSet(new long[]{0x0000000000000A00L});
|
|
public static final BitSet FOLLOW_number_in_expr3962 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_number_in_expr31002 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_STRINGCONST_in_expr31006 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_21_in_expr31010 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_expr31013 = new BitSet(new long[]{0x0000000000400000L});
|
|
public static final BitSet FOLLOW_22_in_expr31016 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr_in_cond1049 = new BitSet(new long[]{0x0000000380000000L});
|
|
public static final BitSet FOLLOW_cond2_in_cond1051 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_compOp_in_cond21062 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_cond21064 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_43_in_synpred4_X554 = new BitSet(new long[]{0x0000020000000002L});
|
|
public static final BitSet FOLLOW_41_in_synpred4_X556 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_43_in_synpred5_X561 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_condElseStat_in_synpred13_X697 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr2_in_synpred16_X846 = new BitSet(new long[]{0x0000000003000000L});
|
|
public static final BitSet FOLLOW_24_in_synpred16_X851 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_25_in_synpred16_X857 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_synpred16_X860 = new BitSet(new long[]{0x0000000000000002L});
|
|
public static final BitSet FOLLOW_expr3_in_synpred18_X901 = new BitSet(new long[]{0x0000000008800000L});
|
|
public static final BitSet FOLLOW_23_in_synpred18_X906 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_27_in_synpred18_X912 = new BitSet(new long[]{0x0000000002220A00L});
|
|
public static final BitSet FOLLOW_expr_in_synpred18_X915 = new BitSet(new long[]{0x0000000000000002L});
|
|
}
|