File: AllCSharpConstructs.cs

package info (click to toggle)
antlr 2.7.7%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 9,888 kB
  • sloc: java: 54,649; cs: 12,537; makefile: 8,945; cpp: 7,359; pascal: 5,273; sh: 4,337; python: 4,301; lisp: 1,969; xml: 220; lex: 192; ansic: 127
file content (352 lines) | stat: -rw-r--r-- 7,286 bytes parent folder | download | duplicates (10)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
using System;
using File = System.IO.File;

[assembly: AssemblyTitle("antlr.runtime")]
[assembly: AssemblyDescription("ANTLR Runtime for .NET")]
[assembly: AssemblyCompany("www.antlr.org")]
[assembly: AssemblyVersion("2.7.2.4")]
[assembly: CLSCompliantAttribute(true)]


[Serializable]
public class PublicTopLevelClass
{
	public PublicTopLevelClass()	
	{
		for (int i = 0, j = 0; i <= 20; i++, j++)
		{
			j = j * i;
		}
		StringVar1 = s;
	}
	
	public PublicTopLevelClass()	{}
	
	public ~PublicTopLevelClass()	{}
	
	public ~PublicTopLevelClass()
	{
		for (int i = 0, j = 0; i <= 20; i++, j++)
		{
			j = j * i;
		}
		StringVar1 = s;
	}
	
	public PublicTopLevelClass(string s) : base(s)
	{
		StringVar1 = s;
	}

	public static PublicTopLevelClass operator++(PublicTopLevelClass iv) { 
		PublicTopLevelClass temp = new PublicTopLevelClass(iv.Length);
		PublicTopLevelClass temp = new PublicTopLevelClass[i];
		for (int i = 0; i < iv.Length; ++i)
			temp[i] = iv[i] + 1;
		return temp;
	}
	
	public static PublicTopLevelClass operator--(PublicTopLevelClass iv) ;
	
	public static PublicTopLevelClass operator+(PublicTopLevelClass x1, PublicTopLevelClass x2) 
	{ 
		return x1; 
	}
	public static PublicTopLevelClass operator-(PublicTopLevelClass x1, PublicTopLevelClass x2) ;

	public static explicit operator int(PublicTopLevelClass x) { /* . */ } 
  	public static implicit operator long(PublicTopLevelClass x) { /* . */ }
  	
	public void Method1()
	{
		try
		{
			
			for (int i = 0, j = 0; i <= 20; i++, j++)
			{
				j = j * i;
			}
		}
		catch(Exception e)
		{
			Console.Error.WriteLine(e.StackTrace);
		}
		catch(Exception)
		{
			Console.Error.WriteLine(e.StackTrace);
		}
		catch
		{
			Console.Error.WriteLine(Environment.StackTrace);
		}
		finally
		{
			Console.Error.WriteLine(Environment.StackTrace);
		}
	}

	public void Method1(string s)
	{
		for (int i = 0, j = 0; i <= 20; i++, j++)
		{
			j = j * i;
		}
		StringVar1 = s;

		try
		{
			
			for (int i = 0, j = 0; i <= 20; i++, j++)
			{
				j = j * i;
			}
		}
		finally
		{
			Console.Error.WriteLine(Environment.StackTrace);
		}
	}

	public    const int 	TopLevelIntConst = 1;
	internal  const uint 	TopLevelUIntConst = 1u, TopLevelUIntConst2 = 2U;
	[Serializable]
	private   const byte	TopLevelByteConst = 1;
	protected const sbyte	TopLevelSByteConst = 1;
	public    const long	TopLevelLongConst = 1L;
	public    const long	TopLevelLongConst = 1l;
	public    const ulong	TopLevelULongConst = 1UL;
	public    const ulong	TopLevelULongConst = 1LU;
	public    const ulong	TopLevelULongConst = 1ul;
	public    const ulong	TopLevelULongConst = 1lu;
	
	public    int    IntVariable;
	[Serializable]
	public    int    IntVariableWithInit = 1;
	[Serializable]
	private   string 	StringVar1, StringVar2 = "", StringVar3, StringVar4 = "init";
	//private   string[] 	StringVar1, StringVar2 = { "" }, StringVar4 = new string[3];
	private   string[] 	StringVar1, StringVar2, StringVar4;
	private   string[][][] 	StringVar1, StringVar2, StringVar4;
	private   string[,,,,] 	StringVar1, StringVar2, StringVar4;
	private   string[] 	StringVar1;
	private   string[] 	StringVar2 = { "" };
	private   string[] 	StringVar4 = new string[3] { "1", "2", "3" };

	private   string**[,,] 	StringVar4;
	private   string** 	ptrPtrString;
	private   int* 		ptrToInt;
	
	[Serializable]
	public event EventHandler ClickHandler1, ClickHandler;
	
	[Serializable]
	private static readonly object ClickEvent = new object();
      
      // Defines the Click event using the event property syntax.
      // The Events property stores all the event delegates of
      // a control as name/value pairs. 
      [Serializable]
      public event EventHandler Click 
      {
         // When a user attaches an event handler to the Click event 
         // (Click += myHandler;), the add method 
         // adds the handler to the 
         // delegate for the Click event (keyed by ClickEvent 
         // in the Events list).
         [Serializable]
         add 
         {
            Events.AddHandler(ClickEvent, value);
         }
         // When a user removes an event handler from the Click event 
         // (Click -= myHandler;), the remove method 
         // removes the handler from the 
         // delegate for the Click event (keyed by ClickEvent 
         // in the Events list).
         remove 
         {
            Events.RemoveHandler(ClickEvent, value);
         }
      }
      
      
      [Serializable]
		public int IntProperty1
		{
			[Serializable]
			get { return IntVariable;  }
			[Serializable]
			set { IntVariable = value; }
		}
		public int IntProperty2
		{
			get { return IntVariable;  }
			set { IntVariable = value; }
		}
		public string ReadOnlyStringProperty
		{
			[Serializable]
			get { return StringVar2;  }
		}
		[Serializable]
		public string WriteOnlyStringProperty
		{
			set { StringVar3 = value; }
		}

		public int this[int i]
		{
			[Serializable]
			get { return IntVariable;  }
			[Serializable]
			set { IntVariable = value; }
		}
		[Serializable]
		public int this[string s, int i]
		{
			[Serializable]
			get { return IntVariable;  }
			[Serializable]
			set { IntVariable = value; }
		}
		[Serializable]
		public int IConstructorInfo.this[string s, int i]
		{
			[Serializable]
			get { return IntVariable;  }
			[Serializable]
			set { IntVariable = value; }
		}
}

[Serializable]
internal class InternalTopLevelClass
{
	private InternalTopLevelClass()	{}
	
	public int MethodThatReturnsVoid()		{}

	public string MethodThatReturnsVoid(int i, uint ui, short s, ushort us) 
	{
		switch(Type)
		{
			case INT:
				DoIntCase();
				break;
			case REAL:
			case FLOAT:
			case DOUBLE:
				DoRealCase();
				break;
			default:
				DoDefaultThing();
				break;
		}
		
		do
		{
			CallSomeMethod();
		} while (anObj.SomeAccessor());
		
		while (aPointer != null)
			try
			{
				CallAFunction();
				lock(this)
				{
					DoSomeStuff();
				}
				CallAnotherFunction();
			}
			catch {}
			
		while (aPointer != null)
		{
			CallAFunction();
			lock(this)
			{
				DoSomeStuff();
			}
			CallAnotherFunction();
		}
	}

	public string[] MethodThatReturnsVoid(long i, ulong ul) 
	{
		if (SomeCondition)
			DoSomething();
		else
			DoSomethingElse();
			
		if (SomeValue == IF)
		{
			DoSomethingIf();
		}
		else if (SomeValue == ELSE_IF_1)
		{
			DoSomethingElseIf_1();
		}
		else if (SomeValue == ELSE_IF_2)
		{
			if (SomeCondition)
				DoSomething();
			else
				DoSomethingElse();
			DoSomethingElseIf_2();
		}
		else
		{
			DoSomethingElse();
		}
	}

	public void MethodThatReturnsVoid(string s, char c) 
	{
		foreach (Assembly assem in AppDomain.CurrentDomain.GetAssemblies())
		{
			CallSomeMethod();
		}
		foreach (Assembly assem in AppDomain.CurrentDomain.GetAssemblies())
			checked
			{
				SomeCodeGoesHere();
			}
	}

	public void MethodThatReturnsVoid(byte b, sbyte sb) {}

	public void MethodThatReturnsVoid(int[] iarray, string[] sarray) {}

}


namespace TopLevel
{
	namespace SecondLevel
	{
		using System;
		using System.Collections;
	}
}

namespace Server.Extensions
{
}

namespace TopLevel.SecondLevel
{
	using System.Text;
	using Debug = System.Diagnostics.Debug;
}

namespace Client.Core
{
}

namespace Server.Persistence
{
}

namespace TopLevel.SecondLevel.ThirdLevel
{
}