| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |