Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: pkg/compiler/lib/src/resolution/send_structure.dart

Issue 1086543002: Revert "Handle SendSet and NewExpression through NewResolvedVisitor." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.send_structure; 5 library dart2js.send_structure;
6 6
7 import 'access_semantics.dart'; 7 import 'access_semantics.dart';
8 import 'operators.dart'; 8 import 'operators.dart';
9 import 'semantic_visitor.dart'; 9 import 'semantic_visitor.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
11 import '../constants/expressions.dart'; 11 import '../constants/expressions.dart';
12 import '../elements/elements.dart'; 12 import '../elements/elements.dart';
13 import '../tree/tree.dart'; 13 import '../tree/tree.dart';
14 import '../universe/universe.dart'; 14 import '../universe/universe.dart';
15 import '../util/util.dart'; 15 import '../util/util.dart';
16 16
17 /// Interface for the structure of the semantics of a [Send] or [NewExpression]
18 /// node.
19 abstract class SemanticSendStructure<R, A> {
20 /// Calls the matching visit method on [visitor] with [node] and [arg].
21 R dispatch(SemanticSendVisitor<R, A> visitor, Node node, A arg);
22 }
23
24 /// Interface for the structure of the semantics of a [Send] node. 17 /// Interface for the structure of the semantics of a [Send] node.
25 /// 18 ///
26 /// Subclasses handle each of the [Send] variations; `assert(e)`, `a && b`, 19 /// Subclasses handle each of the [Send] variations; `assert(e)`, `a && b`,
27 /// `a.b`, `a.b(c)`, etc. 20 /// `a.b`, `a.b(c)`, etc.
28 abstract class SendStructure<R, A> extends SemanticSendStructure<R, A> { 21 abstract class SendStructure<R, A> {
29 /// Calls the matching visit method on [visitor] with [send] and [arg]. 22 /// Calls the matching visit method on [visitor] with [send] and [arg].
30 R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg); 23 R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg);
31 } 24 }
32 25
33 /// The structure for a [Send] of the form `assert(e)`. 26 /// The structure for a [Send] of the form `assert(e)`.
34 class AssertStructure<R, A> implements SendStructure<R, A> { 27 class AssertStructure<R, A> implements SendStructure<R, A> {
35 const AssertStructure(); 28 const AssertStructure();
36 29
37 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) { 30 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
38 return visitor.visitAssert( 31 return visitor.visitAssert(
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 } 1804 }
1812 } 1805 }
1813 throw new SpannableAssertionFailure(node, 1806 throw new SpannableAssertionFailure(node,
1814 "Invalid compound assigment: ${semantics}"); 1807 "Invalid compound assigment: ${semantics}");
1815 } 1808 }
1816 1809
1817 String toString() => 'postfix($operator,$semantics)'; 1810 String toString() => 'postfix($operator,$semantics)';
1818 } 1811 }
1819 1812
1820 /// The structure for a [NewExpression] of a new invocation. 1813 /// The structure for a [NewExpression] of a new invocation.
1821 abstract class NewStructure<R, A> implements SemanticSendStructure<R, A> { 1814 abstract class NewStructure<R, A> {
1822 /// Calls the matching visit method on [visitor] with [node] and [arg]. 1815 /// Calls the matching visit method on [visitor] with [node] and [arg].
1823 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg); 1816 R dispatch(SemanticSendVisitor<R, A> visitor, NewExpression node, A arg);
1824 } 1817 }
1825 1818
1826 /// The structure for a [NewExpression] of a new invocation. For instance 1819 /// The structure for a [NewExpression] of a new invocation. For instance
1827 /// `new C()`. 1820 /// `new C()`.
1828 class NewInvokeStructure<R, A> extends NewStructure<R, A> { 1821 class NewInvokeStructure<R, A> extends NewStructure<R, A> {
1829 final ConstructorAccessSemantics semantics; 1822 final ConstructorAccessSemantics semantics;
1830 final Selector selector; 1823 final Selector selector;
1831 1824
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 final ConstructorElement constructor; 2070 final ConstructorElement constructor;
2078 final Selector selector; 2071 final Selector selector;
2079 2072
2080 ThisConstructorInvokeStructure(this.constructor, this.selector); 2073 ThisConstructorInvokeStructure(this.constructor, this.selector);
2081 2074
2082 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) { 2075 R dispatch(SemanticDeclarationVisitor<R, A> visitor, Send node, A arg) {
2083 return visitor.visitThisConstructorInvoke( 2076 return visitor.visitThisConstructorInvoke(
2084 node, constructor, node.argumentsNode, selector, arg); 2077 node, constructor, node.argumentsNode, selector, arg);
2085 } 2078 }
2086 } 2079 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/resolved_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698