示例#1
0
文件: XmlMaker.cs 项目: YSheldon/cdef
        private XmlElement MakeFieldEntry(CType type, string name, Offset offset)
        {
            XmlElement result;

            if (type is CBits)
            {
                CBits bit = (CBits)type;
                result = MakeElem("bit-field");
                AddTypeBasicAttrs(result, bit.Next, false);
                AddNameAndOffsetAttrs(result, name, offset);
                AddAttr(result, "len", bit.Len);
            }
            else
            {
                result = MakeElem("field");
                AddTypeBasicAttrs(result, type, true);
                AddNameAndOffsetAttrs(result, name, offset);
            }
            return(result);
        }
示例#2
0
 public void VisitBits(CBits bits)
 {
     throw new InvalidOperationException();
 }