Package org.apache.flex.abc.semantics

Examples of org.apache.flex.abc.semantics.Name


            }
        }
       
        functionSemanticChecks(func);

        Name funcName = funcDef.getMName(classScope.getProject());
        Name bindableName = null;
        boolean wasOverride = false;
        if (isBindable)
        {
            // move function into bindable namespace
            bindableName = BindableHelper.getBackingPropertyName(funcName, "_" + this.classDefinition.getQualifiedName());
View Full Code Here



    ITraitVisitor declareVariable(VariableNode varNode, DefinitionBase varDef, boolean is_static, boolean is_const, Object initializer)
    {
        final ICompilerProject project = this.classScope.getProject();
        Name var_name = varDef.getMName(project);

        TypeDefinitionBase typeDef = varDef.resolveType(project);
        Name var_type = typeDef != null ? typeDef.getMName(project) : null;

        int trait_kind = is_const? TRAIT_Const: TRAIT_Var;

        LexicalScope ls = is_static? this.classStaticScope: this.classScope;
View Full Code Here

            result.addInstruction(OP_finddef, name);
        }
        else if (def.isStatic())
        {
            DefinitionBase staticContainingScope = (DefinitionBase)def.getContainingScope().getDefinition();
            Name containingScopeName = staticContainingScope.getMName(getProject());
            result.addInstruction(OP_finddef, containingScopeName);
            result.addInstruction(OP_getproperty, containingScopeName);
        }
        else if (((DefinitionBase)def).isTopLevelDefinition())
        {
View Full Code Here

                constructorInstructionList.addInstruction(ABCConstants.OP_newarray, resourceBundleCount);
                constructorInstructionList.addInstruction(ABCConstants.OP_constructsuper, 1);
                constructorInstructionList.addInstruction(ABCConstants.OP_returnvoid);
               
                ClassGeneratorHelper classGen = new ClassGeneratorHelper(flexProject, emitter,
                        new Name(qname),
                        (ClassDefinition)resourceModuleBaseRef.resolve(flexProject),
                        Collections.<Name> emptyList(),
                        constructorInstructionList);

                classGen.finishScript();
View Full Code Here

            emitter.visit(ABCConstants.VERSION_ABC_MAJOR_FP10, ABCConstants.VERSION_ABC_MINOR_FP10);
           

            final String generatedRootClassNameString = moduleFactoryInfo.generatedModuleFactoryClassName;

            Name generatedRootName = new Name(generatedRootClassNameString);
           
            // Generate code for the constructor:
            // public function ClassName()
            // {
            //    super();
View Full Code Here

            return currentScope.resolveName((IdentifierNode)iNode);
        }
        else if ( iNode instanceof ExpressionNodeBase )
        {
            ExpressionNodeBase expr = (ExpressionNodeBase) iNode;
            Name n = expr.getMName(currentScope.getProject());

            if ( n == null )
            {
                currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove member name: " + iNode.toString()));
                n = new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name);
            }

            return currentScope.getBinding(iNode, n, expr.resolve(currentScope.getProject()));
        }

        //else
            currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove to a dotted name: " + iNode.toString()));
            return new Binding(iNode, new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name), null);
    }
View Full Code Here

     this is an error, and a diagnostic will be emitted
     */
    Binding errorPackageName(IASNode iNode, String qualifiers, String base_name)
    {
        currentScope.addProblem(new PackageCannotBeUsedAsValueProblem(iNode, "'" + qualifiers + "." + base_name + "'"));
        return new Binding(iNode, new Name(qualifiers + "." + base_name), null);
    }
View Full Code Here

     @param accessType - one of Lenient or Strict.
     *  @param result - the instruction sequence to generate into.
     */
    void generateAccess(Binding binding, final boolean is_super, AccessType accessType, InstructionList result)
    {
        final Name name = binding.getName();
        assert (name != null) : "binding must have a name when calling generateAccess()";

        final IASNode node = binding.getNode();
        if ( name.isTypeName() )
        {
            // a type names node should always be a ITypedExpressionNode
            ITypedExpressionNode typeNode = (ITypedExpressionNode)node;
            IExpressionNode collectionNode = typeNode.getCollectionNode();
            IDefinition collectionDefinition = SemanticUtils.getDefinition(collectionNode, currentScope.getProject());
            Binding collectionBinding = currentScope.getBinding(collectionNode, name.getTypeNameBase(), collectionDefinition);
            generateAccess(collectionBinding, is_super, AccessType.Strict, result);

            IExpressionNode typeTypeNode = typeNode.getTypeNode();
            IDefinition typeDefinition = SemanticUtils.getDefinition(typeTypeNode, currentScope.getProject());
            Binding typeBinding = currentScope.getBinding(typeTypeNode, name.getTypeNameParameter(), typeDefinition);
            generateTypeNameParameter(typeBinding, result);

            result.addInstruction(OP_applytype, 1);
        }
        else
View Full Code Here

    public InstructionList reduce_functionObject(IASNode iNode, IASNode function_name, InstructionList plist, Binding return_binding, InstructionList function_body)
    {
        InstructionList result = createInstructionList(iNode);

        Binding nestedFunctionName = currentScope.resolveName((IdentifierNode)function_name);
        Name return_type;

        if ( return_binding != null )
            return_type = return_binding.getName();
        else
            return_type = null;
View Full Code Here

        if ( isNamespace(qualifier) )
        {
            result.addAll(runtime_member_selector);
            //  Extract the URI from the namespace and use it to construct a qualified name.
            NamespaceDefinition ns_def = (NamespaceDefinition)qualifier.getDefinition();
            Name qualified_name = new Name(CONSTANT_MultinameL, new Nsset(ns_def.resolveAETNamespace(currentScope.getProject())), null);
            result.addAll(rhs);
            result.addInstruction(OP_setproperty, qualified_name);
        }
        else
        {
            generateAccess(qualifier, result);
            //  Verifier insists on this.
            result.addInstruction(OP_coerce, namespaceType);
            result.addAll(runtime_member_selector);
            result.addAll(rhs);

            Binding value_temp = null;
            if ( need_value )
            {
                value_temp = currentScope.allocateTemp();
                result.addInstruction(OP_dup);
                result.addInstruction(value_temp.setlocal());
            }
            result.addInstruction(OP_setproperty, new Name(CONSTANT_RTQnameL, null, null));

            if ( need_value )
            {
                result.addInstruction(value_temp.getlocal());
                currentScope.releaseTemp(value_temp);
View Full Code Here

TOP

Related Classes of org.apache.flex.abc.semantics.Name

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.