| 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 /** | 7 /** |
| 8 * Implements the #library directive. | 8 * Implements the #library directive. |
| 9 */ | 9 */ |
| 10 public class DartLibraryDirective extends DartDirective { | 10 public class DartLibraryDirective extends DartDirective { |
| 11 private DartStringLiteral name; | 11 private DartStringLiteral name; |
| 12 | 12 |
| 13 public DartLibraryDirective(DartStringLiteral name) { | 13 public DartLibraryDirective(DartStringLiteral name) { |
| 14 this.name = becomeParentOf(name); | 14 this.name = becomeParentOf(name); |
| 15 } | 15 } |
| 16 | 16 |
| 17 public DartStringLiteral getName() { | 17 public DartStringLiteral getName() { |
| 18 return name; | 18 return name; |
| 19 } | 19 } |
| 20 | 20 |
| 21 @Override | 21 @Override |
| 22 public void traverse(DartVisitor v, DartContext ctx) { | 22 public void visitChildren(ASTVisitor<?> visitor) { |
| 23 if (v.visit(this, ctx)) { | |
| 24 name = becomeParentOf(v.accept(name)); | |
| 25 } | |
| 26 v.endVisit(this, ctx); | |
| 27 } | |
| 28 | |
| 29 @Override | |
| 30 public void visitChildren(DartPlainVisitor<?> visitor) { | |
| 31 name.accept(visitor); | 23 name.accept(visitor); |
| 32 } | 24 } |
| 33 | 25 |
| 34 @Override | 26 @Override |
| 35 public <R> R accept(DartPlainVisitor<R> visitor) { | 27 public <R> R accept(ASTVisitor<R> visitor) { |
| 36 return visitor.visitLibraryDirective(this); | 28 return visitor.visitLibraryDirective(this); |
| 37 } | 29 } |
| 38 } | 30 } |
| OLD | NEW |