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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartFunction.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 function. 10 * Represents a Dart function.
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 public List<DartParameter> getParams() { 32 public List<DartParameter> getParams() {
33 return params; 33 return params;
34 } 34 }
35 35
36 public DartTypeNode getReturnTypeNode() { 36 public DartTypeNode getReturnTypeNode() {
37 return returnTypeNode; 37 return returnTypeNode;
38 } 38 }
39 39
40 public void traverse(DartVisitor v, DartContext ctx) {
41 if (v.visit(this, ctx)) {
42 v.acceptWithInsertRemove(this, params);
43 if (body != null) {
44 body = becomeParentOf(v.accept(body));
45 }
46 if (returnTypeNode != null) {
47 returnTypeNode = becomeParentOf(v.accept(returnTypeNode));
48 }
49 }
50 v.endVisit(this, ctx);
51 }
52
53 @Override 40 @Override
54 public void visitChildren(DartPlainVisitor<?> visitor) { 41 public void visitChildren(ASTVisitor<?> visitor) {
55 visitor.visit(params); 42 visitor.visit(params);
56 if (body != null) { 43 if (body != null) {
57 body.accept(visitor); 44 body.accept(visitor);
58 } 45 }
59 if (returnTypeNode != null) { 46 if (returnTypeNode != null) {
60 returnTypeNode.accept(visitor); 47 returnTypeNode.accept(visitor);
61 } 48 }
62 } 49 }
63 50
64 @Override 51 @Override
65 public <R> R accept(DartPlainVisitor<R> visitor) { 52 public <R> R accept(ASTVisitor<R> visitor) {
66 return visitor.visitFunction(this); 53 return visitor.visitFunction(this);
67 } 54 }
68 } 55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698