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 part of js; | 5 part of js; |
6 | 6 |
7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
9 | 9 |
10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 final String code; | 422 final String code; |
423 | 423 |
424 LiteralStatement(this.code); | 424 LiteralStatement(this.code); |
425 | 425 |
426 accept(NodeVisitor visitor) => visitor.visitLiteralStatement(this); | 426 accept(NodeVisitor visitor) => visitor.visitLiteralStatement(this); |
427 void visitChildren(NodeVisitor visitor) { } | 427 void visitChildren(NodeVisitor visitor) { } |
428 } | 428 } |
429 | 429 |
430 abstract class Expression extends Node { | 430 abstract class Expression extends Node { |
431 int get precedenceLevel; | 431 int get precedenceLevel; |
432 | |
433 PropertyAccess dot(String name) => new PropertyAccess.field(this, name); | |
434 Call callWith(List<Expression> arguments) => new Call(this, arguments); | |
ngeoffray
2012/11/30 09:01:56
I prefer 'call' :)
| |
432 } | 435 } |
433 | 436 |
434 class LiteralExpression extends Expression { | 437 class LiteralExpression extends Expression { |
435 final String template; | 438 final String template; |
436 final List<Expression> inputs; | 439 final List<Expression> inputs; |
437 | 440 |
438 LiteralExpression(this.template) : inputs = const []; | 441 LiteralExpression(this.template) : inputs = const []; |
439 LiteralExpression.withData(this.template, this.inputs); | 442 LiteralExpression.withData(this.template, this.inputs); |
440 | 443 |
441 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); | 444 accept(NodeVisitor visitor) => visitor.visitLiteralExpression(this); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
843 /** Contains the pattern and the flags.*/ | 846 /** Contains the pattern and the flags.*/ |
844 String pattern; | 847 String pattern; |
845 | 848 |
846 RegExpLiteral(this.pattern); | 849 RegExpLiteral(this.pattern); |
847 | 850 |
848 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); | 851 accept(NodeVisitor visitor) => visitor.visitRegExpLiteral(this); |
849 void visitChildren(NodeVisitor visitor) {} | 852 void visitChildren(NodeVisitor visitor) {} |
850 | 853 |
851 int get precedenceLevel => PRIMARY; | 854 int get precedenceLevel => PRIMARY; |
852 } | 855 } |
OLD | NEW |