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

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

Issue 929113002: Add SemanticVisitor to dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix indents and long lines. Created 5 years, 9 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dart2js.send_structure;
6
7 import 'access_semantics.dart';
8 import 'operators.dart';
9 import 'semantic_visitor.dart';
10 import '../tree/tree.dart';
11 import '../dart_types.dart';
12 import '../universe/universe.dart';
13 import '../util/util.dart';
14
15 /// Interface for the structure of the semantics of a [Send] node.
16 ///
17 /// Subclasses handle each of the [Send] variations; `assert(e)`, `a && b`,
18 /// `a.b`, `a.b(c)`, etc.
19 abstract class SendStructure<R, A> {
20 /// Calls the matching visit method on [visitor] with [send] and [arg].
21 R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg);
22 }
23
24 /// The structure for a [Send] of the form `assert(e)`.
25 class AssertStructure<R, A> implements SendStructure<R, A> {
26 const AssertStructure();
27
28 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
29 return visitor.visitAssert(
30 node,
31 node.arguments.single,
32 arg);
33 }
34 }
35
36 /// The structure for a [Send] of the form an `assert` with less or more than
37 /// one argument.
38 class InvalidAssertStructure<R, A> implements SendStructure<R, A> {
39 const InvalidAssertStructure();
40
41 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
42 return visitor.errorInvalidAssert(
43 node,
44 node.argumentsNode,
45 arg);
46 }
47 }
48
49 /// The structure for a [Send] of the form `a && b`.
50 class LogicalAndStructure<R, A> implements SendStructure<R, A> {
51 const LogicalAndStructure();
52
53 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
54 return visitor.visitLogicalAnd(
55 node,
56 node.receiver,
57 node.arguments.single,
58 arg);
59 }
60 }
61
62 /// The structure for a [Send] of the form `a || b`.
63 class LogicalOrStructure<R, A> implements SendStructure<R, A> {
64 const LogicalOrStructure();
65
66 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
67 return visitor.visitLogicalOr(
68 node,
69 node.receiver,
70 node.arguments.single,
71 arg);
72 }
73 }
74
75 /// The structure for a [Send] of the form `a is T`.
76 class IsStructure<R, A> implements SendStructure<R, A> {
77 /// The type that the expression is tested against.
78 final DartType type;
79
80 IsStructure(this.type);
81
82 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
83 return visitor.visitIs(
84 node,
85 node.receiver,
86 type,
87 arg);
88 }
89 }
90
91 /// The structure for a [Send] of the form `a is! T`.
92 class IsNotStructure<R, A> implements SendStructure<R, A> {
93 /// The type that the expression is tested against.
94 final DartType type;
95
96 IsNotStructure(this.type);
97
98 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
99 return visitor.visitIsNot(
100 node,
101 node.receiver,
102 type,
103 arg);
104 }
105 }
106
107 /// The structure for a [Send] of the form `a as T`.
108 class AsStructure<R, A> implements SendStructure<R, A> {
109 /// The type that the expression is cast to.
110 final DartType type;
111
112 AsStructure(this.type);
113
114 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
115 return visitor.visitAs(
116 node,
117 node.receiver,
118 type,
119 arg);
120 }
121 }
122
123 /// The structure for a [Send] that is an invocation.
124 class InvokeStructure<R, A> implements SendStructure<R, A> {
125 /// The target of the invocation.
126 final AccessSemantics semantics;
127
128 /// The [Selector] for the invocation.
129 final Selector selector;
130
131 InvokeStructure(this.semantics, this.selector);
132
133 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
134 switch (semantics.kind) {
135 case AccessKind.DYNAMIC_PROPERTY:
136 return visitor.visitDynamicPropertyInvoke(
137 node,
138 node.receiver,
139 node.argumentsNode,
140 selector,
141 arg);
142 case AccessKind.LOCAL_FUNCTION:
143 return visitor.visitLocalFunctionInvoke(
144 node,
145 semantics.element,
146 node.argumentsNode,
147 selector,
148 arg);
149 case AccessKind.LOCAL_VARIABLE:
150 return visitor.visitLocalVariableInvoke(
151 node,
152 semantics.element,
153 node.argumentsNode,
154 selector,
155 arg);
156 case AccessKind.PARAMETER:
157 return visitor.visitParameterInvoke(
158 node,
159 semantics.element,
160 node.argumentsNode,
161 selector,
162 arg);
163 case AccessKind.STATIC_FIELD:
164 return visitor.visitStaticFieldInvoke(
165 node,
166 semantics.element,
167 node.argumentsNode,
168 selector,
169 arg);
170 case AccessKind.STATIC_METHOD:
171 return visitor.visitStaticFunctionInvoke(
172 node,
173 semantics.element,
174 node.argumentsNode,
175 selector,
176 arg);
177 case AccessKind.STATIC_GETTER:
178 return visitor.visitStaticGetterInvoke(
179 node,
180 semantics.element,
181 node.argumentsNode,
182 selector,
183 arg);
184 case AccessKind.STATIC_SETTER:
185 return visitor.errorStaticSetterInvoke(
186 node,
187 semantics.element,
188 node.argumentsNode,
189 selector,
190 arg);
191 case AccessKind.TOPLEVEL_FIELD:
192 return visitor.visitTopLevelFieldInvoke(
193 node,
194 semantics.element,
195 node.argumentsNode,
196 selector,
197 arg);
198 case AccessKind.TOPLEVEL_METHOD:
199 return visitor.visitTopLevelFunctionInvoke(
200 node,
201 semantics.element,
202 node.argumentsNode,
203 selector,
204 arg);
205 case AccessKind.TOPLEVEL_GETTER:
206 return visitor.visitTopLevelGetterInvoke(
207 node,
208 semantics.element,
209 node.argumentsNode,
210 selector,
211 arg);
212 case AccessKind.TOPLEVEL_SETTER:
213 return visitor.errorTopLevelSetterInvoke(
214 node,
215 semantics.element,
216 node.argumentsNode,
217 selector,
218 arg);
219 case AccessKind.CLASS_TYPE_LITERAL:
220 return visitor.visitClassTypeLiteralInvoke(
221 node,
222 semantics.constant,
223 node.argumentsNode,
224 selector,
225 arg);
226 case AccessKind.TYPEDEF_TYPE_LITERAL:
227 return visitor.visitTypedefTypeLiteralInvoke(
228 node,
229 semantics.constant,
230 node.argumentsNode,
231 selector,
232 arg);
233 case AccessKind.DYNAMIC_TYPE_LITERAL:
234 return visitor.visitDynamicTypeLiteralInvoke(
235 node,
236 semantics.constant,
237 node.argumentsNode,
238 selector,
239 arg);
240 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
241 return visitor.visitTypeVariableTypeLiteralInvoke(
242 node,
243 semantics.element,
244 node.argumentsNode,
245 selector,
246 arg);
247 case AccessKind.EXPRESSION:
248 return visitor.visitExpressionInvoke(
249 node,
250 node.selector,
251 node.argumentsNode,
252 selector,
253 arg);
254 case AccessKind.THIS:
255 return visitor.visitThisInvoke(
256 node,
257 node.argumentsNode,
258 selector,
259 arg);
260 case AccessKind.THIS_PROPERTY:
261 return visitor.visitThisPropertyInvoke(
262 node,
263 node.argumentsNode,
264 selector,
265 arg);
266 case AccessKind.SUPER_FIELD:
267 return visitor.visitSuperFieldInvoke(
268 node,
269 semantics.element,
270 node.argumentsNode,
271 selector,
272 arg);
273 case AccessKind.SUPER_METHOD:
274 return visitor.visitSuperMethodInvoke(
275 node,
276 semantics.element,
277 node.argumentsNode,
278 selector,
279 arg);
280 case AccessKind.SUPER_GETTER:
281 return visitor.visitSuperGetterInvoke(
282 node,
283 semantics.element,
284 node.argumentsNode,
285 selector,
286 arg);
287 case AccessKind.SUPER_SETTER:
288 return visitor.errorSuperSetterInvoke(
289 node,
290 semantics.element,
291 node.argumentsNode,
292 selector,
293 arg);
294 case AccessKind.CONSTANT:
295 return visitor.visitConstantInvoke(
296 node,
297 semantics.constant,
298 node.argumentsNode,
299 selector,
300 arg);
301 case AccessKind.UNRESOLVED:
302 return visitor.errorUnresolvedInvoke(
303 node,
304 semantics.element,
305 node.argumentsNode,
306 selector,
307 arg);
308 case AccessKind.COMPOUND:
309 // This is not a valid case.
310 break;
311 }
312 throw new SpannableAssertionFailure(node, "Invalid invoke: ${semantics}");
313 }
314 }
315
316 /// The structure for a [Send] that is a read access.
317 class GetStructure<R, A> implements SendStructure<R, A> {
318 /// The target of the read access.
319 final AccessSemantics semantics;
320
321 /// The [Selector] for the getter invocation.
322 final Selector selector;
323
324 GetStructure(this.semantics, this.selector);
325
326 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
327 switch (semantics.kind) {
328 case AccessKind.DYNAMIC_PROPERTY:
329 return visitor.visitDynamicPropertyGet(
330 node,
331 node.receiver,
332 selector,
333 arg);
334 case AccessKind.LOCAL_FUNCTION:
335 return visitor.visitLocalFunctionGet(
336 node,
337 semantics.element,
338 arg);
339 case AccessKind.LOCAL_VARIABLE:
340 return visitor.visitLocalVariableGet(
341 node,
342 semantics.element,
343 arg);
344 case AccessKind.PARAMETER:
345 return visitor.visitParameterGet(
346 node,
347 semantics.element,
348 arg);
349 case AccessKind.STATIC_FIELD:
350 return visitor.visitStaticFieldGet(
351 node,
352 semantics.element,
353 arg);
354 case AccessKind.STATIC_METHOD:
355 return visitor.visitStaticFunctionGet(
356 node,
357 semantics.element,
358 arg);
359 case AccessKind.STATIC_GETTER:
360 return visitor.visitStaticGetterGet(
361 node,
362 semantics.element,
363 arg);
364 case AccessKind.STATIC_SETTER:
365 return visitor.errorStaticSetterGet(
366 node,
367 semantics.element,
368 arg);
369 case AccessKind.TOPLEVEL_FIELD:
370 return visitor.visitTopLevelFieldGet(
371 node,
372 semantics.element,
373 arg);
374 case AccessKind.TOPLEVEL_METHOD:
375 return visitor.visitTopLevelFunctionGet(
376 node,
377 semantics.element,
378 arg);
379 case AccessKind.TOPLEVEL_GETTER:
380 return visitor.visitTopLevelGetterGet(
381 node,
382 semantics.element,
383 arg);
384 case AccessKind.TOPLEVEL_SETTER:
385 return visitor.errorTopLevelSetterGet(
386 node,
387 semantics.element,
388 arg);
389 case AccessKind.CLASS_TYPE_LITERAL:
390 return visitor.visitClassTypeLiteralGet(
391 node,
392 semantics.constant,
393 arg);
394 case AccessKind.TYPEDEF_TYPE_LITERAL:
395 return visitor.visitTypedefTypeLiteralGet(
396 node,
397 semantics.constant,
398 arg);
399 case AccessKind.DYNAMIC_TYPE_LITERAL:
400 return visitor.visitDynamicTypeLiteralGet(
401 node,
402 semantics.constant,
403 arg);
404 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
405 return visitor.visitTypeVariableTypeLiteralGet(
406 node,
407 semantics.element,
408 arg);
409 case AccessKind.EXPRESSION:
410 // This is not a valid case.
411 break;
412 case AccessKind.THIS:
413 // TODO(johnniwinther): Handle this when `this` is a [Send].
414 break;
415 case AccessKind.THIS_PROPERTY:
416 return visitor.visitThisPropertyGet(
417 node,
418 selector,
419 arg);
420 case AccessKind.SUPER_FIELD:
421 return visitor.visitSuperFieldGet(
422 node,
423 semantics.element,
424 arg);
425 case AccessKind.SUPER_METHOD:
426 return visitor.visitSuperMethodGet(
427 node,
428 semantics.element,
429 arg);
430 case AccessKind.SUPER_GETTER:
431 return visitor.visitSuperGetterGet(
432 node,
433 semantics.element,
434 arg);
435 case AccessKind.SUPER_SETTER:
436 return visitor.errorSuperSetterGet(
437 node,
438 semantics.element,
439 arg);
440 case AccessKind.CONSTANT:
441 return visitor.visitConstantGet(
442 node,
443 semantics.constant,
444 arg);
445 case AccessKind.UNRESOLVED:
446 return visitor.errorUnresolvedGet(
447 node,
448 semantics.element,
449 arg);
450 case AccessKind.COMPOUND:
451 // This is not a valid case.
452 break;
453 }
454 throw new SpannableAssertionFailure(node, "Invalid getter: ${semantics}");
455 }
456 }
457
458 /// The structure for a [Send] that is an assignment.
459 class SetStructure<R, A> implements SendStructure<R, A> {
460 /// The target of the assignment.
461 final AccessSemantics semantics;
462
463 /// The [Selector] for the setter invocation.
464 final Selector selector;
465
466 SetStructure(this.semantics, this.selector);
467
468 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
469 switch (semantics.kind) {
470 case AccessKind.DYNAMIC_PROPERTY:
471 return visitor.visitDynamicPropertySet(
472 node,
473 node.receiver,
474 selector,
475 node.arguments.single,
476 arg);
477 case AccessKind.LOCAL_FUNCTION:
478 return visitor.errorLocalFunctionSet(
479 node,
480 semantics.element,
481 node.arguments.single,
482 arg);
483 case AccessKind.LOCAL_VARIABLE:
484 return visitor.visitLocalVariableSet(
485 node,
486 semantics.element,
487 node.arguments.single,
488 arg);
489 case AccessKind.PARAMETER:
490 return visitor.visitParameterSet(
491 node,
492 semantics.element,
493 node.arguments.single,
494 arg);
495 case AccessKind.STATIC_FIELD:
496 return visitor.visitStaticFieldSet(
497 node,
498 semantics.element,
499 node.arguments.single,
500 arg);
501 case AccessKind.STATIC_METHOD:
502 return visitor.errorStaticFunctionSet(
503 node,
504 semantics.element,
505 node.arguments.single,
506 arg);
507 case AccessKind.STATIC_GETTER:
508 return visitor.errorStaticGetterSet(
509 node,
510 semantics.element,
511 node.arguments.single,
512 arg);
513 case AccessKind.STATIC_SETTER:
514 return visitor.visitStaticSetterSet(
515 node,
516 semantics.element,
517 node.arguments.single,
518 arg);
519 case AccessKind.TOPLEVEL_FIELD:
520 return visitor.visitTopLevelFieldSet(
521 node,
522 semantics.element,
523 node.arguments.single,
524 arg);
525 case AccessKind.TOPLEVEL_METHOD:
526 return visitor.errorTopLevelFunctionSet(
527 node,
528 semantics.element,
529 node.arguments.single,
530 arg);
531 case AccessKind.TOPLEVEL_GETTER:
532 return visitor.errorTopLevelGetterSet(
533 node,
534 semantics.element,
535 node.arguments.single,
536 arg);
537 case AccessKind.TOPLEVEL_SETTER:
538 return visitor.visitTopLevelSetterSet(
539 node,
540 semantics.element,
541 node.arguments.single,
542 arg);
543 case AccessKind.CLASS_TYPE_LITERAL:
544 return visitor.errorClassTypeLiteralSet(
545 node,
546 semantics.constant,
547 node.arguments.single,
548 arg);
549 case AccessKind.TYPEDEF_TYPE_LITERAL:
550 return visitor.errorTypedefTypeLiteralSet(
551 node,
552 semantics.constant,
553 node.arguments.single,
554 arg);
555 case AccessKind.DYNAMIC_TYPE_LITERAL:
556 return visitor.errorDynamicTypeLiteralSet(
557 node,
558 semantics.constant,
559 node.arguments.single,
560 arg);
561 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
562 return visitor.errorTypeVariableTypeLiteralSet(
563 node,
564 semantics.element,
565 node.arguments.single,
566 arg);
567 case AccessKind.EXPRESSION:
568 // This is not a valid case.
569 break;
570 case AccessKind.THIS:
571 // This is not a valid case.
572 break;
573 case AccessKind.THIS_PROPERTY:
574 return visitor.visitThisPropertySet(
575 node,
576 selector,
577 node.arguments.single,
578 arg);
579 case AccessKind.SUPER_FIELD:
580 return visitor.visitSuperFieldSet(
581 node,
582 semantics.element,
583 node.arguments.single,
584 arg);
585 case AccessKind.SUPER_METHOD:
586 return visitor.errorSuperMethodSet(
587 node,
588 semantics.element,
589 node.arguments.single,
590 arg);
591 case AccessKind.SUPER_GETTER:
592 return visitor.errorSuperGetterSet(
593 node,
594 semantics.element,
595 node.arguments.single,
596 arg);
597 case AccessKind.SUPER_SETTER:
598 return visitor.visitSuperSetterSet(
599 node,
600 semantics.element,
601 node.arguments.single,
602 arg);
603 case AccessKind.CONSTANT:
604 // TODO(johnniwinther): Should this be a valid case?
605 break;
606 case AccessKind.UNRESOLVED:
607 return visitor.errorUnresolvedSet(
608 node,
609 semantics.element,
610 node.arguments.single,
611 arg);
612 case AccessKind.COMPOUND:
613 // This is not a valid case.
614 break;
615 }
616 throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
617 }
618 }
619
620 /// The structure for a [Send] that is a negation, i.e. of the form `!e`.
621 class NotStructure<R, A> implements SendStructure<R, A> {
622 /// The target of the negation.
623 final AccessSemantics semantics;
624
625 // TODO(johnniwinther): Should we store this?
626 final Selector selector;
627
628 NotStructure(this.semantics, this.selector);
629
630 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
631 switch (semantics.kind) {
632 case AccessKind.DYNAMIC_PROPERTY:
633 return visitor.visitNot(
634 node,
635 node.receiver,
636 arg);
637 default:
638 // This is not a valid case.
639 break;
640 }
641 throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
642 }
643 }
644
645 /// The structure for a [Send] that is an invocation of a user definable unary
646 /// operator.
647 class UnaryStructure<R, A> implements SendStructure<R, A> {
648 /// The target of the unary operation.
649 final AccessSemantics semantics;
650
651 /// The user definable unary operator.
652 final UnaryOperator operator;
653
654 // TODO(johnniwinther): Should we store this?
655 /// The [Selector] for the unary operator invocation.
656 final Selector selector;
657
658 UnaryStructure(this.semantics, this.operator, this.selector);
659
660 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
661 switch (semantics.kind) {
662 case AccessKind.DYNAMIC_PROPERTY:
663 return visitor.visitUnary(
664 node,
665 operator,
666 node.receiver,
667 arg);
668 case AccessKind.SUPER_METHOD:
669 return visitor.visitSuperUnary(
670 node,
671 operator,
672 semantics.element,
673 arg);
674 case AccessKind.UNRESOLVED:
675 return visitor.errorUnresolvedSuperUnary(
676 node,
677 operator,
678 semantics.element,
679 arg);
680 default:
681 // This is not a valid case.
682 break;
683 }
684 throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
685 }
686 }
687
688 /// The structure for a [Send] that is an invocation of a undefined unary
689 /// operator.
690 class InvalidUnaryStructure<R, A> implements SendStructure<R, A> {
691 const InvalidUnaryStructure();
692
693 @override
694 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
695 return visitor.errorUndefinedUnaryExpression(
696 node,
697 node.selector,
698 node.receiver,
699 arg);
700 }
701 }
702
703 /// The structure for a [Send] that is an equals test, i.e. of the form
704 /// `a == b`.
705 class EqualsStructure<R, A> implements SendStructure<R, A> {
706 /// The target of the left operand.
707 final AccessSemantics semantics;
708
709 // TODO(johnniwinther): Should we store this?
710 /// The [Selector] for the `==` invocation.
711 final Selector selector;
712
713 EqualsStructure(this.semantics, this.selector);
714
715 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
716 switch (semantics.kind) {
717 case AccessKind.DYNAMIC_PROPERTY:
718 return visitor.visitEquals(
719 node,
720 node.receiver,
721 node.arguments.single,
722 arg);
723 case AccessKind.SUPER_METHOD:
724 return visitor.visitSuperEquals(
725 node,
726 semantics.element,
727 node.arguments.single,
728 arg);
729 default:
730 // This is not a valid case.
731 break;
732 }
733 throw new SpannableAssertionFailure(node, "Invalid equals: ${semantics}");
734 }
735 }
736
737 /// The structure for a [Send] that is a not-equals test, i.e. of the form
738 /// `a != b`.
739 class NotEqualsStructure<R, A> implements SendStructure<R, A> {
740 /// The target of the left operand.
741 final AccessSemantics semantics;
742
743 // TODO(johnniwinther): Should we store this?
744 /// The [Selector] for the underlying `==` invocation.
745 final Selector selector;
746
747 NotEqualsStructure(this.semantics, this.selector);
748
749 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
750 switch (semantics.kind) {
751 case AccessKind.DYNAMIC_PROPERTY:
752 return visitor.visitNotEquals(
753 node,
754 node.receiver,
755 node.arguments.single,
756 arg);
757 case AccessKind.SUPER_METHOD:
758 return visitor.visitSuperNotEquals(
759 node,
760 semantics.element,
761 node.arguments.single,
762 arg);
763 default:
764 // This is not a valid case.
765 break;
766 }
767 throw new SpannableAssertionFailure(
768 node, "Invalid not equals: ${semantics}");
769 }
770 }
771
772 /// The structure for a [Send] that is an invocation of a user-definable binary
773 /// operator.
774 class BinaryStructure<R, A> implements SendStructure<R, A> {
775 /// The target of the left operand.
776 final AccessSemantics semantics;
777
778 /// The user definable binary operator.
779 final BinaryOperator operator;
780
781 // TODO(johnniwinther): Should we store this?
782 /// The [Selector] for the binary operator invocation.
783 final Selector selector;
784
785 BinaryStructure(this.semantics, this.operator, this.selector);
786
787 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
788 switch (semantics.kind) {
789 case AccessKind.DYNAMIC_PROPERTY:
790 return visitor.visitBinary(
791 node,
792 node.receiver,
793 operator,
794 node.arguments.single,
795 arg);
796 case AccessKind.SUPER_METHOD:
797 return visitor.visitSuperBinary(
798 node,
799 semantics.element,
800 operator,
801 node.arguments.single,
802 arg);
803 case AccessKind.UNRESOLVED:
804 return visitor.errorUnresolvedSuperBinary(
805 node,
806 semantics.element,
807 operator,
808 node.arguments.single,
809 arg);
810 default:
811 // This is not a valid case.
812 break;
813 }
814 throw new SpannableAssertionFailure(
815 node, "Invalid binary: ${semantics}");
816 }
817 }
818
819 /// The structure for a [Send] that is an invocation of a undefined binary
820 /// operator.
821 class InvalidBinaryStructure<R, A> implements SendStructure<R, A> {
822 const InvalidBinaryStructure();
823
824 @override
825 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
826 return visitor.errorUndefinedBinaryExpression(
827 node,
828 node.receiver,
829 node.selector,
830 node.arguments.single,
831 arg);
832 }
833 }
834
835 /// The structure for a [Send] that is of the form `a[b] = c`.
836 class IndexSetStructure<R, A> implements SendStructure<R, A> {
837 /// The target of the index set operation.
838 final AccessSemantics semantics;
839
840 // TODO(johnniwinther): Should we store this?
841 /// The [Selector] for the `[]=` operator invocation.
842 final Selector selector;
843
844 IndexSetStructure(this.semantics, this.selector);
845
846 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
847 switch (semantics.kind) {
848 case AccessKind.DYNAMIC_PROPERTY:
849 return visitor.visitIndexSet(
850 node,
851 node.receiver,
852 node.arguments.first,
853 node.arguments.tail.head,
854 arg);
855 case AccessKind.SUPER_METHOD:
856 return visitor.visitSuperIndexSet(
857 node,
858 semantics.element,
859 node.arguments.first,
860 node.arguments.tail.head,
861 arg);
862 case AccessKind.UNRESOLVED:
863 return visitor.errorUnresolvedSuperIndexSet(
864 node,
865 semantics.element,
866 node.arguments.first,
867 node.arguments.tail.head,
868 arg);
869 default:
870 // This is not a valid case.
871 break;
872 }
873 throw new SpannableAssertionFailure(
874 node, "Invalid index set: ${semantics}");
875 }
876 }
877
878 /// The structure for a [Send] that is a compound assignment. For instance
879 /// `a += b`.
880 class CompoundStructure<R, A> implements SendStructure<R, A> {
881 /// The target of the compound assignment, i.e. the left-hand side.
882 final AccessSemantics semantics;
883
884 /// The assignment operator used in the compound assignment.
885 final AssignmentOperator operator;
886
887 /// The [Selector] for the getter invocation.
888 final Selector getterSelector;
889
890 /// The [Selector] for the setter invocation.
891 final Selector setterSelector;
892
893 CompoundStructure(this.semantics,
894 this.operator,
895 this.getterSelector,
896 this.setterSelector);
897
898 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
899 switch (semantics.kind) {
900 case AccessKind.DYNAMIC_PROPERTY:
901 return visitor.visitDynamicPropertyCompound(
902 node,
903 node.receiver,
904 operator,
905 node.arguments.single,
906 getterSelector,
907 setterSelector,
908 arg);
909 case AccessKind.LOCAL_FUNCTION:
910 return visitor.errorLocalFunctionCompound(
911 node,
912 semantics.element,
913 operator,
914 node.arguments.single,
915 arg);
916 case AccessKind.LOCAL_VARIABLE:
917 return visitor.visitLocalVariableCompound(
918 node,
919 semantics.element,
920 operator,
921 node.arguments.single,
922 arg);
923 case AccessKind.PARAMETER:
924 return visitor.visitParameterCompound(
925 node,
926 semantics.element,
927 operator,
928 node.arguments.single,
929 arg);
930 case AccessKind.STATIC_FIELD:
931 return visitor.visitStaticFieldCompound(
932 node,
933 semantics.element,
934 operator,
935 node.arguments.single,
936 arg);
937 case AccessKind.STATIC_METHOD:
938 // TODO(johnniwinther): Handle this.
939 break;
940 case AccessKind.STATIC_GETTER:
941 // This is not a valid case.
942 break;
943 case AccessKind.STATIC_SETTER:
944 // This is not a valid case.
945 break;
946 case AccessKind.TOPLEVEL_FIELD:
947 return visitor.visitTopLevelFieldCompound(
948 node,
949 semantics.element,
950 operator,
951 node.arguments.single,
952 arg);
953 case AccessKind.TOPLEVEL_METHOD:
954 // TODO(johnniwinther): Handle this.
955 break;
956 case AccessKind.TOPLEVEL_GETTER:
957 // This is not a valid case.
958 break;
959 case AccessKind.TOPLEVEL_SETTER:
960 // This is not a valid case.
961 break;
962 case AccessKind.CLASS_TYPE_LITERAL:
963 return visitor.visitClassTypeLiteralCompound(
964 node,
965 semantics.constant,
966 operator,
967 node.arguments.single,
968 arg);
969 case AccessKind.TYPEDEF_TYPE_LITERAL:
970 return visitor.visitTypedefTypeLiteralCompound(
971 node,
972 semantics.constant,
973 operator,
974 node.arguments.single,
975 arg);
976 case AccessKind.DYNAMIC_TYPE_LITERAL:
977 return visitor.visitDynamicTypeLiteralCompound(
978 node,
979 semantics.constant,
980 operator,
981 node.arguments.single,
982 arg);
983 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
984 return visitor.visitTypeVariableTypeLiteralCompound(
985 node,
986 semantics.element,
987 operator,
988 node.arguments.single,
989 arg);
990 case AccessKind.EXPRESSION:
991 // This is not a valid case.
992 break;
993 case AccessKind.THIS:
994 // This is not a valid case.
995 break;
996 case AccessKind.THIS_PROPERTY:
997 return visitor.visitThisPropertyCompound(
998 node,
999 operator,
1000 node.arguments.single,
1001 getterSelector,
1002 setterSelector,
1003 arg);
1004 case AccessKind.SUPER_FIELD:
1005 return visitor.visitSuperFieldCompound(
1006 node,
1007 semantics.element,
1008 operator,
1009 node.arguments.single,
1010 arg);
1011 case AccessKind.SUPER_METHOD:
1012 // TODO(johnniwinther): Handle this.
1013 break;
1014 case AccessKind.SUPER_GETTER:
1015 // This is not a valid case.
1016 break;
1017 case AccessKind.SUPER_SETTER:
1018 // This is not a valid case.
1019 break;
1020 case AccessKind.CONSTANT:
1021 // TODO(johnniwinther): Should this be a valid case?
1022 break;
1023 case AccessKind.UNRESOLVED:
1024 return visitor.errorUnresolvedCompound(
1025 node,
1026 semantics.element,
1027 operator,
1028 node.arguments.single,
1029 arg);
1030 case AccessKind.COMPOUND:
1031 CompoundAccessSemantics compoundSemantics = semantics;
1032 switch (compoundSemantics.compoundAccessKind) {
1033 case CompoundAccessKind.STATIC_GETTER_SETTER:
1034 return visitor.visitStaticGetterSetterCompound(
1035 node,
1036 compoundSemantics.getter,
1037 compoundSemantics.setter,
1038 operator,
1039 node.arguments.single,
1040 arg);
1041 case CompoundAccessKind.STATIC_METHOD_SETTER:
1042 return visitor.visitStaticMethodSetterCompound(
1043 node,
1044 compoundSemantics.getter,
1045 compoundSemantics.setter,
1046 operator,
1047 node.arguments.single,
1048 arg);
1049 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1050 return visitor.visitTopLevelGetterSetterCompound(
1051 node,
1052 compoundSemantics.getter,
1053 compoundSemantics.setter,
1054 operator,
1055 node.arguments.single,
1056 arg);
1057 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1058 return visitor.visitTopLevelMethodSetterCompound(
1059 node,
1060 compoundSemantics.getter,
1061 compoundSemantics.setter,
1062 operator,
1063 node.arguments.single,
1064 arg);
1065 case CompoundAccessKind.SUPER_FIELD_FIELD:
1066 // TODO(johnniwinther): Handle this.
1067 break;
1068 case CompoundAccessKind.SUPER_GETTER_SETTER:
1069 return visitor.visitSuperGetterSetterCompound(
1070 node,
1071 compoundSemantics.getter,
1072 compoundSemantics.setter,
1073 operator,
1074 node.arguments.single,
1075 arg);
1076 case CompoundAccessKind.SUPER_GETTER_FIELD:
1077 return visitor.visitSuperGetterFieldCompound(
1078 node,
1079 compoundSemantics.getter,
1080 compoundSemantics.setter,
1081 operator,
1082 node.arguments.single,
1083 arg);
1084 case CompoundAccessKind.SUPER_METHOD_SETTER:
1085 return visitor.visitSuperMethodSetterCompound(
1086 node,
1087 compoundSemantics.getter,
1088 compoundSemantics.setter,
1089 operator,
1090 node.arguments.single,
1091 arg);
1092 case CompoundAccessKind.SUPER_FIELD_SETTER:
1093 return visitor.visitSuperFieldSetterCompound(
1094 node,
1095 compoundSemantics.getter,
1096 compoundSemantics.setter,
1097 operator,
1098 node.arguments.single,
1099 arg);
1100 }
1101 break;
1102 }
1103 throw new SpannableAssertionFailure(node,
1104 "Invalid compound assigment: ${semantics}");
1105 }
1106 }
1107
1108 /// The structure for a [Send] that is a compound assignment on the index
1109 /// operator. For instance `a[b] += c`.
1110 class CompoundIndexSetStructure<R, A> implements SendStructure<R, A> {
1111 /// The target of the index operations.
1112 final AccessSemantics semantics;
1113
1114 /// The assignment operator used in the compound assignment.
1115 final AssignmentOperator operator;
1116
1117 /// The [Selector] for the `[]` operator invocation.
1118 final Selector getterSelector;
1119
1120 /// The [Selector] for the `[]=` operator invocation.
1121 final Selector setterSelector;
1122
1123 CompoundIndexSetStructure(this.semantics, this.operator,
1124 this.getterSelector,
1125 this.setterSelector);
1126
1127 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
1128 switch (semantics.kind) {
1129 case AccessKind.DYNAMIC_PROPERTY:
1130 return visitor.visitCompoundIndexSet(
1131 node,
1132 node.receiver,
1133 node.arguments.first,
1134 operator,
1135 node.arguments.tail.head,
1136 arg);
1137 case AccessKind.UNRESOLVED:
1138 return visitor.errorUnresolvedSuperCompoundIndexSet(
1139 node,
1140 semantics.element,
1141 node.arguments.first,
1142 operator,
1143 node.arguments.tail.head,
1144 arg);
1145 case AccessKind.COMPOUND:
1146 CompoundAccessSemantics compoundSemantics = semantics;
1147 switch (compoundSemantics.compoundAccessKind) {
1148 case CompoundAccessKind.SUPER_GETTER_SETTER:
1149 return visitor.visitSuperCompoundIndexSet(
1150 node,
1151 compoundSemantics.getter,
1152 compoundSemantics.setter,
1153 node.arguments.first,
1154 operator,
1155 node.arguments.tail.head,
1156 arg);
1157 default:
1158 // This is not a valid case.
1159 break;
1160 }
1161 break;
1162 default:
1163 // This is not a valid case.
1164 break;
1165 }
1166 throw new SpannableAssertionFailure(
1167 node, "Invalid compound index set: ${semantics}");
1168 }
1169 }
1170
1171 /// The structure for a [Send] that is a prefix operations. For instance
1172 /// `++a`.
1173 class PrefixStructure<R, A> implements SendStructure<R, A> {
1174 /// The target of the prefix operation.
1175 final AccessSemantics semantics;
1176
1177 /// The `++` or `--` operator used in the operation.
1178 final IncDecOperator operator;
1179
1180 /// The [Selector] for the getter invocation.
1181 final Selector getterSelector;
1182
1183 /// The [Selector] for the setter invocation.
1184 final Selector setterSelector;
1185
1186 PrefixStructure(this.semantics,
1187 this.operator,
1188 this.getterSelector,
1189 this.setterSelector);
1190
1191 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
1192 switch (semantics.kind) {
1193 case AccessKind.DYNAMIC_PROPERTY:
1194 return visitor.visitDynamicPropertyPrefix(
1195 node,
1196 node.receiver,
1197 operator,
1198 getterSelector,
1199 setterSelector,
1200 arg);
1201 case AccessKind.LOCAL_FUNCTION:
1202 return visitor.errorLocalFunctionPrefix(
1203 node,
1204 semantics.element,
1205 operator,
1206 arg);
1207 case AccessKind.LOCAL_VARIABLE:
1208 return visitor.visitLocalVariablePrefix(
1209 node,
1210 semantics.element,
1211 operator,
1212 arg);
1213 case AccessKind.PARAMETER:
1214 return visitor.visitParameterPrefix(
1215 node,
1216 semantics.element,
1217 operator,
1218 arg);
1219 case AccessKind.STATIC_FIELD:
1220 return visitor.visitStaticFieldPrefix(
1221 node,
1222 semantics.element,
1223 operator,
1224 arg);
1225 case AccessKind.STATIC_METHOD:
1226 // TODO(johnniwinther): Handle this.
1227 break;
1228 case AccessKind.STATIC_GETTER:
1229 // This is not a valid case.
1230 break;
1231 case AccessKind.STATIC_SETTER:
1232 // This is not a valid case.
1233 break;
1234 case AccessKind.TOPLEVEL_FIELD:
1235 return visitor.visitTopLevelFieldPrefix(
1236 node,
1237 semantics.element,
1238 operator,
1239 arg);
1240 case AccessKind.TOPLEVEL_METHOD:
1241 // TODO(johnniwinther): Handle this.
1242 break;
1243 case AccessKind.TOPLEVEL_GETTER:
1244 // This is not a valid case.
1245 break;
1246 case AccessKind.TOPLEVEL_SETTER:
1247 // This is not a valid case.
1248 break;
1249 case AccessKind.CLASS_TYPE_LITERAL:
1250 return visitor.visitClassTypeLiteralPrefix(
1251 node,
1252 semantics.constant,
1253 operator,
1254 arg);
1255 case AccessKind.TYPEDEF_TYPE_LITERAL:
1256 return visitor.visitTypedefTypeLiteralPrefix(
1257 node,
1258 semantics.constant,
1259 operator,
1260 arg);
1261 case AccessKind.DYNAMIC_TYPE_LITERAL:
1262 return visitor.visitDynamicTypeLiteralPrefix(
1263 node,
1264 semantics.constant,
1265 operator,
1266 arg);
1267 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
1268 return visitor.visitTypeVariableTypeLiteralPrefix(
1269 node,
1270 semantics.element,
1271 operator,
1272 arg);
1273 case AccessKind.EXPRESSION:
1274 // This is not a valid case.
1275 break;
1276 case AccessKind.THIS:
1277 // This is not a valid case.
1278 break;
1279 case AccessKind.THIS_PROPERTY:
1280 return visitor.visitThisPropertyPrefix(
1281 node,
1282 operator,
1283 getterSelector,
1284 setterSelector,
1285 arg);
1286 case AccessKind.SUPER_FIELD:
1287 return visitor.visitSuperFieldPrefix(
1288 node,
1289 semantics.element,
1290 operator,
1291 arg);
1292 case AccessKind.SUPER_METHOD:
1293 // TODO(johnniwinther): Handle this.
1294 break;
1295 case AccessKind.SUPER_GETTER:
1296 // This is not a valid case.
1297 break;
1298 case AccessKind.SUPER_SETTER:
1299 // This is not a valid case.
1300 break;
1301 case AccessKind.CONSTANT:
1302 // TODO(johnniwinther): Should this be a valid case?
1303 break;
1304 case AccessKind.UNRESOLVED:
1305 return visitor.errorUnresolvedPrefix(
1306 node,
1307 semantics.element,
1308 operator,
1309 arg);
1310 case AccessKind.COMPOUND:
1311 CompoundAccessSemantics compoundSemantics = semantics;
1312 switch (compoundSemantics.compoundAccessKind) {
1313 case CompoundAccessKind.STATIC_GETTER_SETTER:
1314 return visitor.visitStaticGetterSetterPrefix(
1315 node,
1316 compoundSemantics.getter,
1317 compoundSemantics.setter,
1318 operator,
1319 arg);
1320 case CompoundAccessKind.STATIC_METHOD_SETTER:
1321 return visitor.visitStaticMethodSetterPrefix(
1322 node,
1323 compoundSemantics.getter,
1324 compoundSemantics.setter,
1325 operator,
1326 arg);
1327 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1328 return visitor.visitTopLevelGetterSetterPrefix(
1329 node,
1330 compoundSemantics.getter,
1331 compoundSemantics.setter,
1332 operator,
1333 arg);
1334 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1335 return visitor.visitTopLevelMethodSetterPrefix(
1336 node,
1337 compoundSemantics.getter,
1338 compoundSemantics.setter,
1339 operator,
1340 arg);
1341 case CompoundAccessKind.SUPER_FIELD_FIELD:
1342 return visitor.visitSuperFieldFieldPrefix(
1343 node,
1344 compoundSemantics.getter,
1345 compoundSemantics.setter,
1346 operator,
1347 arg);
1348 case CompoundAccessKind.SUPER_GETTER_SETTER:
1349 return visitor.visitSuperGetterSetterPrefix(
1350 node,
1351 compoundSemantics.getter,
1352 compoundSemantics.setter,
1353 operator,
1354 arg);
1355 case CompoundAccessKind.SUPER_GETTER_FIELD:
1356 return visitor.visitSuperGetterFieldPrefix(
1357 node,
1358 compoundSemantics.getter,
1359 compoundSemantics.setter,
1360 operator,
1361 arg);
1362 case CompoundAccessKind.SUPER_METHOD_SETTER:
1363 return visitor.visitSuperMethodSetterPrefix(
1364 node,
1365 compoundSemantics.getter,
1366 compoundSemantics.setter,
1367 operator,
1368 arg);
1369 case CompoundAccessKind.SUPER_FIELD_SETTER:
1370 return visitor.visitSuperFieldSetterPrefix(
1371 node,
1372 compoundSemantics.getter,
1373 compoundSemantics.setter,
1374 operator,
1375 arg);
1376 }
1377 }
1378 throw new SpannableAssertionFailure(node,
1379 "Invalid compound assigment: ${semantics}");
1380 }
1381 }
1382
1383 /// The structure for a [Send] that is a postfix operations. For instance
1384 /// `a++`.
1385 class PostfixStructure<R, A> implements SendStructure<R, A> {
1386 /// The target of the postfix operation.
1387 final AccessSemantics semantics;
1388
1389 /// The `++` or `--` operator used in the operation.
1390 final IncDecOperator operator;
1391
1392 /// The [Selector] for the getter invocation.
1393 final Selector getterSelector;
1394
1395 /// The [Selector] for the setter invocation.
1396 final Selector setterSelector;
1397
1398 PostfixStructure(this.semantics,
1399 this.operator,
1400 this.getterSelector,
1401 this.setterSelector);
1402
1403 R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
1404 switch (semantics.kind) {
1405 case AccessKind.DYNAMIC_PROPERTY:
1406 return visitor.visitDynamicPropertyPostfix(
1407 node,
1408 node.receiver,
1409 operator,
1410 getterSelector,
1411 setterSelector,
1412 arg);
1413 case AccessKind.LOCAL_FUNCTION:
1414 return visitor.errorLocalFunctionPostfix(
1415 node,
1416 semantics.element,
1417 operator,
1418 arg);
1419 case AccessKind.LOCAL_VARIABLE:
1420 return visitor.visitLocalVariablePostfix(
1421 node,
1422 semantics.element,
1423 operator,
1424 arg);
1425 case AccessKind.PARAMETER:
1426 return visitor.visitParameterPostfix(
1427 node,
1428 semantics.element,
1429 operator,
1430 arg);
1431 case AccessKind.STATIC_FIELD:
1432 return visitor.visitStaticFieldPostfix(
1433 node,
1434 semantics.element,
1435 operator,
1436 arg);
1437 case AccessKind.STATIC_METHOD:
1438 // TODO(johnniwinther): Handle this.
1439 break;
1440 case AccessKind.STATIC_GETTER:
1441 // This is not a valid case.
1442 break;
1443 case AccessKind.STATIC_SETTER:
1444 // This is not a valid case.
1445 break;
1446 case AccessKind.TOPLEVEL_FIELD:
1447 return visitor.visitTopLevelFieldPostfix(
1448 node,
1449 semantics.element,
1450 operator,
1451 arg);
1452 case AccessKind.TOPLEVEL_METHOD:
1453 // TODO(johnniwinther): Handle this.
1454 break;
1455 case AccessKind.TOPLEVEL_GETTER:
1456 // This is not a valid case.
1457 break;
1458 case AccessKind.TOPLEVEL_SETTER:
1459 // This is not a valid case.
1460 break;
1461 case AccessKind.CLASS_TYPE_LITERAL:
1462 return visitor.visitClassTypeLiteralPostfix(
1463 node,
1464 semantics.constant,
1465 operator,
1466 arg);
1467 case AccessKind.TYPEDEF_TYPE_LITERAL:
1468 return visitor.visitTypedefTypeLiteralPostfix(
1469 node,
1470 semantics.constant,
1471 operator,
1472 arg);
1473 case AccessKind.DYNAMIC_TYPE_LITERAL:
1474 return visitor.visitDynamicTypeLiteralPostfix(
1475 node,
1476 semantics.constant,
1477 operator,
1478 arg);
1479 case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
1480 return visitor.visitTypeVariableTypeLiteralPostfix(
1481 node,
1482 semantics.element,
1483 operator,
1484 arg);
1485 case AccessKind.EXPRESSION:
1486 // This is not a valid case.
1487 break;
1488 case AccessKind.THIS:
1489 // This is not a valid case.
1490 break;
1491 case AccessKind.THIS_PROPERTY:
1492 return visitor.visitThisPropertyPostfix(
1493 node,
1494 operator,
1495 getterSelector,
1496 setterSelector,
1497 arg);
1498 case AccessKind.SUPER_FIELD:
1499 return visitor.visitSuperFieldPostfix(
1500 node,
1501 semantics.element,
1502 operator,
1503 arg);
1504 case AccessKind.SUPER_METHOD:
1505 // TODO(johnniwinther): Handle this.
1506 break;
1507 case AccessKind.SUPER_GETTER:
1508 // This is not a valid case.
1509 break;
1510 case AccessKind.SUPER_SETTER:
1511 // This is not a valid case.
1512 break;
1513 case AccessKind.CONSTANT:
1514 // TODO(johnniwinther): Should this be a valid case?
1515 break;
1516 case AccessKind.UNRESOLVED:
1517 return visitor.errorUnresolvedPostfix(
1518 node,
1519 semantics.element,
1520 operator,
1521 arg);
1522 case AccessKind.COMPOUND:
1523 CompoundAccessSemantics compoundSemantics = semantics;
1524 switch (compoundSemantics.compoundAccessKind) {
1525 case CompoundAccessKind.STATIC_GETTER_SETTER:
1526 return visitor.visitStaticGetterSetterPostfix(
1527 node,
1528 compoundSemantics.getter,
1529 compoundSemantics.setter,
1530 operator,
1531 arg);
1532 case CompoundAccessKind.STATIC_METHOD_SETTER:
1533 return visitor.visitStaticMethodSetterPostfix(
1534 node,
1535 compoundSemantics.getter,
1536 compoundSemantics.setter,
1537 operator,
1538 arg);
1539 case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
1540 return visitor.visitTopLevelGetterSetterPostfix(
1541 node,
1542 compoundSemantics.getter,
1543 compoundSemantics.setter,
1544 operator,
1545 arg);
1546 case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
1547 return visitor.visitTopLevelMethodSetterPostfix(
1548 node,
1549 compoundSemantics.getter,
1550 compoundSemantics.setter,
1551 operator,
1552 arg);
1553 case CompoundAccessKind.SUPER_FIELD_FIELD:
1554 return visitor.visitSuperFieldFieldPostfix(
1555 node,
1556 compoundSemantics.getter,
1557 compoundSemantics.setter,
1558 operator,
1559 arg);
1560 case CompoundAccessKind.SUPER_GETTER_SETTER:
1561 return visitor.visitSuperGetterSetterPostfix(
1562 node,
1563 compoundSemantics.getter,
1564 compoundSemantics.setter,
1565 operator,
1566 arg);
1567 case CompoundAccessKind.SUPER_GETTER_FIELD:
1568 return visitor.visitSuperGetterFieldPostfix(
1569 node,
1570 compoundSemantics.getter,
1571 compoundSemantics.setter,
1572 operator,
1573 arg);
1574 case CompoundAccessKind.SUPER_METHOD_SETTER:
1575 return visitor.visitSuperMethodSetterPostfix(
1576 node,
1577 compoundSemantics.getter,
1578 compoundSemantics.setter,
1579 operator,
1580 arg);
1581 case CompoundAccessKind.SUPER_FIELD_SETTER:
1582 return visitor.visitSuperFieldSetterPostfix(
1583 node,
1584 compoundSemantics.getter,
1585 compoundSemantics.setter,
1586 operator,
1587 arg);
1588 }
1589 }
1590 throw new SpannableAssertionFailure(node,
1591 "Invalid compound assigment: ${semantics}");
1592 }
1593 }
1594
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698