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

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


     * application class at runtme. May not be null but a library.swf for a SWC
     * may pass in a {@link Name} that resolves to "Object" at runtime.
     */
    protected final void codegenCreateMethod(ClassGeneratorHelper classGen, Name mainApplicationName)
    {
        IResolvedQualifiersReference applyReference = ReferenceFactory.resolvedQualifierQualifiedReference(flexProject.getWorkspace(),
                NamespaceDefinition.getAS3NamespaceDefinition(), "apply");
        IResolvedQualifiersReference getDefinitionByNameReference =
                ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(), IASLanguageConstants.getDefinitionByName);
        IResolvedQualifiersReference iFlexModule =
                ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(), IMXMLTypeConstants.IFlexModule);
        Name getDefinitionByName = getDefinitionByNameReference.getMName();
        InstructionList create = new InstructionList();
        create.addInstruction(ABCConstants.OP_getlocal1);
        create.addInstruction(ABCConstants.OP_getproperty, new Name("length"));
        create.addInstruction(ABCConstants.OP_pushbyte, 0);
        Label createL1 = new Label();
        create.addInstruction(ABCConstants.OP_ifgt, createL1);
        create.addInstruction(ABCConstants.OP_findproperty, mainApplicationName);
        create.addInstruction(ABCConstants.OP_getproperty, mainApplicationName);
        Label createL3 = new Label();
        create.addInstruction(ABCConstants.OP_jump, createL3);
        create.labelNext(createL1);
        create.addInstruction(ABCConstants.OP_getlocal1);
        create.addInstruction(ABCConstants.OP_getproperty, new Name("0"));
        create.addInstruction(ABCConstants.OP_istype, new Name("String"));
        Label createL2 = new Label();
        create.addInstruction(ABCConstants.OP_iffalse, createL2);
        create.addInstruction(ABCConstants.OP_finddef, getDefinitionByName);
        create.addInstruction(ABCConstants.OP_getlocal1);
        create.addInstruction(ABCConstants.OP_getproperty, new Name("0"));
        create.addInstruction(ABCConstants.OP_callproperty, new Object[] {getDefinitionByName, 1});
        create.addInstruction(ABCConstants.OP_jump, createL3);
        create.labelNext(createL2);
        create.addInstruction(ABCConstants.OP_getlocal0);
        create.addInstruction(ABCConstants.OP_getsuper, new Name("create"));
        create.addInstruction(ABCConstants.OP_getlocal0);
        create.addInstruction(ABCConstants.OP_getlocal1);
        create.addInstruction(ABCConstants.OP_callproperty, new Object[] {applyReference.getMName(), 2});
        create.addInstruction(ABCConstants.OP_returnvalue);
        create.labelNext(createL3);
        create.addInstruction(ABCConstants.OP_astype, new Name("Class"));
        create.addInstruction(ABCConstants.OP_dup);
        Label createL5 = new Label();
        create.addInstruction(ABCConstants.OP_iffalse, createL5);
        create.addInstruction(ABCConstants.OP_construct, 0);
        create.addInstruction(ABCConstants.OP_dup);
        create.addInstruction(ABCConstants.OP_istype, iFlexModule.getMName());
        Label createL4 = new Label();
        create.addInstruction(ABCConstants.OP_iffalse, createL4);
        create.addInstruction(ABCConstants.OP_dup);
        create.addInstruction(ABCConstants.OP_getlocal0);
        create.addInstruction(ABCConstants.OP_setproperty, new Name("moduleFactory"));
View Full Code Here


            FlexRSLInfo rslInfo,
            Collection<ICompilerProblem> problemCollection,
            boolean isAppFlexInfo)
            throws InterruptedException
    {
        IResolvedQualifiersReference applicationDomainRef = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                IASLanguageConstants.ApplicationDomain);
        IResolvedQualifiersReference infoSlotReference;
        if (isAppFlexInfo)
        {
            NamespaceDefinition.IStaticProtectedNamespaceDefinition staticNSDef = NamespaceDefinition.createStaticProtectedNamespaceDefinition("");
            infoSlotReference = ReferenceFactory.resolvedQualifierQualifiedReference(flexProject.getWorkspace(),
                    staticNSDef, "_info");           
        }
        else
        {
            NamespaceDefinition.IPrivateNamespaceDefinition privateNSDef = NamespaceDefinition.createPrivateNamespaceDefinition("");
            infoSlotReference = ReferenceFactory.resolvedQualifierQualifiedReference(flexProject.getWorkspace(),
                    privateNSDef, "info");
        }
        Name infoSlotName = infoSlotReference.getMName();

        InstructionList info = new InstructionList();
        info.addInstruction(ABCConstants.OP_getlocal0);
        info.addInstruction(ABCConstants.OP_getproperty, infoSlotName);
        info.addInstruction(ABCConstants.OP_dup);
View Full Code Here

    {
        ISWCManager swcManager = flexProject.getWorkspace().getSWCManager();
       
        info.addInstruction(ABCConstants.OP_pushstring, entryLabel);
       
        IResolvedQualifiersReference mxCoreRSLDataReference =
            ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(), IMXMLTypeConstants.RSLData);
        Name mxCoreRSLDataSlotName = mxCoreRSLDataReference.getMName();
        Object[] mxCoreRSLDataCtor = new Object[] { mxCoreRSLDataSlotName, 7 };
       
        // Add an RSLData instance to an array for the primary RSL in RSLSettings
        // plus one for every failover RSL.
        for (RSLSettings rslSettings : rslSettingsList)
View Full Code Here

           
            String accessibilityClass = md.getAttributeValue(IMetaAttributeConstants.NAME_ACCESSIBILITY_IMPLEMENTATION);
            if (accessibilityClass == null)
                continue;
           
            IResolvedQualifiersReference ref = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                    accessibilityClass);
            assert ref != null;

            // Collect a list of classes to add to the info structure.
            accessibleClassNames.add(accessibilityClass);
           
            IDefinition accessibilityClassDefinition = ref.resolve(flexProject);
            if ((accessibilityClassDefinition != null) && (!accessibilityClassDefinition.isImplicit()))
            {
                ICompilationUnit cu = flexProject.getScope().getCompilationUnitForDefinition(accessibilityClassDefinition);
                assert cu != null : "Unable to find compilation unit for definition!";
                accessibleCompilationUnits.add(cu);
View Full Code Here

            return false;
       
        // Find the SWC that contains Object.
        if (pathContainingObject == null)
        {
            IResolvedQualifiersReference objectReference = ReferenceFactory.packageQualifiedReference(
                    project.getWorkspace(),
                    IASLanguageConstants.Object);
            Set<ICompilationUnit> units = project.getScope().
                    getCompilationUnitsForReferences(Collections.singletonList(objectReference));
            assert units.size() == 1;
View Full Code Here

TOP

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

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.