FAttrs is meta-data for a FType of FSlot - we only decode what we understand and ignore anything else.
Esempio n. 1
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;
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        //
        //  if (attrs == null) return;
        //  for (int i=0; i<attrs.Length; ++i)
        //    attr(attrs[i]);
        //}

        public void attr(FAttrs attr)
        {
            /*
             * string name = name(attr.name);
             * if (name.equals(LineNumbersAttr) && !showLines) return;
             * println("    [" + name + "] len=" + attr.data.len);
             * if (name.equals(SourceFileAttr))  sourceFile(attr);
             * if (name.equals(ErrTableAttr))    errTable(attr);
             * if (name.equals(LineNumbersAttr)) lineNumbers(attr);
             * if (name.equals(FacetsAttr))      facets(attr);
             */
        }
Esempio n. 4
0
 //
 //  if (attrs == null) return;
 //  for (int i=0; i<attrs.Length; ++i)
 //    attr(attrs[i]);
 //}
 public void attr(FAttrs attr)
 {
     /*
       string name = name(attr.name);
       if (name.equals(LineNumbersAttr) && !showLines) return;
       println("    [" + name + "] len=" + attr.data.len);
       if (name.equals(SourceFileAttr))  sourceFile(attr);
       if (name.equals(ErrTableAttr))    errTable(attr);
       if (name.equals(LineNumbersAttr)) lineNumbers(attr);
       if (name.equals(FacetsAttr))      facets(attr);
       */
 }
Esempio n. 5
0
 public static Facets mapFacets(Pod pod, FAttrs.FFacet[] ffacets)
 {
     if (ffacets == null || ffacets.Length == 0) return empty();
       Hashtable map = new Hashtable();
       for (int i=0; i<ffacets.Length; ++i)
       {
     FAttrs.FFacet ff = ffacets[i];
     Type t = pod.findType(ff.type);
     map[t] = ff.val;
       }
       return new Facets(map);
 }
Esempio n. 6
0
File: FType.cs Progetto: nomit007/f4
        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();
        }
Esempio n. 7
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();
        }
Esempio n. 8
0
File: FSlot.cs Progetto: nomit007/f4
 protected void readAttrs(FStore.Input input)
 {
     m_attrs = FAttrs.read(input);
 }
Esempio n. 9
0
        //////////////////////////////////////////////////////////////////////////
        // Facets
        //////////////////////////////////////////////////////////////////////////

        public void attrs(FAttrs attrs)
        {
        }
Esempio n. 10
0
 /// <summary>
 /// Emit a attribute.
 /// </summary>
 private void emitAttributes(FAttrs attrs)
 {
     //if (attrs.sourceFile != null)
       //{
       //  AttrEmit attr = emitAttr("SourceFile");
       //  attr.info.u2(utf(attrs.sourceFile));
       //}
 }
Esempio n. 11
0
 protected void readAttrs(FStore.Input input)
 {
     m_attrs = FAttrs.read(input);
 }
Esempio n. 12
0
 //////////////////////////////////////////////////////////////////////////
 // Facets
 //////////////////////////////////////////////////////////////////////////
 public void attrs(FAttrs attrs)
 {
 }