// // Mono.ILASM.PeapiTypeRef // // Author(s): // Jackson Harper (Jackson@LatitudeGeo.com) // // (C) 2003 Jackson Harper, All rights reserved // using System; using System.Collections; namespace Mono.ILASM { public class PeapiTypeRef { private PEAPI.Type peapi_type; private string full_name; private bool is_pinned; private bool is_array; private bool is_ref; private bool use_type_spec; public PeapiTypeRef (PEAPI.Type peapi_type, string full_name) { this.peapi_type = peapi_type; this.full_name = full_name; is_pinned = false; is_array = false; is_ref = false; use_type_spec = false; } public string FullName { get { return full_name; } } public bool IsPinned { get { return is_pinned; } } public bool IsArray { get { return is_array; } } public bool IsRef { get { return is_ref; } } public bool UseTypeSpec { get { return use_type_spec; } } public PEAPI.Type PeapiType { get { return peapi_type; } } public void MakeArray () { use_type_spec = true; if (peapi_type is PEAPI.Class) { PEAPI.Class klass = (PEAPI.Class) peapi_type; peapi_type = klass.GetZeroBasedArray (); } else { peapi_type = new PEAPI.ZeroBasedArray (peapi_type); } full_name += "[]"; is_array = true; } public void MakeBoundArray (ArrayList bound_list) { use_type_spec = true; int dimen = bound_list.Count; int[] lower_array = new int[dimen]; int[] size_array = new int[dimen]; bool lower_set = false; bool size_set = false; bool prev_lower_set = true; bool prev_size_set = true; // TODO: There should probably be an error reported if // something like [3...,3...5] is done for (int i=0; i