Exemplo n.º 1
0
                public FieldRef (TypeRef owner, BaseTypeRef ret_type, string name)
                {
                        this.owner = owner;
                        this.ret_type = ret_type;
                        this.name = name;
			
			is_resolved = false;
                }
Exemplo n.º 2
0
		public MethodDefinedEventArgs (string signature, string name, 
			TypeRef return_type, Param[] param_list, bool is_in_table, MethAttr method_attr, 
			ImplAttr impl_attr, CallConv call_conv) : base (signature, name, 
			return_type, param_list, is_in_table)
		{
			MethodAttributes = method_attr;
			ImplAttributes = impl_attr;
			CallConv = call_conv;
		}
Exemplo n.º 3
0
		public MethodEventArgs (string signature, string name,
			TypeRef return_type, Param[] param_list, bool is_in_table) 
		{
			Signature = signature;
			Name = name;
			ReturnType = return_type;
			ParamList = param_list;
			IsInTable = is_in_table;
		}
Exemplo n.º 4
0
		public Field GetReference (TypeRef type, string name, Location location)
		{
			FieldTableItem item = table[name] as FieldTableItem;
			
			if (item != null) {
				item.LocationList.Add (location);
				return item.Field;
			}
			
			FieldDef field = parent_class.AddField (name, type.Type);
			AddReferenced (name, field, location);

			return field;
		}
Exemplo n.º 5
0
		public FieldDef AddDefinition (FieldAttr field_attr, string name, 
			TypeRef type, Location location) 
		{
			FieldTableItem item = (FieldTableItem) table[name];
			
			if (item == null) {
				FieldDef field = parent_class.AddField (field_attr, name, type.Type);
				AddDefined (name, field, location);
				return field;
			}
			
			item.Field.AddFieldAttr (field_attr);
			item.Defined = true;
			
			return item.Field;
		}
Exemplo n.º 6
0
                public TypeRef GetTypeRef (string name)
                {
                        TypeRef tr = null;

                        if (typeref_table == null) 
                                typeref_table = new Hashtable ();
                        else 
                                tr = typeref_table [name] as TypeRef;

                        if (tr == null) {
                                tr = new TypeRef (name, false, null);
                                typeref_table [name] = tr;
                        }

                        return tr;
                }
Exemplo n.º 7
0
		public MethodReferencedEventArgs (string signature, string name, 
			TypeRef return_type, Param[] param_list, bool is_in_table) : base (signature, name, 
			return_type, param_list, is_in_table)
		{

		}
Exemplo n.º 8
0
		protected string GetSignature (string name, TypeRef return_type, 
			TypeRef[] param_list)
		{
			StringBuilder builder = new StringBuilder ();
			
			builder.Append (return_type.FullName);
			builder.Append ('_');
			builder.Append (name);
			builder.Append ('(');
			
			bool first = true;
			foreach (TypeRef type_ref in param_list) {
				if (!first)
					builder.Append (',');
				builder.Append (type_ref.FullName);
			}
			builder.Append (')');

			return builder.ToString ();
		}
Exemplo n.º 9
0
		public MethodDef AddDefinition (MethAttr method_attr, ImplAttr impl_attr, CallConv call_conv, 
			string name, TypeRef return_type, Param[] param_list, 
			TypeRef[] param_type_list, Location location) 
		{
			string signature = GetSignature (name, return_type, param_type_list);

			if (MethodDefinedEvent != null)
				MethodDefinedEvent (this, new MethodDefinedEventArgs (signature, name,
					return_type, param_list, table.Contains (signature), method_attr, 
					impl_attr, call_conv));

			MethodTableItem item = (MethodTableItem) table[signature];
			
			if (item == null) {
				MethodDef method = parent_class.AddMethod (method_attr, impl_attr, name, 
					return_type.Type, param_list);
				method.AddCallConv (call_conv);
				AddDefined (signature, method, location);
				return method;
			}
			
			item.Method.AddMethAttribute (method_attr);
			item.Method.AddImplAttribute (impl_attr);
			item.Method.AddCallConv (call_conv);
			item.Defined = true;
		
			return item.Method;
		}
Exemplo n.º 10
0
		public Method GetReference (string name, TypeRef return_type, 
			Param[] param_list, TypeRef[] param_type_list, Location location)
		{
			string signature = GetSignature (name, return_type, param_type_list);

			if (MethodReferencedEvent != null)
				MethodReferencedEvent (this, new MethodReferencedEventArgs (signature, name,
					return_type, param_list, table.Contains (signature)));

			MethodTableItem item = table[signature] as MethodTableItem;
			
			if (item != null) {
				item.LocationList.Add (location);
				return item.Method;
			}
			
			MethodDef method = parent_class.AddMethod (name, return_type.Type,
				param_list);
			
			AddReferenced (signature, method, location);

			return method;
		}
Exemplo n.º 11
0
 public MethodRef (TypeRef owner, PEAPI.CallConv call_conv,
         BaseTypeRef ret_type, string name, BaseTypeRef[] param, int gen_param_count)
         : base (owner, call_conv, ret_type, name, param, gen_param_count)
 {
 }
Exemplo n.º 12
0
 public MethodRef(TypeRef owner, PEAPI.CallConv call_conv,
                  BaseTypeRef ret_type, string name, BaseTypeRef[] param, int gen_param_count)
     : base(owner, call_conv, ret_type, name, param, gen_param_count)
 {
 }