Determine the modified variable for a given LVal. Almost all lvals modify
exactly one variable, though dereferences don't.

@param lval
@param scope
@return
331696
public static Expr.VariableAccess extractAssignedVariable(LVal lval) {
		if (lval instanceof Expr.VariableAccess) {
			return (Expr.VariableAccess) lval;
		} else if (lval instanceof Expr.RecordAccess) {
			Expr.RecordAccess e = (Expr.RecordAccess) lval;
			return extractAssignedVariable((LVal) e.getOperand());
		} else if (lval instanceof Expr.ArrayAccess) {
			Expr.ArrayAccess e = (Expr.ArrayAccess) lval;
			return extractAssignedVariable((LVal) e.getFirstOperand());
		} else if (lval instanceof Expr.Dereference) {
			return null;
		} else {
			syntaxError(lval, WyilFile.INVALID_LVAL_EXPRESSION);
			return null; // dead code
		}
	}
478455
public void setScope(java.util.Collection<String> scope) {
        if (scope == null) {
            this.scope = null;
            return;
        }

        this.scope = new java.util.ArrayList<String>(scope);
    }
581765
public LocalVariable findVariable(String name, int depth) {
        LocalVariable variable = localVariables.get(name);

        if (variable != null) {
            // Destined scope need adjusted variable since it need to know how deep to look for it.
            if (depth != 0) {
                return new LocalVariable(name, variable.getOffset(), depth);
            }

            return variable;
        }

        if (parent != null) {
            return parent.findVariable(name, depth + 1);
        }

        return null;
    }
507349
@Override
    public XValue call(Scope scope) {
        List<String> res = new LinkedList<>();
        for (Element e:scope.context()){
            if ("script".equals(e.nodeName())){
                res.add(e.data());
            }else {
                res.add(e.text());
            }
        }
        return XValue.create(res);
    }
884764
function resolveVariableInScope(identifier, scope) {
            return scope.variables.find(variable => variable.name === identifier.name) ||
                (scope.upper ? resolveVariableInScope(identifier, scope.upper) : null);
        }
1000912
public static void fixUpLocalVariables(List<? extends Variable> localVariables, VariableScope scope, boolean isClosureScope) {
    for (Variable localVar : localVariables) {
      Variable scopeVar = scope.getReferencedClassVariable(localVar.getName());
      if (scopeVar instanceof DynamicVariable) {
        scope.removeReferencedClassVariable(localVar.getName());
        scope.putReferencedLocalVariable(localVar);
        if (isClosureScope)
          localVar.setClosureSharedVariable(true);
      }
    }
  }
435030
def scope=(scope)
      validator = EnumAttributeValidator.new('String', ["OTHER_TAX_SCOPE", "LINE_ITEM", "ORDER"])
      unless validator.valid?(scope)
        fail ArgumentError, "invalid value for 'scope', must be one of #{validator.allowable_values}."
      end
      @scope = scope
    end
278970
def has_variable?(var)
      @stack.reverse_each do |scope|
        if SCOPE_BLOCKER_9000 == scope
          return false
        elsif scope.include?(var)
          return true
        end
      end
    end
315779
public static Tuple<Decl.Variable> determineModifiedVariables(Stmt.Block block) {
		HashSet<Decl.Variable> modified = new HashSet<>();
		determineModifiedVariables(block, modified);
		return new Tuple<>(modified);
	}
720586
public String getScopeValue(Scope scope)  {
		logger.debug("Enter OAuth2config::getDefaultScope");
		return PropertiesConfig.getInstance().getProperty(scope.value());
	}
337427
function getVariableOfArguments(scope) {
    const variables = scope.variables;

    for (let i = 0; i < variables.length; ++i) {
        const variable = variables[i];

        if (variable.name === "arguments") {

            /*
             * If there was a parameter which is named "arguments", the
             * implicit "arguments" is not defined.
             * So does fast return with null.
             */
            return (variable.identifiers.length === 0) ? variable : null;
        }
    }

    /* istanbul ignore next */
    return null;
}
1134670
private static String getFreeVariable(Expression2 expression, int index, Scope scope) {
    Expression2 sub = expression.getSubexpression(index);
    if (sub.isConstant()) {
      String constant = sub.getConstant();
      if (!constant.equals(LAMBDA) && !scope.isBound(constant)) {
        return sub.getConstant();
      } 
    }
    return null;
  }
707966
function checkVariable(variable) {
			getModifyingReferences(variable.references).forEach(function(reference) {
				context.report(
					reference.identifier,
					ProblemMessages.noConstantAssign,
					{
						name: reference.identifier.name
					});
			});
		}
522445
private String getNarrowestScope(FacesContext facesContext, String valueExpression)
    {
        List<String> expressions = extractExpressions(valueExpression);
        // exclude NONE scope, if there are more than one ValueExpressions (see Spec for details)
        String narrowestScope = expressions.size() == 1 ? NONE : APPLICATION;
        boolean scopeFound = false;
        
        for (String expression : expressions)
        {
            String valueScope = getScope(facesContext, expression);
            if (valueScope == null)
            {
                continue;
            }
            // we have found at least one valid scope at this point
            scopeFound = true;
            if (SCOPE_COMPARATOR.compare(valueScope, narrowestScope) < 0)
            {
                narrowestScope = valueScope;
            }
        }
        
        return scopeFound ? narrowestScope : null;
    }
352100
public boolean isLocalVariable(@Nullable final String variableName) {
    boolean result = false;
    if (variableName != null) {
      final String normalized = PreprocessorUtils.normalizeVariableName(variableName);
      result = this.localVarTable.containsKey(normalized);
    }
    return result;
  }
69764
function Variable(scope,name,decl,o){
	this._ref = STACK._counter++;
	this._c = null;
	this._scope = scope;
	this._name = name;
	this._alias = null;
	this._initialized = true;
	this._declarator = decl;
	this._autodeclare = false;
	this._declared = o && o.declared || false;
	this._resolved = false;
	this._options = o || {};
	this._type = o && o.type || 'var'; // what about let here=
	this._export = false;
	this._references = []; // only needed when profiling
	this._assignments = [];
	this;
}
622907
def p_scope(p):
    """'"""
    slist = p[4]
    scopes = OrderedDict()
    for i in ('CLASS',
              'ASSOCIATION',
              'INDICATION',
              'PROPERTY',
              'REFERENCE',
              'METHOD',
              'PARAMETER',
              'ANY'):
        scopes[i] = i in slist
    p[0] = scopes