Pulls the variable names from the expression and stores them in {@link #names}
420414
private void extractVariableNames() {
    if (expression == null) {
      throw new IllegalArgumentException("The expression was null");
    }

    for (final List<String> exp_list : JEXL_ENGINE.getVariables(expression)) {
      for (final String variable : exp_list) {
        names.add(variable);
      }
    }
  }
131559
public static String[] getVariableNames(NameSpace ns) {
        if (ns == null)
            return new String[0];
        return Stream.of(ns.getVariableNames())
                .filter(name->!name.matches("_?bsh.*"))
                .toArray(String[]::new);
    }
865615
public static List<Global> getVariableList( final List<String> variableCells ){
        final List<Global> variableList = new ArrayList<Global>();
        if ( variableCells == null ) return variableList;

        for( String variableCell: variableCells ){
            final StringTokenizer tokens = new StringTokenizer( variableCell, "," );
            while ( tokens.hasMoreTokens() ) {
                final String token = tokens.nextToken();
                final Global vars = new Global();
                final StringTokenizer paramTokens = new StringTokenizer( token, " " );
                vars.setClassName( paramTokens.nextToken() );
                if ( !paramTokens.hasMoreTokens() ) {
                    throw new DecisionTableParseException( "The format for global variables is incorrect. " + "It should be: [Class name, Class otherName]. But it was: [" + variableCell + "]" );
                }
                vars.setIdentifier( paramTokens.nextToken() );
                variableList.add( vars );
            }
        }
        return variableList;
    }
990973
@Override
    public ImmutableSet<Variable> getVariables(QueryNode node) {
        if (node instanceof ExplicitVariableProjectionNode) {
            return ((ExplicitVariableProjectionNode) node).getVariables();
        }
        else {
            return getProjectedVariableStream(node)
                    .collect(ImmutableCollectors.toSet());
        }
    }
326330
protected void parseBindVariable() {
        String expr = tokenizer.getToken();
        peek().addChild(new BindVariableNode(expr, beanDescFactory));
    }
24132
public INDArray getArrForVarName(@NonNull String varName) {
        Preconditions.checkState(variables.containsKey(varName), "No variable found with name \"%s\"", varName);
        SDVariable v = variables.get(varName).getVariable();
        switch(v.getVariableType()){
            case VARIABLE:
                if(!variablesArrays.containsKey(varName)) {
                    //VARIBALE type arrays should have a parameter initializer...
                    // we should use this to azy init the array if none is present
                    v.storeAndAllocateNewArray();
                }
                return variablesArrays.get(varName).get();
            case CONSTANT:
                if(!constantArrays.containsKey(varName))
                    return null;
                return constantArrays.get(varName).get();
            case ARRAY:
                //Only stored in inference session...
                InferenceSession s = sessions.get(Thread.currentThread().getId());
                if(s == null)
                    return null;
                return s.get(varName, InferenceSession.OUTER_FRAME, 0, null, false);
            case PLACEHOLDER:
                long tid = Thread.currentThread().getId();
                if(placeholdersPerThread.get(tid) == null || !placeholdersPerThread.get(tid).containsKey(varName))
                    return null;
                return placeholdersPerThread.get(tid).get(varName);
            default:
                throw new RuntimeException("Unknown variable type: " + v.getVariableType());
        }
    }
396154
def stringToExpression(s, types, context):
    
    old_ctx = expressions._context.get_current_context()
    try:
        expressions._context.set_new_context(context)
        # first compile to a code object to determine the names
        if context.get('truediv', False):
            flags = __future__.division.compiler_flag
        else:
            flags = 0
        c = compile(s, '<expr>', 'eval', flags)
        # make VariableNode's for the names
        names = {}
        for name in c.co_names:
            if name == "None":
                names[name] = None
            elif name == "True":
                names[name] = True
            elif name == "False":
                names[name] = False
            else:
                t = types.get(name, default_type)
                names[name] = expressions.VariableNode(name, type_to_kind[t])
        names.update(expressions.functions)
        # now build the expression
        ex = eval(c, names)
        if expressions.isConstant(ex):
            ex = expressions.ConstantNode(ex, expressions.getKind(ex))
        elif not isinstance(ex, expressions.ExpressionNode):
            raise TypeError("unsupported expression type: %s" % type(ex))
    finally:
        expressions._context.set_new_context(old_ctx)
    return ex
56740
public List<String> getVariableNames() {

		return variables.asList().stream() //
				.map(TemplateVariable::getName) //
				.collect(Collectors.toList());
	}
691455
public Collection<Variable> getVariables() {
        if (parent == null) {
            return getLocalVariables();
        }
        List<Variable> result = new ArrayList<>();
        result.addAll(parent.getVariables());
        result.addAll(getLocalVariables());
        return result;
    }
523800
protected TypeName[] createTypeVariables(
      TypeName extractedType, String extractVariableName, int extractArity) {
    List<TypeName> typeVariables = new ArrayList<>();
    typeVariables.add(extractedType);
    if (extractArity > 0) {
      typeVariables.addAll(
          IntStream.rangeClosed(1, extractArity)
              .mapToObj(j -> TypeVariableName.get(extractVariableName + j))
              .collect(Collectors.toList()));
    }

    return typeVariables.toArray(new TypeName[typeVariables.size()]);
  }
1054423
public Collection<String> getVariableNames()
    {
        ImmutableSet.Builder<String> builder = ImmutableSet.builder();
        for ( ConfigurationKeyPart p : parts )
        {
            if ( p.isVariable() )
            {
                builder.add(p.getValue());
            }
        }

        return builder.build();
    }
785798
@Override
    public Map<String, String> getValues(final String variableContains) {
        final Map<String, String> valueMap = new HashMap<>();
        for (final VariableProvider variableProvider : variableProviderPool) {
            valueMap.putAll(variableProvider.getValues(variableContains));
        }
        return valueMap;
    }
325855
public static String toVariableName(Object o) throws PageException {
	String str = toString(o);
	if (!Decision.isVariableName(str)) throw new ExpressionException("can't cast [" + str + "] to variable name value");
	return str;
    }
1293511
public SDVariable[] updateVariableNamesAndReferences(SDVariable[] variablesToUpdate, String[] newVariableNames) {

        int numVariables = variablesToUpdate.length;
        SDVariable[] updatedVariables = new SDVariable[numVariables];

        for (int i = 0; i < numVariables; i++) {
            SDVariable varToUpdate = variablesToUpdate[i];
            String name = newVariableNames == null ? null : newVariableNames[i];
            updatedVariables[i] = updateVariableNameAndReference(varToUpdate, name);
        }

        return updatedVariables;
    }
274080
public String parseVariableName() {
    	if(asString == null)
    		return null;
    	
    	String var = asString.trim();
    	if(!var.startsWith("$"))
    		throw new IllegalStateException("This expression is not a variable reference");
    	
    	Scanner scanner = new Scanner(var.substring(1));
    	scanner.findInLine("\\{\\s*(\\w+)\\s*\\}");
    	MatchResult matchResults = scanner.match();
    	if(matchResults.groupCount() != 1)
    		throw new IllegalStateException("Malformed variable name expression.");
    		
		return matchResults.group(1);
	}
656716
private void collectParameterValueExpressions(AbstractExpression expr, List<AbstractExpression> pves) {
        if (expr == null) {
            return;
        }

        if (expr instanceof TupleValueExpression || expr instanceof AggregateExpression) {
            // Create a matching PVE for this expression to be used on the EE side
            // to get the original expression value
            addCorrelationParameterValueExpression(expr, pves);
            return;
        }
        collectParameterValueExpressions(expr.getLeft(), pves);
        collectParameterValueExpressions(expr.getRight(), pves);
        if (expr.getArgs() != null) {
            for (AbstractExpression arg : expr.getArgs()) {
                collectParameterValueExpressions(arg, pves);
            }
        }
    }
1220114
private List<Object> eval(Iterable<ExpressionContext> expressions) {

    List<Object> results = new ArrayList<Object>();

    for (ExpressionContext expression : expressions) {
      results.add(eval(expression));
    }

    return results;
  }