Package macromedia.asc.semantics

Examples of macromedia.asc.semantics.Slot


    }

    private static Method getGetter(Context cx, AbcClass watchedClass, ReferenceValue ref, MultiName multiName)
    {
        Method meth = null;
        Slot s;
        // if ref.slot is non-null then the reference has already been resolved.
        if( ref != null )
        {
            meth = getMethodFromRef(cx, watchedClass, ref, Tokens.GET_TOKEN);
        }
View Full Code Here


            kind = Tokens.GET_TOKEN;
        }

        if( ref.slot != null && ref.getKind() == kind)
        {
            Slot s = ref.getSlot(cx, orig_kind);

            if( s instanceof MethodSlot )
            {
                // If we want a getter, make sure the slot is a real getter
                if( (orig_kind==Tokens.GET_TOKEN) == s.isGetter() )
                    meth = new flex2.compiler.as3.reflect.Method(s, ref.namespaces.at(0), ref.name);
            }
        }
        if (meth == null )
        {
View Full Code Here

            int referencingIndex = referencingTypeInfo.getSlotIndex(ascContext, kind, localPart, namespace);
            int referencedIndex = referencedTypeInfo.getSlotIndex(ascContext, kind, localPart, namespace);

            if (referencingIndex != referencedIndex)
            {
                Slot referencingSlot = referencingTypeInfo.getSlot(ascContext, referencingIndex);
                Slot referencedSlot = referencedTypeInfo.getSlot(ascContext, referencedIndex);

                // Types are stored in VariableSlot's as opposed to MethodSlot's.
                if ((referencingSlot instanceof VariableSlot) &&
                    (referencedSlot instanceof VariableSlot) &&
                    (referencingSlot.getValue() != referencedSlot.getValue()))
                {
                    result = true;
                }
            }
        }
View Full Code Here

                    ObjectValue namespace = ascContext.getNamespace(topLevelDefinition.getNamespace().intern());

                    if (frame.hasName(ascContext, Tokens.GET_TOKEN, name, namespace))
                    {
                        int slotId = frame.getSlotIndex(ascContext, Tokens.GET_TOKEN, name, namespace);
                        Slot slot = frame.getSlot(ascContext, slotId);

                        if (slot != null)
                        {
                            int implicitId = frame.getImplicitIndex(ascContext, slotId, Tokens.EMPTY_TOKEN);

                            if ((slotId != implicitId) && (slot instanceof VariableSlot))
                            {
                                Slot implicitSlot = frame.getSlot(ascContext, implicitId);
                                TypeValue typeValue = implicitSlot.getType().getTypeValue();
                                assert topLevelDefinition.toString().equals(typeValue.name.toString()) :
                                "topLevelDefinition = " + topLevelDefinition + ", typeValue = " + typeValue.name.toString();
                                perCompileData.userDefined.put(typeValue.name.toString(), typeValue);
                            }
                        }
View Full Code Here

                        List values = idn.interfaces.values;
                        baseClasses = new String[values.size()];
                        for (int i = 0; i < values.size(); i++)
                        {
                            ReferenceValue rv = (ReferenceValue)values.get(i);
                            Slot s = rv.getSlot(cx, Tokens.GET_TOKEN);
                            baseClasses[i] = (s == null || s.getDebugName().length() == 0) ? rv.name : s.getDebugName();
                        }
                    }
                    else
                    {
                        baseClasses = new String[] {"Object"};
                    }
                }
                else
                {
                    if (cd.baseref != null)
                    {
                        Slot s = cd.baseref.getSlot(cx, Tokens.GET_TOKEN);
                        baseClass = (s == null || s.getDebugName().length() == 0) ? "Object" : s.getDebugName();
                    }
                    else
                    {
                        baseClass = "Object";
                    }

                    if (cd.interfaces != null)
                    {
                        List values = cd.interfaces.values;
                        interfaces = new String[values.size()];
                        for (int i = 0; i < values.size(); i++)
                        {
                            ReferenceValue rv = (ReferenceValue)values.get(i);
                            Slot s = rv.getSlot(cx, Tokens.GET_TOKEN);
                            interfaces[i] = (s == null || s.getDebugName().length() == 0) ? rv.name : s.getDebugName();
                        }
                    }
                }

                AttributeListNode attrs = cd.attrs;
View Full Code Here

                {
                    isStatic = attrs.hasStatic;
                    hasUserNamespace  = attrs.hasUserNamespace();
                }
               
                Slot s = vb.ref.getSlot(cx);
                if (s != null)
                {
                    isConst = s.isConst();              
                }

                if (vb.initializer != null)
                {
                    if (vb.initializer instanceof LiteralNumberNode)
                    {
                        defaultValue = ((LiteralNumberNode)(vb.initializer)).value;
                    }
                    else if (vb.initializer instanceof LiteralStringNode)
                    {
                        defaultValue = DocCommentNode.escapeXml(((LiteralStringNode)(vb.initializer)).value);
                    }
                    else if (vb.initializer instanceof LiteralNullNode)
                    {
                        defaultValue = "null";
                    }
                    else if (vb.initializer instanceof LiteralBooleanNode)
                    {
                        defaultValue = (((LiteralBooleanNode)(vb.initializer)).value) ? "true" : "false";
                    }
                    else if (vb.initializer instanceof MemberExpressionNode)
                    {
                        MemberExpressionNode mb = (MemberExpressionNode)(vb.initializer);
                        Slot vs = null;
            if (mb.ref != null && mb.selector.isGetExpression())
            {
              vs = (mb.ref != null ? mb.ref.getSlot(cx, Tokens.GET_TOKEN) : null);
            }
            else
            {
              vs = vb.ref.getSlot(cx, Tokens.GET_TOKEN);
            }
                       
                        Value v = (vs != null ? vs.getValue() : null);
                        ObjectValue ov = ((v instanceof ObjectValue) ? (ObjectValue)(v) : null);
                        // if constant evaluator has determined this has a value, use it.
                        defaultValue = (ov != null) ? ov.getValue() : "unknown";
                    }
                    else
                    {
                        Slot vs = vb.ref.getSlot(cx, Tokens.GET_TOKEN);
                        Value v = (vs != null ? vs.getValue() : null);
                        ObjectValue ov = ((v instanceof ObjectValue) ? (ObjectValue)(v) : null);
                        // if constant evaluator has determined this has a value, use it.
                        defaultValue = (ov != null) ? ov.getValue() : "unknown";
                    }
                }
View Full Code Here

           
            // Helper method to print types in a way asdoc wants.
            // This is mostly for Vectors, which need to print as Vector$basetype.
            public String getRefName(Context cx, ReferenceValue ref)
            {
                Slot s = ref.getSlot(cx, Tokens.GET_TOKEN);
                if( s == null || s.getDebugName().length() == 0 )
                {
                    String name = ref.name;
                    if( ref.type_params != null && s != null && s.getValue() instanceof TypeValue)
                    {
                        // Vector
                        TypeValue t = (TypeValue)s.getValue();
                        name += getIndexedTypeName(cx, t.indexed_type);
                    }
                    return name;
                }
                else
                {
                    return s.getDebugName();
                }
            }
View Full Code Here

  public int ExplicitGet( Context cx, ObjectValue ob, String name, Namespaces namespaces, TypeValue type, boolean is_final, boolean is_override, int expected_id , int method_id , int var_id  )
  {
    int slot_id = ob.addMethodSlot(cx,type);
    CHECK_SLOT_INDEX(expected_id,slot_id);
    ob.defineNames(cx,GET_TOKEN,name,namespaces,slot_id);
    Slot slot = ob.getSlot(cx,slot_id);
    slot.attrs(CALL_ThisMethod,method_id);
    slot.setFinal(is_final);
    slot.setOverride(is_override);

    // do backend binding

    if(!Builder.removeBuilderNames)
    {
View Full Code Here

  public int ExplicitSet(Context cx, ObjectValue ob, String name, ObjectValue ns, TypeValue type, boolean is_final, boolean is_override, int expected_id, int method_id, int var_id)
  {
    int slot_id = ob.addMethodSlot(cx, type);
    CHECK_SLOT_INDEX(expected_id, slot_id);
    ob.defineName(cx, SET_TOKEN, name, ns, slot_id);
    Slot slot = ob.getSlot(cx,slot_id);
    slot.attrs(CALL_ThisMethod,method_id);
    slot.setFinal(is_final);
    slot.setOverride(is_override);

    if(!Builder.removeBuilderNames)
    {
      if( method_id >= 0 )
      {
View Full Code Here

  public int ExplicitSet( Context cx, ObjectValue ob, String name, Namespaces namespaces, TypeValue type, boolean is_final, boolean is_override, int expected_id, int method_id , int var_id )
  {
    int slot_id = ob.addMethodSlot(cx,type);
    CHECK_SLOT_INDEX(expected_id,slot_id);
    ob.defineNames(cx,SET_TOKEN,name,namespaces,slot_id);
    Slot slot = ob.getSlot(cx,slot_id);
    slot.attrs(CALL_ThisMethod,method_id);
    slot.setFinal(is_final);
    slot.setOverride(is_override);

    // do backend binding

    if(!Builder.removeBuilderNames)
    {
View Full Code Here

TOP

Related Classes of macromedia.asc.semantics.Slot

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.