| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface NodeVisitor<T> { | 5 interface NodeVisitor<T> { |
| 6 T visitProgram(Program node); | 6 T visitProgram(Program node); |
| 7 | 7 |
| 8 T visitBlock(Block node); | 8 T visitBlock(Block node); |
| 9 T visitExpressionStatement(ExpressionStatement node); | 9 T visitExpressionStatement(ExpressionStatement node); |
| 10 T visitEmptyStatement(EmptyStatement node); | 10 T visitEmptyStatement(EmptyStatement node); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 accept(NodeVisitor visitor) => visitor.visitEmptyStatement(this); | 187 accept(NodeVisitor visitor) => visitor.visitEmptyStatement(this); |
| 188 void visitChildren(NodeVisitor visitor) {} | 188 void visitChildren(NodeVisitor visitor) {} |
| 189 } | 189 } |
| 190 | 190 |
| 191 class If extends Statement { | 191 class If extends Statement { |
| 192 final Expression condition; | 192 final Expression condition; |
| 193 final Node then; | 193 final Node then; |
| 194 final Node otherwise; | 194 final Node otherwise; |
| 195 | 195 |
| 196 If(this.condition, this.then, this.otherwise); | 196 If(this.condition, this.then, this.otherwise); |
| 197 If.then(this.condition, this.then) : this.otherwise = new EmptyStatement(); | 197 If.noElse(this.condition, this.then) : this.otherwise = new EmptyStatement(); |
| 198 | 198 |
| 199 bool get hasElse => otherwise is !EmptyStatement; | 199 bool get hasElse => otherwise is !EmptyStatement; |
| 200 | 200 |
| 201 accept(NodeVisitor visitor) => visitor.visitIf(this); | 201 accept(NodeVisitor visitor) => visitor.visitIf(this); |
| 202 | 202 |
| 203 void visitChildren(NodeVisitor visitor) { | 203 void visitChildren(NodeVisitor visitor) { |
| 204 condition.accept(visitor); | 204 condition.accept(visitor); |
| 205 then.accept(visitor); | 205 then.accept(visitor); |
| 206 otherwise.accept(visitor); | 206 otherwise.accept(visitor); |
| 207 } | 207 } |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 /** Contains the pattern and the flags.*/ | 830 /** Contains the pattern and the flags.*/ |
| 831 String pattern; | 831 String pattern; |
| 832 | 832 |
| 833 RegExpLiteral(this.pattern); | 833 RegExpLiteral(this.pattern); |
| 834 | 834 |
| 835 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); | 835 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); |
| 836 void visitChildren(NodeVisitor visitor) {} | 836 void visitChildren(NodeVisitor visitor) {} |
| 837 | 837 |
| 838 int get precedenceLevel => PRIMARY; | 838 int get precedenceLevel => PRIMARY; |
| 839 } | 839 } |
| OLD | NEW |