@Override public IVariableDefinition resolveProperty(ICompilerProject project) { if (propertyNameNode == null) return null; IDefinition definition = propertyNameNode.resolve(project); if (!(definition instanceof IVariableDefinition)) return null; return (IVariableDefinition)definition; }
@Override public IVariableDefinition resolveProperty(ICompilerProject project) { if (propertyNameNode == null) return null; IDefinition definition = propertyNameNode.resolve(project); if (!(definition instanceof IVariableDefinition)) return null; return (IVariableDefinition)definition; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is an interface name. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child is an interface. */ public static int qualifierIsInterface(IASNode iNode, ICompilerProject project) { IdentifierNode qualifier = (IdentifierNode) SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(project); if ( def instanceof InterfaceDefinition ) return 1; else return Integer.MAX_VALUE; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is a compile-time constant. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child has a known namespace, i.e., * it's a compile-time constant qualifier. */ public static int qualifierIsCompileTimeConstant(IASNode iNode, ICompilerProject project) { IdentifierNode qualifier = (IdentifierNode) SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(project); if ( def instanceof NamespaceDefinition ) return 1; else return Integer.MAX_VALUE; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is a compile-time constant. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child has a known namespace, i.e., * it's a compile-time constant qualifier. */ public static int qualifierIsCompileTimeConstant(IASNode iNode, ICompilerProject project) { IdentifierNode qualifier = (IdentifierNode) SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(project); if ( def instanceof NamespaceDefinition ) return 1; else return Integer.MAX_VALUE; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is an interface name. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child is an interface. */ public static int qualifierIsInterface(IASNode iNode, ICompilerProject project) { IdentifierNode qualifier = (IdentifierNode) SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(project); if ( def instanceof InterfaceDefinition ) return 1; else return Integer.MAX_VALUE; }
/** * @return a feasible cost if a node has a compile-time constant defintion. */ int isCompileTimeConstantFunction(IASNode iNode) { if (hookallreducercalls) hookforreducercalls("isCompileTimeConstantFunction"); IDefinition def = ((IdentifierNode)iNode).resolve(project); if (SemanticUtils.isConstDefinition(def)) return 1; else return Integer.MAX_VALUE; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is a compile-time constant. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child has a known namespace, i.e., * it's a compile-time constant qualifier. */ int qualifierIsCompileTimeConstant(IASNode iNode) { IdentifierNode qualifier = (IdentifierNode)SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(currentScope.getProject()); int result = def instanceof NamespaceDefinition ? 1 : Integer.MAX_VALUE; return result; }
/** * Get the definition associated with a node's qualifier * and decide if the qualifier is a compile-time constant. * @param iNode - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child has a known namespace, i.e., * it's a compile-time constant qualifier. */ int qualifierIsCompileTimeConstant(IASNode iNode) { IdentifierNode qualifier = (IdentifierNode)SemanticUtils.getNthChild(iNode, 0); IDefinition def = qualifier.resolve(currentScope.getProject()); int result = def instanceof NamespaceDefinition ? 1 : Integer.MAX_VALUE; return result; }
/** * Get the definition associated with a node's qualifier and decide if the * qualifier is a compile-time constant. * * @param iNode * - the node to check. * @pre - the node has an IdentifierNode 0th child. * @return an attractive cost if the child has a known namespace, i.e., it's * a compile-time constant qualifier. */ int qualifierIsCompileTimeConstant(IASNode iNode) { if (hookallreducercalls) hookforreducercalls("qualifierIsCompileTimeConstant"); IdentifierNode qualifier = (IdentifierNode) SemanticUtils .getNthChild(iNode, 0); IDefinition def = qualifier.resolve(project); int result = def instanceof NamespaceDefinition ? 1 : Integer.MAX_VALUE; return result; }
@Override public ITypeDefinition resolveType(ICompilerProject project) { IDefinition def = resolve(project); if (def != null) { if (isXMLish(def.getParent(), project)) { // XML and XMLList members should be treated as '*' because any access could // resolve to some content inside the XML (i.e. it has a child tag named 'name'). // return '*' since we can't statically know what the type will be. // Compat with ASC behavior. return project.getBuiltinType(IASLanguageConstants.BuiltinType.ANY_TYPE); } return def.resolveType(project); } return null; }
@Override public ITypeDefinition resolveType(ICompilerProject project) { IDefinition def = resolve(project); if (def != null) { if (isXMLish(def.getParent(), project)) { // XML and XMLList members should be treated as '*' because any access could // resolve to some content inside the XML (i.e. it has a child tag named 'name'). // return '*' since we can't statically know what the type will be. // Compat with ASC behavior. return project.getBuiltinType(IASLanguageConstants.BuiltinType.ANY_TYPE); } return def.resolveType(project); } return null; }
public Name reduce_namespaceAsName_to_multinameL(IASNode iNode, final boolean is_attribute) { IdentifierNode qualifier = (IdentifierNode)iNode; NamespaceDefinition ns = (NamespaceDefinition) qualifier.resolve(currentScope.getProject()); int name_kind = is_attribute? CONSTANT_MultinameLA: CONSTANT_MultinameL; return new Name(name_kind, new Nsset( ns.resolveAETNamespace(currentScope.getProject())), null); }
public Name reduce_namespaceAsName_to_multinameL(IASNode iNode, final boolean is_attribute) { IdentifierNode qualifier = (IdentifierNode)iNode; NamespaceDefinition ns = (NamespaceDefinition) qualifier.resolve(currentScope.getProject()); int name_kind = is_attribute? CONSTANT_MultinameLA: CONSTANT_MultinameL; return new Name(name_kind, new Nsset( ns.resolveAETNamespace(currentScope.getProject())), null); }
def = super.resolve(project); break;
public Binding reduce_simpleName(IASNode iNode) { final Binding result; final IdentifierNode identifier = (IdentifierNode)iNode; if (identifier.getName().equals(IASLanguageConstants.ANY_TYPE) && SemanticUtils.isE4XWildcardProperty(identifier)) { // TODO: This is a specific fix for CMP-1731. CMP-696 should be able // to cover this use case in a more generic and robust way. Revisit // this implementation when CMP-696 is fixed. final ICompilerProject project = currentScope.getProject(); final Nsset qualifiers = SemanticUtils.getOpenNamespaces(iNode, project); final Name name = new Name(CONSTANT_Multiname, qualifiers, null); result = new Binding(iNode, name, identifier.resolve(project)); } else { result = currentScope.resolveName(identifier); currentScope.getMethodBodySemanticChecker().checkSimpleName(iNode, result); } return result; }
public Binding reduce_simpleName(IASNode iNode) { final Binding result; final IdentifierNode identifier = (IdentifierNode)iNode; if (identifier.getName().equals(IASLanguageConstants.ANY_TYPE) && SemanticUtils.isE4XWildcardProperty(identifier)) { // TODO: This is a specific fix for CMP-1731. CMP-696 should be able // to cover this use case in a more generic and robust way. Revisit // this implementation when CMP-696 is fixed. final ICompilerProject project = currentScope.getProject(); final Nsset qualifiers = SemanticUtils.getOpenNamespaces(iNode, project); final Name name = new Name(CONSTANT_Multiname, qualifiers, null); result = new Binding(iNode, name, identifier.resolve(project)); } else { result = currentScope.resolveName(identifier); currentScope.getMethodBodySemanticChecker().checkSimpleName(iNode, result); } return result; }
def = super.resolve(project); break;
IDefinition d = super.resolve(project);
IDefinition d = super.resolve(project);