/** * Helper method to get the parent node as an IDefinitionNode * * @return the parent IDefinitionNode, or null if the parent is not an * IDefinitionNode */ private BaseDefinitionNode getParentAsDefinition() { IASNode p = getParent(); BaseDefinitionNode def = p instanceof BaseDefinitionNode ? (BaseDefinitionNode)p : null; return def; }
/** * Helper method to get the parent node as an IDefinitionNode * * @return the parent IDefinitionNode, or null if the parent is not an * IDefinitionNode */ private BaseDefinitionNode getParentAsDefinition() { IASNode p = getParent(); BaseDefinitionNode def = p instanceof BaseDefinitionNode ? (BaseDefinitionNode)p : null; return def; }
result = asScope.findProperty(project, "royalegraphics", getDependencyType(), isTypeRef()); if (isLegacyCodegen(project) && result != null && getParent().getNodeID() == ASTNodeID.FunctionCallID && result instanceof VariableDefinition)
@Override // TODO What is special about this class // that requires it to override getParent()? public IASNode getParent() { if (parent == null && decoratedDefinitionNode != null) { // if we don't have a parent, try the IDefinition return decoratedDefinitionNode.getParent(); } return super.getParent(); }
if (isLegacyCodegen(project) && result != null && getParent().getNodeID() == ASTNodeID.FunctionCallID && result instanceof VariableDefinition)
@Override // TODO What is special about this class // that requires it to override getParent()? public IASNode getParent() { if (parent == null && decoratedDefinitionNode != null) { // if we don't have a parent, try the IDefinition return decoratedDefinitionNode.getParent(); } return super.getParent(); }
/** * Is this a type reference - e.g. a base class ref, type anno, etc * * @return true if this is a type reference */ protected boolean isTypeRef() { DependencyType dt = getDependencyType(); if (dt == DependencyType.SIGNATURE || dt == DependencyType.INHERITANCE) return true; if (dt == DependencyType.EXPRESSION) { final IASNode parent = getParent(); if (parent instanceof BaseTypedDefinitionNode && this == ((BaseTypedDefinitionNode)parent).getTypeNode()) return true; } return false; }
/** * Is this a type reference - e.g. a base class ref, type anno, etc * * @return true if this is a type reference */ protected boolean isTypeRef() { DependencyType dt = getDependencyType(); if (dt == DependencyType.SIGNATURE || dt == DependencyType.INHERITANCE) return true; if (dt == DependencyType.EXPRESSION) { final IASNode parent = getParent(); if (parent instanceof BaseTypedDefinitionNode && this == ((BaseTypedDefinitionNode)parent).getTypeNode()) return true; } return false; }
/** * Check if {@code node} is in an E4X filter expression. * * @param node AST node to be checked. * @return True if the node is in an E4X filter expression without crossing * a block. */ public static boolean isE4XWildcardProperty(final IdentifierNode node) { assert node != null : "node can't be null"; IASNode blockOrFilterNode = node.getParent(); // "*::bar", "foo::*", "foo.*", "foo.(@* == 10) are not E4X wildcard properties if (blockOrFilterNode instanceof MemberAccessExpressionNode || blockOrFilterNode instanceof UnaryOperatorAtNode) return false; while (blockOrFilterNode != null && blockOrFilterNode.getNodeID() != ASTNodeID.BlockID && blockOrFilterNode.getNodeID() != ASTNodeID.E4XFilterID) { blockOrFilterNode = blockOrFilterNode.getParent(); } if (blockOrFilterNode != null && blockOrFilterNode.getNodeID() == ASTNodeID.E4XFilterID) return true; else return false; }
/** * Check if {@code node} is in an E4X filter expression. * * @param node AST node to be checked. * @return True if the node is in an E4X filter expression without crossing * a block. */ public static boolean isE4XWildcardProperty(final IdentifierNode node) { assert node != null : "node can't be null"; IASNode blockOrFilterNode = node.getParent(); // "*::bar", "foo::*", "foo.*", "foo.(@* == 10) are not E4X wildcard properties if (blockOrFilterNode instanceof MemberAccessExpressionNode || blockOrFilterNode instanceof UnaryOperatorAtNode) return false; while (blockOrFilterNode != null && blockOrFilterNode.getNodeID() != ASTNodeID.BlockID && blockOrFilterNode.getNodeID() != ASTNodeID.E4XFilterID) { blockOrFilterNode = blockOrFilterNode.getParent(); } if (blockOrFilterNode != null && blockOrFilterNode.getNodeID() == ASTNodeID.E4XFilterID) return true; else return false; }
@Override public IScopedNode getScopeNode() IASNode parent = getParent();
@Override public IScopedNode getScopeNode() IASNode parent = getParent();
if (node.getName().equals("override")) IASNode parent = node.getParent(); if (parent.getNodeID() == ASTNodeID.ConfigBlockID)
if (node.getName().equals("override")) IASNode parent = node.getParent(); if (parent.getNodeID() == ASTNodeID.ConfigBlockID)