u2() public method

public u2 ( ) : int
return int
Exemplo n.º 1
0
 public override FTable read(FStore.Input input)
 {
     if (input == null)
     {
         m_size = 0; return(this);
     }
     m_size  = input.u2();
     m_table = new object[m_size];
     for (int i = 0; i < m_size; i++)
     {
         int   parent = input.u2();
         int   name   = input.u2();
         int   ret    = input.u2();
         int   paramn = input.u1();
         int[] x      = new int[3 + paramn];
         x[0] = parent;
         x[1] = name;
         x[2] = ret;
         for (int j = 0; j < paramn; ++j)
         {
             x[j + 3] = input.u2();
         }
         m_table[i] = new FTuple(x);
     }
     return(this);
 }
Exemplo n.º 2
0
        //////////////////////////////////////////////////////////////////////////
        // IO
        //////////////////////////////////////////////////////////////////////////

        public static FTypeRef read(FStore.Input input)
        {
            FPod   fpod     = input.fpod;
            string podName  = fpod.name(input.u2());
            string typeName = fpod.name(input.u2());
            string sig      = input.utf(); // full sig if parameterized, "?" if nullable, or ""

            return(new FTypeRef(podName, typeName, sig));
        }
Exemplo n.º 3
0
        //////////////////////////////////////////////////////////////////////////
        // Read
        //////////////////////////////////////////////////////////////////////////

        public static FAttrs read(FStore.Input input)
        {
            int n = input.u2();

            if (n == 0)
            {
                return(none);
            }
            FAttrs attrs = new FAttrs();

            for (int i = 0; i < n; ++i)
            {
                string name = input.name();

                switch (name[0])
                {
                case 'E':
                    if (name == FConst.ErrTableAttr)
                    {
                        attrs.errTable(input); continue;
                    }
                    break;

                case 'F':
                    if (name == FConst.FacetsAttr)
                    {
                        attrs.facets(input); continue;
                    }
                    break;

                case 'L':
                    if (name == FConst.LineNumberAttr)
                    {
                        attrs.lineNumber(input); continue;
                    }
                    if (name == FConst.LineNumbersAttr)
                    {
                        attrs.lineNumbers(input); continue;
                    }
                    break;

                case 'S':
                    if (name == FConst.SourceFileAttr)
                    {
                        attrs.sourceFile(input); continue;
                    }
                    break;
                }
                int skip = input.u2();
                if (input.skip(skip) != skip)
                {
                    throw new System.IO.IOException("Can't skip over attr " + name);
                }
            }
            return(attrs);
        }
Exemplo n.º 4
0
        //////////////////////////////////////////////////////////////////////////
        // Meta IO
        //////////////////////////////////////////////////////////////////////////

        public FType readMeta(FStore.Input input)
        {
            m_self   = input.u2();
            m_base   = input.u2();
            m_mixins = new int[input.u2()];
            for (int i = 0; i < m_mixins.Length; i++)
            {
                m_mixins[i] = input.u2();
            }
            m_flags = input.u4();
            return(this);
        }
Exemplo n.º 5
0
        private void facets(FStore.Input input)
        {
            input.u2();
            int n = input.u2();

            m_facets = new FFacet[n];
            for (int i = 0; i < n; ++i)
            {
                FFacet f = m_facets[i] = new FFacet();
                f.type = input.u2();
                f.val  = input.utf();
            }
        }
Exemplo n.º 6
0
 public override FTable read(FStore.Input input)
 {
     if (input == null)
     {
         m_size = 0; return(this);
     }
     m_size  = input.u2();
     m_table = new object[m_size];
     for (int i = 0; i < m_size; i++)
     {
         int[] x = { input.u2(), input.u2(), input.u2() };
         m_table[i] = new FTuple(x);
     }
     return(this);
 }
Exemplo n.º 7
0
 public FField read(FStore.Input input)
 {
     base.readCommon(input);
     m_type = input.u2();
     base.readAttrs(input);
     return(this);
 }
Exemplo n.º 8
0
 public FMethod read(FStore.Input input)
 {
     base.readCommon(input);
     m_ret          = input.u2();
     m_inheritedRet = input.u2();
     m_maxStack     = input.u1();
     m_paramCount   = input.u1();
     m_localCount   = input.u1();
     m_vars         = new FMethodVar[m_paramCount + m_localCount];
     for (int i = 0; i < m_vars.Length; i++)
     {
         m_vars[i] = new FMethodVar().read(input);
     }
     m_code = FBuf.read(input);
     base.readAttrs(input);
     return(this);
 }
Exemplo n.º 9
0
 private void readTypeMeta(FStore.Input input)
 {
     m_types = new FType[input.u2()];
     for (int i = 0; i < m_types.Length; i++)
     {
         m_types[i]          = new FType(this).readMeta(input);
         m_types[i].m_hollow = true;
     }
     input.Close();
 }
Exemplo n.º 10
0
        //////////////////////////////////////////////////////////////////////////
        // IO
        //////////////////////////////////////////////////////////////////////////

        public FMethodVar read(FStore.Input input)
        {
            name  = input.name();
            type  = input.u2();
            flags = input.u1();

            int attrCount = input.u2();

            for (int i = 0; i < attrCount; ++i)
            {
                string attrName = input.fpod.name(input.u2());
                FBuf   attrBuf  = FBuf.read(input);
                if (attrName == FConst.ParamDefaultAttr)
                {
                    def = attrBuf;
                }
            }
            return(this);
        }
Exemplo n.º 11
0
 public override FTable read(FStore.Input input)
 {
     if (input == null)
     {
         m_size = 0; return(this);
     }
     m_size  = input.u2();
     m_table = new object[m_size];
     for (int i = 0; i < m_size; i++)
     {
         m_table[i] = FanDecimal.fromStr(input.utf(), true);
     }
     return(this);
 }
Exemplo n.º 12
0
 public override FTable read(FStore.Input input)
 {
     if (input == null)
     {
         m_size = 0; return(this);
     }
     m_size  = input.u2();
     m_table = new object[m_size];
     for (int i = 0; i < m_size; i++)
     {
         m_table[i] = Duration.make(input.u8());
     }
     return(this);
 }
Exemplo n.º 13
0
 public override FTable read(FStore.Input input)
 {
     if (input == null)
     {
         m_size = 0; return(this);
     }
     m_size  = input.u2();
     m_table = new object[m_size];
     for (int i = 0; i < m_size; i++)
     {
         m_table[i] = String.Intern(input.utf());
     }
     return(this);
 }
Exemplo n.º 14
0
        public void read(FStore.Input input)
        {
            if (input.fpod.m_fcodeVersion == null)
            {
                throw new IOException("FStore.Input.version == null");
            }

            m_fields = new FField[input.u2()];
            for (int i = 0; i < m_fields.Length; i++)
            {
                m_fields[i] = new FField().read(input);
            }

            m_methods = new FMethod[input.u2()];
            for (int i = 0; i < m_methods.Length; i++)
            {
                m_methods[i] = new FMethod().read(input);
            }

            m_attrs = FAttrs.read(input);

            m_hollow = false;
            input.Close();
        }
Exemplo n.º 15
0
        //////////////////////////////////////////////////////////////////////////
        // IO
        //////////////////////////////////////////////////////////////////////////

        public static FBuf read(FStore.Input input)
        {
            int len = input.u2();

            if (len == 0)
            {
                return(null);
            }

            byte[] buf = new byte[len];
            for (int r = 0; r < len;)
            {
                r += input.Read(buf, r, len - r);
            }
            return(new FBuf(buf, len));
        }
Exemplo n.º 16
0
 private void lineNumber(FStore.Input input)
 {
     input.u2();
     m_lineNum = input.u2();
 }
Exemplo n.º 17
0
 private void sourceFile(FStore.Input input)
 {
     input.u2();
     m_sourceFile = input.utf();
 }