Get a set of definitions for the pattern's variables. Note that if the pattern includes duplicate variable names,
these are collapse into one.

@param rp
@param ptype
@param scope
@return
977312
public List<PDefinition> getDefinitions(PPattern rp, PType ptype,
			NameScope scope)
	{
		PDefinitionSet set = af.createPDefinitionSet();
		set.addAll(af.createPPatternAssistant().getAllDefinitions(rp, ptype, scope));
		List<PDefinition> result = new Vector<PDefinition>(set);
		return result;
	}
754037
protected void dupHideCheck(List<PDefinition> list, NameScope scope)
	{
		LexNameList allnames = af.createPDefinitionListAssistant().getVariableNames(list);

		for (ILexNameToken n1 : allnames)
		{
			LexNameList done = new LexNameList();

			for (ILexNameToken n2 : allnames)
			{
				if (n1 != n2 && n1.equals(n2) && !done.contains(n1))
				{
					TypeChecker.warning(5007, "Duplicate definition: " + n1, n1.getLocation());
					done.add(n1);
				}
			}

			if (outer != null)
			{
				// We search for any scoped name (ie. the first), but then check
				// the scope matches what we can see. If we pass scope to findName
				// it throws errors if the name does not match the scope.

				PDefinition def = outer.findName(n1, NameScope.NAMESANDSTATE);

				// TODO: RWL: This is not sound, however the behaviour below is not sound
				// in case def.getNameScope is null.
				if (def != null && def.getNameScope() == null)
				{
					def.setNameScope(NameScope.GLOBAL);
				}

				if (def != null && !def.getLocation().equals(n1.getLocation())
						&& def.getNameScope().matches(scope))
				{
					// Reduce clutter for names in the same module/class
					String message = null;

					if (def.getLocation().getFile().equals(n1.getLocation().getFile()))
					{
						message = def.getName() + " "
								+ def.getLocation().toShortString()
								+ " hidden by " + n1.getFullName();
					} else
					{
						message = def.getName() + " " + def.getLocation()
								+ " hidden by " + n1.getFullName();
					}

					TypeChecker.warning(5008, message, n1.getLocation());
				}
			}
		}
	}
578481
public V getVar(String name) {
    ImplicitVar implicit = name != null ? ImplicitVar.of(name) : null;
    if (implicit != null) {
      return getImplicitVar(implicit, true);
    }
    S scope = thisScope();
    while (scope != null) {
      V var = scope.getOwnSlot(name);
      if (var != null) {
        return var;
      }
      // Recurse up the parent Scope
      scope = scope.getParent();
    }
    return null;
  }
299660
@Override
    public List<String> getScopeNames() {
	List<String> scopeNames = new ArrayList<String>();

	if (checkArguments) {
	    scopeNames.add("local");
	    scopeNames.add("arguments");
	}
	scopeNames.add("variables");

	// thread scopes
	if (pc.hasFamily()) {
	    String[] names = pc.getThreadScopeNames();
	    for (int i = 0; i < names.length; i++)
		scopeNames.add(i, names[i]);
	}

	for (int i = 0; i < scopes.length; i++) {
	    scopeNames.add((scopes[i]).getTypeAsString());
	}
	return scopeNames;
    }

    @Override
    public Object getCollection(Key key) throws PageException {
	Object rtn = null;

	if (checkArguments) {
	    rtn = local.get(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) return rtn;
	    rtn = argument.getFunctionArgument(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) {
		if (debug) debugCascadedAccess(pc, argument.getTypeAsString(), key);
		return rtn;
	    }
	}

	// get data from queries
	if (allowImplicidQueryCall && pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML && !qryStack.isEmpty()) {
	    rtn = qryStack.getColumnFromACollection(key);
	    if (rtn != null) {
		if (debug) debugCascadedAccess(pc, "query", key);
		return rtn;
	    }
	}

	// variable
	rtn = variable.get(key, NullSupportHelper.NULL());
	if (rtn != NullSupportHelper.NULL()) {
	    if (debug && checkArguments) debugCascadedAccess(pc, variable, rtn, key);
	    return rtn;
	}

	// thread scopes
	if (pc.hasFamily()) {
	    rtn = pc.getThreadScope(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) {
		if (debug) debugCascadedAccess(pc, "thread", key);
		return rtn;
	    }
	}

	// get a scope value (only CFML is searching addioanl scopes)
	if (pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML) {
	    for (int i = 0; i < scopes.length; i++) {
		rtn = scopes[i].get(key, NullSupportHelper.NULL());
		if (rtn != NullSupportHelper.NULL()) {
		    if (debug) debugCascadedAccess(pc, scopes[i].getTypeAsString(), key);
		    return rtn;
		}
	    }
	}
	throw new ExpressionException("variable [" + key.getString() + "] doesn't exist");
    }

    @Override
    public Object get(Collection.Key key, Object defaultValue) {
	Object rtn = null;
	if (checkArguments) {
	    rtn = local.get(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) return rtn;

	    rtn = argument.getFunctionArgument(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) {
		if (debug) debugCascadedAccess(pc, argument.getTypeAsString(), key);
		return rtn;
	    }
	}

	// get data from queries
	if (allowImplicidQueryCall && pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML && !qryStack.isEmpty()) {
	    rtn = qryStack.getDataFromACollection(pc, key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) {
		if (debug) debugCascadedAccess(pc, "query", key);
		return rtn;
	    }
	}

	// variable
	rtn = variable.get(key, NullSupportHelper.NULL());
	if (rtn != NullSupportHelper.NULL()) {
	    if (debug && checkArguments) debugCascadedAccess(pc, variable, rtn, key);
	    return rtn;
	}

	// thread scopes
	if (pc.hasFamily()) {
	    rtn = pc.getThreadScope(key, NullSupportHelper.NULL());
	    if (rtn != NullSupportHelper.NULL()) {
		if (debug && checkArguments) debugCascadedAccess(pc, "thread", key);
		return rtn;
	    }
	}

	// get a scope value (only CFML is searching additional scopes)
	if (pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML) {
	    for (int i = 0; i < scopes.length; i++) {
		rtn = scopes[i].get(key, NullSupportHelper.NULL());
		if (rtn != NullSupportHelper.NULL()) {
		    if (debug) debugCascadedAccess(pc, scopes[i].getTypeAsString(), key);
		    return rtn;
		}
	    }
	}

	return defaultValue;
    }

    @Override
    public Object getCascading(Collection.Key key) {
	throw new RuntimeException("this method is no longer supported, use getCascading(Collection.Key key, Object defaultValue) instead");
    }

    @Override
    public Object getCascading(Collection.Key key, Object defaultValue) {
	Object rtn;

	// get a scope value (only CFML is searching additional scopes)
	if (pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML) {
	    for (int i = 0; i < scopes.length; i++) {
		rtn = scopes[i].get(key, NullSupportHelper.NULL());
		if (rtn != NullSupportHelper.NULL()) {
		    return rtn;
		}
	    }
	}
	return defaultValue;
    }

    @Override
    public Object setEL(Collection.Key key, Object value) {
	if (checkArguments) {
	    if (localAlways || local.containsKey(key)) return local.setEL(key, value);
	    if (argument.containsFunctionArgumentKey(key)) {
		if (debug) debugCascadedAccess(pc, argument.getTypeAsString(), key);
		return argument.setEL(key, value);
	    }
	}

	if (debug && checkArguments) debugCascadedAccess(pc, variable.getTypeAsString(), key);
	return variable.setEL(key, value);
    }

    @Override
    public Object set(Collection.Key key, Object value) throws PageException {
	if (checkArguments) {
	    if (localAlways || local.containsKey(key)) return local.set(key, value);
	    if (argument.containsFunctionArgumentKey(key)) {
		if (debug) debugCascadedAccess(pc, argument.getTypeAsString(), key);
		return argument.set(key, value);
	    }

	}
	if (debug && checkArguments) debugCascadedAccess(pc, variable.getTypeAsString(), key);
	return variable.set(key, value);
    }

    @Override
    public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
	return variable.toDumpData(pageContext, maxlevel, dp);
    }

    @Override
    public Iterator<Collection.Key> keyIterator() {
	return variable.keyIterator();
    }

    @Override
    public Iterator<String> keysAsStringIterator() {
	return variable.keysAsStringIterator();
    }

    @Override
    public Iterator<Entry<Key, Object>> entryIterator() {
	return variable.entryIterator();
    }

    @Override
    public Iterator<Object> valueIterator() {
	return variable.valueIterator();
    }

    @Override
    public boolean isInitalized() {
	return isInit;
    }

    @Override
    public void initialize(PageContext pc) {
	// if(isInitalized()) return;
	isInit = true;
	variable = pc.variablesScope();
	argument = pc.argumentsScope();
	local = pc.localScope();
	allowImplicidQueryCall = pc.getConfig().allowImplicidQueryCall();
	type = ((PageContextImpl) pc).getScopeCascadingType();
	debug = pc.getConfig().debug() && ((ConfigImpl) pc.getConfig()).hasDebugOptions(ConfigImpl.DEBUG_IMPLICIT_ACCESS);

	// Strict
	if (type == Config.SCOPE_STRICT) {
	    // print.ln("strict");
	    scopes = new Scope[] {};
	}
	// small
	else if (type == Config.SCOPE_SMALL) {
	    // print.ln("small");
	    if (pc.getConfig().mergeFormAndURL()) {
		scopes = new Scope[] { pc.formScope() };
	    }
	    else {
		scopes = new Scope[] { pc.urlScope(), pc.formScope() };
	    }
	}
	// standard
	else {
	    reinitialize(pc);
	}

    }

    @Override
    public void reinitialize(PageContext pc) {
	if (type != Config.SCOPE_STANDARD) return;
	Client cs = pc.clientScopeEL();
	// print.ln("standard");
	if (pc.getConfig().mergeFormAndURL()) {
	    scopes = new Scope[cs == null ? 3 : 4];
	    scopes[0] = pc.cgiScope();
	    scopes[1] = pc.formScope();
	    scopes[2] = pc.cookieScope();
	    if (cs != null) scopes[3] = cs;
	}
	else {
	    scopes = new Scope[cs == null ? 4 : 5];
	    scopes[0] = pc.cgiScope();
	    scopes[1] = pc.urlScope();
	    scopes[2] = pc.formScope();
	    scopes[3] = pc.cookieScope();
	    if (cs != null) scopes[4] = cs;
	}
    }

    @Override
    public final void release(PageContext pc) {
	isInit = false;
	argument = null;
	local = null;
	variable = null;
	scopes = null;
	checkArguments = false;
	localAlways = false;
	if (allowImplicidQueryCall) qryStack.clear();
    }

    @Override
    public Collection duplicate(boolean deepCopy) {
	UndefinedImpl dupl = new UndefinedImpl(pc, type);
	dupl.allowImplicidQueryCall = allowImplicidQueryCall;
	dupl.checkArguments = checkArguments;
	dupl.argument = deepCopy ? (Argument) Duplicator.duplicate(argument, deepCopy) : argument;
	dupl.isInit = isInit;
	dupl.local = deepCopy ? (Local) Duplicator.duplicate(local, deepCopy) : local;
	dupl.localAlways = localAlways;
	dupl.qryStack = (deepCopy ? (QueryStackImpl) Duplicator.duplicate(qryStack, deepCopy) : qryStack);

	dupl.variable = deepCopy ? (Variables) Duplicator.duplicate(variable, deepCopy) : variable;
	dupl.pc = pc;
	dupl.debug = debug;

	// scopes
	if (deepCopy) {
	    dupl.scopes = new Scope[scopes.length];
	    for (int i = 0; i < scopes.length; i++) {
		dupl.scopes[i] = (Scope) Duplicator.duplicate(scopes[i], deepCopy);
	    }
	}
	else dupl.scopes = scopes;

	return dupl;
    }

    @Override
    public boolean containsKey(Key key) {
	return get(key, null) != null;
    }

    @Override
    public String castToString() throws ExpressionException {
	throw new ExpressionException("Can't cast Complex Object Type Struct to String", "Use Built-In-Function \"serialize(Struct):String\" to create a String from Struct");
    }

    @Override
    public String castToString(String defaultValue) {
	return defaultValue;
    }

    @Override
    public boolean castToBooleanValue() throws ExpressionException {
	throw new ExpressionException("Can't cast Complex Object Type Struct to a boolean value");
    }

    @Override
    public Boolean castToBoolean(Boolean defaultValue) {
	return defaultValue;
    }

    @Override
    public double castToDoubleValue() throws ExpressionException {
	throw new ExpressionException("Can't cast Complex Object Type Struct to a number value");
    }

    @Override
    public double castToDoubleValue(double defaultValue) {
	return defaultValue;
    }

    @Override
    public DateTime castToDateTime() throws ExpressionException {
	throw new ExpressionException("Can't cast Complex Object Type Struct to a Date");
    }

    @Override
    public DateTime castToDateTime(DateTime defaultValue) {
	return defaultValue;
    }

    @Override
    public int compareTo(boolean b) throws ExpressionException {
	throw new ExpressionException("can't compare Complex Object Type Struct with a boolean value");
    }

    @Override
    public int compareTo(DateTime dt) throws PageException {
	throw new ExpressionException("can't compare Complex Object Type Struct with a DateTime Object");
    }

    @Override
    public int compareTo(double d) throws PageException {
	throw new ExpressionException("can't compare Complex Object Type Struct with a numeric value");
    }

    @Override
    public int compareTo(String str) throws PageException {
	throw new ExpressionException("can't compare Complex Object Type Struct with a String");
    }

    @Override
    public void setVariableScope(Variables scope) {
	variable = scope;
    }

    @Override
    public int getType() {
	return SCOPE_UNDEFINED;
    }

    @Override
    public String getTypeAsString() {
	return "undefined";
    }

    /**
     * @return the allowImplicidQueryCall
     */
    public boolean isAllowImplicidQueryCall() {
	return allowImplicidQueryCall;
    }

    /**
     * @param allowImplicidQueryCall the allowImplicidQueryCall to set
     */
    @Override
    public boolean setAllowImplicidQueryCall(boolean allowImplicidQueryCall) {
	boolean old = this.allowImplicidQueryCall;
	this.allowImplicidQueryCall = allowImplicidQueryCall;
	return old;
    }

    /**
     * @return the checkArguments
     */
    @Override
    public boolean getCheckArguments() {
	return checkArguments;
    }

    @Override
    public Object call(PageContext pc, final Key methodName, Object[] args) throws PageException {
	Object obj = get(methodName, null); // every none UDF value is fine as default argument
	if (obj instanceof UDFPlus) {
	    return ((UDFPlus) obj).call(pc, methodName, args, false);
	}
	UDF udf = getUDF(pc, methodName);
	if (udf instanceof UDFPlus) {
	    return ((UDFPlus) udf).call(pc, methodName, args, false);
	}
	throw new ExpressionException("No matching function [" + methodName + "] found");
    }

    @Override
    public Object callWithNamedValues(PageContext pc, Key methodName, Struct args) throws PageException {
	Object obj = get(methodName, null);
	if (obj instanceof UDFPlus) {
	    return ((UDFPlus) obj).callWithNamedValues(pc, methodName, args, false);
	}
	UDF udf = getUDF(pc, methodName);
	if (udf instanceof UDFPlus) {
	    return ((UDFPlus) udf).callWithNamedValues(pc, methodName, args, false);
	}
	throw new ExpressionException("No matching function [" + methodName + "] found");
    }

    private UDF getUDF(PageContext pc, Key methodName) throws PageException {
	ApplicationContextSupport ac = (ApplicationContextSupport) pc.getApplicationContext();
	if (ac != null) {
	    List<Resource> dirs = ac.getFunctionDirectories();
	    Resource[] files;
	    if (dirs != null && dirs.size() > 0) {
		Resource file = null;
		Iterator<Resource> it = dirs.iterator();
		Resource dir;
		while (it.hasNext()) {
		    dir = it.next();
		    files = dir.listResources(new ResourceNameFilter() {
			@Override
			public boolean accept(Resource dir, String name) {
			    String[] exts = Constants.getTemplateExtensions();
			    for (String ex: exts) {
				if (name.equalsIgnoreCase(methodName + "." + ex)) return true;
			    }
			    return false;
			}
		    });
		    if (files != null && files.length > 0) {
			file = files[0];
			break;
		    }
		}
		if (file != null) {
		    return CFFunction.loadUDF(pc, file, methodName, pc.getConfig() instanceof ConfigWeb, false);
		}
	    }
	}
	return null;
    }

    public short getScopeCascadingType() {
	return type;
    }
624405
private static List<TypeVariableSymbol> typeVariablesEnclosing(Symbol sym) {
    List<TypeVariableSymbol> typeVarScopes = new ArrayList<>();
    outer:
    while (!sym.isStatic()) {
      sym = sym.owner;
      switch (sym.getKind()) {
        case PACKAGE:
          break outer;
        case METHOD:
        case CLASS:
          typeVarScopes.addAll(sym.getTypeParameters());
          break;
        default: // fall out
      }
    }
    return typeVarScopes;
  }
256152
function findVariablesInScope(scope) {
            for (const variable of scope.variables) {
                const [
                    declaration,
                    ...extraDeclarations
                ] = iterateDeclarations(variable);

                if (extraDeclarations.length === 0) {
                    continue;
                }

                /*
                 * If the type of a declaration is different from the type of
                 * the first declaration, it shows the location of the first
                 * declaration.
                 */
                const detailMessageId = declaration.type === "builtin"
                    ? "redeclaredAsBuiltin"
                    : "redeclaredBySyntax";
                const data = { id: variable.name };

                // Report extra declarations.
                for (const { type, node, loc } of extraDeclarations) {
                    const messageId = type === declaration.type
                        ? "redeclared"
                        : detailMessageId;

                    context.report({ node, loc, messageId, data });
                }
            }
        }
938897
private void visit(VariableRestrictionDescr descr) {

        PatternVariable patternVariable = (PatternVariable) data.getVariableByRuleAndVariableName(pattern.getRuleName(),
                descr.getIdentifier());
        VariableRestriction restriction = new VariableRestriction(pattern);

        restriction.setPatternIsNot(pattern.isPatternNot());
        restriction.setFieldPath(field.getPath());
        restriction.setOperator(Operator.determineOperator(descr.getEvaluator(),
                descr.isNegated()));
        restriction.setVariable(patternVariable);
        restriction.setOrderNumber(orderNumber);
        restriction.setParentPath(pattern.getPath());
        restriction.setParentType(pattern.getVerifierComponentType());

        // Set field value, if it is unset.
        field.setFieldType(Field.VARIABLE);

        data.add(restriction);
        solvers.addPatternComponent(restriction);
    }
1204156
public static Set<String> getFreeVariables(Expression2 expression) {
    Set<String> freeVariables = Sets.newHashSet();
    ScopeSet scopes = getScopes(expression);
    for (int i = 0; i < expression.size(); i++) {
      Scope scope = scopes.getScope(i);
      String varName = getFreeVariable(expression, i, scope);
      if (varName != null) {
        freeVariables.add(varName);
      }
    }
    return freeVariables;
  }
978595
private WyalFile.VariableDeclaration[] generateQuantifierTypePattern(WyilFile.Expr.Quantifier expr,
			LocalEnvironment environment) {
		//
		Tuple<WyilFile.Decl.Variable> params = expr.getParameters();
		WyalFile.VariableDeclaration[] vardecls = new WyalFile.VariableDeclaration[params.size()];
		for (int i = 0; i != params.size(); ++i) {
			WyilFile.Decl.Variable var = params.get(i);
			vardecls[i] = environment.read(var);
		}
		return vardecls;
	}
884764
function resolveVariableInScope(identifier, scope) {
            return scope.variables.find(variable => variable.name === identifier.name) ||
                (scope.upper ? resolveVariableInScope(identifier, scope.upper) : null);
        }
1337784
AttrContext dup(WriteableScope scope) {
        AttrContext info = new AttrContext();
        info.scope = scope;
        info.staticLevel = staticLevel;
        info.isSelfCall = isSelfCall;
        info.selectSuper = selectSuper;
        info.pendingResolutionPhase = pendingResolutionPhase;
        info.lint = lint;
        info.enclVar = enclVar;
        info.returnResult = returnResult;
        info.defaultSuperCallSite = defaultSuperCallSite;
        info.isSerializable = isSerializable;
        info.isLambda = isLambda;
        info.isSpeculative = isSpeculative;
        info.isAnonymousDiamond = isAnonymousDiamond;
        info.isNewClass = isNewClass;
        info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
        info.visitingServiceImplementation = visitingServiceImplementation;
        return info;
    }
278047
public final void variable_definition() throws RecognitionException {
		CommonTree varname=null;
		CommonTree q=null;
		CommonTree pattern=null;

		try {
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:5: ( ^( VT_VAR_DEF varname= LITERAL ^( VT_QUAL (q= LITERAL )? ) (pattern= VT_PATTERN )? ) )
			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:9: ^( VT_VAR_DEF varname= LITERAL ^( VT_QUAL (q= LITERAL )? ) (pattern= VT_PATTERN )? )
			{
			match(input,VT_VAR_DEF,FOLLOW_VT_VAR_DEF_in_variable_definition423); 
			match(input, Token.DOWN, null); 
			varname=(CommonTree)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition427); 
			match(input,VT_QUAL,FOLLOW_VT_QUAL_in_variable_definition430); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:49: (q= LITERAL )?
				int alt13=2;
				int LA13_0 = input.LA(1);
				if ( (LA13_0==LITERAL) ) {
					alt13=1;
				}
				switch (alt13) {
					case 1 :
						// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:49: q= LITERAL
						{
						q=(CommonTree)match(input,LITERAL,FOLLOW_LITERAL_in_variable_definition434); 
						}
						break;

				}

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

			// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:67: (pattern= VT_PATTERN )?
			int alt14=2;
			int LA14_0 = input.LA(1);
			if ( (LA14_0==VT_PATTERN) ) {
				alt14=1;
			}
			switch (alt14) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/dsl/DSLMapWalker.g:127:67: pattern= VT_PATTERN
					{
					pattern=(CommonTree)match(input,VT_PATTERN,FOLLOW_VT_PATTERN_in_variable_definition440); 
					}
					break;

			}

			match(input, Token.UP, null); 


			        entry_stack.peek().variables.put((varname!=null?varname.getText():null), Integer.valueOf(0));

			        if(q!=null && pattern!=null){
			            entry_stack.peek().sentenceKeyBuffer.append("{"+(varname!=null?varname.getText():null)+":"+(q!=null?q.getText():null)+":"+(pattern!=null?pattern.getText():null)+"}");
			        }else if(q==null && pattern!=null){
			            entry_stack.peek().sentenceKeyBuffer.append("{"+(varname!=null?varname.getText():null)+":"+(pattern!=null?pattern.getText():null)+"}");
			        }else{
			            entry_stack.peek().sentenceKeyBuffer.append("{"+(varname!=null?varname.getText():null)+"}");
			        }

			        if(q == null || (!q.getText().equals("ENUM") && !q.getText().equals("CF") && 
			                          !q.getText().equals("DATE") && !q.getText().equals("BOOLEAN"))){
			            entry_stack.peek().keybuffer.append(pattern != null? "(" + (pattern!=null?pattern.getText():null) + ")" : "(.*?)");
			        }else{
			            entry_stack.peek().keybuffer.append("(.*?)");
			        }
			    
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
	}
530957
public static boolean isVariableNamePartValid( String namePart, Scope scope ) {
        if ( DIGITS_PATTERN.matcher(namePart).matches() ) {
            return true;
        }
        if ( REUSABLE_KEYWORDS.contains(namePart) ) {
            return scope.followUp(namePart, true);
        }
        return isVariableNameValid(namePart);
    }
106646
Rule variableDefinition() {
		return Sequence(
				group.types.type().label("type"),
				variableDefinitionPart().label("head"),
				ZeroOrMore(Sequence(
						Ch(','), group.basics.optWS(),
						variableDefinitionPart()).label("tail")),
				set(actions.createVariableDefinition(value("type"), value("head"), values("ZeroOrMore/tail"))));
	}
13200
CharSequence scopeDeclaration()
	{
		if (scopeVariables.length == 0)
		{
			return "";
		}
		StringBuilder scopeDeclaration = new StringBuilder();
		scopeDeclaration.append(scopeVariables[0]);
		for (int i = 1; i < scopeVariables.length; i++)
		{
			scopeDeclaration.append(", ");
			scopeDeclaration.append(scopeVariables[i]);
		}
		return scopeDeclaration;
	}
579222
protected JSType getTypeIfRefinable(Node node, FlowScope scope) {
    switch (node.getToken()) {
      case NAME:
        StaticTypedSlot nameVar = scope.getSlot(node.getString());
        if (nameVar != null) {
          JSType nameVarType = nameVar.getType();
          if (nameVarType == null) {
            nameVarType = node.getJSType();
          }
          return nameVarType;
        }
        return null;

      case GETPROP:
        String qualifiedName = node.getQualifiedName();
        if (qualifiedName == null) {
          return null;
        }
        StaticTypedSlot propVar = scope.getSlot(qualifiedName);
        JSType propVarType = null;
        if (propVar != null) {
          propVarType = propVar.getType();
        }
        if (propVarType == null) {
          propVarType = node.getJSType();
        }
        if (propVarType == null) {
          propVarType = getNativeType(UNKNOWN_TYPE);
        }
        return propVarType;
      default:
        break;
    }
    return null;
  }
364265
public TypeUsage.Builder scope(Optional<? extends QualifiedName> scope) {
    if (scope.isPresent()) {
      return scope(scope.get());
    } else {
      return clearScope();
    }
  }