Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LambdaBodyOutputVisitor.cs « Mono.Debugging.Evaluation « Mono.Debugging - github.com/mono/debugger-libs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d71eb8ab5bb5f4c8a277073449e69a1652dc1b0c (plain)
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;

using Mono.Debugging.Client;

using ICSharpCode.NRefactory.CSharp;

namespace Mono.Debugging.Evaluation
{
	// Outputs lambda expression inputted on Immediate Pad. Also
	// this class works for followings.
	// - Check if body of lambda has not-supported expression
	// - Output reserved words like `this` or `base` with generated
	//   identifer.
	// - Collect variable references for outside the lambda
	//   (local variables/properties...)
	public class LambdaBodyOutputVisitor : CSharpOutputVisitor
	{
		readonly Dictionary<string, ValueReference> userVariables;
		readonly EvaluationContext ctx;

		Dictionary<string, Tuple<string, object>> localValues;
		List<string> definedIdentifier;
		int gensymCount;

		public LambdaBodyOutputVisitor (EvaluationContext ctx, Dictionary<string, ValueReference> userVariables, TextWriter writer) : base (writer, FormattingOptionsFactory.CreateMono ())
		{
			this.ctx = ctx;
			this.userVariables = userVariables;
			this.localValues = new Dictionary<string, Tuple<string, object>> ();
			this.definedIdentifier = new List<string> ();
		}

		public Tuple<string, object>[] GetLocalValues ()
		{
			var locals = new Tuple<string, object>[localValues.Count];
			int n = 0;
			foreach(var localv in localValues.Values) {
				locals [n] = localv;
				n++;
			}
			return locals;
		}

		static Exception NotSupportedToConsistency ()
		{
			return new NotSupportedExpressionException ();
		}

		static Exception NotSupported ()
		{
			return new NotSupportedExpressionException ();
		}

		static Exception EvaluationError (string message, params object [] args)
		{
			return new EvaluatorException (message, args);
		}

		bool IsPublicValueFlag (ObjectValueFlags flags)
		{
			var isField = (flags & ObjectValueFlags.Field) != 0;
			var isProperty = (flags & ObjectValueFlags.Property) != 0;
			var isPublic = (flags & ObjectValueFlags.Public) != 0;

			return !(isField || isProperty) || isPublic;
		}

		void AssertPublicType (object type)
		{
			if (!ctx.Adapter.IsPublic (ctx, type)) {
				var typeName = ctx.Adapter.GetDisplayTypeName (ctx, type);
				throw EvaluationError ("Not Support to reference non-public type: `{0}'", typeName);
			}
		}

		void AssertPublicValueReference (ValueReference vr)
		{
			if (!(vr is NamespaceValueReference)) {
				var typ = vr.Type;
				AssertPublicType (typ);
			}
			if (!IsPublicValueFlag (vr.Flags)) {
				throw EvaluationError ("Not Support to reference non-public thing: `{0}'", vr.Name);
			}
		}

		ValueReference Evaluate (IdentifierExpression t)
		{
			var visitor = new NRefactoryExpressionEvaluatorVisitor (ctx, t.Identifier, null, userVariables);
			return t.AcceptVisitor<ValueReference> (visitor);
		}

		ValueReference Evaluate (BaseReferenceExpression t)
		{
			var visitor = new NRefactoryExpressionEvaluatorVisitor (ctx, "base", null, userVariables);
			return t.AcceptVisitor<ValueReference> (visitor);
		}

		ValueReference Evaluate (ThisReferenceExpression t)
		{
			var visitor = new NRefactoryExpressionEvaluatorVisitor (ctx, "this", null, userVariables);
			return t.AcceptVisitor<ValueReference> (visitor);
		}

		string GenerateSymbol (string s)
		{
			var prefix = "__" + s;
			var sym = prefix;
			while (ExistsLocalName (sym)) {
				sym = prefix + gensymCount++;
			}

			return sym;
		}

		string AddToLocals (string name, ValueReference vr, bool shouldRename = false)
		{
			if (localValues.ContainsKey (name))
				return GetLocalName (name);

			string localName;
			if (shouldRename) {
				localName = GenerateSymbol (name);
			} else if (!ExistsLocalName (name)) {
				localName = name;
			} else {
				throw EvaluationError ("Cannot use a variable named {0} inside lambda", name);
			}

			AssertPublicValueReference (vr);

			var valu = vr != null ? vr.Value : null;
			var pair = Tuple.Create (localName, valu);
			localValues.Add (name, pair);
			return localName;
		}

		string GetLocalName (string name)
		{
			Tuple<string, object> pair;
			if (localValues.TryGetValue(name, out pair))
				return pair.Item1;
			return null;
		}

		bool ExistsLocalName (string localName)
		{
			foreach(var pair in localValues.Values) {
				if (pair.Item1 == localName)
					return true;
			}
			return definedIdentifier.Contains (localName);
		}

		#region IAstVisitor implementation

		public override void VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitAsExpression (AsExpression asExpression)
		{
		}
		*/
		public override void VisitAssignmentExpression (AssignmentExpression assignmentExpression)
		{
			throw EvaluationError ("Not support assignment expression inside lambda");
		}

		public override void VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression)
		{
			StartNode (baseReferenceExpression);
			var basee = "base";
			var localbase = GetLocalName(basee);
			if (localbase == null) {
				var vr = Evaluate (baseReferenceExpression);
				localbase = AddToLocals (basee, vr, true);
			}
			WriteKeyword (localbase);
			EndNode (baseReferenceExpression);
		}
		/*
		public override void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression)
		{
		}
		*//*
		public override void VisitCastExpression (CastExpression castExpression)
		{
		}
		*/
		public override void VisitCheckedExpression (CheckedExpression checkedExpression)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitConditionalExpression (ConditionalExpression conditionalExpression)
		{
		}
		*/
		public override void VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitDirectionExpression (DirectionExpression directionExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitIdentifierExpression (IdentifierExpression identifierExpression)
		{
			StartNode (identifierExpression);
			var identifier = identifierExpression.Identifier;
			var localIdentifier = "";

			if (definedIdentifier.Contains (identifier)) {
				localIdentifier = identifier;
			} else {
				localIdentifier = GetLocalName (identifier);
				if (localIdentifier == null) {
					var vr = Evaluate (identifierExpression);
					localIdentifier = AddToLocals (identifier, vr);
				}
			}
			var idToken = identifierExpression.IdentifierToken;
			idToken.Name = localIdentifier;
			WriteIdentifier (idToken);
			WriteTypeArguments (identifierExpression.TypeArguments);
			EndNode (identifierExpression);
		}
		/*
		public override void VisitIndexerExpression (IndexerExpression indexerExpression)
		{
		}
		*/
		public override void VisitInvocationExpression (InvocationExpression invocationExpression)
		{
			var invocationTarget = invocationExpression.Target;
			if (!(invocationTarget is IdentifierExpression)) {
				base.VisitInvocationExpression (invocationExpression);
				return;
			}

			var argc = invocationExpression.Arguments.Count;
			var method = (IdentifierExpression)invocationTarget;
			var methodName = method.Identifier;
			var vref = ctx.Adapter.GetThisReference (ctx);
			var vtype = ctx.Adapter.GetEnclosingType (ctx);
			string accessor = null;

			var hasInstanceMethod = ctx.Adapter.HasMethodWithParamLength (ctx, vtype, methodName, BindingFlags.Instance, argc);
			var hasStaticMethod = ctx.Adapter.HasMethodWithParamLength (ctx, vtype, methodName, BindingFlags.Static, argc);
			var publicFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static;
			var hasPublicMethod = ctx.Adapter.HasMethodWithParamLength (ctx, vtype, methodName, publicFlags, argc);

			if ((hasInstanceMethod || hasStaticMethod) && !hasPublicMethod)
				throw EvaluationError ("Only support public method invocation inside lambda");

			if (vref == null && hasStaticMethod) {
				AssertPublicType (vtype);
				var typeName = ctx.Adapter.GetTypeName (ctx, vtype);
				accessor = ctx.Adapter.GetDisplayTypeName (typeName);
			} else if (vref != null) {
				AssertPublicValueReference (vref);
				if (hasInstanceMethod) {
					if (hasStaticMethod) {
						// It's hard to determine which one is expected because
						// we don't have any information of parameter types now.
						throw EvaluationError ("Not supported invocation of static/instance overloaded method");
					}
					accessor = GetLocalName ("this");
					if (accessor == null)
						accessor = AddToLocals ("this", vref, true);
				} else if (hasStaticMethod) {
					var typeName = ctx.Adapter.GetTypeName (ctx, vtype);
					accessor = ctx.Adapter.GetDisplayTypeName (typeName);
				}
			}

			StartNode (invocationExpression);
			if (accessor == null)
				WriteIdentifier (method.Identifier);
			else
				WriteKeyword (accessor + "." + methodName);
			Space (policy.SpaceBeforeMethodCallParentheses);
			WriteCommaSeparatedListInParenthesis (invocationExpression.Arguments, policy.SpaceWithinMethodCallParentheses);
			EndNode (invocationExpression);
		}

		/*
		public override void VisitIsExpression (IsExpression isExpression)
		{
		}*/

		public override void VisitLambdaExpression (LambdaExpression lambdaExpression)
		{
			foreach (var par in lambdaExpression.Parameters) {
				if (par.ParameterModifier != ICSharpCode.NRefactory.CSharp.ParameterModifier.None)
					throw NotSupported();

				definedIdentifier.Add(par.Name);
			}

			base.VisitLambdaExpression (lambdaExpression);
		}
		/*
		public override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)
		{
		}*/

		public override void VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitNamedExpression (NamedExpression namedExpression)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression)
		{
		}
		*//*
		public override void VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression)
		{
		}*/

		public override void VisitAnonymousTypeCreateExpression (AnonymousTypeCreateExpression anonymousTypeCreateExpression)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression)
		{
		}*/

		public override void VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitPrimitiveExpression (PrimitiveExpression primitiveExpression)
		{
			return primitiveExpression.ToString ();
		}*/

		public override void VisitSizeOfExpression (SizeOfExpression sizeOfExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitStackAllocExpression (StackAllocExpression stackAllocExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitThisReferenceExpression (ThisReferenceExpression thisReferenceExpression)
		{
			StartNode (thisReferenceExpression);
			var thiss = "this";
			var localthis = GetLocalName (thiss);
			if (localthis == null) {
				var vr = Evaluate (thisReferenceExpression);
				localthis = AddToLocals (thiss, vr, true);
			}
			WriteKeyword (localthis);
			EndNode (thisReferenceExpression);
		}
		/*
		public override void VisitTypeOfExpression (TypeOfExpression typeOfExpression)
		{
		}*/
		/*
		public override void VisitTypeReferenceExpression (TypeReferenceExpression typeReferenceExpression)
		{
		}*//*
		public override void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression)
		{
		}*/

		public override void VisitUncheckedExpression (UncheckedExpression uncheckedExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryExpression (QueryExpression queryExpression)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryContinuationClause (QueryContinuationClause queryContinuationClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryFromClause (QueryFromClause queryFromClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryLetClause (QueryLetClause queryLetClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryWhereClause (QueryWhereClause queryWhereClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryJoinClause (QueryJoinClause queryJoinClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryOrderClause (QueryOrderClause queryOrderClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryOrdering (QueryOrdering queryOrdering)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQuerySelectClause (QuerySelectClause querySelectClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitQueryGroupClause (QueryGroupClause queryGroupClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitAttribute (ICSharpCode.NRefactory.CSharp.Attribute attribute)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitAttributeSection (AttributeSection attributeSection)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUsingAliasDeclaration (UsingAliasDeclaration usingAliasDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUsingDeclaration (UsingDeclaration usingDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitExternAliasDeclaration (ExternAliasDeclaration externAliasDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitBlockStatement (BlockStatement blockStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitBreakStatement (BreakStatement breakStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitCheckedStatement (CheckedStatement checkedStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitContinueStatement (ContinueStatement continueStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitDoWhileStatement (DoWhileStatement doWhileStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitEmptyStatement (EmptyStatement emptyStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitExpressionStatement (ExpressionStatement expressionStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitFixedStatement (FixedStatement fixedStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitForeachStatement (ForeachStatement foreachStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitForStatement (ForStatement forStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitGotoStatement (GotoStatement gotoStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitIfElseStatement (IfElseStatement ifElseStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitLabelStatement (LabelStatement labelStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitLockStatement (LockStatement lockStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitReturnStatement (ReturnStatement returnStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitSwitchStatement (SwitchStatement switchStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitSwitchSection (SwitchSection switchSection)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitCaseLabel (CaseLabel caseLabel)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitThrowStatement (ThrowStatement throwStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitTryCatchStatement (TryCatchStatement tryCatchStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitCatchClause (CatchClause catchClause)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUncheckedStatement (UncheckedStatement uncheckedStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUnsafeStatement (UnsafeStatement unsafeStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitUsingStatement (UsingStatement usingStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitWhileStatement (WhileStatement whileStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitAccessor (Accessor accessor)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitConstructorInitializer (ConstructorInitializer constructorInitializer)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitEventDeclaration (EventDeclaration eventDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitCustomEventDeclaration (CustomEventDeclaration customEventDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitFieldDeclaration (FieldDeclaration fieldDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitMethodDeclaration (MethodDeclaration methodDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration)
		{
			if (parameterDeclaration.Parent is LambdaExpression)
				base.VisitParameterDeclaration (parameterDeclaration);
			else
				throw NotSupportedToConsistency ();
		}

		public override void VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitVariableInitializer (VariableInitializer variableInitializer)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitSyntaxTree (SyntaxTree syntaxTree)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitSimpleType (SimpleType simpleType)
		{
		}*/
		/*
		public override void VisitMemberType (MemberType memberType)
		{
		}*/
		/*
		public override void VisitComposedType (ComposedType composedType)
		{
		}*/

		public override void VisitArraySpecifier (ArraySpecifier arraySpecifier)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitPrimitiveType (PrimitiveType primitiveType)
		{
		}*/

		public override void VisitComment (Comment comment)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitWhitespace (WhitespaceNode whitespaceNode)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitText (TextNode textNode)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitNewLine (NewLineNode newLineNode)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitDocumentationReference (DocumentationReference documentationReference)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitConstraint (Constraint constraint)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitCSharpTokenNode (CSharpTokenNode cSharpTokenNode)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitIdentifier (Identifier identifier)
		{
			throw NotSupportedToConsistency ();
		}

		public override void VisitPatternPlaceholder (AstNode placeholder, ICSharpCode.NRefactory.PatternMatching.Pattern pattern)
		{
			throw NotSupportedToConsistency ();
		}
		/*
		public override void VisitNullNode (AstNode nullNode)
		{
			throw NotSupportedToConsistency ();
		}
		*//*
		public override void VisitErrorNode (AstNode errorNode)
		{
			throw NotSupportedToConsistency ();
		}*/

		#endregion
	}
}