public static CIL_Type DefineType(string name, string parent = null, IEnumerable <CIL_Attribute> attributes = null, IEnumerable <CIL_FunctionDeclaration> funtion = null) { var cilType = new CIL_Type(name, _tag++, attributes, funtion); typeMapper[cilType.Name] = cilType.Id; _inheritanceTree.Insert(cilType.Id, parent is null ? -1 : typeMapper[parent]); return(cilType); }
public static void AddType(CIL_Type type) { _data.Add(new DataHolder($"{type.Name}", type.Name)); _types.Add(type); }