public static ExprType GetType(ExprType from_type, Int32 to_index) {
switch (from_type.Kind) {
case ExprTypeKind.ARRAY:
return ((ArrayType)from_type).ElemType;
case ExprTypeKind.INCOMPLETE_ARRAY:
return ((IncompleteArrayType)from_type).ElemType;
case ExprTypeKind.STRUCT_OR_UNION:
return ((StructOrUnionType)from_type).Attribs[to_index].type;
default:
throw new InvalidProgramException("Not an aggregate Type.");
}
}