1 | // |
---|
2 | // IAstVisitor.cs |
---|
3 | // |
---|
4 | // Author: |
---|
5 | // Mike Krüger <mkrueger@novell.com> |
---|
6 | // |
---|
7 | // Copyright (c) 2010 Novell, Inc (http://www.novell.com) |
---|
8 | // |
---|
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
10 | // of this software and associated documentation files (the "Software"), to deal |
---|
11 | // in the Software without restriction, including without limitation the rights |
---|
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
13 | // copies of the Software, and to permit persons to whom the Software is |
---|
14 | // furnished to do so, subject to the following conditions: |
---|
15 | // |
---|
16 | // The above copyright notice and this permission notice shall be included in |
---|
17 | // all copies or substantial portions of the Software. |
---|
18 | // |
---|
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
25 | // THE SOFTWARE. |
---|
26 | |
---|
27 | using System; |
---|
28 | |
---|
29 | namespace ICSharpCode.NRefactory.CSharp |
---|
30 | { |
---|
31 | /// <summary> |
---|
32 | /// AST visitor with a default implementation that visits all node depth-first. |
---|
33 | /// </summary> |
---|
34 | public abstract class DepthFirstAstVisitor : IAstVisitor |
---|
35 | { |
---|
36 | protected virtual void VisitChildren (AstNode node) |
---|
37 | { |
---|
38 | AstNode next; |
---|
39 | for (var child = node.FirstChild; child != null; child = next) { |
---|
40 | // Store next to allow the loop to continue |
---|
41 | // if the visitor removes/replaces child. |
---|
42 | next = child.NextSibling; |
---|
43 | child.AcceptVisitor (this); |
---|
44 | } |
---|
45 | } |
---|
46 | |
---|
47 | public virtual void VisitNullNode(AstNode nullNode) |
---|
48 | { |
---|
49 | // Should we call VisitChildren here? |
---|
50 | // We usually want to ignore null nodes. |
---|
51 | // Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes; |
---|
52 | // so changing this might break VisitChildren() overrides that expect the node to be part of the AST. |
---|
53 | } |
---|
54 | |
---|
55 | public virtual void VisitSyntaxTree (SyntaxTree syntaxTree) |
---|
56 | { |
---|
57 | VisitChildren (syntaxTree); |
---|
58 | } |
---|
59 | |
---|
60 | public virtual void VisitComment(Comment comment) |
---|
61 | { |
---|
62 | VisitChildren(comment); |
---|
63 | } |
---|
64 | |
---|
65 | public virtual void VisitNewLine(NewLineNode newLineNode) |
---|
66 | { |
---|
67 | VisitChildren(newLineNode); |
---|
68 | } |
---|
69 | |
---|
70 | public virtual void VisitWhitespace(WhitespaceNode whitespaceNode) |
---|
71 | { |
---|
72 | VisitChildren(whitespaceNode); |
---|
73 | } |
---|
74 | |
---|
75 | public virtual void VisitText(TextNode textNode) |
---|
76 | { |
---|
77 | VisitChildren(textNode); |
---|
78 | } |
---|
79 | |
---|
80 | public virtual void VisitDocumentationReference (DocumentationReference documentationReference) |
---|
81 | { |
---|
82 | VisitChildren (documentationReference); |
---|
83 | } |
---|
84 | |
---|
85 | public virtual void VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective) |
---|
86 | { |
---|
87 | VisitChildren (preProcessorDirective); |
---|
88 | } |
---|
89 | |
---|
90 | public virtual void VisitIdentifier (Identifier identifier) |
---|
91 | { |
---|
92 | VisitChildren (identifier); |
---|
93 | } |
---|
94 | |
---|
95 | public virtual void VisitCSharpTokenNode (CSharpTokenNode token) |
---|
96 | { |
---|
97 | VisitChildren (token); |
---|
98 | } |
---|
99 | |
---|
100 | public virtual void VisitPrimitiveType (PrimitiveType primitiveType) |
---|
101 | { |
---|
102 | VisitChildren (primitiveType); |
---|
103 | } |
---|
104 | |
---|
105 | public virtual void VisitComposedType (ComposedType composedType) |
---|
106 | { |
---|
107 | VisitChildren (composedType); |
---|
108 | } |
---|
109 | |
---|
110 | public virtual void VisitSimpleType(SimpleType simpleType) |
---|
111 | { |
---|
112 | VisitChildren (simpleType); |
---|
113 | } |
---|
114 | |
---|
115 | public virtual void VisitMemberType(MemberType memberType) |
---|
116 | { |
---|
117 | VisitChildren (memberType); |
---|
118 | } |
---|
119 | |
---|
120 | public virtual void VisitAttribute (Attribute attribute) |
---|
121 | { |
---|
122 | VisitChildren (attribute); |
---|
123 | } |
---|
124 | |
---|
125 | public virtual void VisitAttributeSection (AttributeSection attributeSection) |
---|
126 | { |
---|
127 | VisitChildren (attributeSection); |
---|
128 | } |
---|
129 | |
---|
130 | public virtual void VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration) |
---|
131 | { |
---|
132 | VisitChildren (delegateDeclaration); |
---|
133 | } |
---|
134 | |
---|
135 | public virtual void VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration) |
---|
136 | { |
---|
137 | VisitChildren (namespaceDeclaration); |
---|
138 | } |
---|
139 | |
---|
140 | public virtual void VisitTypeDeclaration (TypeDeclaration typeDeclaration) |
---|
141 | { |
---|
142 | VisitChildren (typeDeclaration); |
---|
143 | } |
---|
144 | |
---|
145 | public virtual void VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration) |
---|
146 | { |
---|
147 | VisitChildren (typeParameterDeclaration); |
---|
148 | } |
---|
149 | |
---|
150 | public virtual void VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration) |
---|
151 | { |
---|
152 | VisitChildren (enumMemberDeclaration); |
---|
153 | } |
---|
154 | |
---|
155 | public virtual void VisitUsingDeclaration (UsingDeclaration usingDeclaration) |
---|
156 | { |
---|
157 | VisitChildren (usingDeclaration); |
---|
158 | } |
---|
159 | |
---|
160 | public virtual void VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration) |
---|
161 | { |
---|
162 | VisitChildren (usingDeclaration); |
---|
163 | } |
---|
164 | |
---|
165 | public virtual void VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration) |
---|
166 | { |
---|
167 | VisitChildren (externAliasDeclaration); |
---|
168 | } |
---|
169 | |
---|
170 | public virtual void VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration) |
---|
171 | { |
---|
172 | VisitChildren (constructorDeclaration); |
---|
173 | } |
---|
174 | |
---|
175 | public virtual void VisitConstructorInitializer (ConstructorInitializer constructorInitializer) |
---|
176 | { |
---|
177 | VisitChildren (constructorInitializer); |
---|
178 | } |
---|
179 | |
---|
180 | public virtual void VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration) |
---|
181 | { |
---|
182 | VisitChildren (destructorDeclaration); |
---|
183 | } |
---|
184 | |
---|
185 | public virtual void VisitEventDeclaration (EventDeclaration eventDeclaration) |
---|
186 | { |
---|
187 | VisitChildren (eventDeclaration); |
---|
188 | } |
---|
189 | |
---|
190 | public virtual void VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration) |
---|
191 | { |
---|
192 | VisitChildren (eventDeclaration); |
---|
193 | } |
---|
194 | |
---|
195 | public virtual void VisitFieldDeclaration (FieldDeclaration fieldDeclaration) |
---|
196 | { |
---|
197 | VisitChildren (fieldDeclaration); |
---|
198 | } |
---|
199 | |
---|
200 | public virtual void VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration) |
---|
201 | { |
---|
202 | VisitChildren (fixedFieldDeclaration); |
---|
203 | } |
---|
204 | |
---|
205 | public virtual void VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer) |
---|
206 | { |
---|
207 | VisitChildren (fixedVariableInitializer); |
---|
208 | } |
---|
209 | |
---|
210 | public virtual void VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration) |
---|
211 | { |
---|
212 | VisitChildren (indexerDeclaration); |
---|
213 | } |
---|
214 | |
---|
215 | public virtual void VisitMethodDeclaration (MethodDeclaration methodDeclaration) |
---|
216 | { |
---|
217 | VisitChildren (methodDeclaration); |
---|
218 | } |
---|
219 | |
---|
220 | public virtual void VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration) |
---|
221 | { |
---|
222 | VisitChildren (operatorDeclaration); |
---|
223 | } |
---|
224 | |
---|
225 | public virtual void VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration) |
---|
226 | { |
---|
227 | VisitChildren (propertyDeclaration); |
---|
228 | } |
---|
229 | |
---|
230 | public virtual void VisitAccessor (Accessor accessor) |
---|
231 | { |
---|
232 | VisitChildren (accessor); |
---|
233 | } |
---|
234 | |
---|
235 | public virtual void VisitVariableInitializer (VariableInitializer variableInitializer) |
---|
236 | { |
---|
237 | VisitChildren (variableInitializer); |
---|
238 | } |
---|
239 | |
---|
240 | public virtual void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration) |
---|
241 | { |
---|
242 | VisitChildren (parameterDeclaration); |
---|
243 | } |
---|
244 | |
---|
245 | public virtual void VisitConstraint (Constraint constraint) |
---|
246 | { |
---|
247 | VisitChildren (constraint); |
---|
248 | } |
---|
249 | |
---|
250 | public virtual void VisitBlockStatement (BlockStatement blockStatement) |
---|
251 | { |
---|
252 | VisitChildren (blockStatement); |
---|
253 | } |
---|
254 | |
---|
255 | public virtual void VisitExpressionStatement (ExpressionStatement expressionStatement) |
---|
256 | { |
---|
257 | VisitChildren (expressionStatement); |
---|
258 | } |
---|
259 | |
---|
260 | public virtual void VisitBreakStatement (BreakStatement breakStatement) |
---|
261 | { |
---|
262 | VisitChildren (breakStatement); |
---|
263 | } |
---|
264 | |
---|
265 | public virtual void VisitCheckedStatement (CheckedStatement checkedStatement) |
---|
266 | { |
---|
267 | VisitChildren (checkedStatement); |
---|
268 | } |
---|
269 | |
---|
270 | public virtual void VisitContinueStatement (ContinueStatement continueStatement) |
---|
271 | { |
---|
272 | VisitChildren (continueStatement); |
---|
273 | } |
---|
274 | |
---|
275 | public virtual void VisitDoWhileStatement (DoWhileStatement doWhileStatement) |
---|
276 | { |
---|
277 | VisitChildren (doWhileStatement); |
---|
278 | } |
---|
279 | |
---|
280 | public virtual void VisitEmptyStatement (EmptyStatement emptyStatement) |
---|
281 | { |
---|
282 | VisitChildren (emptyStatement); |
---|
283 | } |
---|
284 | |
---|
285 | public virtual void VisitFixedStatement (FixedStatement fixedStatement) |
---|
286 | { |
---|
287 | VisitChildren (fixedStatement); |
---|
288 | } |
---|
289 | |
---|
290 | public virtual void VisitForeachStatement (ForeachStatement foreachStatement) |
---|
291 | { |
---|
292 | VisitChildren (foreachStatement); |
---|
293 | } |
---|
294 | |
---|
295 | public virtual void VisitForStatement (ForStatement forStatement) |
---|
296 | { |
---|
297 | VisitChildren (forStatement); |
---|
298 | } |
---|
299 | |
---|
300 | public virtual void VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement) |
---|
301 | { |
---|
302 | VisitChildren (gotoCaseStatement); |
---|
303 | } |
---|
304 | |
---|
305 | public virtual void VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement) |
---|
306 | { |
---|
307 | VisitChildren (gotoDefaultStatement); |
---|
308 | } |
---|
309 | |
---|
310 | public virtual void VisitGotoStatement (GotoStatement gotoStatement) |
---|
311 | { |
---|
312 | VisitChildren (gotoStatement); |
---|
313 | } |
---|
314 | |
---|
315 | public virtual void VisitIfElseStatement (IfElseStatement ifElseStatement) |
---|
316 | { |
---|
317 | VisitChildren (ifElseStatement); |
---|
318 | } |
---|
319 | |
---|
320 | public virtual void VisitLabelStatement (LabelStatement labelStatement) |
---|
321 | { |
---|
322 | VisitChildren (labelStatement); |
---|
323 | } |
---|
324 | |
---|
325 | public virtual void VisitLockStatement (LockStatement lockStatement) |
---|
326 | { |
---|
327 | VisitChildren (lockStatement); |
---|
328 | } |
---|
329 | |
---|
330 | public virtual void VisitReturnStatement (ReturnStatement returnStatement) |
---|
331 | { |
---|
332 | VisitChildren (returnStatement); |
---|
333 | } |
---|
334 | |
---|
335 | public virtual void VisitSwitchStatement (SwitchStatement switchStatement) |
---|
336 | { |
---|
337 | VisitChildren (switchStatement); |
---|
338 | } |
---|
339 | |
---|
340 | public virtual void VisitSwitchSection (SwitchSection switchSection) |
---|
341 | { |
---|
342 | VisitChildren (switchSection); |
---|
343 | } |
---|
344 | |
---|
345 | public virtual void VisitCaseLabel (CaseLabel caseLabel) |
---|
346 | { |
---|
347 | VisitChildren (caseLabel); |
---|
348 | } |
---|
349 | |
---|
350 | public virtual void VisitThrowStatement (ThrowStatement throwStatement) |
---|
351 | { |
---|
352 | VisitChildren (throwStatement); |
---|
353 | } |
---|
354 | |
---|
355 | public virtual void VisitTryCatchStatement (TryCatchStatement tryCatchStatement) |
---|
356 | { |
---|
357 | VisitChildren (tryCatchStatement); |
---|
358 | } |
---|
359 | |
---|
360 | public virtual void VisitCatchClause (CatchClause catchClause) |
---|
361 | { |
---|
362 | VisitChildren (catchClause); |
---|
363 | } |
---|
364 | |
---|
365 | public virtual void VisitUncheckedStatement (UncheckedStatement uncheckedStatement) |
---|
366 | { |
---|
367 | VisitChildren (uncheckedStatement); |
---|
368 | } |
---|
369 | |
---|
370 | public virtual void VisitUnsafeStatement (UnsafeStatement unsafeStatement) |
---|
371 | { |
---|
372 | VisitChildren (unsafeStatement); |
---|
373 | } |
---|
374 | |
---|
375 | public virtual void VisitUsingStatement (UsingStatement usingStatement) |
---|
376 | { |
---|
377 | VisitChildren (usingStatement); |
---|
378 | } |
---|
379 | |
---|
380 | public virtual void VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement) |
---|
381 | { |
---|
382 | VisitChildren (variableDeclarationStatement); |
---|
383 | } |
---|
384 | |
---|
385 | public virtual void VisitWhileStatement (WhileStatement whileStatement) |
---|
386 | { |
---|
387 | VisitChildren (whileStatement); |
---|
388 | } |
---|
389 | |
---|
390 | public virtual void VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement) |
---|
391 | { |
---|
392 | VisitChildren (yieldBreakStatement); |
---|
393 | } |
---|
394 | |
---|
395 | public virtual void VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement) |
---|
396 | { |
---|
397 | VisitChildren (yieldReturnStatement); |
---|
398 | } |
---|
399 | |
---|
400 | public virtual void VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression) |
---|
401 | { |
---|
402 | VisitChildren (anonymousMethodExpression); |
---|
403 | } |
---|
404 | |
---|
405 | public virtual void VisitLambdaExpression (LambdaExpression lambdaExpression) |
---|
406 | { |
---|
407 | VisitChildren (lambdaExpression); |
---|
408 | } |
---|
409 | |
---|
410 | public virtual void VisitAssignmentExpression (AssignmentExpression assignmentExpression) |
---|
411 | { |
---|
412 | VisitChildren (assignmentExpression); |
---|
413 | } |
---|
414 | |
---|
415 | public virtual void VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression) |
---|
416 | { |
---|
417 | VisitChildren (baseReferenceExpression); |
---|
418 | } |
---|
419 | |
---|
420 | public virtual void VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression) |
---|
421 | { |
---|
422 | VisitChildren (binaryOperatorExpression); |
---|
423 | } |
---|
424 | |
---|
425 | public virtual void VisitCastExpression (CastExpression castExpression) |
---|
426 | { |
---|
427 | VisitChildren (castExpression); |
---|
428 | } |
---|
429 | |
---|
430 | public virtual void VisitCheckedExpression (CheckedExpression checkedExpression) |
---|
431 | { |
---|
432 | VisitChildren (checkedExpression); |
---|
433 | } |
---|
434 | |
---|
435 | public virtual void VisitConditionalExpression (ConditionalExpression conditionalExpression) |
---|
436 | { |
---|
437 | VisitChildren (conditionalExpression); |
---|
438 | } |
---|
439 | |
---|
440 | public virtual void VisitIdentifierExpression (IdentifierExpression identifierExpression) |
---|
441 | { |
---|
442 | VisitChildren (identifierExpression); |
---|
443 | } |
---|
444 | |
---|
445 | public virtual void VisitIndexerExpression (IndexerExpression indexerExpression) |
---|
446 | { |
---|
447 | VisitChildren (indexerExpression); |
---|
448 | } |
---|
449 | |
---|
450 | public virtual void VisitInvocationExpression (InvocationExpression invocationExpression) |
---|
451 | { |
---|
452 | VisitChildren (invocationExpression); |
---|
453 | } |
---|
454 | |
---|
455 | public virtual void VisitDirectionExpression (DirectionExpression directionExpression) |
---|
456 | { |
---|
457 | VisitChildren (directionExpression); |
---|
458 | } |
---|
459 | |
---|
460 | public virtual void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression) |
---|
461 | { |
---|
462 | VisitChildren (memberReferenceExpression); |
---|
463 | } |
---|
464 | |
---|
465 | public virtual void VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression) |
---|
466 | { |
---|
467 | VisitChildren (nullReferenceExpression); |
---|
468 | } |
---|
469 | |
---|
470 | public virtual void VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression) |
---|
471 | { |
---|
472 | VisitChildren (objectCreateExpression); |
---|
473 | } |
---|
474 | |
---|
475 | public virtual void VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression) |
---|
476 | { |
---|
477 | VisitChildren (anonymousTypeCreateExpression); |
---|
478 | } |
---|
479 | |
---|
480 | public virtual void VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression) |
---|
481 | { |
---|
482 | VisitChildren (arrayCreateExpression); |
---|
483 | } |
---|
484 | |
---|
485 | public virtual void VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression) |
---|
486 | { |
---|
487 | VisitChildren (parenthesizedExpression); |
---|
488 | } |
---|
489 | |
---|
490 | public virtual void VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression) |
---|
491 | { |
---|
492 | VisitChildren (pointerReferenceExpression); |
---|
493 | } |
---|
494 | |
---|
495 | public virtual void VisitPrimitiveExpression(PrimitiveExpression primitiveExpression) |
---|
496 | { |
---|
497 | VisitChildren (primitiveExpression); |
---|
498 | } |
---|
499 | |
---|
500 | public virtual void VisitSizeOfExpression (SizeOfExpression sizeOfExpression) |
---|
501 | { |
---|
502 | VisitChildren (sizeOfExpression); |
---|
503 | } |
---|
504 | |
---|
505 | public virtual void VisitStackAllocExpression (StackAllocExpression stackAllocExpression) |
---|
506 | { |
---|
507 | VisitChildren (stackAllocExpression); |
---|
508 | } |
---|
509 | |
---|
510 | public virtual void VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression) |
---|
511 | { |
---|
512 | VisitChildren (thisReferenceExpression); |
---|
513 | } |
---|
514 | |
---|
515 | public virtual void VisitTypeOfExpression (TypeOfExpression typeOfExpression) |
---|
516 | { |
---|
517 | VisitChildren (typeOfExpression); |
---|
518 | } |
---|
519 | |
---|
520 | public virtual void VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression) |
---|
521 | { |
---|
522 | VisitChildren (typeReferenceExpression); |
---|
523 | } |
---|
524 | |
---|
525 | public virtual void VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression) |
---|
526 | { |
---|
527 | VisitChildren (unaryOperatorExpression); |
---|
528 | } |
---|
529 | |
---|
530 | public virtual void VisitUncheckedExpression (UncheckedExpression uncheckedExpression) |
---|
531 | { |
---|
532 | VisitChildren (uncheckedExpression); |
---|
533 | } |
---|
534 | |
---|
535 | public virtual void VisitQueryExpression(QueryExpression queryExpression) |
---|
536 | { |
---|
537 | VisitChildren (queryExpression); |
---|
538 | } |
---|
539 | |
---|
540 | public virtual void VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause) |
---|
541 | { |
---|
542 | VisitChildren (queryContinuationClause); |
---|
543 | } |
---|
544 | |
---|
545 | public virtual void VisitQueryFromClause(QueryFromClause queryFromClause) |
---|
546 | { |
---|
547 | VisitChildren (queryFromClause); |
---|
548 | } |
---|
549 | |
---|
550 | public virtual void VisitQueryLetClause(QueryLetClause queryLetClause) |
---|
551 | { |
---|
552 | VisitChildren (queryLetClause); |
---|
553 | } |
---|
554 | |
---|
555 | public virtual void VisitQueryWhereClause(QueryWhereClause queryWhereClause) |
---|
556 | { |
---|
557 | VisitChildren (queryWhereClause); |
---|
558 | } |
---|
559 | |
---|
560 | public virtual void VisitQueryJoinClause(QueryJoinClause queryJoinClause) |
---|
561 | { |
---|
562 | VisitChildren (queryJoinClause); |
---|
563 | } |
---|
564 | |
---|
565 | public virtual void VisitQueryOrderClause(QueryOrderClause queryOrderClause) |
---|
566 | { |
---|
567 | VisitChildren (queryOrderClause); |
---|
568 | } |
---|
569 | |
---|
570 | public virtual void VisitQueryOrdering(QueryOrdering queryOrdering) |
---|
571 | { |
---|
572 | VisitChildren (queryOrdering); |
---|
573 | } |
---|
574 | |
---|
575 | public virtual void VisitQuerySelectClause(QuerySelectClause querySelectClause) |
---|
576 | { |
---|
577 | VisitChildren (querySelectClause); |
---|
578 | } |
---|
579 | |
---|
580 | public virtual void VisitQueryGroupClause(QueryGroupClause queryGroupClause) |
---|
581 | { |
---|
582 | VisitChildren (queryGroupClause); |
---|
583 | } |
---|
584 | |
---|
585 | public virtual void VisitAsExpression (AsExpression asExpression) |
---|
586 | { |
---|
587 | VisitChildren (asExpression); |
---|
588 | } |
---|
589 | |
---|
590 | public virtual void VisitIsExpression (IsExpression isExpression) |
---|
591 | { |
---|
592 | VisitChildren (isExpression); |
---|
593 | } |
---|
594 | |
---|
595 | public virtual void VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression) |
---|
596 | { |
---|
597 | VisitChildren (defaultValueExpression); |
---|
598 | } |
---|
599 | |
---|
600 | public virtual void VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression) |
---|
601 | { |
---|
602 | VisitChildren (undocumentedExpression); |
---|
603 | } |
---|
604 | |
---|
605 | public virtual void VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression) |
---|
606 | { |
---|
607 | VisitChildren (arrayInitializerExpression); |
---|
608 | } |
---|
609 | |
---|
610 | public virtual void VisitArraySpecifier (ArraySpecifier arraySpecifier) |
---|
611 | { |
---|
612 | VisitChildren (arraySpecifier); |
---|
613 | } |
---|
614 | |
---|
615 | public virtual void VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression) |
---|
616 | { |
---|
617 | VisitChildren (namedArgumentExpression); |
---|
618 | } |
---|
619 | |
---|
620 | public virtual void VisitNamedExpression (NamedExpression namedExpression) |
---|
621 | { |
---|
622 | VisitChildren (namedExpression); |
---|
623 | } |
---|
624 | |
---|
625 | public virtual void VisitErrorNode(AstNode errorNode) |
---|
626 | { |
---|
627 | VisitChildren(errorNode); |
---|
628 | } |
---|
629 | |
---|
630 | public virtual void VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern) |
---|
631 | { |
---|
632 | VisitChildren (placeholder); |
---|
633 | } |
---|
634 | } |
---|
635 | |
---|
636 | /// <summary> |
---|
637 | /// AST visitor with a default implementation that visits all node depth-first. |
---|
638 | /// </summary> |
---|
639 | public abstract class DepthFirstAstVisitor<T> : IAstVisitor<T> |
---|
640 | { |
---|
641 | protected virtual T VisitChildren (AstNode node) |
---|
642 | { |
---|
643 | AstNode next; |
---|
644 | for (var child = node.FirstChild; child != null; child = next) { |
---|
645 | // Store next to allow the loop to continue |
---|
646 | // if the visitor removes/replaces child. |
---|
647 | next = child.NextSibling; |
---|
648 | child.AcceptVisitor (this); |
---|
649 | } |
---|
650 | return default (T); |
---|
651 | } |
---|
652 | |
---|
653 | public virtual T VisitNullNode(AstNode nullNode) |
---|
654 | { |
---|
655 | // Should we call VisitChildren here? |
---|
656 | // We usually want to ignore null nodes. |
---|
657 | // Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes; |
---|
658 | // so changing this might break VisitChildren() overrides that expect the node to be part of the AST. |
---|
659 | return default (T); |
---|
660 | } |
---|
661 | |
---|
662 | public virtual T VisitSyntaxTree (SyntaxTree unit) |
---|
663 | { |
---|
664 | return VisitChildren (unit); |
---|
665 | } |
---|
666 | |
---|
667 | public virtual T VisitComment (Comment comment) |
---|
668 | { |
---|
669 | return VisitChildren (comment); |
---|
670 | } |
---|
671 | |
---|
672 | public virtual T VisitNewLine(NewLineNode newLineNode) |
---|
673 | { |
---|
674 | return VisitChildren(newLineNode); |
---|
675 | } |
---|
676 | |
---|
677 | public virtual T VisitWhitespace(WhitespaceNode whitespaceNode) |
---|
678 | { |
---|
679 | return VisitChildren(whitespaceNode); |
---|
680 | } |
---|
681 | |
---|
682 | public virtual T VisitText(TextNode textNode) |
---|
683 | { |
---|
684 | return VisitChildren(textNode); |
---|
685 | } |
---|
686 | |
---|
687 | public virtual T VisitDocumentationReference (DocumentationReference documentationReference) |
---|
688 | { |
---|
689 | return VisitChildren (documentationReference); |
---|
690 | } |
---|
691 | |
---|
692 | public virtual T VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective) |
---|
693 | { |
---|
694 | return VisitChildren (preProcessorDirective); |
---|
695 | } |
---|
696 | |
---|
697 | public virtual T VisitIdentifier (Identifier identifier) |
---|
698 | { |
---|
699 | return VisitChildren (identifier); |
---|
700 | } |
---|
701 | |
---|
702 | public virtual T VisitCSharpTokenNode (CSharpTokenNode token) |
---|
703 | { |
---|
704 | return VisitChildren (token); |
---|
705 | } |
---|
706 | |
---|
707 | public virtual T VisitPrimitiveType (PrimitiveType primitiveType) |
---|
708 | { |
---|
709 | return VisitChildren (primitiveType); |
---|
710 | } |
---|
711 | |
---|
712 | public virtual T VisitComposedType (ComposedType composedType) |
---|
713 | { |
---|
714 | return VisitChildren (composedType); |
---|
715 | } |
---|
716 | |
---|
717 | public virtual T VisitSimpleType(SimpleType simpleType) |
---|
718 | { |
---|
719 | return VisitChildren (simpleType); |
---|
720 | } |
---|
721 | |
---|
722 | public virtual T VisitMemberType(MemberType memberType) |
---|
723 | { |
---|
724 | return VisitChildren (memberType); |
---|
725 | } |
---|
726 | |
---|
727 | public virtual T VisitAttribute (Attribute attribute) |
---|
728 | { |
---|
729 | return VisitChildren (attribute); |
---|
730 | } |
---|
731 | |
---|
732 | public virtual T VisitAttributeSection (AttributeSection attributeSection) |
---|
733 | { |
---|
734 | return VisitChildren (attributeSection); |
---|
735 | } |
---|
736 | |
---|
737 | public virtual T VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration) |
---|
738 | { |
---|
739 | return VisitChildren (delegateDeclaration); |
---|
740 | } |
---|
741 | |
---|
742 | public virtual T VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration) |
---|
743 | { |
---|
744 | return VisitChildren (namespaceDeclaration); |
---|
745 | } |
---|
746 | |
---|
747 | public virtual T VisitTypeDeclaration (TypeDeclaration typeDeclaration) |
---|
748 | { |
---|
749 | return VisitChildren (typeDeclaration); |
---|
750 | } |
---|
751 | |
---|
752 | public virtual T VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration) |
---|
753 | { |
---|
754 | return VisitChildren (typeParameterDeclaration); |
---|
755 | } |
---|
756 | |
---|
757 | public virtual T VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration) |
---|
758 | { |
---|
759 | return VisitChildren (enumMemberDeclaration); |
---|
760 | } |
---|
761 | |
---|
762 | public virtual T VisitUsingDeclaration (UsingDeclaration usingDeclaration) |
---|
763 | { |
---|
764 | return VisitChildren (usingDeclaration); |
---|
765 | } |
---|
766 | |
---|
767 | public virtual T VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration) |
---|
768 | { |
---|
769 | return VisitChildren (usingDeclaration); |
---|
770 | } |
---|
771 | |
---|
772 | public virtual T VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration) |
---|
773 | { |
---|
774 | return VisitChildren (externAliasDeclaration); |
---|
775 | } |
---|
776 | |
---|
777 | public virtual T VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration) |
---|
778 | { |
---|
779 | return VisitChildren (constructorDeclaration); |
---|
780 | } |
---|
781 | |
---|
782 | public virtual T VisitConstructorInitializer (ConstructorInitializer constructorInitializer) |
---|
783 | { |
---|
784 | return VisitChildren (constructorInitializer); |
---|
785 | } |
---|
786 | |
---|
787 | public virtual T VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration) |
---|
788 | { |
---|
789 | return VisitChildren (destructorDeclaration); |
---|
790 | } |
---|
791 | |
---|
792 | public virtual T VisitEventDeclaration (EventDeclaration eventDeclaration) |
---|
793 | { |
---|
794 | return VisitChildren (eventDeclaration); |
---|
795 | } |
---|
796 | |
---|
797 | public virtual T VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration) |
---|
798 | { |
---|
799 | return VisitChildren (eventDeclaration); |
---|
800 | } |
---|
801 | |
---|
802 | public virtual T VisitFieldDeclaration (FieldDeclaration fieldDeclaration) |
---|
803 | { |
---|
804 | return VisitChildren (fieldDeclaration); |
---|
805 | } |
---|
806 | |
---|
807 | public virtual T VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration) |
---|
808 | { |
---|
809 | return VisitChildren (fixedFieldDeclaration); |
---|
810 | } |
---|
811 | |
---|
812 | public virtual T VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer) |
---|
813 | { |
---|
814 | return VisitChildren (fixedVariableInitializer); |
---|
815 | } |
---|
816 | |
---|
817 | public virtual T VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration) |
---|
818 | { |
---|
819 | return VisitChildren (indexerDeclaration); |
---|
820 | } |
---|
821 | |
---|
822 | public virtual T VisitMethodDeclaration (MethodDeclaration methodDeclaration) |
---|
823 | { |
---|
824 | return VisitChildren (methodDeclaration); |
---|
825 | } |
---|
826 | |
---|
827 | public virtual T VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration) |
---|
828 | { |
---|
829 | return VisitChildren (operatorDeclaration); |
---|
830 | } |
---|
831 | |
---|
832 | public virtual T VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration) |
---|
833 | { |
---|
834 | return VisitChildren (propertyDeclaration); |
---|
835 | } |
---|
836 | |
---|
837 | public virtual T VisitAccessor (Accessor accessor) |
---|
838 | { |
---|
839 | return VisitChildren (accessor); |
---|
840 | } |
---|
841 | |
---|
842 | public virtual T VisitVariableInitializer (VariableInitializer variableInitializer) |
---|
843 | { |
---|
844 | return VisitChildren (variableInitializer); |
---|
845 | } |
---|
846 | |
---|
847 | public virtual T VisitParameterDeclaration (ParameterDeclaration parameterDeclaration) |
---|
848 | { |
---|
849 | return VisitChildren (parameterDeclaration); |
---|
850 | } |
---|
851 | |
---|
852 | public virtual T VisitConstraint (Constraint constraint) |
---|
853 | { |
---|
854 | return VisitChildren (constraint); |
---|
855 | } |
---|
856 | |
---|
857 | public virtual T VisitBlockStatement (BlockStatement blockStatement) |
---|
858 | { |
---|
859 | return VisitChildren (blockStatement); |
---|
860 | } |
---|
861 | |
---|
862 | public virtual T VisitExpressionStatement (ExpressionStatement expressionStatement) |
---|
863 | { |
---|
864 | return VisitChildren (expressionStatement); |
---|
865 | } |
---|
866 | |
---|
867 | public virtual T VisitBreakStatement (BreakStatement breakStatement) |
---|
868 | { |
---|
869 | return VisitChildren (breakStatement); |
---|
870 | } |
---|
871 | |
---|
872 | public virtual T VisitCheckedStatement (CheckedStatement checkedStatement) |
---|
873 | { |
---|
874 | return VisitChildren (checkedStatement); |
---|
875 | } |
---|
876 | |
---|
877 | public virtual T VisitContinueStatement (ContinueStatement continueStatement) |
---|
878 | { |
---|
879 | return VisitChildren (continueStatement); |
---|
880 | } |
---|
881 | |
---|
882 | public virtual T VisitDoWhileStatement (DoWhileStatement doWhileStatement) |
---|
883 | { |
---|
884 | return VisitChildren (doWhileStatement); |
---|
885 | } |
---|
886 | |
---|
887 | public virtual T VisitEmptyStatement (EmptyStatement emptyStatement) |
---|
888 | { |
---|
889 | return VisitChildren (emptyStatement); |
---|
890 | } |
---|
891 | |
---|
892 | public virtual T VisitFixedStatement (FixedStatement fixedStatement) |
---|
893 | { |
---|
894 | return VisitChildren (fixedStatement); |
---|
895 | } |
---|
896 | |
---|
897 | public virtual T VisitForeachStatement (ForeachStatement foreachStatement) |
---|
898 | { |
---|
899 | return VisitChildren (foreachStatement); |
---|
900 | } |
---|
901 | |
---|
902 | public virtual T VisitForStatement (ForStatement forStatement) |
---|
903 | { |
---|
904 | return VisitChildren (forStatement); |
---|
905 | } |
---|
906 | |
---|
907 | public virtual T VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement) |
---|
908 | { |
---|
909 | return VisitChildren (gotoCaseStatement); |
---|
910 | } |
---|
911 | |
---|
912 | public virtual T VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement) |
---|
913 | { |
---|
914 | return VisitChildren (gotoDefaultStatement); |
---|
915 | } |
---|
916 | |
---|
917 | public virtual T VisitGotoStatement (GotoStatement gotoStatement) |
---|
918 | { |
---|
919 | return VisitChildren (gotoStatement); |
---|
920 | } |
---|
921 | |
---|
922 | public virtual T VisitIfElseStatement (IfElseStatement ifElseStatement) |
---|
923 | { |
---|
924 | return VisitChildren (ifElseStatement); |
---|
925 | } |
---|
926 | |
---|
927 | public virtual T VisitLabelStatement (LabelStatement labelStatement) |
---|
928 | { |
---|
929 | return VisitChildren (labelStatement); |
---|
930 | } |
---|
931 | |
---|
932 | public virtual T VisitLockStatement (LockStatement lockStatement) |
---|
933 | { |
---|
934 | return VisitChildren (lockStatement); |
---|
935 | } |
---|
936 | |
---|
937 | public virtual T VisitReturnStatement (ReturnStatement returnStatement) |
---|
938 | { |
---|
939 | return VisitChildren (returnStatement); |
---|
940 | } |
---|
941 | |
---|
942 | public virtual T VisitSwitchStatement (SwitchStatement switchStatement) |
---|
943 | { |
---|
944 | return VisitChildren (switchStatement); |
---|
945 | } |
---|
946 | |
---|
947 | public virtual T VisitSwitchSection (SwitchSection switchSection) |
---|
948 | { |
---|
949 | return VisitChildren (switchSection); |
---|
950 | } |
---|
951 | |
---|
952 | public virtual T VisitCaseLabel (CaseLabel caseLabel) |
---|
953 | { |
---|
954 | return VisitChildren (caseLabel); |
---|
955 | } |
---|
956 | |
---|
957 | public virtual T VisitThrowStatement (ThrowStatement throwStatement) |
---|
958 | { |
---|
959 | return VisitChildren (throwStatement); |
---|
960 | } |
---|
961 | |
---|
962 | public virtual T VisitTryCatchStatement (TryCatchStatement tryCatchStatement) |
---|
963 | { |
---|
964 | return VisitChildren (tryCatchStatement); |
---|
965 | } |
---|
966 | |
---|
967 | public virtual T VisitCatchClause (CatchClause catchClause) |
---|
968 | { |
---|
969 | return VisitChildren (catchClause); |
---|
970 | } |
---|
971 | |
---|
972 | public virtual T VisitUncheckedStatement (UncheckedStatement uncheckedStatement) |
---|
973 | { |
---|
974 | return VisitChildren (uncheckedStatement); |
---|
975 | } |
---|
976 | |
---|
977 | public virtual T VisitUnsafeStatement (UnsafeStatement unsafeStatement) |
---|
978 | { |
---|
979 | return VisitChildren (unsafeStatement); |
---|
980 | } |
---|
981 | |
---|
982 | public virtual T VisitUsingStatement (UsingStatement usingStatement) |
---|
983 | { |
---|
984 | return VisitChildren (usingStatement); |
---|
985 | } |
---|
986 | |
---|
987 | public virtual T VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement) |
---|
988 | { |
---|
989 | return VisitChildren (variableDeclarationStatement); |
---|
990 | } |
---|
991 | |
---|
992 | public virtual T VisitWhileStatement (WhileStatement whileStatement) |
---|
993 | { |
---|
994 | return VisitChildren (whileStatement); |
---|
995 | } |
---|
996 | |
---|
997 | public virtual T VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement) |
---|
998 | { |
---|
999 | return VisitChildren (yieldBreakStatement); |
---|
1000 | } |
---|
1001 | |
---|
1002 | public virtual T VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement) |
---|
1003 | { |
---|
1004 | return VisitChildren (yieldReturnStatement); |
---|
1005 | } |
---|
1006 | |
---|
1007 | public virtual T VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression) |
---|
1008 | { |
---|
1009 | return VisitChildren (anonymousMethodExpression); |
---|
1010 | } |
---|
1011 | |
---|
1012 | public virtual T VisitLambdaExpression (LambdaExpression lambdaExpression) |
---|
1013 | { |
---|
1014 | return VisitChildren (lambdaExpression); |
---|
1015 | } |
---|
1016 | |
---|
1017 | public virtual T VisitAssignmentExpression (AssignmentExpression assignmentExpression) |
---|
1018 | { |
---|
1019 | return VisitChildren (assignmentExpression); |
---|
1020 | } |
---|
1021 | |
---|
1022 | public virtual T VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression) |
---|
1023 | { |
---|
1024 | return VisitChildren (baseReferenceExpression); |
---|
1025 | } |
---|
1026 | |
---|
1027 | public virtual T VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression) |
---|
1028 | { |
---|
1029 | return VisitChildren (binaryOperatorExpression); |
---|
1030 | } |
---|
1031 | |
---|
1032 | public virtual T VisitCastExpression (CastExpression castExpression) |
---|
1033 | { |
---|
1034 | return VisitChildren (castExpression); |
---|
1035 | } |
---|
1036 | |
---|
1037 | public virtual T VisitCheckedExpression (CheckedExpression checkedExpression) |
---|
1038 | { |
---|
1039 | return VisitChildren (checkedExpression); |
---|
1040 | } |
---|
1041 | |
---|
1042 | public virtual T VisitConditionalExpression (ConditionalExpression conditionalExpression) |
---|
1043 | { |
---|
1044 | return VisitChildren (conditionalExpression); |
---|
1045 | } |
---|
1046 | |
---|
1047 | public virtual T VisitIdentifierExpression (IdentifierExpression identifierExpression) |
---|
1048 | { |
---|
1049 | return VisitChildren (identifierExpression); |
---|
1050 | } |
---|
1051 | |
---|
1052 | public virtual T VisitIndexerExpression (IndexerExpression indexerExpression) |
---|
1053 | { |
---|
1054 | return VisitChildren (indexerExpression); |
---|
1055 | } |
---|
1056 | |
---|
1057 | public virtual T VisitInvocationExpression (InvocationExpression invocationExpression) |
---|
1058 | { |
---|
1059 | return VisitChildren (invocationExpression); |
---|
1060 | } |
---|
1061 | |
---|
1062 | public virtual T VisitDirectionExpression (DirectionExpression directionExpression) |
---|
1063 | { |
---|
1064 | return VisitChildren (directionExpression); |
---|
1065 | } |
---|
1066 | |
---|
1067 | public virtual T VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression) |
---|
1068 | { |
---|
1069 | return VisitChildren (memberReferenceExpression); |
---|
1070 | } |
---|
1071 | |
---|
1072 | public virtual T VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression) |
---|
1073 | { |
---|
1074 | return VisitChildren (nullReferenceExpression); |
---|
1075 | } |
---|
1076 | |
---|
1077 | public virtual T VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression) |
---|
1078 | { |
---|
1079 | return VisitChildren (objectCreateExpression); |
---|
1080 | } |
---|
1081 | |
---|
1082 | public virtual T VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression) |
---|
1083 | { |
---|
1084 | return VisitChildren (anonymousTypeCreateExpression); |
---|
1085 | } |
---|
1086 | |
---|
1087 | public virtual T VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression) |
---|
1088 | { |
---|
1089 | return VisitChildren (arrayCreateExpression); |
---|
1090 | } |
---|
1091 | |
---|
1092 | public virtual T VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression) |
---|
1093 | { |
---|
1094 | return VisitChildren (parenthesizedExpression); |
---|
1095 | } |
---|
1096 | |
---|
1097 | public virtual T VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression) |
---|
1098 | { |
---|
1099 | return VisitChildren (pointerReferenceExpression); |
---|
1100 | } |
---|
1101 | |
---|
1102 | public virtual T VisitPrimitiveExpression(PrimitiveExpression primitiveExpression) |
---|
1103 | { |
---|
1104 | return VisitChildren (primitiveExpression); |
---|
1105 | } |
---|
1106 | |
---|
1107 | public virtual T VisitSizeOfExpression (SizeOfExpression sizeOfExpression) |
---|
1108 | { |
---|
1109 | return VisitChildren (sizeOfExpression); |
---|
1110 | } |
---|
1111 | |
---|
1112 | public virtual T VisitStackAllocExpression (StackAllocExpression stackAllocExpression) |
---|
1113 | { |
---|
1114 | return VisitChildren (stackAllocExpression); |
---|
1115 | } |
---|
1116 | |
---|
1117 | public virtual T VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression) |
---|
1118 | { |
---|
1119 | return VisitChildren (thisReferenceExpression); |
---|
1120 | } |
---|
1121 | |
---|
1122 | public virtual T VisitTypeOfExpression (TypeOfExpression typeOfExpression) |
---|
1123 | { |
---|
1124 | return VisitChildren (typeOfExpression); |
---|
1125 | } |
---|
1126 | |
---|
1127 | public virtual T VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression) |
---|
1128 | { |
---|
1129 | return VisitChildren (typeReferenceExpression); |
---|
1130 | } |
---|
1131 | |
---|
1132 | public virtual T VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression) |
---|
1133 | { |
---|
1134 | return VisitChildren (unaryOperatorExpression); |
---|
1135 | } |
---|
1136 | |
---|
1137 | public virtual T VisitUncheckedExpression (UncheckedExpression uncheckedExpression) |
---|
1138 | { |
---|
1139 | return VisitChildren (uncheckedExpression); |
---|
1140 | } |
---|
1141 | |
---|
1142 | public virtual T VisitQueryExpression(QueryExpression queryExpression) |
---|
1143 | { |
---|
1144 | return VisitChildren (queryExpression); |
---|
1145 | } |
---|
1146 | |
---|
1147 | public virtual T VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause) |
---|
1148 | { |
---|
1149 | return VisitChildren (queryContinuationClause); |
---|
1150 | } |
---|
1151 | |
---|
1152 | public virtual T VisitQueryFromClause(QueryFromClause queryFromClause) |
---|
1153 | { |
---|
1154 | return VisitChildren (queryFromClause); |
---|
1155 | } |
---|
1156 | |
---|
1157 | public virtual T VisitQueryLetClause(QueryLetClause queryLetClause) |
---|
1158 | { |
---|
1159 | return VisitChildren (queryLetClause); |
---|
1160 | } |
---|
1161 | |
---|
1162 | public virtual T VisitQueryWhereClause(QueryWhereClause queryWhereClause) |
---|
1163 | { |
---|
1164 | return VisitChildren (queryWhereClause); |
---|
1165 | } |
---|
1166 | |
---|
1167 | public virtual T VisitQueryJoinClause(QueryJoinClause queryJoinClause) |
---|
1168 | { |
---|
1169 | return VisitChildren (queryJoinClause); |
---|
1170 | } |
---|
1171 | |
---|
1172 | public virtual T VisitQueryOrderClause(QueryOrderClause queryOrderClause) |
---|
1173 | { |
---|
1174 | return VisitChildren (queryOrderClause); |
---|
1175 | } |
---|
1176 | |
---|
1177 | public virtual T VisitQueryOrdering(QueryOrdering queryOrdering) |
---|
1178 | { |
---|
1179 | return VisitChildren (queryOrdering); |
---|
1180 | } |
---|
1181 | |
---|
1182 | public virtual T VisitQuerySelectClause(QuerySelectClause querySelectClause) |
---|
1183 | { |
---|
1184 | return VisitChildren (querySelectClause); |
---|
1185 | } |
---|
1186 | |
---|
1187 | public virtual T VisitQueryGroupClause(QueryGroupClause queryGroupClause) |
---|
1188 | { |
---|
1189 | return VisitChildren (queryGroupClause); |
---|
1190 | } |
---|
1191 | |
---|
1192 | public virtual T VisitAsExpression (AsExpression asExpression) |
---|
1193 | { |
---|
1194 | return VisitChildren (asExpression); |
---|
1195 | } |
---|
1196 | |
---|
1197 | public virtual T VisitIsExpression (IsExpression isExpression) |
---|
1198 | { |
---|
1199 | return VisitChildren (isExpression); |
---|
1200 | } |
---|
1201 | |
---|
1202 | public virtual T VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression) |
---|
1203 | { |
---|
1204 | return VisitChildren (defaultValueExpression); |
---|
1205 | } |
---|
1206 | |
---|
1207 | public virtual T VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression) |
---|
1208 | { |
---|
1209 | return VisitChildren (undocumentedExpression); |
---|
1210 | } |
---|
1211 | |
---|
1212 | public virtual T VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression) |
---|
1213 | { |
---|
1214 | return VisitChildren (arrayInitializerExpression); |
---|
1215 | } |
---|
1216 | |
---|
1217 | public virtual T VisitArraySpecifier (ArraySpecifier arraySpecifier) |
---|
1218 | { |
---|
1219 | return VisitChildren (arraySpecifier); |
---|
1220 | } |
---|
1221 | |
---|
1222 | public virtual T VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression) |
---|
1223 | { |
---|
1224 | return VisitChildren (namedArgumentExpression); |
---|
1225 | } |
---|
1226 | |
---|
1227 | public virtual T VisitNamedExpression (NamedExpression namedExpression) |
---|
1228 | { |
---|
1229 | return VisitChildren (namedExpression); |
---|
1230 | } |
---|
1231 | |
---|
1232 | public virtual T VisitErrorNode(AstNode errorNode) |
---|
1233 | { |
---|
1234 | return VisitChildren(errorNode); |
---|
1235 | } |
---|
1236 | |
---|
1237 | public virtual T VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern) |
---|
1238 | { |
---|
1239 | return VisitChildren (placeholder); |
---|
1240 | } |
---|
1241 | } |
---|
1242 | |
---|
1243 | /// <summary> |
---|
1244 | /// AST visitor with a default implementation that visits all node depth-first. |
---|
1245 | /// </summary> |
---|
1246 | public abstract class DepthFirstAstVisitor<T, S> : IAstVisitor<T, S> |
---|
1247 | { |
---|
1248 | protected virtual S VisitChildren (AstNode node, T data) |
---|
1249 | { |
---|
1250 | AstNode next; |
---|
1251 | for (var child = node.FirstChild; child != null; child = next) { |
---|
1252 | // Store next to allow the loop to continue |
---|
1253 | // if the visitor removes/replaces child. |
---|
1254 | next = child.NextSibling; |
---|
1255 | child.AcceptVisitor (this, data); |
---|
1256 | } |
---|
1257 | return default (S); |
---|
1258 | } |
---|
1259 | |
---|
1260 | public virtual S VisitNullNode(AstNode nullNode, T data) |
---|
1261 | { |
---|
1262 | // Should we call VisitChildren here? |
---|
1263 | // We usually want to ignore null nodes. |
---|
1264 | // Older NR versions (before VisitNullNode was introduced) didn't call VisitChildren() with null nodes; |
---|
1265 | // so changing this might break VisitChildren() overrides that expect the node to be part of the AST. |
---|
1266 | return default (S); |
---|
1267 | } |
---|
1268 | |
---|
1269 | public virtual S VisitSyntaxTree (SyntaxTree unit, T data) |
---|
1270 | { |
---|
1271 | return VisitChildren (unit, data); |
---|
1272 | } |
---|
1273 | |
---|
1274 | public virtual S VisitComment (Comment comment, T data) |
---|
1275 | { |
---|
1276 | return VisitChildren (comment, data); |
---|
1277 | } |
---|
1278 | |
---|
1279 | public virtual S VisitNewLine(NewLineNode newLineNode, T data) |
---|
1280 | { |
---|
1281 | return VisitChildren(newLineNode, data); |
---|
1282 | } |
---|
1283 | |
---|
1284 | public virtual S VisitWhitespace(WhitespaceNode whitespaceNode, T data) |
---|
1285 | { |
---|
1286 | return VisitChildren(whitespaceNode, data); |
---|
1287 | } |
---|
1288 | |
---|
1289 | public virtual S VisitText(TextNode textNode, T data) |
---|
1290 | { |
---|
1291 | return VisitChildren(textNode, data); |
---|
1292 | } |
---|
1293 | |
---|
1294 | public virtual S VisitDocumentationReference (DocumentationReference documentationReference, T data) |
---|
1295 | { |
---|
1296 | return VisitChildren (documentationReference, data); |
---|
1297 | } |
---|
1298 | |
---|
1299 | public virtual S VisitPreProcessorDirective (PreProcessorDirective preProcessorDirective, T data) |
---|
1300 | { |
---|
1301 | return VisitChildren (preProcessorDirective, data); |
---|
1302 | } |
---|
1303 | |
---|
1304 | public virtual S VisitIdentifier (Identifier identifier, T data) |
---|
1305 | { |
---|
1306 | return VisitChildren (identifier, data); |
---|
1307 | } |
---|
1308 | |
---|
1309 | public virtual S VisitCSharpTokenNode (CSharpTokenNode token, T data) |
---|
1310 | { |
---|
1311 | return VisitChildren (token, data); |
---|
1312 | } |
---|
1313 | |
---|
1314 | public virtual S VisitPrimitiveType (PrimitiveType primitiveType, T data) |
---|
1315 | { |
---|
1316 | return VisitChildren (primitiveType, data); |
---|
1317 | } |
---|
1318 | |
---|
1319 | public virtual S VisitComposedType (ComposedType composedType, T data) |
---|
1320 | { |
---|
1321 | return VisitChildren (composedType, data); |
---|
1322 | } |
---|
1323 | |
---|
1324 | public virtual S VisitSimpleType(SimpleType simpleType, T data) |
---|
1325 | { |
---|
1326 | return VisitChildren (simpleType, data); |
---|
1327 | } |
---|
1328 | |
---|
1329 | public virtual S VisitMemberType(MemberType memberType, T data) |
---|
1330 | { |
---|
1331 | return VisitChildren (memberType, data); |
---|
1332 | } |
---|
1333 | |
---|
1334 | public virtual S VisitAttribute (Attribute attribute, T data) |
---|
1335 | { |
---|
1336 | return VisitChildren (attribute, data); |
---|
1337 | } |
---|
1338 | |
---|
1339 | public virtual S VisitAttributeSection (AttributeSection attributeSection, T data) |
---|
1340 | { |
---|
1341 | return VisitChildren (attributeSection, data); |
---|
1342 | } |
---|
1343 | |
---|
1344 | public virtual S VisitDelegateDeclaration (DelegateDeclaration delegateDeclaration, T data) |
---|
1345 | { |
---|
1346 | return VisitChildren (delegateDeclaration, data); |
---|
1347 | } |
---|
1348 | |
---|
1349 | public virtual S VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration, T data) |
---|
1350 | { |
---|
1351 | return VisitChildren (namespaceDeclaration, data); |
---|
1352 | } |
---|
1353 | |
---|
1354 | public virtual S VisitTypeDeclaration (TypeDeclaration typeDeclaration, T data) |
---|
1355 | { |
---|
1356 | return VisitChildren (typeDeclaration, data); |
---|
1357 | } |
---|
1358 | |
---|
1359 | public virtual S VisitTypeParameterDeclaration (TypeParameterDeclaration typeParameterDeclaration, T data) |
---|
1360 | { |
---|
1361 | return VisitChildren (typeParameterDeclaration, data); |
---|
1362 | } |
---|
1363 | |
---|
1364 | public virtual S VisitEnumMemberDeclaration (EnumMemberDeclaration enumMemberDeclaration, T data) |
---|
1365 | { |
---|
1366 | return VisitChildren (enumMemberDeclaration, data); |
---|
1367 | } |
---|
1368 | |
---|
1369 | public virtual S VisitUsingDeclaration (UsingDeclaration usingDeclaration, T data) |
---|
1370 | { |
---|
1371 | return VisitChildren (usingDeclaration, data); |
---|
1372 | } |
---|
1373 | |
---|
1374 | public virtual S VisitUsingAliasDeclaration (UsingAliasDeclaration usingDeclaration, T data) |
---|
1375 | { |
---|
1376 | return VisitChildren (usingDeclaration, data); |
---|
1377 | } |
---|
1378 | |
---|
1379 | public virtual S VisitExternAliasDeclaration(ExternAliasDeclaration externAliasDeclaration, T data) |
---|
1380 | { |
---|
1381 | return VisitChildren (externAliasDeclaration, data); |
---|
1382 | } |
---|
1383 | |
---|
1384 | public virtual S VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration, T data) |
---|
1385 | { |
---|
1386 | return VisitChildren (constructorDeclaration, data); |
---|
1387 | } |
---|
1388 | |
---|
1389 | public virtual S VisitConstructorInitializer (ConstructorInitializer constructorInitializer, T data) |
---|
1390 | { |
---|
1391 | return VisitChildren (constructorInitializer, data); |
---|
1392 | } |
---|
1393 | |
---|
1394 | public virtual S VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration, T data) |
---|
1395 | { |
---|
1396 | return VisitChildren (destructorDeclaration, data); |
---|
1397 | } |
---|
1398 | |
---|
1399 | public virtual S VisitEventDeclaration (EventDeclaration eventDeclaration, T data) |
---|
1400 | { |
---|
1401 | return VisitChildren (eventDeclaration, data); |
---|
1402 | } |
---|
1403 | |
---|
1404 | public virtual S VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration, T data) |
---|
1405 | { |
---|
1406 | return VisitChildren (eventDeclaration, data); |
---|
1407 | } |
---|
1408 | |
---|
1409 | public virtual S VisitFieldDeclaration (FieldDeclaration fieldDeclaration, T data) |
---|
1410 | { |
---|
1411 | return VisitChildren (fieldDeclaration, data); |
---|
1412 | } |
---|
1413 | |
---|
1414 | public virtual S VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration, T data) |
---|
1415 | { |
---|
1416 | return VisitChildren (fixedFieldDeclaration, data); |
---|
1417 | } |
---|
1418 | |
---|
1419 | public virtual S VisitFixedVariableInitializer (FixedVariableInitializer fixedVariableInitializer, T data) |
---|
1420 | { |
---|
1421 | return VisitChildren (fixedVariableInitializer, data); |
---|
1422 | } |
---|
1423 | |
---|
1424 | public virtual S VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration, T data) |
---|
1425 | { |
---|
1426 | return VisitChildren (indexerDeclaration, data); |
---|
1427 | } |
---|
1428 | |
---|
1429 | public virtual S VisitMethodDeclaration (MethodDeclaration methodDeclaration, T data) |
---|
1430 | { |
---|
1431 | return VisitChildren (methodDeclaration, data); |
---|
1432 | } |
---|
1433 | |
---|
1434 | public virtual S VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration, T data) |
---|
1435 | { |
---|
1436 | return VisitChildren (operatorDeclaration, data); |
---|
1437 | } |
---|
1438 | |
---|
1439 | public virtual S VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration, T data) |
---|
1440 | { |
---|
1441 | return VisitChildren (propertyDeclaration, data); |
---|
1442 | } |
---|
1443 | |
---|
1444 | public virtual S VisitAccessor (Accessor accessor, T data) |
---|
1445 | { |
---|
1446 | return VisitChildren (accessor, data); |
---|
1447 | } |
---|
1448 | |
---|
1449 | public virtual S VisitVariableInitializer (VariableInitializer variableInitializer, T data) |
---|
1450 | { |
---|
1451 | return VisitChildren (variableInitializer, data); |
---|
1452 | } |
---|
1453 | |
---|
1454 | public virtual S VisitParameterDeclaration (ParameterDeclaration parameterDeclaration, T data) |
---|
1455 | { |
---|
1456 | return VisitChildren (parameterDeclaration, data); |
---|
1457 | } |
---|
1458 | |
---|
1459 | public virtual S VisitConstraint (Constraint constraint, T data) |
---|
1460 | { |
---|
1461 | return VisitChildren (constraint, data); |
---|
1462 | } |
---|
1463 | |
---|
1464 | public virtual S VisitBlockStatement (BlockStatement blockStatement, T data) |
---|
1465 | { |
---|
1466 | return VisitChildren (blockStatement, data); |
---|
1467 | } |
---|
1468 | |
---|
1469 | public virtual S VisitExpressionStatement (ExpressionStatement expressionStatement, T data) |
---|
1470 | { |
---|
1471 | return VisitChildren (expressionStatement, data); |
---|
1472 | } |
---|
1473 | |
---|
1474 | public virtual S VisitBreakStatement (BreakStatement breakStatement, T data) |
---|
1475 | { |
---|
1476 | return VisitChildren (breakStatement, data); |
---|
1477 | } |
---|
1478 | |
---|
1479 | public virtual S VisitCheckedStatement (CheckedStatement checkedStatement, T data) |
---|
1480 | { |
---|
1481 | return VisitChildren (checkedStatement, data); |
---|
1482 | } |
---|
1483 | |
---|
1484 | public virtual S VisitContinueStatement (ContinueStatement continueStatement, T data) |
---|
1485 | { |
---|
1486 | return VisitChildren (continueStatement, data); |
---|
1487 | } |
---|
1488 | |
---|
1489 | public virtual S VisitDoWhileStatement (DoWhileStatement doWhileStatement, T data) |
---|
1490 | { |
---|
1491 | return VisitChildren (doWhileStatement, data); |
---|
1492 | } |
---|
1493 | |
---|
1494 | public virtual S VisitEmptyStatement (EmptyStatement emptyStatement, T data) |
---|
1495 | { |
---|
1496 | return VisitChildren (emptyStatement, data); |
---|
1497 | } |
---|
1498 | |
---|
1499 | public virtual S VisitFixedStatement (FixedStatement fixedStatement, T data) |
---|
1500 | { |
---|
1501 | return VisitChildren (fixedStatement, data); |
---|
1502 | } |
---|
1503 | |
---|
1504 | public virtual S VisitForeachStatement (ForeachStatement foreachStatement, T data) |
---|
1505 | { |
---|
1506 | return VisitChildren (foreachStatement, data); |
---|
1507 | } |
---|
1508 | |
---|
1509 | public virtual S VisitForStatement (ForStatement forStatement, T data) |
---|
1510 | { |
---|
1511 | return VisitChildren (forStatement, data); |
---|
1512 | } |
---|
1513 | |
---|
1514 | public virtual S VisitGotoCaseStatement (GotoCaseStatement gotoCaseStatement, T data) |
---|
1515 | { |
---|
1516 | return VisitChildren (gotoCaseStatement, data); |
---|
1517 | } |
---|
1518 | |
---|
1519 | public virtual S VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement, T data) |
---|
1520 | { |
---|
1521 | return VisitChildren (gotoDefaultStatement, data); |
---|
1522 | } |
---|
1523 | |
---|
1524 | public virtual S VisitGotoStatement (GotoStatement gotoStatement, T data) |
---|
1525 | { |
---|
1526 | return VisitChildren (gotoStatement, data); |
---|
1527 | } |
---|
1528 | |
---|
1529 | public virtual S VisitIfElseStatement (IfElseStatement ifElseStatement, T data) |
---|
1530 | { |
---|
1531 | return VisitChildren (ifElseStatement, data); |
---|
1532 | } |
---|
1533 | |
---|
1534 | public virtual S VisitLabelStatement (LabelStatement labelStatement, T data) |
---|
1535 | { |
---|
1536 | return VisitChildren (labelStatement, data); |
---|
1537 | } |
---|
1538 | |
---|
1539 | public virtual S VisitLockStatement (LockStatement lockStatement, T data) |
---|
1540 | { |
---|
1541 | return VisitChildren (lockStatement, data); |
---|
1542 | } |
---|
1543 | |
---|
1544 | public virtual S VisitReturnStatement (ReturnStatement returnStatement, T data) |
---|
1545 | { |
---|
1546 | return VisitChildren (returnStatement, data); |
---|
1547 | } |
---|
1548 | |
---|
1549 | public virtual S VisitSwitchStatement (SwitchStatement switchStatement, T data) |
---|
1550 | { |
---|
1551 | return VisitChildren (switchStatement, data); |
---|
1552 | } |
---|
1553 | |
---|
1554 | public virtual S VisitSwitchSection (SwitchSection switchSection, T data) |
---|
1555 | { |
---|
1556 | return VisitChildren (switchSection, data); |
---|
1557 | } |
---|
1558 | |
---|
1559 | public virtual S VisitCaseLabel (CaseLabel caseLabel, T data) |
---|
1560 | { |
---|
1561 | return VisitChildren (caseLabel, data); |
---|
1562 | } |
---|
1563 | |
---|
1564 | public virtual S VisitThrowStatement (ThrowStatement throwStatement, T data) |
---|
1565 | { |
---|
1566 | return VisitChildren (throwStatement, data); |
---|
1567 | } |
---|
1568 | |
---|
1569 | public virtual S VisitTryCatchStatement (TryCatchStatement tryCatchStatement, T data) |
---|
1570 | { |
---|
1571 | return VisitChildren (tryCatchStatement, data); |
---|
1572 | } |
---|
1573 | |
---|
1574 | public virtual S VisitCatchClause (CatchClause catchClause, T data) |
---|
1575 | { |
---|
1576 | return VisitChildren (catchClause, data); |
---|
1577 | } |
---|
1578 | |
---|
1579 | public virtual S VisitUncheckedStatement (UncheckedStatement uncheckedStatement, T data) |
---|
1580 | { |
---|
1581 | return VisitChildren (uncheckedStatement, data); |
---|
1582 | } |
---|
1583 | |
---|
1584 | public virtual S VisitUnsafeStatement (UnsafeStatement unsafeStatement, T data) |
---|
1585 | { |
---|
1586 | return VisitChildren (unsafeStatement, data); |
---|
1587 | } |
---|
1588 | |
---|
1589 | public virtual S VisitUsingStatement (UsingStatement usingStatement, T data) |
---|
1590 | { |
---|
1591 | return VisitChildren (usingStatement, data); |
---|
1592 | } |
---|
1593 | |
---|
1594 | public virtual S VisitVariableDeclarationStatement (VariableDeclarationStatement variableDeclarationStatement, T data) |
---|
1595 | { |
---|
1596 | return VisitChildren (variableDeclarationStatement, data); |
---|
1597 | } |
---|
1598 | |
---|
1599 | public virtual S VisitWhileStatement (WhileStatement whileStatement, T data) |
---|
1600 | { |
---|
1601 | return VisitChildren (whileStatement, data); |
---|
1602 | } |
---|
1603 | |
---|
1604 | public virtual S VisitYieldBreakStatement (YieldBreakStatement yieldBreakStatement, T data) |
---|
1605 | { |
---|
1606 | return VisitChildren (yieldBreakStatement, data); |
---|
1607 | } |
---|
1608 | |
---|
1609 | public virtual S VisitYieldReturnStatement (YieldReturnStatement yieldReturnStatement, T data) |
---|
1610 | { |
---|
1611 | return VisitChildren (yieldReturnStatement, data); |
---|
1612 | } |
---|
1613 | |
---|
1614 | public virtual S VisitAnonymousMethodExpression (AnonymousMethodExpression anonymousMethodExpression, T data) |
---|
1615 | { |
---|
1616 | return VisitChildren (anonymousMethodExpression, data); |
---|
1617 | } |
---|
1618 | |
---|
1619 | public virtual S VisitLambdaExpression (LambdaExpression lambdaExpression, T data) |
---|
1620 | { |
---|
1621 | return VisitChildren (lambdaExpression, data); |
---|
1622 | } |
---|
1623 | |
---|
1624 | public virtual S VisitAssignmentExpression (AssignmentExpression assignmentExpression, T data) |
---|
1625 | { |
---|
1626 | return VisitChildren (assignmentExpression, data); |
---|
1627 | } |
---|
1628 | |
---|
1629 | public virtual S VisitBaseReferenceExpression (BaseReferenceExpression baseReferenceExpression, T data) |
---|
1630 | { |
---|
1631 | return VisitChildren (baseReferenceExpression, data); |
---|
1632 | } |
---|
1633 | |
---|
1634 | public virtual S VisitBinaryOperatorExpression (BinaryOperatorExpression binaryOperatorExpression, T data) |
---|
1635 | { |
---|
1636 | return VisitChildren (binaryOperatorExpression, data); |
---|
1637 | } |
---|
1638 | |
---|
1639 | public virtual S VisitCastExpression (CastExpression castExpression, T data) |
---|
1640 | { |
---|
1641 | return VisitChildren (castExpression, data); |
---|
1642 | } |
---|
1643 | |
---|
1644 | public virtual S VisitCheckedExpression (CheckedExpression checkedExpression, T data) |
---|
1645 | { |
---|
1646 | return VisitChildren (checkedExpression, data); |
---|
1647 | } |
---|
1648 | |
---|
1649 | public virtual S VisitConditionalExpression (ConditionalExpression conditionalExpression, T data) |
---|
1650 | { |
---|
1651 | return VisitChildren (conditionalExpression, data); |
---|
1652 | } |
---|
1653 | |
---|
1654 | public virtual S VisitIdentifierExpression (IdentifierExpression identifierExpression, T data) |
---|
1655 | { |
---|
1656 | return VisitChildren (identifierExpression, data); |
---|
1657 | } |
---|
1658 | |
---|
1659 | public virtual S VisitIndexerExpression (IndexerExpression indexerExpression, T data) |
---|
1660 | { |
---|
1661 | return VisitChildren (indexerExpression, data); |
---|
1662 | } |
---|
1663 | |
---|
1664 | public virtual S VisitInvocationExpression (InvocationExpression invocationExpression, T data) |
---|
1665 | { |
---|
1666 | return VisitChildren (invocationExpression, data); |
---|
1667 | } |
---|
1668 | |
---|
1669 | public virtual S VisitDirectionExpression (DirectionExpression directionExpression, T data) |
---|
1670 | { |
---|
1671 | return VisitChildren (directionExpression, data); |
---|
1672 | } |
---|
1673 | |
---|
1674 | public virtual S VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression, T data) |
---|
1675 | { |
---|
1676 | return VisitChildren (memberReferenceExpression, data); |
---|
1677 | } |
---|
1678 | |
---|
1679 | public virtual S VisitNullReferenceExpression (NullReferenceExpression nullReferenceExpression, T data) |
---|
1680 | { |
---|
1681 | return VisitChildren (nullReferenceExpression, data); |
---|
1682 | } |
---|
1683 | |
---|
1684 | public virtual S VisitObjectCreateExpression (ObjectCreateExpression objectCreateExpression, T data) |
---|
1685 | { |
---|
1686 | return VisitChildren (objectCreateExpression, data); |
---|
1687 | } |
---|
1688 | |
---|
1689 | public virtual S VisitAnonymousTypeCreateExpression(AnonymousTypeCreateExpression anonymousTypeCreateExpression, T data) |
---|
1690 | { |
---|
1691 | return VisitChildren (anonymousTypeCreateExpression, data); |
---|
1692 | } |
---|
1693 | |
---|
1694 | public virtual S VisitArrayCreateExpression (ArrayCreateExpression arrayCreateExpression, T data) |
---|
1695 | { |
---|
1696 | return VisitChildren (arrayCreateExpression, data); |
---|
1697 | } |
---|
1698 | |
---|
1699 | public virtual S VisitParenthesizedExpression (ParenthesizedExpression parenthesizedExpression, T data) |
---|
1700 | { |
---|
1701 | return VisitChildren (parenthesizedExpression, data); |
---|
1702 | } |
---|
1703 | |
---|
1704 | public virtual S VisitPointerReferenceExpression (PointerReferenceExpression pointerReferenceExpression, T data) |
---|
1705 | { |
---|
1706 | return VisitChildren (pointerReferenceExpression, data); |
---|
1707 | } |
---|
1708 | |
---|
1709 | public virtual S VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, T data) |
---|
1710 | { |
---|
1711 | return VisitChildren (primitiveExpression, data); |
---|
1712 | } |
---|
1713 | |
---|
1714 | public virtual S VisitSizeOfExpression (SizeOfExpression sizeOfExpression, T data) |
---|
1715 | { |
---|
1716 | return VisitChildren (sizeOfExpression, data); |
---|
1717 | } |
---|
1718 | |
---|
1719 | public virtual S VisitStackAllocExpression (StackAllocExpression stackAllocExpression, T data) |
---|
1720 | { |
---|
1721 | return VisitChildren (stackAllocExpression, data); |
---|
1722 | } |
---|
1723 | |
---|
1724 | public virtual S VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, T data) |
---|
1725 | { |
---|
1726 | return VisitChildren (thisReferenceExpression, data); |
---|
1727 | } |
---|
1728 | |
---|
1729 | public virtual S VisitTypeOfExpression (TypeOfExpression typeOfExpression, T data) |
---|
1730 | { |
---|
1731 | return VisitChildren (typeOfExpression, data); |
---|
1732 | } |
---|
1733 | |
---|
1734 | public virtual S VisitTypeReferenceExpression(TypeReferenceExpression typeReferenceExpression, T data) |
---|
1735 | { |
---|
1736 | return VisitChildren (typeReferenceExpression, data); |
---|
1737 | } |
---|
1738 | |
---|
1739 | public virtual S VisitUnaryOperatorExpression (UnaryOperatorExpression unaryOperatorExpression, T data) |
---|
1740 | { |
---|
1741 | return VisitChildren (unaryOperatorExpression, data); |
---|
1742 | } |
---|
1743 | |
---|
1744 | public virtual S VisitUncheckedExpression (UncheckedExpression uncheckedExpression, T data) |
---|
1745 | { |
---|
1746 | return VisitChildren (uncheckedExpression, data); |
---|
1747 | } |
---|
1748 | |
---|
1749 | public virtual S VisitQueryExpression(QueryExpression queryExpression, T data) |
---|
1750 | { |
---|
1751 | return VisitChildren (queryExpression, data); |
---|
1752 | } |
---|
1753 | |
---|
1754 | public virtual S VisitQueryContinuationClause(QueryContinuationClause queryContinuationClause, T data) |
---|
1755 | { |
---|
1756 | return VisitChildren (queryContinuationClause, data); |
---|
1757 | } |
---|
1758 | |
---|
1759 | public virtual S VisitQueryFromClause(QueryFromClause queryFromClause, T data) |
---|
1760 | { |
---|
1761 | return VisitChildren (queryFromClause, data); |
---|
1762 | } |
---|
1763 | |
---|
1764 | public virtual S VisitQueryLetClause(QueryLetClause queryLetClause, T data) |
---|
1765 | { |
---|
1766 | return VisitChildren (queryLetClause, data); |
---|
1767 | } |
---|
1768 | |
---|
1769 | public virtual S VisitQueryWhereClause(QueryWhereClause queryWhereClause, T data) |
---|
1770 | { |
---|
1771 | return VisitChildren (queryWhereClause, data); |
---|
1772 | } |
---|
1773 | |
---|
1774 | public virtual S VisitQueryJoinClause(QueryJoinClause queryJoinClause, T data) |
---|
1775 | { |
---|
1776 | return VisitChildren (queryJoinClause, data); |
---|
1777 | } |
---|
1778 | |
---|
1779 | public virtual S VisitQueryOrderClause(QueryOrderClause queryOrderClause, T data) |
---|
1780 | { |
---|
1781 | return VisitChildren (queryOrderClause, data); |
---|
1782 | } |
---|
1783 | |
---|
1784 | public virtual S VisitQueryOrdering(QueryOrdering queryOrdering, T data) |
---|
1785 | { |
---|
1786 | return VisitChildren (queryOrdering, data); |
---|
1787 | } |
---|
1788 | |
---|
1789 | public virtual S VisitQuerySelectClause(QuerySelectClause querySelectClause, T data) |
---|
1790 | { |
---|
1791 | return VisitChildren (querySelectClause, data); |
---|
1792 | } |
---|
1793 | |
---|
1794 | public virtual S VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data) |
---|
1795 | { |
---|
1796 | return VisitChildren (queryGroupClause, data); |
---|
1797 | } |
---|
1798 | |
---|
1799 | public virtual S VisitAsExpression (AsExpression asExpression, T data) |
---|
1800 | { |
---|
1801 | return VisitChildren (asExpression, data); |
---|
1802 | } |
---|
1803 | |
---|
1804 | public virtual S VisitIsExpression (IsExpression isExpression, T data) |
---|
1805 | { |
---|
1806 | return VisitChildren (isExpression, data); |
---|
1807 | } |
---|
1808 | |
---|
1809 | public virtual S VisitDefaultValueExpression (DefaultValueExpression defaultValueExpression, T data) |
---|
1810 | { |
---|
1811 | return VisitChildren (defaultValueExpression, data); |
---|
1812 | } |
---|
1813 | |
---|
1814 | public virtual S VisitUndocumentedExpression (UndocumentedExpression undocumentedExpression, T data) |
---|
1815 | { |
---|
1816 | return VisitChildren (undocumentedExpression, data); |
---|
1817 | } |
---|
1818 | |
---|
1819 | public virtual S VisitArrayInitializerExpression (ArrayInitializerExpression arrayInitializerExpression, T data) |
---|
1820 | { |
---|
1821 | return VisitChildren (arrayInitializerExpression, data); |
---|
1822 | } |
---|
1823 | |
---|
1824 | public virtual S VisitArraySpecifier (ArraySpecifier arraySpecifier, T data) |
---|
1825 | { |
---|
1826 | return VisitChildren (arraySpecifier, data); |
---|
1827 | } |
---|
1828 | |
---|
1829 | public virtual S VisitNamedArgumentExpression (NamedArgumentExpression namedArgumentExpression, T data) |
---|
1830 | { |
---|
1831 | return VisitChildren (namedArgumentExpression, data); |
---|
1832 | } |
---|
1833 | |
---|
1834 | public virtual S VisitNamedExpression (NamedExpression namedExpression, T data) |
---|
1835 | { |
---|
1836 | return VisitChildren (namedExpression, data); |
---|
1837 | } |
---|
1838 | |
---|
1839 | public virtual S VisitErrorNode(AstNode errorNode, T data) |
---|
1840 | { |
---|
1841 | return VisitChildren(errorNode, data); |
---|
1842 | } |
---|
1843 | |
---|
1844 | public virtual S VisitPatternPlaceholder(AstNode placeholder, PatternMatching.Pattern pattern, T data) |
---|
1845 | { |
---|
1846 | return VisitChildren (placeholder, data); |
---|
1847 | } |
---|
1848 | } |
---|
1849 | } |
---|