FAttrs is meta-data for a FType of FSlot - we only decode what we understand and ignore anything else.
示例#1
0
文件: FAttrs.cs 项目: nomit007/f4
        //////////////////////////////////////////////////////////////////////////
        // 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;
        }
示例#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);
        }
示例#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);
             */
        }
示例#4
0
文件: FPrinter.cs 项目: nomit007/f4
 //
 //  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);
       */
 }
示例#5
0
文件: Facets.cs 项目: nomit007/f4
 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);
 }
示例#6
0
文件: FType.cs 项目: 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();
        }
示例#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();
        }
示例#8
0
文件: FSlot.cs 项目: nomit007/f4
 protected void readAttrs(FStore.Input input)
 {
     m_attrs = FAttrs.read(input);
 }
示例#9
0
        //////////////////////////////////////////////////////////////////////////
        // Facets
        //////////////////////////////////////////////////////////////////////////

        public void attrs(FAttrs attrs)
        {
        }
示例#10
0
文件: FTypeEmit.cs 项目: nomit007/f4
 /// <summary>
 /// Emit a attribute.
 /// </summary>
 private void emitAttributes(FAttrs attrs)
 {
     //if (attrs.sourceFile != null)
       //{
       //  AttrEmit attr = emitAttr("SourceFile");
       //  attr.info.u2(utf(attrs.sourceFile));
       //}
 }
示例#11
0
文件: FSlot.cs 项目: syatanic/fantom
 protected void readAttrs(FStore.Input input)
 {
     m_attrs = FAttrs.read(input);
 }
示例#12
0
文件: FPrinter.cs 项目: nomit007/f4
 //////////////////////////////////////////////////////////////////////////
 // Facets
 //////////////////////////////////////////////////////////////////////////
 public void attrs(FAttrs attrs)
 {
 }