Examples of ITypeDefinition


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

        if (getProject().getTargetSettings().getMxmlChildrenAsData())
            context.addInstruction(OP_pushundefined); // vector type
       
        ICompilerProject project = getProject();
        int n = vectorNode.getChildCount();
        ITypeDefinition type = vectorNode.getType();
        if (type instanceof IAppliedVectorDefinition)
            type = ((IAppliedVectorDefinition)(vectorNode.getType())).resolveElementType(project);
        boolean fixed = vectorNode.getFixed();
               
        ASProjectScope projectScope = (ASProjectScope)project.getScope();
View Full Code Here

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

     *
     * @param node node represents Resource compiler directive in MXML
     */
    void processMXMLResource(IMXMLResourceNode node, Context context)
    {
        ITypeDefinition type = node.getType();
       
        FlexProject project = getProject();

        try
        {
            String bundleName = node.getBundleName();
            String key = node.getKey();
            if(bundleName != null && key != null)
            {
                //compilation unit of the file that has the compiler directive
                final ICompilationUnit refCompUnit = project.getScope(
                ).getCompilationUnitForScope(((NodeBase)node).getASScope());
                assert refCompUnit != null;

                ResourceBundleUtils.resolveDependencies(bundleName, refCompUnit, project, node, getProblems());
            }
        }
        catch(InterruptedException ie)
        {
            throw new CodegenInterruptedException(ie);
        }
       
        //Based on the type of the identifier which its value is set with this compiler
        //directive, we are figuring out which method we need to call on ResourceManager instance.
        String methodName = null;       
        if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.STRING), project))
        {
            methodName = "getString";
        }
        else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.BOOLEAN), project))
        {
            methodName = "getBoolean";
        }
        else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.NUMBER), project))
        {
            methodName = "getNumber";
        }
        else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.INT), project))
        {
            methodName = "getInt";
        }
        else if (type.isInstanceOf(project.getBuiltinType(
                BuiltinType.UINT).resolveType(project), project))
        {
            methodName = "getUint";
        }
        else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.CLASS), project))
        {
            methodName = "getClass";
        }
        else if (type.isInstanceOf((ITypeDefinition)project.getBuiltinType(
                BuiltinType.ARRAY), project))
        {
            methodName = "getStringArray";
        }
        else
View Full Code Here

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

        public ITypeDefinition next()
        {
            if (!hasNext())
                throw new NoSuchElementException();

            ITypeDefinition next = stack.pop();
            visited.add(next);
            pushChildren(next);
            return next;
        }
View Full Code Here

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

        protected void init(ITypeDefinition initialType, boolean skipThis)
        {
            this.initialType = initialType;

            stack.push(initialType);
            ITypeDefinition classType = (ITypeDefinition)project.getBuiltinType(BuiltinType.CLASS);
            stack.push(classType);

            if (skipThis)
                next();
        }
View Full Code Here

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

       
        IInterfaceDefinition[] result = new IInterfaceDefinition[n];

        for (int i = 0; i < n; i++)
        {
            ITypeDefinition typeDefinition =
                    resolveType(extendedInterfaces[i], project, DependencyType.INHERITANCE);

            if (!(typeDefinition instanceof IInterfaceDefinition))
                typeDefinition = null;
View Full Code Here

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

            // Only global (outside a package) or function locals can be redeclared.

            VariableDefinition var1 = (VariableDefinition)v1;
            VariableDefinition var2 = (VariableDefinition)v2;

            ITypeDefinition thisType = var1.resolveType(project);
            ITypeDefinition thatType = var2.resolveType(project);

            // If the types match, doesn't matter which one we return
            if (thisType == thatType)
            {
                return v1;
View Full Code Here

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

        IScopedDefinition containingDef = varDef.getContainingScope().getDefinition();
        if (containingDef instanceof FunctionDefinition || containingScope instanceof ASFileScope)
        {
            // Only global (outside a package) or function locals can be redeclared.

            ITypeDefinition varType = varDef.resolveType(project);
            IDefinition funcType = project.getBuiltinType(IASLanguageConstants.BuiltinType.FUNCTION);

            // If the types match, doesn't matter which one we return
            if (varType == funcType)
            {
View Full Code Here

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

        if ( owningType instanceof IClassDefinition)
        {
            if( kind == ScopeKind.STATIC )
            {
                // For a static scope, the base scope will be the instance scope of 'Class'
                ITypeDefinition typeDef = project.getBuiltinType(IASLanguageConstants.BuiltinType.CLASS);
                if( typeDef != null )
                {
                    IASScope s = typeDef.getContainedScope();
                    if( s instanceof TypeScope )
                        result = ((TypeScope) s).getInstanceScope();
                }
            }
            else
View Full Code Here

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

     * Utility method called by {@link #resolveType(ICompilerProject)} in subclasses
     * for the <code>++</code> and <code>--</code> operators.
     */
    protected ITypeDefinition resolveIncrementOrDecrementType(ICompilerProject project)
    {
        ITypeDefinition exprType = operandNode.resolveType(project);
       
        if (exprType != null)
        {
            ITypeDefinition intType = project.getBuiltinType(BuiltinType.INT);
            ITypeDefinition uintType = project.getBuiltinType(BuiltinType.UINT);

            if (exprType.equals(intType))
                return intType;
            else if (exprType.equals(uintType))
                return uintType;
View Full Code Here

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

    public InterfaceDefinition resolveImplementedInterface(ICompilerProject project, int i)
    {
        IReference[] implementedInterfaces = getImplementedInterfaceReferences();
        if ((implementedInterfaces != null) && (implementedInterfaces.length > i))
        {
            ITypeDefinition typeDefinition = resolveType(implementedInterfaces[i], project, DependencyType.INHERITANCE);
            if (typeDefinition instanceof IInterfaceDefinition)
                return (InterfaceDefinition)typeDefinition;
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.