@Override protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems) { if (IASLanguageConstants.arguments.equals(name)) { if (!this.isMemberRef() && !this.isQualifiedRef() && set.contains(PostProcessStep.POPULATE_SCOPE)) { FunctionNode fn = (FunctionNode)getAncestorOfType(FunctionNode.class); if (fn != null) fn.needsArguments = true; } } }
@Override protected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems) { if (IASLanguageConstants.arguments.equals(name)) { if (!this.isMemberRef() && !this.isQualifiedRef() && set.contains(PostProcessStep.POPULATE_SCOPE)) { FunctionNode fn = (FunctionNode)getAncestorOfType(FunctionNode.class); if (fn != null) fn.needsArguments = true; } } }
private REF_TYPE getRefType() { if (isMemberRef()) { // If this is a member expr, then the stem better be a package; // otherwise we can't possibly be a type ref. if (baseIsPackage()) return REF_TYPE.PACKAGE_QUALIFIED; else return REF_TYPE.MEMBER; } else if (isQualifiedRef()) { return REF_TYPE.NAMESPACE_QUALIFIED; } else { return REF_TYPE.LEXICAL; } }
private REF_TYPE getRefType() { if (isMemberRef()) { // If this is a member expr, then the stem better be a package; // otherwise we can't possibly be a type ref. if (baseIsPackage()) return REF_TYPE.PACKAGE_QUALIFIED; else return REF_TYPE.MEMBER; } else if (isQualifiedRef()) { return REF_TYPE.NAMESPACE_QUALIFIED; } else { return REF_TYPE.LEXICAL; } }
/** * Is the binding a potential reference to * the 'arguments' object * @param b the Binding to check * @return true if the reference could be a reference to 'arguments' */ public static boolean isArgumentsReference (Binding b) { Name name = b.getName(); if (name != null && IASLanguageConstants.arguments.equals(name.getBaseName())) { // the name is "arguments", but make sure it's not a user defined definition // by checking whether the def is implicit IDefinition definition = b.getDefinition(); if (definition != null) { return definition.isImplicit(); } else { // if there's no definition, as can happen when referencing "arguments" from // within a 'with', then fall back to checking on the node. IASNode node = b.getNode(); return node instanceof IdentifierNode && !((IdentifierNode) node).isMemberRef(); } } return false; }
/** * Is the binding a potential reference to * the 'arguments' object * @param b the Binding to check * @return true if the reference could be a reference to 'arguments' */ public static boolean isArgumentsReference (Binding b) { Name name = b.getName(); if (name != null && IASLanguageConstants.arguments.equals(name.getBaseName())) { // the name is "arguments", but make sure it's not a user defined definition // by checking whether the def is implicit IDefinition definition = b.getDefinition(); if (definition != null) { return definition.isImplicit(); } else { // if there's no definition, as can happen when referencing "arguments" from // within a 'with', then fall back to checking on the node. IASNode node = b.getNode(); return node instanceof IdentifierNode && !((IdentifierNode) node).isMemberRef(); } } return false; }
if (isMemberRef()) if (isMemberRef()) if (isMemberRef())
if (isMemberRef()) if (isMemberRef()) if (isMemberRef())
boolean isMemberRef = isMemberRef(); boolean wasMemberRef = isMemberRef; if (isMemberRef())
boolean isMemberRef = isMemberRef(); boolean wasMemberRef = isMemberRef; if (isMemberRef())