File: IMetaDataProvider.cs

package info (click to toggle)
mono 6.8.0.105%2Bdfsg-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,284,512 kB
  • sloc: cs: 11,172,132; xml: 2,850,069; ansic: 671,653; cpp: 122,091; perl: 59,366; javascript: 30,841; asm: 22,168; makefile: 20,093; sh: 15,020; python: 4,827; pascal: 925; sql: 859; sed: 16; php: 1
file content (171 lines) | stat: -rw-r--r-- 5,977 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// 
// IMetaDataProvider.cs
// 
// Authors:
// 	Alexander Chebaturkin (chebaturkin@gmail.com)
// 
// Copyright (C) 2011 Alexander Chebaturkin
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//  
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// 

using System.Collections.Generic;
using Mono.CodeContracts.Static.AST;
using Mono.CodeContracts.Static.AST.Visitors;
using Mono.CodeContracts.Static.DataStructures;

namespace Mono.CodeContracts.Static.Providers {
	interface IMetaDataProvider {
                TypeNode System_Single { get; }
                TypeNode System_Double { get; }
		TypeNode System_Int32 { get; }
		TypeNode System_String { get; }
		TypeNode System_Boolean { get; }
		TypeNode System_IntPtr { get; }
		TypeNode System_UIntPtr { get; }
		TypeNode System_Void { get; }
		TypeNode System_Array { get; }
		TypeNode System_Object { get; }
		TypeNode System_Int8 { get; }
		TypeNode System_Int64 { get; }
		TypeNode System_Int16 { get; }
		TypeNode System_UInt8 { get; }
		TypeNode System_UInt64 { get; }
		TypeNode System_UInt32 { get; }
		TypeNode System_UInt16 { get; }

		Result AccessMethodBody<Data, Result> (Method method, IMethodCodeConsumer<Data, Result> consumer, Data data);

		IEnumerable<Method> Methods (AssemblyNode assembly);
		IEnumerable<Property> Properties (TypeNode type);
		IEnumerable<Field> Fields (TypeNode type);
		IEnumerable<TypeNode> Interfaces (TypeNode type);
		IIndexable<Local> Locals (Method method);
		IIndexable<Parameter> Parameters (Method method);

		IEnumerable<Method> ImplementedMethods (Method method);
		IEnumerable<Method> OverridenAndImplementedMethods (Method method);

		Parameter This (Method method);

		string Name (Local local);
		string Name (Method method);
		string Name (Field field);
		string Name (TypeNode type);

		string FullName (Method method);
		string FullName (TypeNode type);

		TypeNode FieldType (Field field);
		TypeNode ParameterType (Parameter parameter);
		TypeNode LocalType (Local local);
		TypeNode ReturnType (Method method);
		TypeNode ManagedPointer (TypeNode type);
		TypeNode ElementType (TypeNode type);
		TypeNode ArrayType (TypeNode type, int rank);


		TypeNode DeclaringType (Method method);
		TypeNode DeclaringType (Field field);

		bool Equal (Method thisMethod, Method thatMethod);

		bool IsMain (Method method);

		bool IsStatic (Method method);
		bool IsStatic (Field field);
		bool IsStatic (Property property);

		bool IsPrivate (Method method);

		bool IsProtected (Method method);
		bool IsProtected (Field field);

		bool IsPublic (Method method);
		bool IsPublic (Field field);

		bool IsVirtual (Method method);
		bool IsNewSlot (Method method);
		bool IsOverride (Method method);
		bool IsFinal (Method method);
		bool IsConstructor (Method method);
		bool IsAbstract (Method method);
		bool IsCompilerGenerated (Field field);
		bool IsCompilerGenerated (Method method);

		bool IsAutoPropertyMember (Method method);
		bool IsPropertySetter (Method method, out Property property);
		bool IsPropertyGetter (Method method, out Property property);
		bool HasSetter (Property property, out Method method);
		bool HasGetter (Property property, out Method method);

		bool HasBody (Method method);
		bool DerivesFrom (TypeNode sub, TypeNode type);
		bool Equal (TypeNode type, TypeNode otherType);

		bool TryGetImplementingMethod (TypeNode type, Method calledMethod, out Method implementingMethod);
		bool TryGetRootMethod (Method method, out Method rootMethod);

		Field Unspecialized (Field field);
		Method Unspecialized (Method method);
		TypeNode Unspecialized (TypeNode type);

		Method DeclaringMethod (Parameter parameter);

		int ParameterIndex (Parameter parameter);
		int ParameterStackIndex (Parameter parameter);

		bool TryLoadAssembly (string filename, out AssemblyNode assembly, out string reasonOnFailure);

		string Name (Parameter parameter);

		bool IsReferenceType (TypeNode type);
		bool IsManagedPointer (TypeNode value);
		bool IsStruct (TypeNode type);
		bool IsInterface (TypeNode type);
		bool IsArray (TypeNode type);
		bool IsVoid (TypeNode type);
		bool IsReadonly (Field value);
		bool IsFinalizer (Method method);
		bool IsDispose (Method method);
		bool IsVoidMethod (Method method);
		bool IsOut (Parameter p);
		bool IsPrimitive (TypeNode type);
		bool IsClass (TypeNode type);

		bool IsAsVisibleAs (Field value, Method method);
		bool IsAsVisibleAs (Method value, Method method);
		bool IsVisibleFrom (Field field, TypeNode declaringType);
		bool IsVisibleFrom (Method value, TypeNode declaringType);
		bool IsVisibleFrom (TypeNode type, TypeNode fromType);

		bool TryGetSystemType (string fullName, out TypeNode type);

		bool HasValueRepresentation (TypeNode type);

		void IsSpecialized (Method calledMethod, ref IImmutableMap<TypeNode, TypeNode> specialization);
		bool IsSpecialized (Method method);

		bool IsFormalTypeParameter (TypeNode type);
		bool IsMethodFormalTypeParameter (TypeNode type);

		int TypeSize (TypeNode type);
	}
}