Beispiel #1
0
        public virtual bool VisitCILType(CILType type, TypeQualifiers quals)
        {
            if (!VisitType(type, quals))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        public virtual string VisitCILType(CILType type, TypeQualifiers quals)
        {
            if (type.Type == typeof(string))
            {
                return(quals.IsConst ? "const char*" : "char*");
            }

            throw new NotImplementedException(string.Format("Unhandled .NET type: {0}", type.Type));
        }
Beispiel #3
0
        public virtual string VisitCILType(CILType type, TypeQualifiers quals)
        {
            if (type.Type == typeof(string))
            {
                return(quals.IsConst ? "const char*" : "char*");
            }

            switch (System.Type.GetTypeCode(type.Type))
            {
            case TypeCode.Boolean:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Bool), quals));

            case TypeCode.Char:
            case TypeCode.SByte:
            case TypeCode.Byte:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Char), quals));

            case TypeCode.Int16:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Short), quals));

            case TypeCode.UInt16:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.UShort), quals));

            case TypeCode.Int32:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Int), quals));

            case TypeCode.UInt32:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.UInt), quals));

            case TypeCode.Int64:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Long), quals));

            case TypeCode.UInt64:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.ULong), quals));

            case TypeCode.Single:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Float), quals));

            case TypeCode.Double:
                return(VisitBuiltinType(new BuiltinType(PrimitiveType.Double), quals));

            case TypeCode.String:
                return(quals.IsConst ? "const char*" : "char*");
            }

            return("void*");
        }
Beispiel #4
0
 public CILType(CILType type)
     : base(type)
 {
     Type = type.Type;
 }