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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartSwitchStatement.java

Issue 9600049: Use NodeList where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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) 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 package com.google.dart.compiler.ast; 5 package com.google.dart.compiler.ast;
6 6
7 import java.util.List; 7 import java.util.List;
8 8
9 /** 9 /**
10 * Represents a Dart 'switch' statement. 10 * Represents a Dart 'switch' statement.
11 */ 11 */
12 public class DartSwitchStatement extends DartStatement { 12 public class DartSwitchStatement extends DartStatement {
13 13
14 private DartExpression expression; 14 private DartExpression expression;
15 private final List<DartSwitchMember> members; 15 private final NodeList<DartSwitchMember> members = NodeList.create(this);
16 16
17 public DartSwitchStatement(DartExpression expression, List<DartSwitchMember> m embers) { 17 public DartSwitchStatement(DartExpression expression, List<DartSwitchMember> m embers) {
18 this.expression = becomeParentOf(expression); 18 this.expression = becomeParentOf(expression);
19 this.members = becomeParentOf(members); 19 this.members.addAll(members);
20 } 20 }
21 21
22 public DartExpression getExpression() { 22 public DartExpression getExpression() {
23 return expression; 23 return expression;
24 } 24 }
25 25
26 public List<DartSwitchMember> getMembers() { 26 public List<DartSwitchMember> getMembers() {
27 return members; 27 return members;
28 } 28 }
29 29
30 @Override 30 @Override
31 public void visitChildren(ASTVisitor<?> visitor) { 31 public void visitChildren(ASTVisitor<?> visitor) {
32 expression.accept(visitor); 32 expression.accept(visitor);
33 visitor.visit(members); 33 members.accept(visitor);
34 } 34 }
35 35
36 @Override 36 @Override
37 public <R> R accept(ASTVisitor<R> visitor) { 37 public <R> R accept(ASTVisitor<R> visitor) {
38 return visitor.visitSwitchStatement(this); 38 return visitor.visitSwitchStatement(this);
39 } 39 }
40 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698