Object LEFT_SQUARE13_tree=null;
Object RIGHT_SQUARE14_tree=null;
RewriteRuleTokenStream stream_LEFT_SQUARE=new RewriteRuleTokenStream(adaptor,"token LEFT_SQUARE");
RewriteRuleTokenStream stream_RIGHT_SQUARE=new RewriteRuleTokenStream(adaptor,"token RIGHT_SQUARE");
RewriteRuleSubtreeStream stream_condition_key=new RewriteRuleSubtreeStream(adaptor,"rule condition_key");
RewriteRuleSubtreeStream stream_any_key=new RewriteRuleSubtreeStream(adaptor,"rule any_key");
RewriteRuleSubtreeStream stream_keyword_key=new RewriteRuleSubtreeStream(adaptor,"rule keyword_key");
RewriteRuleSubtreeStream stream_consequence_key=new RewriteRuleSubtreeStream(adaptor,"rule consequence_key");
try {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:116:4: ( LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? ) )
// src/main/resources/org/drools/lang/dsl/DSLMap.g:116:4: LEFT_SQUARE (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key ) RIGHT_SQUARE
{
LEFT_SQUARE13=(Token)input.LT(1);
match(input,LEFT_SQUARE,FOLLOW_LEFT_SQUARE_in_scope_section410); if (failed) return retval;
if ( backtracking==0 ) stream_LEFT_SQUARE.add(LEFT_SQUARE13);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:117:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )
int alt5=4;
int LA5_0 = input.LA(1);
if ( (LA5_0==LITERAL) ) {
int LA5_1 = input.LA(2);
if ( ((synpred6()&&validateIdentifierKey("condition")||validateIdentifierKey("when"))) ) {
alt5=1;
}
else if ( ((synpred7()&&validateIdentifierKey("consequence")||validateIdentifierKey("then"))) ) {
alt5=2;
}
else if ( ((synpred8()&&validateIdentifierKey("keyword"))) ) {
alt5=3;
}
else if ( (validateIdentifierKey("*")) ) {
alt5=4;
}
else {
if (backtracking>0) {failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("117:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 1, input);
throw nvae;
}
}
else {
if (backtracking>0) {failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("117:3: (value1= condition_key | value2= consequence_key | value3= keyword_key | value4= any_key )", 5, 0, input);
throw nvae;
}
switch (alt5) {
case 1 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:117:4: value1= condition_key
{
pushFollow(FOLLOW_condition_key_in_scope_section418);
value1=condition_key();
_fsp--;
if (failed) return retval;
if ( backtracking==0 ) stream_condition_key.add(value1.getTree());
}
break;
case 2 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:118:5: value2= consequence_key
{
pushFollow(FOLLOW_consequence_key_in_scope_section427);
value2=consequence_key();
_fsp--;
if (failed) return retval;
if ( backtracking==0 ) stream_consequence_key.add(value2.getTree());
}
break;
case 3 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:119:5: value3= keyword_key
{
pushFollow(FOLLOW_keyword_key_in_scope_section435);
value3=keyword_key();
_fsp--;
if (failed) return retval;
if ( backtracking==0 ) stream_keyword_key.add(value3.getTree());
}
break;
case 4 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:120:5: value4= any_key
{
pushFollow(FOLLOW_any_key_in_scope_section443);
value4=any_key();
_fsp--;
if (failed) return retval;
if ( backtracking==0 ) stream_any_key.add(value4.getTree());
}
break;
}
RIGHT_SQUARE14=(Token)input.LT(1);
match(input,RIGHT_SQUARE,FOLLOW_RIGHT_SQUARE_in_scope_section451); if (failed) return retval;
if ( backtracking==0 ) stream_RIGHT_SQUARE.add(RIGHT_SQUARE14);
// AST REWRITE
// elements: value2, value3, value1, value4
// token labels:
// rule labels: value1, value4, value2, retval, value3
// token list labels:
// rule list labels:
if ( backtracking==0 ) {
retval.tree = root_0;
RewriteRuleSubtreeStream stream_value1=new RewriteRuleSubtreeStream(adaptor,"token value1",value1!=null?value1.tree:null);
RewriteRuleSubtreeStream stream_value4=new RewriteRuleSubtreeStream(adaptor,"token value4",value4!=null?value4.tree:null);
RewriteRuleSubtreeStream stream_value2=new RewriteRuleSubtreeStream(adaptor,"token value2",value2!=null?value2.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_value3=new RewriteRuleSubtreeStream(adaptor,"token value3",value3!=null?value3.tree:null);
root_0 = (Object)adaptor.nil();
// 123:2: -> ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
{
// src/main/resources/org/drools/lang/dsl/DSLMap.g:123:5: ^( VT_SCOPE[$LEFT_SQUARE, \"SCOPE SECTION\"] ( $value1)? ( $value2)? ( $value3)? ( $value4)? )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_SCOPE, LEFT_SQUARE13, "SCOPE SECTION"), root_1);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:123:47: ( $value1)?
if ( stream_value1.hasNext() ) {
adaptor.addChild(root_1, stream_value1.next());
}
stream_value1.reset();
// src/main/resources/org/drools/lang/dsl/DSLMap.g:123:56: ( $value2)?
if ( stream_value2.hasNext() ) {
adaptor.addChild(root_1, stream_value2.next());
}
stream_value2.reset();
// src/main/resources/org/drools/lang/dsl/DSLMap.g:123:65: ( $value3)?
if ( stream_value3.hasNext() ) {
adaptor.addChild(root_1, stream_value3.next());
}
stream_value3.reset();
// src/main/resources/org/drools/lang/dsl/DSLMap.g:123:74: ( $value4)?
if ( stream_value4.hasNext() ) {
adaptor.addChild(root_1, stream_value4.next());
}