Package macromedia.asc.semantics

Examples of macromedia.asc.semantics.QName


    private TypeValue getTypeFromQName(int typeID)
    {
        if( typeID == 0 )
            return ctx.noType();

        QName typename = getFullName(getBinaryMNFromCPool(typeID));

        if( ctx.isBuiltin(typename.toString()) )
            return ctx.builtin( typename.toString() );

        TypeValue type = TypeValue.getTypeValue(ctx, typename);
        if( !type.resolved )
            ce_unresolved_sets.last().add(new ReferenceValue(ctx, null, typename.name, typename.ns));
View Full Code Here


    }

    private MemberExpressionNode memberExprFromMN(AbcData.BinaryMN mn)
    {
        MemberExpressionNode typeExpr = null;
        QName typeName = getFullName(mn);
        NodeFactory nf = ctx.getNodeFactory();
       
        if( typeName instanceof ParameterizedName )
        {
            ParameterizedName pn = (ParameterizedName)typeName;
View Full Code Here

    private QName getFullName(AbcData.BinaryMN mn)
    {
        if( mn.kind == ActionBlockConstants.CONSTANT_TypeName )
        {
            AbcData.BinaryMN base = getBinaryMNFromCPool(mn.baseMN);
            QName base_qn = getFullName(base);
            ObjectList<QName> params = new ObjectList<QName>(mn.params.length);
           
            for( int i = 0; i < mn.params.length; ++i) {
                params.add(getFullName(getBinaryMNFromCPool(mn.params[i])));
            }
View Full Code Here

        // Instance info
        AbcData.InstanceInfo iinfo = this.abcData.getInstanceInfo(classID);

        AbcData.BinaryMN instanceMN = getBinaryMNFromCPool(iinfo.getInstanceNameID());
        QName fullName = getFullName(instanceMN);
        String fullNameString = fullName.toString();

        int superID = iinfo.getSuperID();
        boolean hasSuper = superID != 0;
        QName superName = null;
        String simpleSuperName ="";
        ObjectValue superNamespace = null;
        if( hasSuper )
        {
            AbcData.BinaryMN superMN = getBinaryMNFromCPool(superID);
           
            assert (superMN.nsIsSet != true):"expected a single namespace";
           
            superNamespace = getNamespace(superMN.nsID);
            superName = getFullName(superMN);
            simpleSuperName = getStringFromCPool(superMN.nameID);
        }

        int flags = iinfo.getFlags();

        int[] interfaces = iinfo.getInterfaces();
        ListNode interface_nodes = null;
    if(debug&&interfaces.length>0) System.out.println("parsing " + interfaces);
        for( int i = 0; i < interfaces.length; ++i )
        {
            int int_index = interfaces[i];
            AbcData.BinaryMN intMN = getBinaryMNFromCPool(int_index);
      String simpleIntName = getStringFromCPool(intMN.nameID);
      Namespaces intNamespaces;
      if(intMN.nsIsSet)
        intNamespaces = getNamespaces(intMN.nsID);
      else {
        intNamespaces = new Namespaces(1);
        intNamespaces.add(getNamespace(intMN.nsID));
      }
   
            IdentifierNode ident = nf.identifier(simpleIntName);

            ident.ref = new ReferenceValue(ctx, null, simpleIntName, intNamespaces);
            GetExpressionNode getNode = nf.getExpression(ident);
            MemberExpressionNode interface_node = nf.memberExpression(null, getNode);
            interface_node.ref = ident.ref;
            interface_nodes = nf.list(interface_nodes, interface_node);
            interface_nodes.values.push_back(ident.ref);
        }

        boolean isFinal = (flags & ActionBlockConstants.CLASS_FLAG_final) != 0;
        boolean isDynamic = ( flags & ActionBlockConstants.CLASS_FLAG_sealed ) == 0;
        boolean isInterface = (flags & ActionBlockConstants.CLASS_FLAG_interface) != 0;
        ClassDefinitionNode cdn = null;
        IdentifierNode idNode = nf.identifier(className);
        idNode.ref = new ReferenceValue(ctx, null, idNode.name, ns);
       
        AttributeListNode attr = attributeList(isFinal, false, isDynamic, ns, current_scope.builder);
        StatementListNode stmtList = nf.statementList(null, (StatementListNode)null);
       
        if (isInterface)
        {
          cdn = nf.binaryInterfaceDefinition(ctx, attr, idNode, null, stmtList);
        }
        else
        {
          cdn = nf.binaryClassDefinition(ctx, attr, idNode, null, stmtList);
        }
        cdn.ref = idNode.ref;
        cdn.interfaces = interface_nodes;
        cdn.public_namespace = ctx.publicNamespace();
        cdn.protected_namespace = ctx.getNamespace(fullNameString, Context.NS_PROTECTED);
        cdn.static_protected_namespace = ctx.getNamespace(fullNameString, Context.NS_STATIC_PROTECTED);
        cdn.private_namespace = ctx.getNamespace(fullNameString, Context.NS_PRIVATE);
        cdn.default_namespace = ctx.getNamespace(fullName.ns.name, Context.NS_INTERNAL);

        boolean is_builtin = ctx.isBuiltin(fullNameString);
        TypeValue cframe;
        ObjectValue iframe;
        if( is_builtin )
        {
            cframe = ctx.builtin(fullNameString);
            iframe = cframe.prototype;
        }
        else
        {
          ClassBuilder cb = new ClassBuilder(fullName,cdn.protected_namespace,cdn.static_protected_namespace);
            cframe = TypeValue.defineTypeValue(ctx,cb,fullName,RuntimeConstants.TYPE_object);
           
            InstanceBuilder ib = new InstanceBuilder(fullName);
            ib.canEarlyBind = false;
            iframe = new ObjectValue(ctx,ib,cframe);
            cframe.prototype = iframe;
          
            cdn.debug_name = fullNameString;
            // Make sure the ClassBuilder and InstanceBuilders get cleaned up
            cdn.owns_cframe = true;
        }
        cdn.cframe = cframe;
        cdn.iframe = iframe;

        if( isInterface )
        {
            ((ClassBuilder)cframe.builder).is_interface = true;
        }
        cframe.builder.is_dynamic = iframe.builder.is_dynamic = isDynamic;
        cframe.builder.is_final = iframe.builder.is_final = isFinal;

        clsdefs_sets.last().add(cdn);

        if( hasSuper )
        {
            TypeValue superType;
            cdn.baseclass = nf.literalString(superName.toString(), -1);
            if( ctx.isBuiltin(superName.toString()) )
            {
                // Set the super type, this important for int/uint which derive from Number
                superType = ctx.builtin(superName.toString());
                cframe.baseclass = superType;
                cdn.baseref = new ReferenceValue(ctx, null, superName.toString(), ctx.publicNamespace());
            }
            else
            {
                //cdn.baseclass = nf.literalString(superName.toString(), -1);
                cdn.baseref = new ReferenceValue(ctx, null, simpleSuperName, superNamespace);
View Full Code Here

          d = slotTrait(name, ns, t.getSlotId(), t.getTypeName(), t.getValueIndex(), t.getValueKind(), t.isConstTrait(), build_ast);
                if( build_ast )
                    statements.items.add(d.def);

                if( prog != null )
                    prog.toplevelDefinitions.add(new QName(ns, name));

                break;
               
            case ActionBlockConstants.TRAIT_Method:
            case ActionBlockConstants.TRAIT_Getter:
            case ActionBlockConstants.TRAIT_Setter:
        d = methodTrait(name, ns, t.getDispId(), t.getMethodId(), t.getAttrs(), t.getTag(), build_ast);
        if( build_ast )
          statements.items.add(d.def);

                if( prog != null )
                    prog.toplevelDefinitions.add(new QName(ns, name));

                break;
               
            case ActionBlockConstants.TRAIT_Class:
        d = classTrait(name, ns, t.getSlotId(), t.getClassId(), buildASTForClasses);

                if( prog != null )
                    prog.toplevelDefinitions.add(new QName(ns, name));

                break;
               
            case ActionBlockConstants.TRAIT_Function: // currently unused
                break;
View Full Code Here

    }

    public Value evaluate(Context cx, ImportNode node)
    {
        String id = node.filespec.value;
        QName qname = new QName(cx.publicNamespace(), id);
        output("<ImportNode value=" + qname + "/>");
        return null;
    }
View Full Code Here

TOP

Related Classes of macromedia.asc.semantics.QName

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.