📄 ruleparser.java
字号:
case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 59: case 60: case 61: alt17=1; break; default: NoViableAltException nvae = new NoViableAltException("403:17: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 17, 0, input); throw nvae; } switch (alt17) { case 1 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:404:25: {...}? expander_lhs_block[lhs] { if ( !( expander != null ) ) { throw new FailedPredicateException(input, "query", " expander != null "); } following.push(FOLLOW_expander_lhs_block_in_query550); expander_lhs_block(lhs); following.pop(); } break; case 2 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:405:27: normal_lhs_block[lhs] { following.push(FOLLOW_normal_lhs_block_in_query558); normal_lhs_block(lhs); following.pop(); } break; } match(input,29,FOLLOW_29_in_query573); following.push(FOLLOW_opt_eol_in_query575); opt_eol(); following.pop(); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return query; } // $ANTLR end query // $ANTLR start rule // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:411:1: rule returns [RuleDescr rule] : opt_eol loc= 'rule' ruleName= word opt_eol ( rule_attributes[rule] )? opt_eol ( (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= 'then' ( ':' )? opt_eol ( options {greedy=false; } : any= . )* )? )? 'end' opt_eol ; public RuleDescr rule() throws RecognitionException { RuleDescr rule; Token loc=null; Token any=null; String ruleName = null; rule = null; String consequence = ""; try { // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:417:17: ( opt_eol loc= 'rule' ruleName= word opt_eol ( rule_attributes[rule] )? opt_eol ( (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= 'then' ( ':' )? opt_eol ( options {greedy=false; } : any= . )* )? )? 'end' opt_eol ) // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:417:17: opt_eol loc= 'rule' ruleName= word opt_eol ( rule_attributes[rule] )? opt_eol ( (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= 'then' ( ':' )? opt_eol ( options {greedy=false; } : any= . )* )? )? 'end' opt_eol { following.push(FOLLOW_opt_eol_in_rule598); opt_eol(); following.pop(); loc=(Token)input.LT(1); match(input,30,FOLLOW_30_in_rule604); following.push(FOLLOW_word_in_rule608); ruleName=word(); following.pop(); following.push(FOLLOW_opt_eol_in_rule610); opt_eol(); following.pop(); debug( "start rule: " + ruleName ); rule = new RuleDescr( ruleName, null ); rule.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() ); // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:424:17: ( rule_attributes[rule] )? int alt18=2; switch ( input.LA(1) ) { case 32: case 34: alt18=1; break; case EOL: case 15: case 24: case 35: case 36: case 37: case 38: case 39: case 40: alt18=1; break; case 31: alt18=1; break; case 33: alt18=1; break; case 29: alt18=1; break; default: NoViableAltException nvae = new NoViableAltException("424:17: ( rule_attributes[rule] )?", 18, 0, input); throw nvae; } switch (alt18) { case 1 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:424:25: rule_attributes[rule] { following.push(FOLLOW_rule_attributes_in_rule621); rule_attributes(rule); following.pop(); } break; } following.push(FOLLOW_opt_eol_in_rule631); opt_eol(); following.pop(); // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:17: ( (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= 'then' ( ':' )? opt_eol ( options {greedy=false; } : any= . )* )? )? int alt25=2; int LA25_0 = input.LA(1); if ( LA25_0==EOL||LA25_0==15||LA25_0==31||LA25_0==33 ) { alt25=1; } else if ( LA25_0==29 ) { alt25=1; } else { NoViableAltException nvae = new NoViableAltException("427:17: ( (loc= \'when\' ( \':\' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= \'then\' ( \':\' )? opt_eol ( options {greedy=false; } : any= . )* )? )?", 25, 0, input); throw nvae; } switch (alt25) { case 1 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:18: (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? ( opt_eol loc= 'then' ( ':' )? opt_eol ( options {greedy=false; } : any= . )* )? { // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:18: (loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )? int alt21=2; int LA21_0 = input.LA(1); if ( LA21_0==31 ) { alt21=1; } else if ( LA21_0==EOL||LA21_0==15||LA21_0==29||LA21_0==33 ) { alt21=2; } else { NoViableAltException nvae = new NoViableAltException("427:18: (loc= \'when\' ( \':\' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) )?", 21, 0, input); throw nvae; } switch (alt21) { case 1 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:25: loc= 'when' ( ':' )? opt_eol ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) { loc=(Token)input.LT(1); match(input,31,FOLLOW_31_in_rule640); // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:36: ( ':' )? int alt19=2; int LA19_0 = input.LA(1); if ( LA19_0==32 ) { int LA19_1 = input.LA(2); if ( !( expander != null ) ) { alt19=1; } else if ( expander != null ) { alt19=2; } else { NoViableAltException nvae = new NoViableAltException("427:36: ( \':\' )?", 19, 1, input); throw nvae; } } else if ( (LA19_0>=EOL && LA19_0<=31)||(LA19_0>=33 && LA19_0<=61) ) { alt19=2; } else { NoViableAltException nvae = new NoViableAltException("427:36: ( \':\' )?", 19, 0, input); throw nvae; } switch (alt19) { case 1 : // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:427:36: ':' { match(input,32,FOLLOW_32_in_rule642); } break; } following.push(FOLLOW_opt_eol_in_rule645); opt_eol(); following.pop(); AndDescr lhs = new AndDescr(); rule.setLhs( lhs ); lhs.setLocation( offset(loc.getLine()), loc.getCharPositionInLine() ); // /home/michael/projects/jboss-rules-3.0.x/drools-compiler/src/main/resources/org/drools/lang/drl.g:432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] ) int alt20=2; switch ( input.LA(1) ) { case 23: int LA20_1 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoViableAltException("432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 20, 1, input); throw nvae; } break; case EOL: int LA20_2 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoViableAltException("432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 20, 2, input); throw nvae; } break; case 15: int LA20_3 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoViableAltException("432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 20, 3, input); throw nvae; } break; case 33: int LA20_4 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoViableAltException("432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 20, 4, input); throw nvae; } break; case 29: int LA20_5 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoViableAltException("432:25: ({...}? expander_lhs_block[lhs] | normal_lhs_block[lhs] )", 20, 5, input); throw nvae; } break; case 56: int LA20_6 = input.LA(2); if ( expander != null ) { alt20=1; } else if ( true ) { alt20=2; } else { NoViableAltException nvae = new NoVia
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -