コード例 #1
0
        internal static P6how Thaw(ThawBuffer tb)
        {
            P6how n = new P6how();

            tb.Register(n);
            n.stable = (STable)tb.ObjRef();
            int state = tb.Byte();

            n.isComposing = state >= 1;
            n.isComposed  = state >= 2;
            n.rtype       = tb.String();
            n.type        =
                n.rtype == "package" ? P6how.PACKAGE :
                n.rtype == "module" ? P6how.MODULE :
                n.rtype == "class" ? P6how.CLASS :
                n.rtype == "grammar" ? P6how.GRAMMAR :
                n.rtype == "role" ? P6how.ROLE :
                n.rtype == "prole" ? P6how.PARAMETRIZED_ROLE :
                n.rtype == "subset" ? P6how.SUBSET :
                n.rtype == "crole" ? P6how.CURRIED_ROLE :
                -1;
            n.roleFactory      = (P6any)tb.ObjRef();
            n.subsetWhereThunk = (P6any)tb.ObjRef();
            n.subsetFilter     = (Variable)tb.ObjRef();
            n.curriedArgs      = tb.RefsA <Variable>();
            n.rolePun          = tb.ObjRef();

            int mcount = tb.Int();

            while (mcount-- > 0)
            {
                MethodInfo mi = default(MethodInfo);
                mi.short_name = tb.String();
                mi.long_name  = tb.String();
                mi.impl       = (P6any)tb.ObjRef();
                mi.flags      = tb.Byte();
                n.lmethods.Add(mi);
            }

            int acount = tb.Int();

            while (acount-- > 0)
            {
                AttrInfo ai = default(AttrInfo);
                ai.name  = tb.String();
                ai.init  = (P6any)tb.ObjRef();
                ai.flags = tb.Byte();
                ai.type  = (STable)tb.ObjRef();
                n.local_attr.Add(ai);
            }

            n.superclasses        = tb.RefsL <STable>();
            n.local_roles         = tb.RefsL <STable>();
            n.role_typecheck_list = tb.RefsL <STable>();
            n.mro = tb.RefsA <STable>();
            tb.PushFixup(n);
            return(n);
        }
コード例 #2
0
ファイル: ObjModel.cs プロジェクト: ebassi/niecza
        internal static P6how Thaw(ThawBuffer tb)
        {
            P6how n = new P6how();

            tb.Register(n);
            n.stable = (STable)tb.ObjRef();
            int state = tb.Byte();

            n.isComposing      = state >= 1;
            n.isComposed       = state >= 2;
            n.rtype            = tb.String();
            n.isRole           = n.rtype == "role" || n.rtype == "prole";
            n.isSubset         = n.rtype == "subset";
            n.isPackage        = n.rtype == "package";
            n.roleFactory      = (P6any)tb.ObjRef();
            n.subsetWhereThunk = (P6any)tb.ObjRef();
            n.subsetFilter     = (Variable)tb.ObjRef();

            // local_does not yet used
            int mcount = tb.Int();

            while (mcount-- > 0)
            {
                MethodInfo mi = default(MethodInfo);
                mi.short_name = tb.String();
                mi.long_name  = tb.String();
                mi.impl       = (P6any)tb.ObjRef();
                mi.flags      = tb.Byte();
                n.lmethods.Add(mi);
            }

            int acount = tb.Int();

            while (acount-- > 0)
            {
                AttrInfo ai = default(AttrInfo);
                ai.name  = tb.String();
                ai.init  = (P6any)tb.ObjRef();
                ai.flags = tb.Byte();
                ai.type  = (STable)tb.ObjRef();
                n.local_attr.Add(ai);
            }

            n.superclasses = tb.RefsL <STable>();
            n.mro          = tb.RefsA <STable>();
            tb.PushFixup(n);
            return(n);
        }
コード例 #3
0
        internal static STable Thaw(ThawBuffer tb)
        {
            STable n = new STable();

            tb.Register(n);
            n.mo         = (P6how)tb.ObjRef();
            n.how        = (P6any)tb.ObjRef();
            n.who        = (P6any)tb.ObjRef();
            n.typeObject = (P6any)tb.ObjRef();
            n.initObject = (P6any)tb.ObjRef();
            n.typeVar    = (Variable)tb.ObjRef();
            n.initVar    = (Variable)tb.ObjRef();
            n.name       = tb.String();
            n.isSubset   = tb.Byte() != 0;
            string box_type = tb.String();

            n.box_type = box_type == null ? null : Type.GetType(box_type, true);
            n.all_slot = tb.Strings();

            if (n.all_slot != null)
            {
                foreach (string s in n.all_slot)
                {
                    n.slotMap[s] = n.nslots++;
                }
            }

            tb.PushRevalidate(n);
            return(n);
        }
コード例 #4
0
        internal static P6opaque Thaw(ThawBuffer tb)
        {
            int      k = tb.Byte();
            P6opaque o = FreezeBuffer.boxCreate[k]();

            tb.Register(o);
            o.mo = (STable)tb.ObjRef();
            int l = tb.Int();

            if (l > 0)
            {
                o.slots = new object[l];
                for (int i = 0; i < l; i++)
                {
                    o.slots[i] = tb.ObjRef();
                }
            }
            if (k != 0)
            {
                o.SetData(tb.ObjRef());
            }
            return(o);
        }
コード例 #5
0
ファイル: Cursor.cs プロジェクト: nbrown/niecza
 internal static object Thaw(ThawBuffer tb)
 {
     var n = new LADQuant();
     tb.Register(n);
     n.type = tb.Byte();
     n.z0 = (LAD) tb.ObjRef();
     if ((n.type & 8) != 0) n.z1 = (LAD) tb.ObjRef();
     return n;
 }