org.antlr.runtime.ParserRuleReturnScope Java Examples
The following examples show how to use
org.antlr.runtime.ParserRuleReturnScope.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 5 votes |
public final void synpred6_DSLMap_fragment() throws RecognitionException { ParserRuleReturnScope value1 =null; // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:132:10: (value1= condition_key ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:132:10: value1= condition_key { pushFollow(FOLLOW_condition_key_in_synpred6_DSLMap425); value1=condition_key(); state._fsp--; if (state.failed) return; } }
Example #2
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 5 votes |
public final void synpred7_DSLMap_fragment() throws RecognitionException { ParserRuleReturnScope value2 =null; // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:133:11: (value2= consequence_key ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:133:11: value2= consequence_key { pushFollow(FOLLOW_consequence_key_in_synpred7_DSLMap439); value2=consequence_key(); state._fsp--; if (state.failed) return; } }
Example #3
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 5 votes |
public final void synpred8_DSLMap_fragment() throws RecognitionException { ParserRuleReturnScope value3 =null; // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:134:11: (value3= keyword_key ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:134:11: value3= keyword_key { pushFollow(FOLLOW_keyword_key_in_synpred8_DSLMap453); value3=keyword_key(); state._fsp--; if (state.failed) return; } }
Example #4
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.mapping_file_return mapping_file() throws RecognitionException { DSLMapParser.mapping_file_return retval = new DSLMapParser.mapping_file_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope statement1 =null; RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement"); try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:107:5: ( ( statement )* -> ^( VT_DSL_GRAMMAR ( statement )* ) ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:107:7: ( statement )* { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:107:7: ( statement )* loop1: while (true) { int alt1=2; int LA1_0 = input.LA(1); if ( (LA1_0==EOL||LA1_0==LEFT_SQUARE) ) { alt1=1; } switch (alt1) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:107:7: statement { pushFollow(FOLLOW_statement_in_mapping_file275); statement1=statement(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_statement.add(statement1.getTree()); } break; default : break loop1; } } // AST REWRITE // elements: statement // 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 = (Object)adaptor.nil(); // 108:5: -> ^( VT_DSL_GRAMMAR ( statement )* ) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:108:8: ^( VT_DSL_GRAMMAR ( statement )* ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_DSL_GRAMMAR, "VT_DSL_GRAMMAR"), root_1); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:108:25: ( statement )* while ( stream_statement.hasNext() ) { adaptor.addChild(root_1, stream_statement.nextTree()); } stream_statement.reset(); adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
Example #5
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.key_section_return key_section() throws RecognitionException { DSLMapParser.key_section_return retval = new DSLMapParser.key_section_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope ks =null; RewriteRuleSubtreeStream stream_key_sentence=new RewriteRuleSubtreeStream(adaptor,"rule key_sentence"); try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:150:5: ( (ks= key_sentence )+ -> ^( VT_ENTRY_KEY ( key_sentence )+ ) ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:150:7: (ks= key_sentence )+ { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:150:9: (ks= key_sentence )+ int cnt8=0; loop8: while (true) { int alt8=2; int LA8_0 = input.LA(1); if ( (LA8_0==COLON||(LA8_0 >= LEFT_CURLY && LA8_0 <= LITERAL)||LA8_0==RIGHT_SQUARE) ) { alt8=1; } switch (alt8) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:150:9: ks= key_sentence { pushFollow(FOLLOW_key_sentence_in_key_section568); ks=key_sentence(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_key_sentence.add(ks.getTree()); } break; default : if ( cnt8 >= 1 ) break loop8; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee = new EarlyExitException(8, input); throw eee; } cnt8++; } // AST REWRITE // elements: key_sentence // 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 = (Object)adaptor.nil(); // 151:5: -> ^( VT_ENTRY_KEY ( key_sentence )+ ) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:151:8: ^( VT_ENTRY_KEY ( key_sentence )+ ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_ENTRY_KEY, "VT_ENTRY_KEY"), root_1); if ( !(stream_key_sentence.hasNext()) ) { throw new RewriteEarlyExitException(); } while ( stream_key_sentence.hasNext() ) { adaptor.addChild(root_1, stream_key_sentence.nextTree()); } stream_key_sentence.reset(); adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
Example #6
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.key_sentence_return key_sentence() throws RecognitionException { DSLMapParser.key_sentence_return retval = new DSLMapParser.key_sentence_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope cb =null; ParserRuleReturnScope variable_definition16 =null; RewriteRuleSubtreeStream stream_key_chunk=new RewriteRuleSubtreeStream(adaptor,"rule key_chunk"); String text = ""; try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:158:5: ( variable_definition |cb= key_chunk -> VT_LITERAL[$cb.start, text] ) int alt9=2; int LA9_0 = input.LA(1); if ( (LA9_0==LEFT_CURLY) ) { alt9=1; } else if ( (LA9_0==COLON||(LA9_0 >= LEFT_SQUARE && LA9_0 <= LITERAL)||LA9_0==RIGHT_SQUARE) ) { alt9=2; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 9, 0, input); throw nvae; } switch (alt9) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:158:7: variable_definition { root_0 = (Object)adaptor.nil(); pushFollow(FOLLOW_variable_definition_in_key_sentence608); variable_definition16=variable_definition(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_definition16.getTree()); } break; case 2 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:159:7: cb= key_chunk { pushFollow(FOLLOW_key_chunk_in_key_sentence618); cb=key_chunk(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_key_chunk.add(cb.getTree()); if ( state.backtracking==0 ) { text = (cb!=null?input.toString(cb.start,cb.stop):null); } // AST REWRITE // elements: // 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 = (Object)adaptor.nil(); // 160:5: -> VT_LITERAL[$cb.start, text] { adaptor.addChild(root_0, (Object)adaptor.create(VT_LITERAL, (cb!=null?(cb.start):null), text)); } retval.tree = root_0; } } break; } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
Example #7
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.key_chunk_return key_chunk() throws RecognitionException { DSLMapParser.key_chunk_return retval = new DSLMapParser.key_chunk_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope literal17 =null; try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:164:5: ( ( literal )+ ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:164:7: ( literal )+ { root_0 = (Object)adaptor.nil(); // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:164:7: ( literal )+ int cnt10=0; loop10: while (true) { int alt10=2; int LA10_0 = input.LA(1); if ( (LA10_0==COLON||(LA10_0 >= LEFT_SQUARE && LA10_0 <= LITERAL)||LA10_0==RIGHT_SQUARE) ) { int LA10_2 = input.LA(2); if ( (synpred12_DSLMap()) ) { alt10=1; } } switch (alt10) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:164:7: literal { pushFollow(FOLLOW_literal_in_key_chunk646); literal17=literal(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) adaptor.addChild(root_0, literal17.getTree()); } break; default : if ( cnt10 >= 1 ) break loop10; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee = new EarlyExitException(10, input); throw eee; } cnt10++; } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
Example #8
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.value_section_return value_section() throws RecognitionException { DSLMapParser.value_section_return retval = new DSLMapParser.value_section_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope value_sentence18 =null; RewriteRuleSubtreeStream stream_value_sentence=new RewriteRuleSubtreeStream(adaptor,"rule value_sentence"); try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:5: ( ( value_sentence )+ -> ^( VT_ENTRY_VAL ( value_sentence )+ ) ) // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: ( value_sentence )+ { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: ( value_sentence )+ int cnt11=0; loop11: while (true) { int alt11=2; int LA11_0 = input.LA(1); if ( ((LA11_0 >= COLON && LA11_0 <= DOT)||LA11_0==EQUALS||(LA11_0 >= LEFT_CURLY && LA11_0 <= LITERAL)||LA11_0==RIGHT_SQUARE) ) { alt11=1; } switch (alt11) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:168:7: value_sentence { pushFollow(FOLLOW_value_sentence_in_value_section664); value_sentence18=value_sentence(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_value_sentence.add(value_sentence18.getTree()); } break; default : if ( cnt11 >= 1 ) break loop11; if (state.backtracking>0) {state.failed=true; return retval;} EarlyExitException eee = new EarlyExitException(11, input); throw eee; } cnt11++; } // AST REWRITE // elements: value_sentence // 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 = (Object)adaptor.nil(); // 169:5: -> ^( VT_ENTRY_VAL ( value_sentence )+ ) { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:169:8: ^( VT_ENTRY_VAL ( value_sentence )+ ) { Object root_1 = (Object)adaptor.nil(); root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(VT_ENTRY_VAL, "VT_ENTRY_VAL"), root_1); if ( !(stream_value_sentence.hasNext()) ) { throw new RewriteEarlyExitException(); } while ( stream_value_sentence.hasNext() ) { adaptor.addChild(root_1, stream_value_sentence.nextTree()); } stream_value_sentence.reset(); adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
Example #9
Source File: DSLMapParser.java From kogito-runtimes with Apache License 2.0 | 4 votes |
public final DSLMapParser.value_sentence_return value_sentence() throws RecognitionException { DSLMapParser.value_sentence_return retval = new DSLMapParser.value_sentence_return(); retval.start = input.LT(1); Object root_0 = null; ParserRuleReturnScope vc =null; ParserRuleReturnScope variable_reference19 =null; RewriteRuleSubtreeStream stream_value_chunk=new RewriteRuleSubtreeStream(adaptor,"rule value_chunk"); String text = ""; try { // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:176:5: ( variable_reference |vc= value_chunk -> VT_LITERAL[$vc.start, text] ) int alt12=2; int LA12_0 = input.LA(1); if ( (LA12_0==LEFT_CURLY) ) { alt12=1; } else if ( ((LA12_0 >= COLON && LA12_0 <= DOT)||LA12_0==EQUALS||(LA12_0 >= LEFT_SQUARE && LA12_0 <= LITERAL)||LA12_0==RIGHT_SQUARE) ) { alt12=2; } else { if (state.backtracking>0) {state.failed=true; return retval;} NoViableAltException nvae = new NoViableAltException("", 12, 0, input); throw nvae; } switch (alt12) { case 1 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:176:7: variable_reference { root_0 = (Object)adaptor.nil(); pushFollow(FOLLOW_variable_reference_in_value_sentence703); variable_reference19=variable_reference(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) adaptor.addChild(root_0, variable_reference19.getTree()); } break; case 2 : // src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:177:7: vc= value_chunk { pushFollow(FOLLOW_value_chunk_in_value_sentence713); vc=value_chunk(); state._fsp--; if (state.failed) return retval; if ( state.backtracking==0 ) stream_value_chunk.add(vc.getTree()); if ( state.backtracking==0 ) { text = (vc!=null?input.toString(vc.start,vc.stop):null); } // AST REWRITE // elements: // 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 = (Object)adaptor.nil(); // 178:5: -> VT_LITERAL[$vc.start, text] { adaptor.addChild(root_0, (Object)adaptor.create(VT_LITERAL, (vc!=null?(vc.start):null), text)); } retval.tree = root_0; } } break; } retval.stop = input.LT(-1); if ( state.backtracking==0 ) { retval.tree = (Object)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }