| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library polymer_expressions.visitor; | 5 library polymer_expressions.visitor; |
| 6 | 6 |
| 7 import 'expression.dart'; | 7 import 'expression.dart'; |
| 8 | 8 |
| 9 abstract class Visitor<E extends Expression> { | 9 abstract class Visitor { |
| 10 visit(E s) => s.accept(this); | 10 visit(Expression s) => s.accept(this); |
| 11 visitEmptyExpression(EmptyExpression e); | 11 visitEmptyExpression(EmptyExpression e); |
| 12 visitParenthesizedExpression(ParenthesizedExpression e); | 12 visitParenthesizedExpression(ParenthesizedExpression e); |
| 13 visitInvoke(Invoke i); | 13 visitInvoke(Invoke i); |
| 14 visitLiteral(Literal l); | 14 visitLiteral(Literal l); |
| 15 visitMapLiteral(MapLiteral l); | 15 visitMapLiteral(MapLiteral l); |
| 16 visitMapLiteralEntry(MapLiteralEntry l); | 16 visitMapLiteralEntry(MapLiteralEntry l); |
| 17 visitIdentifier(Identifier i); | 17 visitIdentifier(Identifier i); |
| 18 visitBinaryOperator(BinaryOperator o); | 18 visitBinaryOperator(BinaryOperator o); |
| 19 visitUnaryOperator(UnaryOperator o); | 19 visitUnaryOperator(UnaryOperator o); |
| 20 visitInExpression(InExpression c); | 20 visitInExpression(InExpression c); |
| 21 } | 21 } |
| 22 | 22 |
| 23 abstract class RecursiveVisitor<E> extends Visitor<E> { | 23 abstract class RecursiveVisitor extends Visitor { |
| 24 visitExpression(E e); | 24 visitExpression(Expression e); |
| 25 | 25 |
| 26 visitEmptyExpression(EmptyExpression e) => visitExpression(e); | 26 visitEmptyExpression(EmptyExpression e) => visitExpression(e); |
| 27 | 27 |
| 28 visitParenthesizedExpression(ParenthesizedExpression e) { | 28 visitParenthesizedExpression(ParenthesizedExpression e) { |
| 29 visit(e); | 29 visit(e); |
| 30 visitExpression(e); | 30 visitExpression(e); |
| 31 } | 31 } |
| 32 | 32 |
| 33 visitInvoke(Invoke i) { | 33 visitInvoke(Invoke i) { |
| 34 visit(i.receiver); | 34 visit(i.receiver); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 visit(o.child); | 67 visit(o.child); |
| 68 visitExpression(o); | 68 visitExpression(o); |
| 69 } | 69 } |
| 70 | 70 |
| 71 visitInExpression(InExpression c) { | 71 visitInExpression(InExpression c) { |
| 72 visit(c.left); | 72 visit(c.left); |
| 73 visit(c.right); | 73 visit(c.right); |
| 74 visitExpression(c); | 74 visitExpression(c); |
| 75 } | 75 } |
| 76 } | 76 } |
| OLD | NEW |