Exemple #1
0
        public static CliType FromType(Type type)
        {
            CliType result;

            if (!typeMap.TryGetValue(type, out result))
            {
                if (type.IsValueType)
                {
                    result = new CliValueType(type);
                }
                else if (type.IsArray || type.IsPointer)
                {
                    result = new CliPointerType(type);
                }
                else
                {
                    throw new ArgumentException(String.Format("Unsupported type '{0}'.", type));
                }
            }
            return(result);
        }
Exemple #2
0
        public static CliType FromType(Type type)
        {
            CliType result;

            if (!typeMap.TryGetValue(type, out result))
            {
                var ti = type.GetTypeInfo();
                if (ti.IsValueType)
                {
                    result = new CliValueType(type);
                }
                else if (ti.IsArray || ti.IsPointer)
                {
                    result = new CliPointerType(type);
                }
                else
                {
                    throw new ArgumentException($"Unsupported type '{type}'.");
                }
            }
            return(result);
        }
Exemple #3
0
 public VarAddr(CliPointerType type, int idx) : base(type)
 {
     this.idx = idx;
 }
Exemple #4
0
 public ParamAddr(CliPointerType type, string name) : base(type)
 {
     this.name = name;
 }