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); }
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); }
public VarAddr(CliPointerType type, int idx) : base(type) { this.idx = idx; }
public ParamAddr(CliPointerType type, string name) : base(type) { this.name = name; }