Inheritance: CType
Exemple #1
0
        private string Decorate(string var, out CTerm core)
        {
            Decorator decorator = new Decorator(var);

            UnwrapTo(decorator, out core);
            return(decorator.Result);
        }
Exemple #2
0
 public void UnwrapTo(IWrapVisitor visitor, out CTerm core)
 {
     CType t = this;
     CWrap w;
     while ((w = t as CWrap) != null)
     {
         w.Accept(visitor);
         visitor.AfterVisit(w);
         t = w.Next;
     }
     core = (CTerm)t;
 }
Exemple #3
0
        public void UnwrapTo(IWrapVisitor visitor, out CTerm core)
        {
            CType t = this;
            CWrap w;

            while ((w = t as CWrap) != null)
            {
                w.Accept(visitor);
                visitor.AfterVisit(w);
                t = w.Next;
            }
            core = (CTerm)t;
        }
Exemple #4
0
 private CTerm StripTypeAttr(CTerm core, out string attr)
 {
     CTerm inner;
     if (core is CAttrTerm)
     {
         CAttrTerm attrTerm = (CAttrTerm)core;
         inner = attrTerm.CoreType;
         attr = attrTerm.AttrStr;
     }
     else
     {
         inner = core;
         attr = "";
     }
     return inner;
 }
Exemple #5
0
 private string EncodeBaseType(CTerm type)
 {
     if (type is CPrim)
     {
         return "." + EncodePrim((CPrim)type);
     }
     else if (type is CTypeRef)
     {
         return "$" + ((CTypeRef)type).Name;
     }
     else
     {
         return "#" + AddUnnamed((CBrace)type);
     }
 }
Exemple #6
0
 private string Decorate(string var, out CTerm core)
 {
     Decorator decorator = new Decorator(var);
     UnwrapTo(decorator, out core);
     return decorator.Result;
 }
Exemple #7
0
        private CTerm WithAttr(CTerm type, IDiaSymbol sym)
        {
            SortedSet<TypeAttr> attrs = new SortedSet<TypeAttr>();
            if (sym.constType == 1) { attrs.Add(TypeAttrs.Const); }
            if (sym.volatileType == 1) { attrs.Add(TypeAttrs.Volatile); }
            if (sym.unalignedType == 1) { attrs.Add(TypeAttrs.Unaligned); }

            return attrs.Any() ? new CAttrTerm(type, attrs) : type;
        }
Exemple #8
0
 public CAttrTerm(CTerm type, SortedSet<TypeAttr> attrs)
 {
     _type = type;
     _attrs = attrs;
 }
Exemple #9
0
 public CAttrTerm(CTerm type, SortedSet <TypeAttr> attrs)
 {
     _type  = type;
     _attrs = attrs;
 }
Exemple #10
0
 // TODO: how about make a class CInt
 public CBits(CTerm baseType, int len)
     : base(baseType)
 {
     _len = len;
 }
Exemple #11
0
 // TODO: how about make a class CInt
 public CBits(CTerm baseType, int len)
     : base(baseType)
 {
     _len = len;
 }