OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 library visitor; | |
6 | |
7 import 'elements.dart'; | |
8 import '../closure.dart' | |
9 show BoxFieldElement, | |
10 ClosureClassElement, | |
11 ClosureFieldElement; | |
12 | |
13 abstract class ElementVisitor<R> { | |
14 R visit(Element e) => e.accept(this); | |
15 | |
16 R visitElement(Element e); | |
17 R visitErroneousElement(ErroneousElement e) => visitFunctionElement(e); | |
18 R visitWarnOnUseElement(WarnOnUseElement e) => visitElement(e); | |
19 R visitAmbiguousElement(AmbiguousElement e) => visitElement(e); | |
20 R visitScopeContainerElement(ScopeContainerElement e) => visitElement(e); | |
21 R visitCompilationUnitElement(CompilationUnitElement e) => visitElement(e); | |
22 R visitLibraryElement(LibraryElement e) => visitScopeContainerElement(e); | |
23 R visitPrefixElement(PrefixElement e) => visitElement(e); | |
24 R visitTypedefElement(TypedefElement e) => visitElement(e); | |
25 R visitVariableElement(VariableElement e) => visitElement(e); | |
26 R visitParameterElement(ParameterElement e) => visitVariableElement(e); | |
27 R visitFormalElement(FormalElement e) => visitElement(e); | |
28 R visitFieldElement(FieldElement e) => visitVariableElement(e); | |
29 R visitFieldParameterElement(InitializingFormalElement e) => | |
30 visitParameterElement(e); | |
31 R visitAbstractFieldElement(AbstractFieldElement e) => visitElement(e); | |
32 R visitFunctionElement(FunctionElement e) => visitElement(e); | |
33 R visitConstructorBodyElement(ConstructorBodyElement e) => visitElement(e); | |
34 R visitClassElement(ClassElement e) => visitScopeContainerElement(e); | |
35 R visitTypeDeclarationElement(TypeDeclarationElement e) => visitElement(e); | |
36 R visitMixinApplicationElement(MixinApplicationElement e) { | |
37 return visitClassElement(e); | |
38 } | |
39 R visitTypeVariableElement(TypeVariableElement e) => visitElement(e); | |
40 R visitBoxFieldElement(BoxFieldElement e) => visitElement(e); | |
41 R visitClosureClassElement(ClosureClassElement e) => visitClassElement(e); | |
42 R visitClosureFieldElement(ClosureFieldElement e) => visitVariableElement(e); | |
43 } | |
OLD | NEW |