Package org.apache.flex.compiler.definitions.references

Examples of org.apache.flex.compiler.definitions.references.IReference


    }

    private void processID(IMXMLTagData tag, IMXMLTagAttributeData idAttribute)
    {
        String id = idAttribute.getRawValue();
        IReference typeRef = fileScope.resolveTagToReference(tag);
       
        // TODO: put in the code below so that instances of the model tag
        // would have a resolvable class (ObjectProxy). We might want to do this a different way.
        // TODO: Also, we need some treatment of the component tag. That case is different,
        // however, in that is already has a class - we just need to add ClassFactory as a base class
View Full Code Here


        hostComponentDef.setPublic();
        hostComponentDef.setBindable();
        hostComponentDef.setImplicit();
        hostComponentDef.setContingent();

        IReference typeRef = ReferenceFactory.packageQualifiedReference(containedScope.getWorkspace(), hostComponentClassName);
        hostComponentDef.setTypeReference(typeRef);

        containedScope.addDefinition(hostComponentDef);

        return hostComponentDef;
View Full Code Here

        thisDef.setImplicit();
        thisDef.setNamespaceReference(NamespaceDefinition.getCodeModelImplicitDefinitionNamespace());

        // Create an implicit VariableDefinition for "super".
        VariableDefinition superDef = new VariableDefinition(IASKeywordConstants.SUPER);
        IReference baseClassRef = getBaseClassReference();
        if (baseClassRef == null)
        {
            baseClassRef = ReferenceFactory.builtinReference(BuiltinType.OBJECT);
        }
        superDef.setTypeReference(baseClassRef);
View Full Code Here

        fillInNamespaceAndModifiers(definition);
        fillInMetadata(definition);

        // Set the return type. If a type annotation doesn't appear in the source,
        // the return type in the definition will be "".
        IReference returnType = typeNode != null ? typeNode.computeTypeReference() : null;
        definition.setReturnTypeReference(returnType);

        definition.setTypeReference(ReferenceFactory.builtinReference(IASLanguageConstants.BuiltinType.FUNCTION));
        setConstructorIfNeeded(definition);
        return definition;
View Full Code Here

        fillInModifiers(definition);
        fillInMetadata(definition);
        fillInStateNames(definition);

        // Set the base class.
        IReference baseRef = null;
        if (baseClassNode != null)
            baseRef = baseClassNode.computeTypeReference();
        definition.setBaseClassReference(baseRef);

        // Set the implemented interfaces.
        if (interfacesNode != null)
        {
            int n = interfacesNode.getChildCount();
            List<IReference> interfaces = new ArrayList<IReference>(n);
            for (int i = 0; i < n; i++)
            {
                IASNode child = interfacesNode.getChild(i);
                if (child instanceof ExpressionNodeBase)
                {
                    IReference typeReference = ((ExpressionNodeBase)child).computeTypeReference();
                    if (typeReference != null)
                        interfaces.add(typeReference);
                }
            }
            definition.setImplementedInterfaceReferences(interfaces.toArray(new IReference[interfaces.size()]));
View Full Code Here

        // Populate this handler scope with a definition for the 'event' parameter.
        // The type of this parameter is determined by the [Event] metadata.
        // For example, if the event is
        // [Event(name="click", type="flash.events.MouseEvent")]
        // then the type is flash.events.MouseEvent.
        IReference typeRef = ((DefinitionBase)getDefinition()).getTypeReference();
        scope.buildEventParameter(typeRef);

        // Add an expression dependency on the event type.
        // It doesn't need to be a signature dependency
        // because autogenerated event handlers are inaccessible;
        // they're either in a special private MXML namespace
        // or they're public but have an 'illegal' name.
        typeRef.resolve(builder.getProject(), scope, DependencyType.EXPRESSION, true);

        // Make the statements inside the event handler the children of this node.
        for (ScopedBlockNode script : scripts)
        {
            int n = script.getChildCount();
View Full Code Here

        setDefinition(definition);

        // Set the type of the parameter. If a type annotation doesn't appear in the source,
        // the parameter type in the definition will be null.
        IReference typeRef = hasExplicitType() ? typeNode.computeTypeReference() : null;

        // If there is no type anno, and we're the rest parameter, we're typed as Array
        if (typeRef == null && this.isRest())
            typeRef = ReferenceFactory.builtinReference(IASLanguageConstants.BuiltinType.ARRAY);
View Full Code Here

       
        IExpressionNode expressionNodeForGetter = expressionNodesForGetter.get(0);
        if (expressionNodeForGetter instanceof IIdentifierNode)
        {
            String name = ((IIdentifierNode)expressionNodeForGetter).getName();
            IReference ref = ReferenceFactory.lexicalReference(project.getWorkspace(), name);
            IDefinition def = ref.resolve(project, scope, DependencyType.EXPRESSION, false);
            if (def instanceof IVariableDefinition)
            {
                // here we have decided that the binding expression is a variable
                IVariableDefinition var = (IVariableDefinition)def;
                if (!var.isStatic())
View Full Code Here

    }

    @Override
    public IReference computeTypeReference()
    {
        IReference base = collectionNode.computeTypeReference();
        IReference param = typeNode.computeTypeReference();
        return ReferenceFactory.parameterizedReference(getWorkspace(), base, param);
    }
View Full Code Here

    {
        if (isWildcardImport())
            return null;
       
        String importName = getImportName();
        IReference importReference = ReferenceFactory.packageQualifiedReference(
            project.getWorkspace(), importName);
        ASScope scope = (ASScope)getScopeNode().getScope();
        return importReference.resolve(project, scope, null, true);
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.references.IReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.