Object name_tree=null;
Object q_tree=null;
Object rc_tree=null;
Object COLON26_tree=null;
Object COLON27_tree=null;
RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
RewriteRuleTokenStream stream_RIGHT_CURLY=new RewriteRuleTokenStream(adaptor,"token RIGHT_CURLY");
RewriteRuleTokenStream stream_LITERAL=new RewriteRuleTokenStream(adaptor,"token LITERAL");
RewriteRuleTokenStream stream_LEFT_CURLY=new RewriteRuleTokenStream(adaptor,"token LEFT_CURLY");
RewriteRuleSubtreeStream stream_pattern=new RewriteRuleSubtreeStream(adaptor,"rule pattern");
String text = "";
boolean hasSpaceBefore = false;
boolean hasSpaceAfter = false;
try {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:181:4: (lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) )
// src/main/resources/org/drools/lang/dsl/DSLMap.g:181:4: lc= LEFT_CURLY name= LITERAL ( ( COLON q= LITERAL )? COLON pat= pattern )? rc= RIGHT_CURLY
{
lc=(Token)input.LT(1);
match(input,LEFT_CURLY,FOLLOW_LEFT_CURLY_in_variable_definition710); if (failed) return retval;
if ( backtracking==0 ) stream_LEFT_CURLY.add(lc);
if ( backtracking==0 ) {
CommonToken back2 = (CommonToken)input.LT(-2);
if( back2!=null && back2.getStopIndex() < ((CommonToken)lc).getStartIndex() -1 ) hasSpaceBefore = true;
}
name=(Token)input.LT(1);
match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition721); if (failed) return retval;
if ( backtracking==0 ) stream_LITERAL.add(name);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:186:15: ( ( COLON q= LITERAL )? COLON pat= pattern )?
int alt14=2;
int LA14_0 = input.LA(1);
if ( (LA14_0==COLON) ) {
alt14=1;
}
switch (alt14) {
case 1 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:186:17: ( COLON q= LITERAL )? COLON pat= pattern
{
// src/main/resources/org/drools/lang/dsl/DSLMap.g:186:17: ( COLON q= LITERAL )?
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==COLON) ) {
int LA13_1 = input.LA(2);
if ( (LA13_1==LITERAL) ) {
int LA13_2 = input.LA(3);
if ( (LA13_2==COLON) ) {
int LA13_4 = input.LA(4);
if ( (synpred21()) ) {
alt13=1;
}
}
}
}
switch (alt13) {
case 1 :
// src/main/resources/org/drools/lang/dsl/DSLMap.g:186:18: COLON q= LITERAL
{
COLON26=(Token)input.LT(1);
match(input,COLON,FOLLOW_COLON_in_variable_definition726); if (failed) return retval;
if ( backtracking==0 ) stream_COLON.add(COLON26);
q=(Token)input.LT(1);
match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition730); if (failed) return retval;
if ( backtracking==0 ) stream_LITERAL.add(q);
}
break;
}
COLON27=(Token)input.LT(1);
match(input,COLON,FOLLOW_COLON_in_variable_definition734); if (failed) return retval;
if ( backtracking==0 ) stream_COLON.add(COLON27);
pushFollow(FOLLOW_pattern_in_variable_definition738);
pat=pattern();
_fsp--;
if (failed) return retval;
if ( backtracking==0 ) stream_pattern.add(pat.getTree());
if ( backtracking==0 ) {
text = input.toString(pat.start,pat.stop);
}
}
break;
}
rc=(Token)input.LT(1);
match(input,RIGHT_CURLY,FOLLOW_RIGHT_CURLY_in_variable_definition747); if (failed) return retval;
if ( backtracking==0 ) stream_RIGHT_CURLY.add(rc);
if ( backtracking==0 ) {
CommonToken rc1 = (CommonToken)input.LT(1);
if(!"=".equals(rc1.getText()) && ((CommonToken)rc).getStopIndex() < rc1.getStartIndex() - 1) hasSpaceAfter = true;
}
// AST REWRITE
// elements: name, q, q, q, q, q, name, q, name, name, name, q, name, name, name, q, q, name
// token labels: q, name
// rule labels: retval
// token list labels:
// rule list labels:
if ( backtracking==0 ) {
retval.tree = root_0;
RewriteRuleTokenStream stream_q=new RewriteRuleTokenStream(adaptor,"token q",q);
RewriteRuleTokenStream stream_name=new RewriteRuleTokenStream(adaptor,"token name",name);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
root_0 = (Object)adaptor.nil();
// 191:2: -> {hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
if (hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) {
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
// src/main/resources/org/drools/lang/dsl/DSLMap.g:191:70: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:191:89: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:191:99: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, adaptor.create(VT_PATTERN, ((Token)pat.start), text));
adaptor.addChild(root_0, root_1);
}
}
else // 192:2: -> {!hasSpaceBefore && !\"\".equals(text) && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
if (!hasSpaceBefore && !"".equals(text) && !hasSpaceAfter) {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:192:63: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:192:82: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:192:92: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, adaptor.create(VT_PATTERN, ((Token)pat.start), text));
adaptor.addChild(root_0, root_1);
}
}
else // 193:2: -> {hasSpaceBefore && !hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
if (hasSpaceBefore && !hasSpaceAfter) {
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
// src/main/resources/org/drools/lang/dsl/DSLMap.g:193:51: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:193:70: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:193:80: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
}
else // 194:2: -> {!hasSpaceBefore && !hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
if (!hasSpaceBefore && !hasSpaceAfter) {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:194:44: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:194:63: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:194:73: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
}
else // 196:2: -> {hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE
if (hasSpaceBefore && !"".equals(text) && hasSpaceAfter) {
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
// src/main/resources/org/drools/lang/dsl/DSLMap.g:196:69: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:196:88: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:196:98: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, adaptor.create(VT_PATTERN, ((Token)pat.start), text));
adaptor.addChild(root_0, root_1);
}
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
}
else // 197:2: -> {!hasSpaceBefore && !\"\".equals(text) && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] ) VT_SPACE
if (!hasSpaceBefore && !"".equals(text) && hasSpaceAfter) {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:197:62: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) VT_PATTERN[$pat.start, text] )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:197:81: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:197:91: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_1, adaptor.create(VT_PATTERN, ((Token)pat.start), text));
adaptor.addChild(root_0, root_1);
}
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
}
else // 198:2: -> {hasSpaceBefore && hasSpaceAfter}? VT_SPACE ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE
if (hasSpaceBefore && hasSpaceAfter) {
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
// src/main/resources/org/drools/lang/dsl/DSLMap.g:198:50: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:198:69: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:198:79: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
}
else // 199:2: -> {!hasSpaceBefore && hasSpaceAfter}? ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) ) VT_SPACE
if (!hasSpaceBefore && hasSpaceAfter) {
// src/main/resources/org/drools/lang/dsl/DSLMap.g:199:43: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:199:62: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);
// src/main/resources/org/drools/lang/dsl/DSLMap.g:199:72: ( $q)?
if ( stream_q.hasNext() ) {
adaptor.addChild(root_2, stream_q.next());
}
stream_q.reset();
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
adaptor.addChild(root_0, adaptor.create(VT_SPACE, "VT_SPACE"));
}
else // 200:2: -> ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
// src/main/resources/org/drools/lang/dsl/DSLMap.g:200:5: ^( VT_VAR_DEF $name ^( VT_QUAL ( $q)? ) )
{
Object root_1 = (Object)adaptor.nil();
root_1 = (Object)adaptor.becomeRoot(adaptor.create(VT_VAR_DEF, "VT_VAR_DEF"), root_1);
adaptor.addChild(root_1, stream_name.next());
// src/main/resources/org/drools/lang/dsl/DSLMap.g:200:24: ^( VT_QUAL ( $q)? )
{
Object root_2 = (Object)adaptor.nil();
root_2 = (Object)adaptor.becomeRoot(adaptor.create(VT_QUAL, "VT_QUAL"), root_2);