Examples of ICompilerProject


Examples of org.apache.flex.compiler.projects.ICompilerProject

        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
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

        if ( var_binding != null && var_binding.isLocal() )
        {
            //  Add initializer code to the init instructions.
            InstructionList init_insns = currentScope.getHoistedInitInstructions();

            ICompilerProject project = currentScope.getProject();

            IDefinition type_def = var_type.getDefinition();

            if  (
                    type_def == project.getBuiltinType(BuiltinType.INT) ||
                    type_def == project.getBuiltinType(BuiltinType.UINT)
                )
            {
                init_insns.addInstruction(OP_pushbyte, 0);
                init_insns.addInstruction(var_binding.setlocal());
            }
            else if ( type_def == project.getBuiltinType(BuiltinType.BOOLEAN) )
            {
                init_insns.addInstruction(OP_pushfalse);
                init_insns.addInstruction(var_binding.setlocal());
            }
            else if ( type_def == project.getBuiltinType(BuiltinType.NUMBER) )
            {
                init_insns.addInstruction(OP_pushnan);
                init_insns.addInstruction(var_binding.setlocal());
            }
            else if ( type_def == project.getBuiltinType(BuiltinType.ANY_TYPE) )
            {
                init_insns.addInstruction(OP_pushundefined);
                init_insns.addInstruction(var_binding.setlocal());
            }
            else if (
                        type_def instanceof ITypeDefinition &&
                        ((ITypeDefinition)type_def).isInstanceOf((ITypeDefinition)project.getBuiltinType(BuiltinType.OBJECT), project)
                )
            {
                init_insns.addInstruction(OP_pushnull);
                init_insns.addInstruction(var_binding.setlocal());
            }
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

        if ( binding.getDefinition() != null )
        {
            ITypeDefinition typezo = binding.getDefinition().resolveType(currentScope.getProject());
           
            ICompilerProject project = currentScope.getProject();

            if ( typezo == project.getBuiltinType(BuiltinType.STRING) )
            {
                result = createInstructionList(iNode);
                result.addInstruction(OP_pushstring, "string");
            }
            else if (
                typezo == project.getBuiltinType(BuiltinType.NUMBER) ||
                typezo == project.getBuiltinType(BuiltinType.INT) ||
                typezo == project.getBuiltinType(BuiltinType.UINT)
            )
            {
                result = createInstructionList(iNode);
                result.addInstruction(OP_pushstring, "number");
            }
            else if ( typezo == project.getBuiltinType(BuiltinType.BOOLEAN) )
            {
                result = createInstructionList(iNode);
                result.addInstruction(OP_pushstring, "boolean");
            }
        }
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

     @return an instruction with the specified opcode
     *    and the set of open namespaces at the given node.
     */
    private Instruction arrayAccess(IASNode iNode, int opcode)
    {
        ICompilerProject project = currentScope.getProject();

        // Determine if iNode represents super[...] (either as an l-value or an r-value).
        // If so, the namespace set will be slightly different; it will have
        // ProtectedNs(thisClass) instead of ProtectedNs(superClass>.
        IDefinition superDef = null;
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

            for (ICompilationUnit compilationUnit : relatedCompilationUnits)
            {
                if (compilationUnit == null)
                    continue;

                ICompilerProject containingProject = compilationUnit.getProject();
                assert(containingProject instanceof ASProject);
                affectedProjects.add((ASProject)containingProject);
            }

            invalidate(removedFile, relatedCompilationUnits, cusToUpdate);          
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

        FunctionDefinition funcDef = func.getDefinition();
        //  Marshal the function's arguments.
        ParameterDefinition[] args = funcDef.getParameters();
        List<String> param_names = new ArrayList<String>();

        ICompilerProject project = scope.getProject();
        if ( args.length > 0 )
        {
          Vector<Name> method_args = new Vector<Name>();
          for ( ParameterDefinition arg: args)
          {
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

            // Remember the Name for the instance's Class,
            // so that processMXMLInstance() can use it to construct the instance
            // and so that endNode() can use it to generate the reference variable
            // autogenerated for the id and to generate an initializer method
            // if appropriate.
            ICompilerProject project = getProject();
            IClassDefinition instanceClassReference = instanceNode.getClassReference(project);
            childContext.instanceClassName =
                instanceClassReference != null ?
                ((DefinitionBase)instanceClassReference).getMName(project) :
                null;
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

        Name name = getVectorGeneratorName(typeName);
        MethodInfo methodInfo = createVectorGeneratorMethodInfo(
            getProject(), vectorNode, name.getBaseName());
        addMethodTrait(name, methodInfo, false);
       
        ICompilerProject project = getProject();
        ASProjectScope projectScope = (ASProjectScope)project.getScope();
        IDefinition vectorDef = projectScope.findDefinitionByName(IASLanguageConstants.Vector_qname);
        Name vectorName = ((ClassDefinition)vectorDef).getMName(project);

        InstructionList generatorFunctionBody = new InstructionList();
        generatorFunctionBody.addInstruction(OP_getlocal0);
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

    void processMXMLVector(IMXMLVectorNode vectorNode, Context context)
    {
        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();
        IDefinition vectorDef = projectScope.findDefinitionByName(IASLanguageConstants.Vector_qname);
        Name vectorName = ((ClassDefinition)vectorDef).getMName(project);
        Name typeName = ((TypeDefinitionBase)type).getMName(project);
        Nsset nsSet = new Nsset(new Namespace(ABCConstants.CONSTANT_PackageNs));
        Name indexName = new Name(ABCConstants.CONSTANT_MultinameL, nsSet, null);
View Full Code Here

Examples of org.apache.flex.compiler.projects.ICompilerProject

    {
        if (getProject().getTargetSettings().getMxmlChildrenAsData())
            context.addInstruction(OP_pushtrue);
       
        // Get the Name for the mx.core.ClassFactory class.
        ICompilerProject project = getProject();
        ClassDefinition classReference = (ClassDefinition)factoryNode.getClassReference(project);
        Name factoryClassName = classReference != null ? classReference.getMName(project) : null;
       
        // Push this class.
        context.addInstruction(OP_finddef, factoryClassName);
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.