src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:149:1: variable_reference : ^(varref= VT_VAR_REF lit= LITERAL ) ;
487032
public final void variable_reference() throws RecognitionException {
		CommonTree varref=null;
		CommonTree lit=null;

		try {
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:150:5: ( ^(varref= VT_VAR_REF lit= LITERAL ) )
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:150:7: ^(varref= VT_VAR_REF lit= LITERAL )
			{
			varref=(CommonTree)match(input,VT_VAR_REF,FOLLOW_VT_VAR_REF_in_variable_reference471); 
			match(input, Token.DOWN, null); 
			lit=(CommonTree)match(input,LITERAL,FOLLOW_LITERAL_in_variable_reference475); 
			match(input, Token.UP, null); 


			        entry_stack.peek().valuebuffer.append("{" + (lit!=null?lit.getText():null) + "}" );
			         entry_stack.peek().sentenceValueBuffer.append("{"+(lit!=null?lit.getText():null)+"}");
			    
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
	}
888771
static void createSynthesizedExternVar(AbstractCompiler compiler, String varName) {
    Node nameNode = IR.name(varName);

    // Mark the variable as constant if it matches the coding convention
    // for constant vars.
    // NOTE(nicksantos): honestly, I'm not sure how much this matters.
    // AFAIK, all people who use the CONST coding convention also
    // compile with undeclaredVars as errors. We have some test
    // cases for this configuration though, and it makes them happier.
    if (compiler.getCodingConvention().isConstant(varName)) {
      nameNode.putBooleanProp(Node.IS_CONSTANT_NAME, true);
    }

    Node syntheticExternVar = IR.var(nameNode);
    getSynthesizedExternsRoot(compiler).addChildToBack(syntheticExternVar);
    compiler.reportChangeToEnclosingScope(syntheticExternVar);
  }
1216489
def p_var_decl_at(p):
    
    p[0] = None

    if len(p[2]) != 1:
        syntax_error(p.lineno(1),
                     'Only one variable at a time can be declared this way')
        return

    idlist = p[2][0]

    entry = SYMBOL_TABLE.declare_variable(idlist[0], idlist[1], p[3])
    if entry is None:
        return

    if p[5].token == 'CONST':
        tmp = p[5].expr
        if tmp.token == 'UNARY' and tmp.operator == 'ADDRESS':  # Must be an ID
            if tmp.operand.token == 'VAR':
                entry.make_alias(tmp.operand)
            elif tmp.operand.token == 'ARRAYACCESS':
                if tmp.operand.offset is None:
                    syntax_error(p.lineno(4), 'Address is not constant. Only constant subscripts are allowed')
                    return

                entry.make_alias(tmp.operand)
                entry.offset = tmp.operand.offset
            else:
                syntax_error(p.lineno(4), 'Only address of identifiers are allowed')
                return

    elif not is_number(p[5]):
        syntax_error(p.lineno(4), 'Address must be a numeric constant expression')
        return
    else:
        entry.addr = str(make_typecast(_TYPE(gl.STR_INDEX_TYPE), p[5], p.lineno(4)).value)
        entry.accessed = True
        if entry.scope == SCOPE.local:
            SYMBOL_TABLE.make_static(entry.name)
884735
public final void variableInitializer() throws RecognitionException {
		int variableInitializer_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 44) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:495:5: ( arrayInitializer | expression )
			int alt60=2;
			int LA60_0 = input.LA(1);
			if ( (LA60_0==121) ) {
				alt60=1;
			}
			else if ( ((LA60_0 >= CharacterLiteral && LA60_0 <= DecimalLiteral)||LA60_0==FloatingPointLiteral||(LA60_0 >= HexLiteral && LA60_0 <= Identifier)||(LA60_0 >= OctalLiteral && LA60_0 <= StringLiteral)||LA60_0==29||LA60_0==36||(LA60_0 >= 40 && LA60_0 <= 41)||(LA60_0 >= 44 && LA60_0 <= 45)||LA60_0==53||LA60_0==65||LA60_0==67||(LA60_0 >= 70 && LA60_0 <= 71)||LA60_0==77||(LA60_0 >= 79 && LA60_0 <= 80)||LA60_0==82||LA60_0==85||LA60_0==92||LA60_0==94||(LA60_0 >= 97 && LA60_0 <= 98)||LA60_0==105||LA60_0==108||LA60_0==111||LA60_0==115||LA60_0==118||LA60_0==126) ) {
				alt60=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 60, 0, input);
				throw nvae;
			}

			switch (alt60) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:495:7: arrayInitializer
					{
					pushFollow(FOLLOW_arrayInitializer_in_variableInitializer1507);
					arrayInitializer();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:496:9: expression
					{
					pushFollow(FOLLOW_expression_in_variableInitializer1517);
					expression();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 44, variableInitializer_StartIndex); }

		}
	}
817819
public <T extends ListBuffer<? super JCVariableDecl>> T variableDeclarators(JCModifiers mods,
                                                                         JCExpression type,
                                                                         T vdefs)
    {
        return variableDeclaratorsRest(token.pos, mods, type, ident(), false, null, vdefs);
    }
1213415
def varvalu(self, varn=None):
        '''
        
        '''

        self.ignore(whitespace)

        if varn is None:
            varn = self.varname()

        varv = s_ast.VarValue(kids=[varn])

        # handle derefs and calls...
        while self.more():

            if self.nextstr('.'):
                varv = self.varderef(varv)
                continue

            if self.nextstr('('):
                varv = self.varcall(varv)
                continue

            #if self.nextstr('['):
                #varv = self.varslice(varv)

            break

        return varv
1209456
def literal(compiler, cont, arg):
  ''''''
  text = compiler.new_var(il.ConstLocalVar('text'))
  pos = compiler.new_var(il.ConstLocalVar('pos'))
  p = compiler.new_var(il.LocalVar('p'))
  i = compiler.new_var(il.LocalVar('i'))
  x = compiler.new_var(il.ConstLocalVar('x'))
  length = compiler.new_var(il.ConstLocalVar('length'))  
  length2 = compiler.new_var(il.ConstLocalVar('length2'))  
  if isinstance(arg, Var):
    return il.Begin((
      il.Assign(x, il.Deref(arg)),
      il.AssignFromList(text, pos, il.parse_state),
      il.Assign(length, il.Len(text)),
      il.Assign(length, il.Len(x)),
      il.Assign(i, il.Integer(0)),
      il.Assign(p, pos),
      il.while_(il.and_(il.Lt(i, length2), il.Lt(p, length), il.Eq(il.GetItem(text, p), il.GetItem(x, i))), 
        il.AddAssign(p, il.Integer(1))),
      il.If(il.Lt(i, length2), 
        il.failcont(il.NONE),
        il.begin(il.append_failcont(compiler, 
          il.SetParseState(il.Tuple(text, pos))),
          il.SetParseState(il.Tuple(text, p)),
          cont(arg)))))
  elif isinstance(arg, String):
    arg = arg.interlang()
    return il.Begin((
      il.AssignFromList(text, pos, il.parse_state),
      il.Assign(length, il.Len(text)),
      il.Assign(length2, il.Len(arg)),
      il.Assign(i, il.Integer(0)),
      il.Assign(p, pos),
      il.while_(il.and_(il.Lt(i, length2), il.Lt(p, length), il.Eq(il.GetItem(text, p), il.GetItem(arg, i))), 
        il.AddAssign(p, il.Integer(1)),
        il.AddAssign(i, il.Integer(1)),
        ),
      il.If(il.Lt(i, length2), 
        il.failcont(il.NONE),
        il.begin(il.append_failcont(compiler, 
          il.SetParseState(il.Tuple(text, pos))),
          il.SetParseState(il.Tuple(text, p)),
          cont(arg)))))
  else:
    raise CompileTypeError
913192
public final void formalParameterDecls() throws RecognitionException {
		int formalParameterDecls_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 57) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:5: ( ( variableModifier )* type ( formalParameterDeclsRest )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:7: ( variableModifier )* type ( formalParameterDeclsRest )?
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:7: ( variableModifier )*
			loop79:
			while (true) {
				int alt79=2;
				int LA79_0 = input.LA(1);
				if ( (LA79_0==58||LA79_0==83) ) {
					alt79=1;
				}

				switch (alt79) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:7: variableModifier
					{
					pushFollow(FOLLOW_variableModifier_in_formalParameterDecls2047);
					variableModifier();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop79;
				}
			}

			pushFollow(FOLLOW_type_in_formalParameterDecls2050);
			type();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:30: ( formalParameterDeclsRest )?
			int alt80=2;
			int LA80_0 = input.LA(1);
			if ( (LA80_0==Identifier||LA80_0==48) ) {
				alt80=1;
			}
			switch (alt80) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:570:30: formalParameterDeclsRest
					{
					pushFollow(FOLLOW_formalParameterDeclsRest_in_formalParameterDecls2052);
					formalParameterDeclsRest();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 57, formalParameterDecls_StartIndex); }

		}
	}
1296739
public final void ternaryExpression() throws RecognitionException {
		ParserRuleReturnScope ts =null;
		ParserRuleReturnScope fs =null;

		 ternOp++; 
		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:175:5: ( QUESTION ts= expression COLON fs= expression )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:175:7: QUESTION ts= expression COLON fs= expression
			{
			match(input,QUESTION,FOLLOW_QUESTION_in_ternaryExpression854); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_ternaryExpression858);
			ts=expression();
			state._fsp--;
			if (state.failed) return;
			match(input,COLON,FOLLOW_COLON_in_ternaryExpression860); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_ternaryExpression864);
			fs=expression();
			state._fsp--;
			if (state.failed) return;
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
			 ternOp--; 
		}
	}
438924
public final void synpred22_DSLMap_fragment() throws RecognitionException {
		Token q=null;


		// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:21: ( COLON q= LITERAL )
		// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:201:21: COLON q= LITERAL
		{
		match(input,COLON,FOLLOW_COLON_in_synpred22_DSLMap832); if (state.failed) return;

		q=(Token)match(input,LITERAL,FOLLOW_LITERAL_in_synpred22_DSLMap836); if (state.failed) return;

		}

	}
86881
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;
	}
888780
public final void variableDeclarators() throws RecognitionException {
		int variableDeclarators_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 38) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:451:5: ( variableDeclarator ( ',' variableDeclarator )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:451:7: variableDeclarator ( ',' variableDeclarator )*
			{
			pushFollow(FOLLOW_variableDeclarator_in_variableDeclarators1303);
			variableDeclarator();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:451:26: ( ',' variableDeclarator )*
			loop53:
			while (true) {
				int alt53=2;
				int LA53_0 = input.LA(1);
				if ( (LA53_0==43) ) {
					alt53=1;
				}

				switch (alt53) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:451:27: ',' variableDeclarator
					{
					match(input,43,FOLLOW_43_in_variableDeclarators1306); if (state.failed) return;
					pushFollow(FOLLOW_variableDeclarator_in_variableDeclarators1308);
					variableDeclarator();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop53;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 38, variableDeclarators_StartIndex); }

		}
	}
312275
@Override
  protected Expression visitVarRefNode(VarRefNode node) {
    Expression translation = variableMappings.maybeGet(node.getName());
    if (translation != null) {
      // Case 1: In-scope local var.
      return translation;
    } else {
      // Case 2: Data reference.
      return genCodeForParamAccess(node.getName(), node.getDefnDecl());
    }
  }
485970
public final void mLEFT_CURLY() throws RecognitionException {
		try {
			int _type = LEFT_CURLY;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:305:9: ( '{' )
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMap.g:305:11: '{'
			{
			match('{'); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
57102
public final DSLMapping mapping_file() throws RecognitionException {
		mapping_file_stack.push(new mapping_file_scope());
		DSLMapping mapping = null;



		    mapping_file_stack.peek().retval = new DefaultDSLMapping() ;

		try {
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:23:5: ( ^( VT_DSL_GRAMMAR ( valid_entry )* ) )
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:23:7: ^( VT_DSL_GRAMMAR ( valid_entry )* )
			{
			match(input,VT_DSL_GRAMMAR,FOLLOW_VT_DSL_GRAMMAR_in_mapping_file63); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:23:24: ( valid_entry )*
				loop1:
				while (true) {
					int alt1=2;
					int LA1_0 = input.LA(1);
					if ( (LA1_0==VT_ENTRY) ) {
						alt1=1;
					}

					switch (alt1) {
					case 1 :
						// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:23:24: valid_entry
						{
						pushFollow(FOLLOW_valid_entry_in_mapping_file65);
						valid_entry();
						state._fsp--;

						}
						break;

					default :
						break loop1;
					}
				}

				match(input, Token.UP, null); 
			}


			        mapping = mapping_file_stack.peek().retval;
			    
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			mapping_file_stack.pop();
		}
		return mapping;
	}
885055
function Reference(ident, scope, flag,writeExpr, maybeImplicitGlobal, partial, init) {
      /**
       * Identifier syntax node.
       * @member {esprima#Identifier} Reference#identifier
       */
      this.identifier = ident;
      /**
       * Reference to the enclosing Scope.
       * @member {Scope} Reference#from
       */
      this.from = scope;
      /**
       * Whether the reference comes from a dynamic scope (such as 'eval',
       * 'with', etc.), and may be trapped by dynamic scopes.
       * @member {boolean} Reference#tainted
       */
      this.tainted = false;
      /**
       * The variable this reference is resolved with.
       * @member {Variable} Reference#resolved
       */
      this.resolved = null;
      /**
       * The read-write mode of the reference. (Value is one of {@link
       * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
       * @member {number} Reference#flag
       * @private
       */
      this.flag = flag;
      if (this.isWrite()) {
          /**
           * If reference is writeable, this is the tree being written to it.
           * @member {esprima#Node} Reference#writeExpr
           */
          this.writeExpr = writeExpr;
          /**
           * Whether the Reference might refer to a partial value of writeExpr.
           * @member {boolean} Reference#partial
           */
          this.partial = partial;
          /**
           * Whether the Reference is to write of initialization.
           * @member {boolean} Reference#init
           */
          this.init = init;
      }
      this.__maybeImplicitGlobal = maybeImplicitGlobal;
  }
186187
public final void literal() throws RecognitionException {
		int literal_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 61) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:587:5: ( integerLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | booleanLiteral | 'null' )
			int alt84=6;
			switch ( input.LA(1) ) {
			case DecimalLiteral:
			case HexLiteral:
			case OctalLiteral:
				{
				alt84=1;
				}
				break;
			case FloatingPointLiteral:
				{
				alt84=2;
				}
				break;
			case CharacterLiteral:
				{
				alt84=3;
				}
				break;
			case StringLiteral:
				{
				alt84=4;
				}
				break;
			case 82:
			case 115:
				{
				alt84=5;
				}
				break;
			case 98:
				{
				alt84=6;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 84, 0, input);
				throw nvae;
			}
			switch (alt84) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:587:9: integerLiteral
					{
					pushFollow(FOLLOW_integerLiteral_in_literal2150);
					integerLiteral();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:588:9: FloatingPointLiteral
					{
					match(input,FloatingPointLiteral,FOLLOW_FloatingPointLiteral_in_literal2160); if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:589:9: CharacterLiteral
					{
					match(input,CharacterLiteral,FOLLOW_CharacterLiteral_in_literal2170); if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:590:9: StringLiteral
					{
					match(input,StringLiteral,FOLLOW_StringLiteral_in_literal2180); if (state.failed) return;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:591:9: booleanLiteral
					{
					pushFollow(FOLLOW_booleanLiteral_in_literal2190);
					booleanLiteral();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 6 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:592:9: 'null'
					{
					match(input,98,FOLLOW_98_in_literal2200); if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 61, literal_StartIndex); }

		}
	}