Exemple #1
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);
        }
Exemple #2
0
        internal static Complex Thaw(ThawBuffer tb)
        {
            // NOTE this deferral only works because we don't call ObjRef
            Complex r = new Complex(tb.Double(), tb.Double());

            tb.Register(r);
            return(r);
        }
Exemple #3
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);
        }
Exemple #4
0
 internal static AltInfo Thaw(ThawBuffer tb)
 {
     var n = new AltInfo();
     tb.Register(n);
     n.labels = tb.Ints();
     n.prefixes = tb.RefsA<LAD>();
     n.dba = tb.String();
     return n;
 }
Exemple #5
0
        internal static FatRat Thaw(ThawBuffer tb)
        {
            FatRat r = new FatRat();

            tb.Register(r);
            r.num = (BigInteger)tb.ObjRef();
            r.den = (BigInteger)tb.ObjRef();
            return(r);
        }
Exemple #6
0
        internal static Rat Thaw(ThawBuffer tb)
        {
            Rat r = new Rat();

            tb.Register(r);
            r.num = (BigInteger)tb.ObjRef();
            r.den = (ulong)tb.Long();
            return(r);
        }
Exemple #7
0
        internal static VarHash Thaw(ThawBuffer tb)
        {
            VarHash r = new VarHash();

            tb.Register(r);
            int c = tb.Int();

            for (int i = 0; i < c; i++)
            {
                r[tb.String()] = (Variable)tb.ObjRef();
            }
            return(r);
        }
Exemple #8
0
        internal static VarDeque Thaw(ThawBuffer tb)
        {
            VarDeque r = new VarDeque();

            tb.Register(r);
            int c = tb.Int();

            for (int i = 0; i < c; i++)
            {
                r.Push((Variable)tb.ObjRef());
            }
            return(r);
        }
Exemple #9
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.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);
        }
Exemple #10
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);
        }
Exemple #11
0
 internal static object Thaw(ThawBuffer tb)
 {
     var n = new LADAny();
     tb.Register(n);
     n.zyg = tb.RefsA<LAD>();
     return n;
 }
Exemple #12
0
 internal static object Thaw(ThawBuffer tb)
 {
     return tb.Register(new CC(tb.Ints()));
 }
Exemple #13
0
 internal static LADStrNoCase Thaw(ThawBuffer tb)
 {
     LADStrNoCase n = new LADStrNoCase();
     tb.Register(n);
     n.text = tb.String();
     return n;
 }
Exemple #14
0
 internal static LADStr Thaw(ThawBuffer tb)
 {
     LADStr n = new LADStr(null);
     tb.Register(n);
     n.text = tb.String();
     return n;
 }
Exemple #15
0
 internal static object Thaw(ThawBuffer tb)
 {
     var n = new LADSequence();
     tb.Register(n);
     n.args = tb.RefsA<LAD>();
     return n;
 }
Exemple #16
0
 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;
 }
Exemple #17
0
 internal static LADCC Thaw(ThawBuffer tb)
 {
     LADCC n = new LADCC();
     tb.Register(n);
     n.cc = (CC) tb.ObjRef();
     return n;
 }
Exemple #18
0
 internal static LADMethod Thaw(ThawBuffer tb)
 {
     LADMethod n = new LADMethod();
     tb.Register(n);
     n.name = tb.String();
     return n;
 }
Exemple #19
0
 internal static LADParam Thaw(ThawBuffer tb)
 {
     LADParam n = new LADParam();
     tb.Register(n);
     n.name = tb.String();
     return n;
 }