Adds a VarRefExpr to the pipeline. This Expression holds a reference to
the current context item of the specified variable.

@param mTransaction
the transaction to operate on.
@param mVarName
the name of the variable
329486
public void addVarRefExpr(final INodeReadTrx mTransaction, final String mVarName) {

        final VariableAxis axis = (VariableAxis)mVarRefMap.get(mVarName);
        if (axis != null) {
            getExpression().add(new VarRefExpr(mTransaction, axis));
        } else {
            throw new IllegalStateException("Variable " + mVarName + " unkown.");
        }

    }
852340
public final void forVarControl() throws RecognitionException {
		int forVarControl_StartIndex = input.index();

		Token id=null;
		ParserRuleReturnScope variableModifier14 =null;
		ParserRuleReturnScope type15 =null;

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

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1073:5: ( ( variableModifier )* type id= Identifier ':' expression )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1073:7: ( variableModifier )* type id= Identifier ':' expression
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1073:7: ( variableModifier )*
			loop138:
			while (true) {
				int alt138=2;
				int LA138_0 = input.LA(1);
				if ( (LA138_0==58||LA138_0==83) ) {
					alt138=1;
				}

				switch (alt138) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1073:9: variableModifier
					{
					pushFollow(FOLLOW_variableModifier_in_forVarControl4678);
					variableModifier14=variableModifier();
					state._fsp--;
					if (state.failed) return;
					if ( state.backtracking==0 ) {
					                VarDecl_stack.peek().descr.updateStart( ((CommonToken)(variableModifier14!=null?(variableModifier14.start):null)).getStartIndex() - 1 );
					                VarDecl_stack.peek().descr.addModifier( (variableModifier14!=null?input.toString(variableModifier14.start,variableModifier14.stop):null) );
					            }
					}
					break;

				default :
					break loop138;
				}
			}

			pushFollow(FOLLOW_type_in_forVarControl4713);
			type15=type();
			state._fsp--;
			if (state.failed) return;
			if ( state.backtracking==0 ) {
			            VarDecl_stack.peek().descr.updateStart( ((CommonToken)(type15!=null?(type15.start):null)).getStartIndex() - 1 );
			            VarDecl_stack.peek().descr.setType( (type15!=null?input.toString(type15.start,type15.stop):null) );
			            VarDecl_stack.peek().descr.setEnd( ((CommonToken)(type15!=null?(type15.stop):null)).getStopIndex() );
			        }
			id=(Token)match(input,Identifier,FOLLOW_Identifier_in_forVarControl4735); if (state.failed) return;
			if ( state.backtracking==0 ) {
			            JavaLocalDeclarationDescr.IdentifierDescr ident = new JavaLocalDeclarationDescr.IdentifierDescr();
			            ident.setIdentifier( (id!=null?id.getText():null) );
			            ident.setStart( ((CommonToken)id).getStartIndex() - 1 );
			            ident.setEnd( ((CommonToken)id).getStopIndex() );
			            VarDecl_stack.peek().descr.addIdentifier( ident );
			        }
			match(input,51,FOLLOW_51_in_forVarControl4756); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_forVarControl4758);
			expression();
			state._fsp--;
			if (state.failed) return;
			}

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

		}
	}
443568
private Context translateVariableAssign(WyilFile.Expr.VariableAccess lval, Expr rval, Context context) {
		WyilFile.Decl.Variable decl = lval.getVariableDeclaration();
		context = context.havoc(decl);
		WyalFile.VariableDeclaration nVersionedVar = context.read(decl);
		Expr.VariableAccess var = new Expr.VariableAccess(nVersionedVar);
		return context.assume(new Expr.Equal(var, rval));
	}
652459
void processAppCommand(final HttpServerExchange exchange, final RequestData requestData, final MCMPAction action) throws IOException {

        final String contextPath = requestData.getFirst(CONTEXT);
        final String jvmRoute = requestData.getFirst(JVMROUTE);
        final String aliases = requestData.getFirst(ALIAS);

        if (contextPath == null || jvmRoute == null || aliases == null) {
            processError(TYPESYNTAX, SMISFLD, exchange);
            return;
        }
        final List<String> virtualHosts = Arrays.asList(aliases.split(","));
        if (virtualHosts == null || virtualHosts.isEmpty()) {
            processError(TYPESYNTAX, SCONBAD, exchange);
            return;
        }

        String response = null;
        switch (action) {
            case ENABLE:
                if (!container.enableContext(contextPath, jvmRoute, virtualHosts)) {
                    processError(MCMPErrorCode.CANT_UPDATE_CONTEXT, exchange);
                    return;
                }
                break;
            case DISABLE:
                if (!container.disableContext(contextPath, jvmRoute, virtualHosts)) {
                    processError(MCMPErrorCode.CANT_UPDATE_CONTEXT, exchange);
                    return;
                }
                break;
            case STOP:
                int i = container.stopContext(contextPath, jvmRoute, virtualHosts);
                final StringBuilder builder = new StringBuilder();
                builder.append("Type=STOP-APP-RSP,JvmRoute=").append(jvmRoute);
                builder.append("Alias=").append(aliases);
                builder.append("Context=").append(contextPath);
                builder.append("Requests=").append(i);
                response = builder.toString();
                break;
            case REMOVE:
                if (!container.removeContext(contextPath, jvmRoute, virtualHosts)) {
                    processError(MCMPErrorCode.CANT_UPDATE_CONTEXT, exchange);
                    return;
                }
                break;
            default: {
                processError(TYPESYNTAX, SMISFLD, exchange);
                return;
            }
        }
        if (response != null) {
            sendResponse(exchange, response);
        } else {
            processOK(exchange);
        }
    }
1108078
private void addMeterValuesToTransaction(final Transaction transaction, final List<MeterValue> meterValues) {
        for (MeterValue meterValue : meterValues) {
            addMeterValueToTransaction(transaction, meterValue);
        }
    }
710279
public void addTranslation(double[] v) {
    assert (v.length == dim);

    // reset inverse transformation - needs recomputation.
    inv = null;

    double[][] homTrans = unitMatrix(dim + 1);
    for(int i = 0; i < dim; i++) {
      homTrans[i][dim] = v[i];
    }
    trans = times(homTrans, trans);
  }
1047057
public void updateExpression(String expr, Object value, PageContext pageContext)
            throws ExpressionUpdateException, JspException
    {
        if (isExpression(expr)) {

            VariableResolver vr = ImplicitObjectUtil.getUpdateVariableResolver(pageContext.getRequest(), pageContext.getResponse(), false);
            ExpressionEvaluatorFactory.getInstance().update(expr, value, vr, false);
        }
        else {
            String s = Bundle.getString("Tags_BindingUpdateExpressionError", new Object[]{expr});
            _tag.registerTagError(s, null);
        }
    }
261150
public void addAndExpression(final INodeReadTrx mTransaction) {
        assert getPipeStack().size() >= 2;

        final AbsAxis mOperand2 = getPipeStack().pop().getExpr();
        final AbsAxis operand1 = getPipeStack().pop().getExpr();
        if (getPipeStack().empty() || getExpression().getSize() != 0) {
            addExpressionSingle();
        }
        getExpression().add(new AndExpr(mTransaction, operand1, mOperand2));
    }
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);
    }
141920
public ISarlFieldBuilder addVarSarlField(String name) {
		ISarlFieldBuilder builder = this.iSarlFieldBuilderProvider.get();
		builder.eInit(getSarlBehavior(), name, "var", getTypeResolutionContext());
		return builder;
	}
1106923
private void parseVarRef() {

        consume(TokenType.DOLLAR, true);
        final String varName = parseVarName();
        mPipeBuilder.addVarRefExpr(getTransaction(), varName);
    }
438670
public void updateVariableName(String varName, String withName) {
        SDVariable oldVarNameRef = getVariable(varName);
        Variable v = variables.remove(varName);
        String oldVarName = varName;
        oldVarNameRef.setVarName(withName);
        v.setName(withName);
        variables.put(withName, v);

        for(SameDiffOp op : ops.values()){
            List<String> outputsOfOp = op.getOutputsOfOp();
            if(outputsOfOp != null && !outputsOfOp.isEmpty()) {
                for (int i = 0; i < outputsOfOp.size(); i++) {
                    if (outputsOfOp.get(i).equals(oldVarName)) {
                        outputsOfOp.set(i, withName);
                    }
                }
            }

            List<String> inputsToOp = op.getInputsToOp();
            if(inputsToOp != null && !inputsToOp.isEmpty()) {
                for (int i = 0; i < inputsToOp.size(); i++) {
                    if (inputsToOp.get(i).equals(oldVarName)) {
                        inputsToOp.set(i, withName);
                    }
                }
            }
        }

//        if (variableNameToArr.containsKey(oldVarName)) {
//            val arr = variableNameToArr.remove(oldVarName);
//            variableNameToArr.put(withName, arr);
//        }


        if (variableNameToShape.containsKey(oldVarName)) {
            val shape = variableNameToShape.remove(oldVarName);
            variableNameToShape.put(withName, shape);
        }

        if (forwardVarForGrad.containsKey(oldVarName)) {
            val forwardGrad = forwardVarForGrad.remove(oldVarName);
            forwardVarForGrad.put(withName, forwardGrad);
        }


        if (v.getInputsForOp() != null) {
            List<String> funcNames = v.getInputsForOp();
            for (String s : funcNames) {
                DifferentialFunction func = ops.get(s).getOp();
                if (func instanceof BaseOp) {
                    BaseOp baseOp = (BaseOp) func;
                    if (baseOp.getXVertexId() != null && baseOp.getXVertexId().equals(oldVarName)) {
                        baseOp.setXVertexId(withName);
                    }

                    if (baseOp.getYVertexId() != null && baseOp.getYVertexId().equals(oldVarName)) {
                        baseOp.setYVertexId(withName);
                    }

                    if (baseOp.getZVertexId() != null && baseOp.getZVertexId().equals(oldVarName)) {
                        baseOp.setZVertexId(withName);
                    }

                }
            }
        }


        if (v.getOutputOfOp() != null) {
            DifferentialFunction func = ops.get(v.getOutputOfOp()).getOp();
            if (func instanceof BaseOp) {
                BaseOp baseOp = (BaseOp) func;
                if (baseOp.getXVertexId() != null && baseOp.getXVertexId().equals(oldVarName)) {
                    baseOp.setXVertexId(withName);
                }

                if (baseOp.getYVertexId() != null && baseOp.getYVertexId().equals(oldVarName)) {
                    baseOp.setYVertexId(withName);
                }

                if (baseOp.getZVertexId() != null && baseOp.getZVertexId().equals(oldVarName)) {
                    baseOp.setZVertexId(withName);
                }
            }
        }
    }
257234
protected void computeVariablesFromObject(MtasParserObject object,
      Map<String, List<MtasParserObject>> currentList,
      Map<String, Map<String, String>> variables) {
    MtasParserType<MtasParserVariable> parserType = object.getType();
    String id = object.getId();
    if (id != null) {
      for (MtasParserVariable variable : parserType.getItems()) {
        if (!variables.containsKey(variable.variable)) {
          variables.put(variable.variable, new HashMap<String, String>());
        }
        StringBuilder builder = new StringBuilder();
        for (MtasParserVariableValue variableValue : variable.values) {
          if (variableValue.type.equals("attribute")) {
            String subValue = object.getAttribute(variableValue.name);
            if (subValue != null) {
              builder.append(subValue);
            }
          }
        }
        variables.get(variable.variable).put(id, builder.toString());
      }
    }
  }
74792
public RTObject getTemporaryVariableWithName(String name, int contextIndex) {
		if (contextIndex == -1)
			contextIndex = getCurrentElementIndex() + 1;

		Element contextElement = getCallStack().get(contextIndex - 1);
		RTObject varValue = contextElement.temporaryVariables.get(name);

		return varValue;
	}
262418
public static void insertValue(HashMap m, String var, String val) {
        insertValue(m, var, val, null);
    }
1197130
public static void updateImports( Instance instance, Map<String,Collection<Import>> variablePrefixToImports ) {
		instance.getImports().clear();
		if( variablePrefixToImports != null )
			instance.getImports().putAll( variablePrefixToImports );
	}
703336
private void visitObject(MethodVisitor mv, LocalVarInfo param) {
        Type paramType = param.getType();
        if (Type.getType(Character.class).equals(paramType)) {
            mv.visitLdcInsn((char) FORTY_TWO);
            mv.visitMethodInsn(INVOKESTATIC, paramType.getInternalName(), "valueOf",
                    "(C)L" + paramType.getInternalName() + ";");
            mv.visitVarInsn(ASTORE, param.getIndex());
        } else if (supportedValueOfTypes.contains(paramType)) {
            mv.visitLdcInsn(String.valueOf(FORTY_TWO));
            mv.visitMethodInsn(INVOKESTATIC, paramType.getInternalName(), "valueOf",
                    "(Ljava/lang/String;)L" + paramType.getInternalName() + ";");
            mv.visitVarInsn(ASTORE, param.getIndex());
        } else {
            throwUnsupportedException(param);
        }
    }