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

Side by Side Diff: lib/compiler/implementation/tree/nodes.dart

Issue 10990108: Handle modifiers (abstract) on class nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 abstract class Visitor<R> { 5 abstract class Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCascade(Cascade node); 8 R visitCascade(Cascade node);
9 R visitCascadeReceiver(CascadeReceiver node); 9 R visitCascadeReceiver(CascadeReceiver node);
10 R visitCaseMatch(CaseMatch node); 10 R visitCaseMatch(CaseMatch node);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 Typedef asTypedef() => null; 165 Typedef asTypedef() => null;
166 TypeVariable asTypeVariable() => null; 166 TypeVariable asTypeVariable() => null;
167 VariableDefinitions asVariableDefinitions() => null; 167 VariableDefinitions asVariableDefinitions() => null;
168 While asWhile() => null; 168 While asWhile() => null;
169 169
170 bool isValidBreakTarget() => false; 170 bool isValidBreakTarget() => false;
171 bool isValidContinueTarget() => false; 171 bool isValidContinueTarget() => false;
172 } 172 }
173 173
174 class ClassNode extends Node { 174 class ClassNode extends Node {
175 final Modifiers modifiers;
175 final Identifier name; 176 final Identifier name;
176 final TypeAnnotation superclass; 177 final TypeAnnotation superclass;
177 final NodeList interfaces; 178 final NodeList interfaces;
178 final NodeList typeParameters; 179 final NodeList typeParameters;
179 final NodeList body; 180 final NodeList body;
180 181
181 // TODO(ahe, karlklose): the default keyword is not recorded. 182 // TODO(ahe, karlklose): the default keyword is not recorded.
182 final TypeAnnotation defaultClause; 183 final TypeAnnotation defaultClause;
183 184
184 final Token beginToken; 185 final Token beginToken;
185 final Token extendsKeyword; 186 final Token extendsKeyword;
186 final Token endToken; 187 final Token endToken;
187 188
188 ClassNode(this.name, this.typeParameters, this.superclass, this.interfaces, 189 ClassNode(this.modifiers, this.name, this.typeParameters, this.superclass,
189 this.defaultClause, this.beginToken, this.extendsKeyword, 190 this.interfaces, this.defaultClause, this.beginToken,
190 this.body, this.endToken); 191 this.extendsKeyword, this.body, this.endToken);
191 192
192 ClassNode asClassNode() => this; 193 ClassNode asClassNode() => this;
193 194
194 accept(Visitor visitor) => visitor.visitClassNode(this); 195 accept(Visitor visitor) => visitor.visitClassNode(this);
195 196
196 visitChildren(Visitor visitor) { 197 visitChildren(Visitor visitor) {
197 if (name !== null) name.accept(visitor); 198 if (name !== null) name.accept(visitor);
198 if (typeParameters !== null) typeParameters.accept(visitor); 199 if (typeParameters !== null) typeParameters.accept(visitor);
199 if (superclass !== null) superclass.accept(visitor); 200 if (superclass !== null) superclass.accept(visitor);
200 if (interfaces !== null) interfaces.accept(visitor); 201 if (interfaces !== null) interfaces.accept(visitor);
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 * argument). 1894 * argument).
1894 * 1895 *
1895 * TODO(ahe): This method is controversial, the team needs to discuss 1896 * TODO(ahe): This method is controversial, the team needs to discuss
1896 * if top-level methods are acceptable and what naming conventions to 1897 * if top-level methods are acceptable and what naming conventions to
1897 * use. 1898 * use.
1898 */ 1899 */
1899 initializerDo(Node node, f(Node node)) { 1900 initializerDo(Node node, f(Node node)) {
1900 SendSet send = node.asSendSet(); 1901 SendSet send = node.asSendSet();
1901 if (send !== null) return f(send.arguments.head); 1902 if (send !== null) return f(send.arguments.head);
1902 } 1903 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698