OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library kernel.ast.visitor; | 4 library kernel.ast.visitor; |
5 | 5 |
6 import 'ast.dart'; | 6 import 'ast.dart'; |
7 | 7 |
8 abstract class ExpressionVisitor<R> { | 8 abstract class ExpressionVisitor<R> { |
9 R defaultExpression(Expression node) => null; | 9 R defaultExpression(Expression node) => null; |
10 R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node); | 10 R defaultBasicLiteral(BasicLiteral node) => defaultExpression(node); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 R visitFieldInitializer(FieldInitializer node) => defaultInitializer(node); | 215 R visitFieldInitializer(FieldInitializer node) => defaultInitializer(node); |
216 R visitSuperInitializer(SuperInitializer node) => defaultInitializer(node); | 216 R visitSuperInitializer(SuperInitializer node) => defaultInitializer(node); |
217 R visitRedirectingInitializer(RedirectingInitializer node) => | 217 R visitRedirectingInitializer(RedirectingInitializer node) => |
218 defaultInitializer(node); | 218 defaultInitializer(node); |
219 R visitLocalInitializer(LocalInitializer node) => defaultInitializer(node); | 219 R visitLocalInitializer(LocalInitializer node) => defaultInitializer(node); |
220 | 220 |
221 // Other tree nodes | 221 // Other tree nodes |
222 R visitLibrary(Library node) => defaultTreeNode(node); | 222 R visitLibrary(Library node) => defaultTreeNode(node); |
223 R visitLibraryDependency(LibraryDependency node) => defaultTreeNode(node); | 223 R visitLibraryDependency(LibraryDependency node) => defaultTreeNode(node); |
224 R visitCombinator(Combinator node) => defaultTreeNode(node); | 224 R visitCombinator(Combinator node) => defaultTreeNode(node); |
| 225 R visitLibraryPart(LibraryPart node) => defaultTreeNode(node); |
225 R visitTypedef(Typedef node) => defaultTreeNode(node); | 226 R visitTypedef(Typedef node) => defaultTreeNode(node); |
226 R visitTypeParameter(TypeParameter node) => defaultTreeNode(node); | 227 R visitTypeParameter(TypeParameter node) => defaultTreeNode(node); |
227 R visitFunctionNode(FunctionNode node) => defaultTreeNode(node); | 228 R visitFunctionNode(FunctionNode node) => defaultTreeNode(node); |
228 R visitArguments(Arguments node) => defaultTreeNode(node); | 229 R visitArguments(Arguments node) => defaultTreeNode(node); |
229 R visitNamedExpression(NamedExpression node) => defaultTreeNode(node); | 230 R visitNamedExpression(NamedExpression node) => defaultTreeNode(node); |
230 R visitSwitchCase(SwitchCase node) => defaultTreeNode(node); | 231 R visitSwitchCase(SwitchCase node) => defaultTreeNode(node); |
231 R visitCatch(Catch node) => defaultTreeNode(node); | 232 R visitCatch(Catch node) => defaultTreeNode(node); |
232 R visitMapEntry(MapEntry node) => defaultTreeNode(node); | 233 R visitMapEntry(MapEntry node) => defaultTreeNode(node); |
233 R visitProgram(Program node) => defaultTreeNode(node); | 234 R visitProgram(Program node) => defaultTreeNode(node); |
234 } | 235 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 defaultStatement(node, arg); | 437 defaultStatement(node, arg); |
437 R visitTryCatch(TryCatch node, T arg) => defaultStatement(node, arg); | 438 R visitTryCatch(TryCatch node, T arg) => defaultStatement(node, arg); |
438 R visitTryFinally(TryFinally node, T arg) => defaultStatement(node, arg); | 439 R visitTryFinally(TryFinally node, T arg) => defaultStatement(node, arg); |
439 R visitYieldStatement(YieldStatement node, T arg) => | 440 R visitYieldStatement(YieldStatement node, T arg) => |
440 defaultStatement(node, arg); | 441 defaultStatement(node, arg); |
441 R visitVariableDeclaration(VariableDeclaration node, T arg) => | 442 R visitVariableDeclaration(VariableDeclaration node, T arg) => |
442 defaultStatement(node, arg); | 443 defaultStatement(node, arg); |
443 R visitFunctionDeclaration(FunctionDeclaration node, T arg) => | 444 R visitFunctionDeclaration(FunctionDeclaration node, T arg) => |
444 defaultStatement(node, arg); | 445 defaultStatement(node, arg); |
445 } | 446 } |
OLD | NEW |