private string Decorate(string var, out CTerm core) { Decorator decorator = new Decorator(var); UnwrapTo(decorator, out core); return(decorator.Result); }
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; }
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; }
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); } }
private string Decorate(string var, out CTerm core) { Decorator decorator = new Decorator(var); UnwrapTo(decorator, out core); return decorator.Result; }
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; }
public CAttrTerm(CTerm type, SortedSet<TypeAttr> attrs) { _type = type; _attrs = attrs; }
public CAttrTerm(CTerm type, SortedSet <TypeAttr> attrs) { _type = type; _attrs = attrs; }
// TODO: how about make a class CInt public CBits(CTerm baseType, int len) : base(baseType) { _len = len; }