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

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

Issue 9598002: Use ASTVisitor as in new AST. (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 /** 7 /**
8 * Represents a Dart 'if' statement. 8 * Represents a Dart 'if' statement.
9 */ 9 */
10 public class DartIfStatement extends DartStatement { 10 public class DartIfStatement extends DartStatement {
(...skipping 14 matching lines...) Expand all
25 25
26 public DartStatement getElseStatement() { 26 public DartStatement getElseStatement() {
27 return elseStmt; 27 return elseStmt;
28 } 28 }
29 29
30 public DartStatement getThenStatement() { 30 public DartStatement getThenStatement() {
31 return thenStmt; 31 return thenStmt;
32 } 32 }
33 33
34 @Override 34 @Override
35 public void traverse(DartVisitor v, DartContext ctx) { 35 public void visitChildren(ASTVisitor<?> visitor) {
36 if (v.visit(this, ctx)) {
37 condition = becomeParentOf(v.accept(condition));
38 thenStmt = becomeParentOf(v.accept(thenStmt));
39 if (elseStmt != null) {
40 elseStmt = becomeParentOf(v.accept(elseStmt));
41 }
42 }
43 v.endVisit(this, ctx);
44 }
45
46 @Override
47 public void visitChildren(DartPlainVisitor<?> visitor) {
48 condition.accept(visitor); 36 condition.accept(visitor);
49 thenStmt.accept(visitor); 37 thenStmt.accept(visitor);
50 if (elseStmt != null) { 38 if (elseStmt != null) {
51 elseStmt.accept(visitor); 39 elseStmt.accept(visitor);
52 } 40 }
53 } 41 }
54 42
55 @Override 43 @Override
56 public <R> R accept(DartPlainVisitor<R> visitor) { 44 public <R> R accept(ASTVisitor<R> visitor) {
57 return visitor.visitIfStatement(this); 45 return visitor.visitIfStatement(this);
58 } 46 }
59 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698