Package org.apache.flex.compiler.definitions

Examples of org.apache.flex.compiler.definitions.ITypeDefinition


    protected NodeBase createExpressionNodeFromFragments(MXMLTreeBuilder builder,
                                                         IMXMLTagData tag,
                                                         MXMLNodeInfo info,
                                                         Object defaultValue)
    {
        ITypeDefinition type = builder.getBuiltinType(getName());

        ISourceFragment[] fragments = info.getSourceFragments();

        ISourceLocation location = info.getSourceLocation();
        if (location == null)
View Full Code Here


    protected NodeBase parseExpressionNodeFromFragments(MXMLTreeBuilder builder,
                                                        IMXMLTagData tag,
                                                        MXMLNodeInfo info,
                                                        Object defaultValue)
    {
        ITypeDefinition type = builder.getBuiltinType(getName());

        ISourceFragment[] fragments = info.getSourceFragments();

        ISourceLocation location = info.getSourceLocation();
        if (location == null)
View Full Code Here

        setLocation(location);

        FlexProject project = builder.getProject();
        setClassReference(project, IASLanguageConstants.Class);

        ITypeDefinition type = builder.getBuiltinType(getName());

        MXMLClassDefinitionNode classNode =
                (MXMLClassDefinitionNode)getClassDefinitionNode();

        NodeBase expressionNode = builder.parseExpressionNode(
View Full Code Here

        // unless the left operand is int, in which case
        // the old compiler says the result is int.
        IDefinition leftType = getLeftOperandNode().resolveType(project);
        if (leftType != null)
        {
            ITypeDefinition intType = project.getBuiltinType(BuiltinType.INT);
            if (leftType.equals(intType))
                return intType;
        }
       
        return project.getBuiltinType(BuiltinType.UINT);
View Full Code Here

        IDefinition base = name.resolve(project, scope, dependencyType, canEscapeWith);
        IDefinition typeParam = param.resolve(project, scope, dependencyType, canEscapeWith);
        IDefinition resolvedType = null;
        if (base instanceof ITypeDefinition && typeParam instanceof ITypeDefinition)
        {
            ITypeDefinition baseType = (ITypeDefinition)base;
            IDefinition vectorType = project.getBuiltinType(IASLanguageConstants.BuiltinType.VECTOR);

            if (baseType == vectorType) //only vectors are parameterizable today
                resolvedType = AppliedVectorDefinitionFactory.newVector(project, (ITypeDefinition)typeParam);
        }
View Full Code Here

        {
            if ((rightDef == null) && (leftDef != null))
            {
                // maybe we are something like ObjectProxy.dynamicProperty
                // (someone who extends ObjectProxy, like Model)
                ITypeDefinition leftType= leftDef.resolveType(project)
                FlexProject project = (FlexProject)this.project;
                String objectProxyClass = project.getObjectProxyClass();
                boolean isProxy = leftType==null ? false : leftType.isInstanceOf(objectProxyClass, project);
   
                // If we are proxy.prop, we set this info into the parse state. This does two things:
                //      1) tells downstream properties that they can be dynamic, and hence don't need
                //          to be resolvable.
                //      2) Stores off the event names from the proxy so that the chained property watchers
                //          can use the info
                if (isProxy)
                {
                    state.isObjectProxyExpression = true;
                    state.objectProxyEventNames = leftType.getBindableEventNames();
                }
            }
            doAnalyze(left, state);
            doAnalyze(right, state);
      
View Full Code Here

        // are created in this one call
        if (def instanceof IVariableDefinition)
        {
            // Is the def for an XML type variable?
            IVariableDefinition var = (IVariableDefinition)def;
            ITypeDefinition varType = var.resolveType(project);
           
            // note that varType might be null if code is bad
            boolean isVarXML = (varType==null) ? false : varType.isInstanceOf("XML", project);

            if (isVarXML)
            {
                // if XML,then create a watcher for it.
                String key = "XML";     // using this unique key will work, but it means we can never
View Full Code Here

    //
   
    @Override
    public ITypeDefinition resolveType(ICompilerProject project)
    {
        ITypeDefinition leftType = getLeftOperandNode().resolveType(project);
        ITypeDefinition rightType = getRightOperandNode().resolveType(project);

        // If we're adding numeric values (Number, int, or uint),
        // then the result is Number.
        if (isNumericType(leftType, project) && isNumericType(rightType, project))
            return project.getBuiltinType(BuiltinType.NUMBER);
       
        // If one of our operands is String,
        // then the result is String.
        ITypeDefinition stringType = project.getBuiltinType(BuiltinType.STRING);
        if (stringType.equals(leftType) || stringType.equals(rightType))
            return stringType;
       
        // If we're adding two XML-ish (i.e., XML or XMLList) objects,
        // then the result is XMLList.
        if (IdentifierNode.isXMLish(leftType, project) &&
View Full Code Here

                IReference[] references = classDefinition
                        .getImplementedInterfaceReferences();
                for (IReference iReference : references)
                {
                    ITypeDefinition type = (ITypeDefinition) iReference
                            .resolve(project, (ASScope) classDefinition
                                    .getContainingScope(),
                                    DependencyType.INHERITANCE, true);
                    emitImplements(type, type.getPackageName());
                }
            }
            else
            {
                String ns = node.getNamespace();
                if (ns != null)
                {
                    begin();
                    emitMethodAccess(node);
                    hasDoc = true;
                }
            }

            // @param
            IParameterNode[] parameters = node.getParameterNodes();
            for (IParameterNode pnode : parameters)
            {
                if (!hasDoc)
                {
                    begin();
                    emitMethodAccess(node);
                    hasDoc = true;
                }

                IExpressionNode enode = pnode.getNameExpressionNode();
                emitParam(pnode, enode.resolveType(project).getPackageName());
            }

            if (!node.isConstructor())
            {
                // @return
                String returnType = node.getReturnType();
                if (returnType != ""
                        && returnType != ASEmitterTokens.VOID.getToken())
                {
                    if (!hasDoc)
                    {
                        begin();
                        emitMethodAccess(node);
                        hasDoc = true;
                    }

                    ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
                            .resolveReturnType(project);

                    String packageName = "";
                    if (tdef instanceof InterfaceDefinition)
                        packageName = tdef.getPackageName();
                    else
                        packageName = node.getPackageName();
                   
                    emitReturn(node, packageName);
                }
View Full Code Here

                && returnType != ASEmitterTokens.VOID.getToken()) // has return
        {
            begin();
            hasDoc = true;

            ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
                    .resolveReturnType(project);

            emitReturn((IFunctionNode) node, tdef.getPackageName());
        }

        IParameterNode[] parameters = ((IFunctionNode) node).getParameterNodes();
        for (IParameterNode pnode : parameters)
        {
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.ITypeDefinition

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.