| 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 function. | 10 * Represents a Dart function. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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 } |
| OLD | NEW |