Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/scanner/class_element_parser.dart

Issue 96623004: Add a visitor for Elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 4
5 part of scanner; 5 part of scanner;
6 6
7 class ClassElementParser extends PartialParser { 7 class ClassElementParser extends PartialParser {
8 ClassElementParser(Listener listener) : super(listener); 8 ClassElementParser(Listener listener) : super(listener);
9 9
10 Token parseClassBody(Token token) => fullParseClassBody(token); 10 Token parseClassBody(Token token) => fullParseClassBody(token);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 }); 54 });
55 }); 55 });
56 return cachedNode; 56 return cachedNode;
57 } 57 }
58 58
59 Token position() => beginToken; 59 Token position() => beginToken;
60 60
61 // TODO(johnniwinther): Ensure that modifiers are always available. 61 // TODO(johnniwinther): Ensure that modifiers are always available.
62 Modifiers get modifiers => 62 Modifiers get modifiers =>
63 cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY; 63 cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
64
65 accept(ElementVisitor visitor) => visitor.visitPartialClassElement(this);
64 } 66 }
65 67
66 class MemberListener extends NodeListener { 68 class MemberListener extends NodeListener {
67 final ClassElement enclosingElement; 69 final ClassElement enclosingElement;
68 70
69 MemberListener(DiagnosticListener listener, 71 MemberListener(DiagnosticListener listener,
70 Element enclosingElement) 72 Element enclosingElement)
71 : this.enclosingElement = enclosingElement, 73 : this.enclosingElement = enclosingElement,
72 super(listener, enclosingElement.getCompilationUnit()); 74 super(listener, enclosingElement.getCompilationUnit());
73 75
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 193
192 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { 194 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
193 popNode(); // Discard arguments. 195 popNode(); // Discard arguments.
194 if (periodBeforeName != null) { 196 if (periodBeforeName != null) {
195 popNode(); // Discard name. 197 popNode(); // Discard name.
196 } 198 }
197 popNode(); // Discard node (Send or Identifier). 199 popNode(); // Discard node (Send or Identifier).
198 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); 200 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
199 } 201 }
200 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698