| 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 { | 9 abstract class Visitor { |
| 10 visit(Expression 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 visitGetter(Getter i); | 13 visitGetter(Getter i); |
| 14 visitIndex(Index i); | 14 visitIndex(Index i); |
| 15 visitInvoke(Invoke i); | 15 visitInvoke(Invoke i); |
| 16 visitLiteral(Literal l); | 16 visitLiteral(Literal l); |
| 17 visitMapLiteral(MapLiteral l); | 17 visitMapLiteral(MapLiteral l); |
| 18 visitMapLiteralEntry(MapLiteralEntry l); | 18 visitMapLiteralEntry(MapLiteralEntry l); |
| 19 visitIdentifier(Identifier i); | 19 visitIdentifier(Identifier i); |
| 20 visitBinaryOperator(BinaryOperator o); | 20 visitBinaryOperator(BinaryOperator o); |
| 21 visitUnaryOperator(UnaryOperator o); | 21 visitUnaryOperator(UnaryOperator o); |
| 22 visitTernaryOperator(TernaryOperator o); |
| 22 visitInExpression(InExpression c); | 23 visitInExpression(InExpression c); |
| 23 } | 24 } |
| 24 | 25 |
| 25 abstract class RecursiveVisitor extends Visitor { | 26 abstract class RecursiveVisitor extends Visitor { |
| 26 visitExpression(Expression e); | 27 visitExpression(Expression e); |
| 27 | 28 |
| 28 visitEmptyExpression(EmptyExpression e) => visitExpression(e); | 29 visitEmptyExpression(EmptyExpression e) => visitExpression(e); |
| 29 | 30 |
| 30 visitParenthesizedExpression(ParenthesizedExpression e) { | 31 visitParenthesizedExpression(ParenthesizedExpression e) { |
| 31 visit(e.child); | 32 visit(e.child); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 visit(o.left); | 75 visit(o.left); |
| 75 visit(o.right); | 76 visit(o.right); |
| 76 visitExpression(o); | 77 visitExpression(o); |
| 77 } | 78 } |
| 78 | 79 |
| 79 visitUnaryOperator(UnaryOperator o) { | 80 visitUnaryOperator(UnaryOperator o) { |
| 80 visit(o.child); | 81 visit(o.child); |
| 81 visitExpression(o); | 82 visitExpression(o); |
| 82 } | 83 } |
| 83 | 84 |
| 85 visitTernaryOperator(TernaryOperator o) { |
| 86 visit(o.condition); |
| 87 visit(o.trueExpr); |
| 88 visit(o.falseExpr); |
| 89 visitExpression(o); |
| 90 } |
| 91 |
| 84 visitInExpression(InExpression c) { | 92 visitInExpression(InExpression c) { |
| 85 visit(c.left); | 93 visit(c.left); |
| 86 visit(c.right); | 94 visit(c.right); |
| 87 visitExpression(c); | 95 visitExpression(c); |
| 88 } | 96 } |
| 89 } | 97 } |
| OLD | NEW |