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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartLibraryDirective.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 * 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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698