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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartFieldDefinition.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 import java.util.List; 7 import java.util.List;
8 8
9 /** 9 /**
10 * Represents a Dart field definition. 10 * Represents a Dart field definition.
(...skipping 14 matching lines...) Expand all
25 25
26 public void setTypeNode(DartTypeNode typeNode) { 26 public void setTypeNode(DartTypeNode typeNode) {
27 this.typeNode = becomeParentOf(typeNode); 27 this.typeNode = becomeParentOf(typeNode);
28 } 28 }
29 29
30 public List<DartField> getFields() { 30 public List<DartField> getFields() {
31 return fields; 31 return fields;
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 if (getTypeNode() != null) {
38 setTypeNode(v.accept(getTypeNode()));
39 }
40 v.acceptWithInsertRemove(this, getFields());
41 }
42 v.endVisit(this, ctx);
43 }
44
45 @Override
46 public void visitChildren(DartPlainVisitor<?> visitor) {
47 if (getTypeNode() != null) { 36 if (getTypeNode() != null) {
48 getTypeNode().accept(visitor); 37 getTypeNode().accept(visitor);
49 } 38 }
50 visitor.visit(getFields()); 39 visitor.visit(getFields());
51 } 40 }
52 41
53 @Override 42 @Override
54 public <R> R accept(DartPlainVisitor<R> visitor) { 43 public <R> R accept(ASTVisitor<R> visitor) {
55 return visitor.visitFieldDefinition(this); 44 return visitor.visitFieldDefinition(this);
56 } 45 }
57 } 46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698