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

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

Issue 929113002: Add SemanticVisitor to dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated and extended 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.semantics_visitor;
6
7 import '../constants/expressions.dart';
8 import '../dart_types.dart';
9 import '../elements/elements.dart';
10 import '../tree/tree.dart';
11 import '../universe/universe.dart';
12 import '../util/util.dart' show Spannable, SpannableAssertionFailure;
13 import 'access_semantics.dart';
14 import 'operators.dart';
15 import 'resolution.dart';
16 import 'send_structure.dart';
17
18 part 'semantic_visitor_mixins.dart';
19 part 'send_resolver.dart';
20
21 abstract class SemanticVisitor<R, A> extends Visitor<R>
22 with SendResolverMixin {
23 TreeElements elements;
24
25 SemanticVisitor(this.elements);
26
27 SemanticSendVisitor<R, A> get sendVisitor;
28
29 @override
30 R visitIdentifier(Identifier node) {
31 // TODO(johnniwinther): Support argument.
32 A arg = null;
33 if (node.isThis()) {
34 // TODO(johnniwinther): Parse `this` as a [Send] whose selector is `this`
35 // to normalize with `this(...)`.
36 return sendVisitor.visitThisGet(node, arg);
37 }
38 return null;
39 }
40
41 @override
42 R visitSend(Send node) {
43 // TODO(johnniwinther): Support argument.
44 A arg = null;
45
46 SendStructure structure = computeSendStructure(node);
47 if (structure == null) {
48 return internalError(node, 'No structure for $node');
49 } else {
50 return structure.dispatch(sendVisitor, node, arg);
51 }
52 }
53
54 @override
55 R visitSendSet(SendSet node) {
56 return visitSend(node);
57 }
58 }
59
60 abstract class SemanticSendVisitor<R, A> {
61 R apply(Node node, A arg);
62
63 /// Read of the [parameter].
64 ///
65 /// For instance:
66 /// m(parameter) => parameter;
67 ///
68 R visitParameterGet(
69 Send node,
70 ParameterElement parameter,
71 A arg);
72
73 /// Assignment of [rhs] to the [parameter].
74 ///
75 /// For instance:
76 /// m(parameter) {
77 /// parameter = rhs;
78 /// }
79 ///
80 R visitParameterSet(
81 SendSet node,
82 ParameterElement parameter,
83 Node rhs,
84 A arg);
85
86 /// Assignment of [rhs] to the final [parameter].
87 ///
88 /// For instance:
89 /// m(final parameter) {
90 /// parameter = rhs;
91 /// }
92 ///
93 R errorFinalParameterSet(
94 SendSet node,
95 ParameterElement parameter,
96 Node rhs,
97 A arg);
98
99 /// Invocation of the [parameter] with [arguments].
100 ///
101 /// For instance:
102 /// m(parameter) {
103 /// parameter(null, 42);
104 /// }
105 ///
106 R visitParameterInvoke(
107 Send node,
108 ParameterElement parameter,
109 NodeList arguments,
110 Selector selector,
111 A arg);
112
113 /// Read of the local [variable].
114 ///
115 /// For instance:
116 /// m() {
117 /// var variable;
118 /// return variable;
119 /// }
120 ///
121 R visitLocalVariableGet(
122 Send node,
123 LocalVariableElement variable,
124 A arg);
125
126 /// Assignment of [rhs] to the local [variable].
127 ///
128 /// For instance:
129 /// m() {
130 /// var variable;
131 /// variable = rhs;
132 /// }
133 ///
134 R visitLocalVariableSet(
135 SendSet node,
136 LocalVariableElement variable,
137 Node rhs,
138 A arg);
139
140 /// Assignment of [rhs] to the final local [variable].
141 ///
142 /// For instance:
143 /// m() {
144 /// final variable = null;
145 /// variable = rhs;
146 /// }
147 ///
148 R errorFinalLocalVariableSet(
149 SendSet node,
150 LocalVariableElement variable,
151 Node rhs,
152 A arg);
153
154 /// Invocation of the local variable [variable] with [arguments].
155 ///
156 /// For instance:
157 /// m() {
158 /// var variable;
159 /// variable(null, 42);
160 /// }
161 ///
162 R visitLocalVariableInvoke(
163 Send node,
164 LocalVariableElement variable,
165 NodeList arguments,
166 Selector selector,
167 A arg);
168
169 /// Closurization of the local [function].
170 ///
171 /// For instance:
172 /// m() {
173 /// o(a, b) {}
174 /// return o;
175 /// }
176 ///
177 R visitLocalFunctionGet(
178 Send node,
179 LocalFunctionElement function,
180 A arg);
181
182 /// Assignment of [rhs] to the local [function].
183 ///
184 /// For instance:
185 /// m() {
186 /// o(a, b) {}
187 /// o = rhs;
188 /// }
189 ///
190 R errorLocalFunctionSet(
191 SendSet node,
192 LocalFunctionElement function,
193 Node rhs,
194 A arg);
195
196 /// Invocation of the local [function] with [arguments].
197 ///
198 /// For instance:
199 /// m() {
200 /// o(a, b) {}
201 /// return o(null, 42);
202 /// }
203 ///
204 R visitLocalFunctionInvoke(
205 Send node,
206 LocalFunctionElement function,
207 NodeList arguments,
208 Selector selector,
209 A arg);
210
211 /// Getter call on [receiver] of the property defined by [selector].
212 ///
213 /// For instance
214 /// m(receiver) => receiver.foo;
215 ///
216 R visitDynamicPropertyGet(
217 Send node,
218 Node receiver,
219 Selector selector,
220 A arg);
221
222 /// Setter call on [receiver] with argument [rhs] of the property defined by
223 /// [selector].
224 ///
225 /// For instance
226 /// m(receiver) {
227 /// receiver.foo = rhs;
228 /// }
229 ///
230 R visitDynamicPropertySet(
231 SendSet node,
232 Node receiver,
233 Selector selector,
234 Node rhs,
235 A arg);
236
237 /// Invocation of the property defined by [selector] on [receiver] with
238 /// [arguments].
239 ///
240 /// For instance
241 /// m(receiver) {
242 /// receiver.foo(null, 42);
243 /// }
244 ///
245 R visitDynamicPropertyInvoke(
246 Send node,
247 Node receiver,
248 NodeList arguments,
249 Selector selector,
250 A arg);
251
252 /// Getter call on `this` of the property defined by [selector].
253 ///
254 /// For instance
255 /// class C {
256 /// m() => this.foo;
257 /// }
258 ///
259 /// or
260 ///
261 /// class C {
262 /// m() => foo;
263 /// }
264 ///
265 R visitThisPropertyGet(
266 Send node,
267 Selector selector,
268 A arg);
269
270 /// Setter call on `this` with argument [rhs] of the property defined by
271 /// [selector].
272 /// class C {
273 /// m() { this.foo = rhs; }
274 /// }
275 ///
276 /// or
277 ///
278 /// class C {
279 /// m() { foo = rhs; }
280 /// }
281 ///
282 R visitThisPropertySet(
283 SendSet node,
284 Selector selector,
285 Node rhs,
286 A arg);
287
288 /// Invocation of the property defined by [selector] on `this` with
289 /// [arguments].
290 ///
291 /// For instance
292 /// class C {
293 /// m() { this.foo(null, 42); }
294 /// }
295 ///
296 /// or
297 ///
298 /// class C {
299 /// m() { foo(null, 42); }
300 /// }
301 ///
302 ///
303 R visitThisPropertyInvoke(
304 Send node,
305 NodeList arguments,
306 Selector selector,
307 A arg);
308
309 /// Read of `this`.
310 ///
311 /// For instance
312 /// class C {
313 /// m() => this;
314 /// }
315 ///
316 R visitThisGet(
317 Identifier node,
318 A arg);
319
320 /// Invocation of `this` with [arguments].
321 ///
322 /// For instance
323 /// class C {
324 /// m() => this(null, 42);
325 /// }
326 ///
327 R visitThisInvoke(
328 Send node,
329 NodeList arguments,
330 Selector selector,
331 A arg);
332
333
334 /// Read of the super [field].
335 ///
336 /// For instance
337 /// class B {
338 /// var foo;
339 /// }
340 /// class C extends B {
341 /// m() => super.foo;
342 /// }
343 ///
344 R visitSuperFieldGet(
345 Send node,
346 FieldElement field,
347 A arg);
348
349 /// Assignment of [rhs] to the super [field].
350 ///
351 /// For instance
352 /// class B {
353 /// var foo;
354 /// }
355 /// class C extends B {
356 /// m() { super.foo = rhs; }
357 /// }
358 ///
359 R visitSuperFieldSet(
360 SendSet node,
361 FieldElement field,
362 Node rhs,
363 A arg);
364
365 /// Assignment of [rhs] to the final static [field].
366 ///
367 /// For instance
368 /// class B {
369 /// final foo = null;
370 /// }
371 /// class C extends B {
372 /// m() { super.foo = rhs; }
373 /// }
374 ///
375 R errorFinalSuperFieldSet(
376 SendSet node,
377 FieldElement field,
378 Node rhs,
379 A arg);
380
381 /// Invocation of the super [field] with [arguments].
382 ///
383 /// For instance
384 /// class B {
385 /// var foo;
386 /// }
387 /// class C extends B {
388 /// m() { super.foo(null, 42); }
389 /// }
390 ///
391 R visitSuperFieldInvoke(
392 Send node,
393 FieldElement field,
394 NodeList arguments,
395 Selector selector,
396 A arg);
397
398 /// Closurization of the super [method].
399 ///
400 /// For instance
401 /// class B {
402 /// foo(a, b) {}
403 /// }
404 /// class C extends B {
405 /// m() => super.foo;
406 /// }
407 ///
408 R visitSuperMethodGet(
409 Send node,
410 MethodElement method,
411 A arg);
412
413 /// Invocation of the super [method] with [arguments].
414 ///
415 /// For instance
416 /// class B {
417 /// foo(a, b) {}
418 /// }
419 /// class C extends B {
420 /// m() { super.foo(null, 42); }
421 /// }
422 ///
423 R visitSuperMethodInvoke(
424 Send node,
425 MethodElement method,
426 NodeList arguments,
427 Selector selector,
428 A arg);
429
430 /// Assignment of [rhs] to the super [method].
431 ///
432 /// For instance
433 /// class B {
434 /// foo(a, b) {}
435 /// }
436 /// class C extends B {
437 /// m() { super.foo = rhs; }
438 /// }
439 ///
440 R errorSuperMethodSet(
441 Send node,
442 MethodElement method,
443 Node rhs,
444 A arg);
445
446 /// Getter call to the super [getter].
447 ///
448 /// For instance
449 /// class B {
450 /// get foo => null;
451 /// }
452 /// class C extends B {
453 /// m() => super.foo;
454 /// }
455 ///
456 R visitSuperGetterGet(
457 Send node,
458 FunctionElement getter,
459 A arg);
460
461 /// Getter call the super [setter].
462 ///
463 /// For instance
464 /// class B {
465 /// set foo(_) {}
466 /// }
467 /// class C extends B {
468 /// m() => super.foo;
469 /// }
470 ///
471 R errorSuperSetterGet(
472 Send node,
473 FunctionElement setter,
474 A arg);
475
476 /// Setter call to the super [setter].
477 ///
478 /// For instance
479 /// class B {
480 /// set foo(_) {}
481 /// }
482 /// class C extends B {
483 /// m() { super.foo = rhs; }
484 /// }
485 ///
486 R visitSuperSetterSet(
487 SendSet node,
488 FunctionElement setter,
489 Node rhs,
490 A arg);
491
492 /// Assignment of [rhs] to the super [getter].
493 ///
494 /// For instance
495 /// class B {
496 /// get foo => null;
497 /// }
498 /// class C extends B {
499 /// m() { super.foo = rhs; }
500 /// }
501 ///
502 R errorSuperGetterSet(
503 SendSet node,
504 FunctionElement getter,
505 Node rhs,
506 A arg);
507
508 /// Invocation of the super [getter] with [arguments].
509 ///
510 /// For instance
511 /// class B {
512 /// get foo => null;
513 /// }
514 /// class C extends B {
515 /// m() { super.foo(null, 42; }
516 /// }
517 ///
518 R visitSuperGetterInvoke(
519 Send node,
520 FunctionElement getter,
521 NodeList arguments,
522 Selector selector,
523 A arg);
524
525 /// Invocation of the super [setter] with [arguments].
526 ///
527 /// For instance
528 /// class B {
529 /// set foo(_) {}
530 /// }
531 /// class C extends B {
532 /// m() { super.foo(null, 42; }
533 /// }
534 ///
535 R errorSuperSetterInvoke(
536 Send node,
537 FunctionElement setter,
538 NodeList arguments,
539 Selector selector,
540 A arg);
541
542 /// Invocation of a [expression] with [arguments].
543 ///
544 /// For instance
545 /// m() => (a, b){}(null, 42);
546 ///
547 R visitExpressionInvoke(
548 Send node,
549 Node expression,
550 NodeList arguments,
551 Selector selector,
552 A arg);
553
554 /// Read of the static [field].
555 ///
556 /// For instance
557 /// class C {
558 /// static var foo;
559 /// }
560 /// m() => C.foo;
561 ///
562 R visitStaticFieldGet(
563 Send node,
564 FieldElement field,
565 A arg);
566
567 /// Assignment of [rhs] to the static [field].
568 ///
569 /// For instance
570 /// class C {
571 /// static var foo;
572 /// }
573 /// m() { C.foo = rhs; }
574 ///
575 R visitStaticFieldSet(
576 SendSet node,
577 FieldElement field,
578 Node rhs,
579 A arg);
580
581 /// Assignment of [rhs] to the final static [field].
582 ///
583 /// For instance
584 /// class C {
585 /// static final foo;
586 /// }
587 /// m() { C.foo = rhs; }
588 ///
589 R errorFinalStaticFieldSet(
590 SendSet node,
591 FieldElement field,
592 Node rhs,
593 A arg);
594
595 /// Invocation of the static [field] with [arguments].
596 ///
597 /// For instance
598 /// class C {
599 /// static var foo;
600 /// }
601 /// m() { C.foo(null, 42); }
602 ///
603 R visitStaticFieldInvoke(
604 Send node,
605 FieldElement field,
606 NodeList arguments,
607 Selector selector,
608 A arg);
609
610 /// Closurization of the static [function].
611 ///
612 /// For instance
613 /// class C {
614 /// static foo(a, b) {}
615 /// }
616 /// m() => C.foo;
617 ///
618 R visitStaticFunctionGet(
619 Send node,
620 MethodElement function,
621 A arg);
622
623 /// Invocation of the static [function] with [arguments].
624 ///
625 /// For instance
626 /// class C {
627 /// static foo(a, b) {}
628 /// }
629 /// m() { C.foo(null, 42); }
630 ///
631 R visitStaticFunctionInvoke(
632 Send node,
633 MethodElement function,
634 NodeList arguments,
635 Selector selector,
636 A arg);
637
638 /// Assignment of [rhs] to the static [function].
639 ///
640 /// For instance
641 /// class C {
642 /// static foo(a, b) {}
643 /// }
644 /// m() { C.foo = rhs; }
645 ///
646 R errorStaticFunctionSet(
647 Send node,
648 MethodElement function,
649 Node rhs,
650 A arg);
651
652 /// Getter call to the static [getter].
653 ///
654 /// For instance
655 /// class C {
656 /// static get foo => null;
657 /// }
658 /// m() => C.foo;
659 ///
660 R visitStaticGetterGet(
661 Send node,
662 FunctionElement getter,
663 A arg);
664
665 /// Getter call the static [setter].
666 ///
667 /// For instance
668 /// class C {
669 /// static set foo(_) {}
670 /// }
671 /// m() => C.foo;
672 ///
673 R errorStaticSetterGet(
674 Send node,
675 FunctionElement setter,
676 A arg);
677
678 /// Setter call to the static [setter].
679 ///
680 /// For instance
681 /// class C {
682 /// static set foo(_) {}
683 /// }
684 /// m() { C.foo = rhs; }
685 ///
686 R visitStaticSetterSet(
687 SendSet node,
688 FunctionElement setter,
689 Node rhs,
690 A arg);
691
692 /// Assignment of [rhs] to the static [getter].
693 ///
694 /// For instance
695 /// class C {
696 /// static get foo => null;
697 /// }
698 /// m() { C.foo = rhs; }
699 ///
700 R errorStaticGetterSet(
701 SendSet node,
702 FunctionElement getter,
703 Node rhs,
704 A arg);
705
706 /// Invocation of the static [getter] with [arguments].
707 ///
708 /// For instance
709 /// class C {
710 /// static get foo => null;
711 /// }
712 /// m() { C.foo(null, 42; }
713 ///
714 R visitStaticGetterInvoke(
715 Send node,
716 FunctionElement getter,
717 NodeList arguments,
718 Selector selector,
719 A arg);
720
721 /// Invocation of the static [setter] with [arguments].
722 ///
723 /// For instance
724 /// class C {
725 /// static set foo(_) {}
726 /// }
727 /// m() { C.foo(null, 42; }
728 ///
729 R errorStaticSetterInvoke(
730 Send node,
731 FunctionElement setter,
732 NodeList arguments,
733 Selector selector,
734 A arg);
735
736 /// Read of the top level [field].
737 ///
738 /// For instance
739 /// var foo;
740 /// m() => foo;
741 ///
742 R visitTopLevelFieldGet(
743 Send node,
744 FieldElement field,
745 A arg);
746
747 /// Assignment of [rhs] to the top level [field].
748 ///
749 /// For instance
750 /// var foo;
751 /// m() { foo = rhs; }
752 ///
753 R visitTopLevelFieldSet(
754 SendSet node,
755 FieldElement field,
756 Node rhs,
757 A arg);
758
759 /// Assignment of [rhs] to the final top level [field].
760 ///
761 /// For instance
762 /// final foo = null;
763 /// m() { foo = rhs; }
764 ///
765 R errorFinalTopLevelFieldSet(
766 SendSet node,
767 FieldElement field,
768 Node rhs,
769 A arg);
770
771 /// Invocation of the top level [field] with [arguments].
772 ///
773 /// For instance
774 /// var foo;
775 /// m() { foo(null, 42); }
776 ///
777 R visitTopLevelFieldInvoke(
778 Send node,
779 FieldElement field,
780 NodeList arguments,
781 Selector selector,
782 A arg);
783
784 /// Closurization of the top level [function].
785 ///
786 /// For instance
787 /// foo(a, b) {};
788 /// m() => foo;
789 ///
790 R visitTopLevelFunctionGet(
791 Send node,
792 MethodElement function,
793 A arg);
794
795 /// Invocation of the top level [function] with [arguments].
796 ///
797 /// For instance
798 /// foo(a, b) {};
799 /// m() { foo(null, 42); }
800 ///
801 R visitTopLevelFunctionInvoke(
802 Send node,
803 MethodElement function,
804 NodeList arguments,
805 Selector selector,
806 A arg);
807
808 /// Assignment of [rhs] to the top level [function].
809 ///
810 /// For instance
811 /// foo(a, b) {};
812 /// m() { foo = rhs; }
813 ///
814 R errorTopLevelFunctionSet(
815 Send node,
816 MethodElement function,
817 Node rhs,
818 A arg);
819
820 /// Getter call to the top level [getter].
821 ///
822 /// For instance
823 /// get foo => null;
824 /// m() => foo;
825 ///
826 R visitTopLevelGetterGet(
827 Send node,
828 FunctionElement getter,
829 A arg);
830
831 /// Getter call the top level [setter].
832 ///
833 /// For instance
834 /// set foo(_) {}
835 /// m() => foo;
836 ///
837 R errorTopLevelSetterGet(
838 Send node,
839 FunctionElement setter,
840 A arg);
841
842 /// Setter call to the top level [setter].
843 ///
844 /// For instance
845 /// set foo(_) {}
846 /// m() { foo = rhs; }
847 ///
848 R visitTopLevelSetterSet(
849 SendSet node,
850 FunctionElement setter,
851 Node rhs,
852 A arg);
853
854 /// Assignment of [rhs] to the top level [getter].
855 ///
856 /// For instance
857 /// get foo => null;
858 /// m() { foo = rhs; }
859 ///
860 R errorTopLevelGetterSet(
861 SendSet node,
862 FunctionElement getter,
863 Node rhs,
864 A arg);
865
866 /// Invocation of the top level [getter] with [arguments].
867 ///
868 /// For instance
869 /// get foo => null;
870 /// m() { foo(null, 42); }
871 ///
872 R visitTopLevelGetterInvoke(
873 Send node,
874 FunctionElement getter,
875 NodeList arguments,
876 Selector selector,
877 A arg);
878
879 /// Invocation of the top level [setter] with [arguments].
880 ///
881 /// For instance
882 /// set foo(_) {};
883 /// m() { foo(null, 42); }
884 ///
885 R errorTopLevelSetterInvoke(
886 Send node,
887 FunctionElement setter,
888 NodeList arguments,
889 Selector selector,
890 A arg);
891
892 /// Read of the type literal for class [element].
893 ///
894 /// For instance
895 /// class C {}
896 /// m() => C;
897 ///
898 R visitClassTypeLiteralGet(
899 Send node,
900 TypeConstantExpression constant,
901 A arg);
902
903 /// Invocation of the type literal for class [element] with [arguments].
904 ///
905 /// For instance
906 /// class C {}
907 /// m() => C(null, 42);
908 ///
909 R visitClassTypeLiteralInvoke(
910 Send node,
911 TypeConstantExpression constant,
912 NodeList arguments,
913 Selector selector,
914 A arg);
915
916 /// Assignment of [rhs] to the type literal for class [element].
917 ///
918 /// For instance
919 /// class C {}
920 /// m() { C = rhs; }
921 ///
922 R errorClassTypeLiteralSet(
923 SendSet node,
924 TypeConstantExpression constant,
925 Node rhs,
926 A arg);
927
928 /// Read of the type literal for typedef [element].
929 ///
930 /// For instance
931 /// typedef F();
932 /// m() => F;
933 ///
934 R visitTypedefTypeLiteralGet(
935 Send node,
936 TypeConstantExpression constant,
937 A arg);
938
939 /// Invocation of the type literal for typedef [element] with [arguments].
940 ///
941 /// For instance
942 /// typedef F();
943 /// m() => F(null, 42);
944 ///
945 R visitTypedefTypeLiteralInvoke(
946 Send node,
947 TypeConstantExpression constant,
948 NodeList arguments,
949 Selector selector,
950 A arg);
951
952 /// Assignment of [rhs] to the type literal for typedef [element].
953 ///
954 /// For instance
955 /// typedef F();
956 /// m() { F = rhs; }
957 ///
958 R errorTypedefTypeLiteralSet(
959 SendSet node,
960 TypeConstantExpression constant,
961 Node rhs,
962 A arg);
963
964 /// Read of the type literal for type variable [element].
965 ///
966 /// For instance
967 /// class C<T> {
968 /// m() => T;
969 /// }
970 ///
971 R visitTypeVariableTypeLiteralGet(
972 Send node,
973 TypeVariableElement element,
974 A arg);
975
976 /// Invocation of the type literal for type variable [element] with
977 /// [arguments].
978 ///
979 /// For instance
980 /// class C<T> {
981 /// m() { T(null, 42); }
982 /// }
983 ///
984 R visitTypeVariableTypeLiteralInvoke(
985 Send node,
986 TypeVariableElement element,
987 NodeList arguments,
988 Selector selector,
989 A arg);
990
991 /// Assignment of [rhs] to the type literal for type variable [element].
992 ///
993 /// For instance
994 /// class C<T> {
995 /// m() { T = rhs; }
996 /// }
997 ///
998 R errorTypeVariableTypeLiteralSet(
999 SendSet node,
1000 TypeVariableElement element,
1001 Node rhs,
1002 A arg);
1003
1004 /// Read of the type literal for `dynamic`.
1005 ///
1006 /// For instance
1007 /// m() => dynamic;
1008 ///
1009 R visitDynamicTypeLiteralGet(
1010 Send node,
1011 TypeConstantExpression constant,
1012 A arg);
1013
1014 /// Invocation of the type literal for `dynamic` with [arguments].
1015 ///
1016 /// For instance
1017 /// m() { dynamic(null, 42); }
1018 ///
1019 R visitDynamicTypeLiteralInvoke(
1020 Send node,
1021 TypeConstantExpression constant,
1022 NodeList arguments,
1023 Selector selector,
1024 A arg);
1025
1026 /// Assignment of [rhs] to the type literal for `dynamic`.
1027 ///
1028 /// For instance
1029 /// m() { dynamic = rhs; }
1030 ///
1031 R errorDynamicTypeLiteralSet(
1032 SendSet node,
1033 TypeConstantExpression constant,
1034 Node rhs,
1035 A arg);
1036
1037 /// Call to `assert` with [expression] as the condition.
1038 ///
1039 /// For instance:
1040 /// m() { assert(expression); }
1041 ///
1042 R visitAssert(
1043 Send node,
1044 Node expression,
1045 A arg);
1046
1047 /// Call to `assert` with the wrong number of [arguments].
1048 ///
1049 /// For instance:
1050 /// m() { assert(); }
1051 /// or
1052 /// m() { assert(expression1, expression2); }
1053 ///
1054 R errorInvalidAssert(
1055 Send node,
1056 NodeList arguments,
1057 A arg);
1058
1059 /// Binary expression `left operator right` where [operator] is a user
1060 /// definable operator. Binary expressions using operator `==` are handled
1061 /// by [visitEquals].
1062 ///
1063 /// For instance:
1064 /// add(a, b) => a + b;
1065 /// sub(a, b) => a - b;
1066 /// mul(a, b) => a * b;
1067 ///
1068 R visitBinary(
1069 Send node,
1070 Node left,
1071 BinaryOperator operator,
1072 Node right,
1073 A arg);
1074
1075 /// Binary expression `super operator argument` where [operator] is a user
1076 /// definable operator implemented on a superclass by [function]. Binary
1077 /// expressions using operator `==` are handled by [visitSuperEquals].
1078 ///
1079 /// For instance:
1080 /// class B {
1081 /// operator +(_) => null;
1082 /// }
1083 /// class C extends B {
1084 /// m(a) => super + a;
1085 /// }
1086 ///
1087 R visitSuperBinary(
1088 Send node,
1089 FunctionElement function,
1090 BinaryOperator operator,
1091 Node argument,
1092 A arg);
1093
1094 /// Binary expression `left == right`.
1095 ///
1096 /// For instance:
1097 /// neq(a, b) => a != b;
1098 ///
1099 R visitNotEquals(
1100 Send node,
1101 Node left,
1102 Node right,
1103 A arg);
1104
1105 /// Binary expression `super != argument` where `==` is implemented on a
1106 /// superclass by [function].
1107 ///
1108 /// For instance:
1109 /// class B {
1110 /// operator +(_) => null;
1111 /// }
1112 /// class C extends B {
1113 /// m(a) => super + a;
1114 /// }
1115 ///
1116 R visitSuperNotEquals(
1117 Send node,
1118 FunctionElement function,
1119 Node argument,
1120 A arg);
1121
1122 /// Binary expression `left == right`.
1123 ///
1124 /// For instance:
1125 /// eq(a, b) => a == b;
1126 ///
1127 R visitEquals(
1128 Send node,
1129 Node left,
1130 Node right,
1131 A arg);
1132
1133 /// Binary expression `super == argument` where `==` is implemented on a
1134 /// superclass by [function].
1135 ///
1136 /// For instance:
1137 /// class B {
1138 /// operator ==(_) => null;
1139 /// }
1140 /// class C extends B {
1141 /// m(a) => super == a;
1142 /// }
1143 ///
1144 R visitSuperEquals(
1145 Send node,
1146 FunctionElement function,
1147 Node argument,
1148 A arg);
1149
1150 /// Unary expression `operator expression` where [operator] is a user
1151 /// definable operator.
1152 ///
1153 /// For instance:
1154 /// neg(a, b) => -a;
1155 /// comp(a, b) => ~a;
1156 ///
1157 R visitUnary(
1158 Send node,
1159 UnaryOperator operator,
1160 Node expression,
1161 A arg);
1162
1163 /// Unary expression `operator super` where [operator] is a user definable
1164 /// operator implemented on a superclass by [function].
1165 ///
1166 /// For instance:
1167 /// class B {
1168 /// operator -() => null;
1169 /// }
1170 /// class C extends B {
1171 /// m(a) => -super;
1172 /// }
1173 ///
1174 R visitSuperUnary(
1175 Send node,
1176 UnaryOperator operator,
1177 FunctionElement function,
1178 A arg);
1179
1180 /// Unary expression `!expression`.
1181 ///
1182 /// For instance:
1183 /// not(a) => !a;
1184 ///
1185 R visitNot(
1186 Send node,
1187 Node expression,
1188 A arg);
1189
1190 /// Index set expression `receiver[index] = rhs`.
1191 ///
1192 /// For instance:
1193 /// m(receiver, index, rhs) => receiver[index] = rhs;
1194 ///
1195 R visitIndexSet(
1196 Send node,
1197 Node receiver,
1198 Node index,
1199 Node rhs,
1200 A arg);
1201
1202 /// Index set expression `super[index] = rhs` where `operator []=` is defined
1203 /// on a superclass by [function].
1204 ///
1205 /// For instance:
1206 /// class B {
1207 /// operator []=(a, b) {}
1208 /// }
1209 /// class C extends B {
1210 /// m(a, b) => super[a] = b;
1211 /// }
1212 ///
1213 R visitSuperIndexSet(
1214 Send node,
1215 FunctionElement function,
1216 Node index,
1217 Node rhs,
1218 A arg);
1219
1220 /// Logical and, &&, expression with operands [left] and [right].
1221 ///
1222 /// For instance
1223 /// m() => left && right;
1224 ///
1225 R visitLogicalAnd(
1226 Send node,
1227 Node left,
1228 Node right,
1229 A arg);
1230
1231 /// Logical or, ||, expression with operands [left] and [right].
1232 ///
1233 /// For instance
1234 /// m() => left || right;
1235 ///
1236 R visitLogicalOr(
1237 Send node,
1238 Node left,
1239 Node right,
1240 A arg);
1241
1242 /// Is test of [expression] against [type].
1243 ///
1244 /// For instance
1245 /// class C {}
1246 /// m() => expression is C;
1247 ///
1248 R visitIs(
1249 Send node,
1250 Node expression,
1251 DartType type,
1252 A arg);
1253
1254 /// Is not test of [expression] against [type].
1255 ///
1256 /// For instance
1257 /// class C {}
1258 /// m() => expression is! C;
1259 ///
1260 R visitIsNot(
1261 Send node,
1262 Node expression,
1263 DartType type,
1264 A arg);
1265
1266 /// As cast of [expression] to [type].
1267 ///
1268 /// For instance
1269 /// class C {}
1270 /// m() => expression as C;
1271 ///
1272 R visitAs(
1273 Send node,
1274 Node expression,
1275 DartType type,
1276 A arg);
1277
1278 /// Compound assignment expression of [rhs] with [operator] of the property on
1279 /// [receiver] whose getter and setter are defined by [getterSelector] and
1280 /// [setterSelector], respectively.
1281 ///
1282 /// For instance:
1283 /// m(receiver, rhs) => receiver.foo += rhs;
1284 ///
1285 R visitDynamicPropertyCompound(
1286 Send node,
1287 Node receiver,
1288 AssignmentOperator operator,
1289 Node rhs,
1290 Selector getterSelector,
1291 Selector setterSelector,
1292 A arg);
1293
1294 /// Compound assignment expression of [rhs] with [operator] of the property on
1295 /// `this` whose getter and setter are defined by [getterSelector] and
1296 /// [setterSelector], respectively.
1297 ///
1298 /// For instance:
1299 /// class C {
1300 /// m(rhs) => this.foo += rhs;
1301 /// }
1302 /// or
1303 /// class C {
1304 /// m(rhs) => foo += rhs;
1305 /// }
1306 ///
1307 R visitThisPropertyCompound(
1308 Send node,
1309 AssignmentOperator operator,
1310 Node rhs,
1311 Selector getterSelector,
1312 Selector setterSelector,
1313 A arg);
1314
1315 /// Compound assignment expression of [rhs] with [operator] on a [parameter].
1316 ///
1317 /// For instance:
1318 /// m(parameter, rhs) => parameter += rhs;
1319 ///
1320 R visitParameterCompound(
1321 Send node,
1322 ParameterElement parameter,
1323 AssignmentOperator operator,
1324 Node rhs,
1325 A arg);
1326
1327 /// Compound assignment expression of [rhs] with [operator] on a final
1328 /// [parameter].
1329 ///
1330 /// For instance:
1331 /// m(final parameter, rhs) => parameter += rhs;
1332 ///
1333 R errorFinalParameterCompound(
1334 Send node,
1335 ParameterElement parameter,
1336 AssignmentOperator operator,
1337 Node rhs,
1338 A arg);
1339
1340 /// Compound assignment expression of [rhs] with [operator] on a local
1341 /// [variable].
1342 ///
1343 /// For instance:
1344 /// m(rhs) {
1345 /// var variable;
1346 /// variable += rhs;
1347 /// }
1348 ///
1349 R visitLocalVariableCompound(
1350 Send node,
1351 LocalVariableElement variable,
1352 AssignmentOperator operator,
1353 Node rhs,
1354 A arg);
1355
1356 /// Compound assignment expression of [rhs] with [operator] on a final local
1357 /// [variable].
1358 ///
1359 /// For instance:
1360 /// m(rhs) {
1361 /// final variable = 0;
1362 /// variable += rhs;
1363 /// }
1364 ///
1365 R errorFinalLocalVariableCompound(
1366 Send node,
1367 LocalVariableElement variable,
1368 AssignmentOperator operator,
1369 Node rhs,
1370 A arg);
1371
1372 /// Compound assignment expression of [rhs] with [operator] on a local
1373 /// [function].
1374 ///
1375 /// For instance:
1376 /// m(rhs) {
1377 /// function() {}
1378 /// function += rhs;
1379 /// }
1380 ///
1381 R errorLocalFunctionCompound(
1382 Send node,
1383 LocalFunctionElement function,
1384 AssignmentOperator operator,
1385 Node rhs,
1386 A arg);
1387
1388 /// Compound assignment expression of [rhs] with [operator] on a static
1389 /// [field].
1390 ///
1391 /// For instance:
1392 /// class C {
1393 /// static var field;
1394 /// m(rhs) => field += rhs;
1395 /// }
1396 ///
1397 R visitStaticFieldCompound(
1398 Send node,
1399 FieldElement field,
1400 AssignmentOperator operator,
1401 Node rhs,
1402 A arg);
1403
1404 /// Compound assignment expression of [rhs] with [operator] on a final static
1405 /// [field].
1406 ///
1407 /// For instance:
1408 /// class C {
1409 /// static final field = 0;
1410 /// m(rhs) => field += rhs;
1411 /// }
1412 ///
1413 R errorFinalStaticFieldCompound(
1414 Send node,
1415 FieldElement field,
1416 AssignmentOperator operator,
1417 Node rhs,
1418 A arg);
1419
1420 /// Compound assignment expression of [rhs] with [operator] reading from a
1421 /// static [getter] and writing to a static [setter].
1422 ///
1423 /// For instance:
1424 /// class C {
1425 /// static get o => 0;
1426 /// static set o(_) {}
1427 /// m(rhs) => o += rhs;
1428 /// }
1429 ///
1430 R visitStaticGetterSetterCompound(
1431 Send node,
1432 FunctionElement getter,
1433 FunctionElement setter,
1434 AssignmentOperator operator,
1435 Node rhs,
1436 A arg);
1437
1438 /// Compound assignment expression of [rhs] with [operator] reading from a
1439 /// static [method], that is, closurizing [method], and writing to a static
1440 /// [setter].
1441 ///
1442 /// For instance:
1443 /// class C {
1444 /// static o() {}
1445 /// static set o(_) {}
1446 /// m(rhs) => o += rhs;
1447 /// }
1448 ///
1449 R visitStaticMethodSetterCompound(
1450 Send node,
1451 FunctionElement method,
1452 FunctionElement setter,
1453 AssignmentOperator operator,
1454 Node rhs,
1455 A arg);
1456
1457 /// Compound assignment expression of [rhs] with [operator] on a top level
1458 /// [field].
1459 ///
1460 /// For instance:
1461 /// var field;
1462 /// m(rhs) => field += rhs;
1463 ///
1464 R visitTopLevelFieldCompound(
1465 Send node,
1466 FieldElement field,
1467 AssignmentOperator operator,
1468 Node rhs,
1469 A arg);
1470
1471 /// Compound assignment expression of [rhs] with [operator] on a final top
1472 /// level [field].
1473 ///
1474 /// For instance:
1475 /// final field = 0;
1476 /// m(rhs) => field += rhs;
1477 ///
1478 R errorFinalTopLevelFieldCompound(
1479 Send node,
1480 FieldElement field,
1481 AssignmentOperator operator,
1482 Node rhs,
1483 A arg);
1484
1485 /// Compound assignment expression of [rhs] with [operator] reading from a
1486 /// top level [getter] and writing to a top level [setter].
1487 ///
1488 /// For instance:
1489 /// get o => 0;
1490 /// set o(_) {}
1491 /// m(rhs) => o += rhs;
1492 ///
1493 R visitTopLevelGetterSetterCompound(
1494 Send node,
1495 FunctionElement getter,
1496 FunctionElement setter,
1497 AssignmentOperator operator,
1498 Node rhs,
1499 A arg);
1500
1501 /// Compound assignment expression of [rhs] with [operator] reading from a
1502 /// top level [method], that is, closurizing [method], and writing to a top
1503 /// level [setter].
1504 ///
1505 /// For instance:
1506 /// o() {}
1507 /// set o(_) {}
1508 /// m(rhs) => o += rhs;
1509 ///
1510 R visitTopLevelMethodSetterCompound(
1511 Send node,
1512 FunctionElement method,
1513 FunctionElement setter,
1514 AssignmentOperator operator,
1515 Node rhs,
1516 A arg);
1517
1518 /// Compound assignment expression of [rhs] with [operator] on a super
1519 /// [field].
1520 ///
1521 /// For instance:
1522 /// class B {
1523 /// var field;
1524 /// }
1525 /// class C extends B {
1526 /// m(rhs) => super.field += rhs;
1527 /// }
1528 ///
1529 R visitSuperFieldCompound(
1530 Send node,
1531 FieldElement field,
1532 AssignmentOperator operator,
1533 Node rhs,
1534 A arg);
1535
1536 /// Compound assignment expression of [rhs] with [operator] on a final super
1537 /// [field].
1538 ///
1539 /// For instance:
1540 /// class B {
1541 /// final field = 0;
1542 /// }
1543 /// class C extends B {
1544 /// m(rhs) => super.field += rhs;
1545 /// }
1546 ///
1547 R errorFinalSuperFieldCompound(
1548 Send node,
1549 FieldElement field,
1550 AssignmentOperator operator,
1551 Node rhs,
1552 A arg);
1553
1554 /// Compound assignment expression of [rhs] with [operator] reading from a
1555 /// super [getter] and writing to a super [setter].
1556 ///
1557 /// For instance:
1558 /// class B {
1559 /// get o => 0;
1560 /// set o(_) {}
1561 /// }
1562 /// class C extends B {
1563 /// m(rhs) => super.o += rhs;
1564 /// }
1565 ///
1566 R visitSuperGetterSetterCompound(
1567 Send node,
1568 FunctionElement getter,
1569 FunctionElement setter,
1570 AssignmentOperator operator,
1571 Node rhs,
1572 A arg);
1573
1574 /// Compound assignment expression of [rhs] with [operator] reading from a
1575 /// super [method], that is, closurizing [method], and writing to a super
1576 /// [setter].
1577 ///
1578 /// For instance:
1579 /// class B {
1580 /// o() {}
1581 /// set o(_) {}
1582 /// }
1583 /// class C extends B {
1584 /// m(rhs) => super.o += rhs;
1585 /// }
1586 ///
1587 R visitSuperMethodSetterCompound(
1588 Send node,
1589 FunctionElement method,
1590 FunctionElement setter,
1591 AssignmentOperator operator,
1592 Node rhs,
1593 A arg);
1594
1595 /// Compound assignment expression of [rhs] with [operator] reading from a
1596 /// super [field] and writing to a super [setter].
1597 ///
1598 /// For instance:
1599 /// class A {
1600 /// var o;
1601 /// }
1602 /// class B extends A {
1603 /// set o(_) {}
1604 /// }
1605 /// class C extends B {
1606 /// m(rhs) => super.o += rhs;
1607 /// }
1608 ///
1609 R visitSuperFieldSetterCompound(
1610 Send node,
1611 FieldElement field,
1612 FunctionElement setter,
1613 AssignmentOperator operator,
1614 Node rhs,
1615 A arg);
1616
1617 /// Compound assignment expression of [rhs] with [operator] reading from a
1618 /// super [getter] and writing to a super [field].
1619 ///
1620 /// For instance:
1621 /// class A {
1622 /// var o;
1623 /// }
1624 /// class B extends A {
1625 /// get o => 0;
1626 /// }
1627 /// class C extends B {
1628 /// m(rhs) => super.o += rhs;
1629 /// }
1630 ///
1631 R visitSuperGetterFieldCompound(
1632 Send node,
1633 FunctionElement getter,
1634 FieldElement field,
1635 AssignmentOperator operator,
1636 Node rhs,
1637 A arg);
1638
1639 /// Compound assignment expression of [rhs] with [operator] on a type literal
1640 /// for class [element].
1641 ///
1642 /// For instance:
1643 /// class C {}
1644 /// m(rhs) => C += rhs;
1645 ///
1646 R visitClassTypeLiteralCompound(
1647 Send node,
1648 TypeConstantExpression constant,
1649 AssignmentOperator operator,
1650 Node rhs,
1651 A arg);
1652
1653 /// Compound assignment expression of [rhs] with [operator] on a type literal
1654 /// for typedef [element].
1655 ///
1656 /// For instance:
1657 /// typedef F();
1658 /// m(rhs) => F += rhs;
1659 ///
1660 R visitTypedefTypeLiteralCompound(
1661 Send node,
1662 TypeConstantExpression constant,
1663 AssignmentOperator operator,
1664 Node rhs,
1665 A arg);
1666
1667 /// Compound assignment expression of [rhs] with [operator] on a type literal
1668 /// for type variable [element].
1669 ///
1670 /// For instance:
1671 /// class C<T> {
1672 /// m(rhs) => T += rhs;
1673 /// }
1674 ///
1675 R visitTypeVariableTypeLiteralCompound(
1676 Send node,
1677 TypeVariableElement element,
1678 AssignmentOperator operator,
1679 Node rhs,
1680 A arg);
1681
1682 /// Compound assignment expression of [rhs] with [operator] on the type
1683 /// literal for `dynamic`.
1684 ///
1685 /// For instance:
1686 /// m(rhs) => dynamic += rhs;
1687 ///
1688 R visitDynamicTypeLiteralCompound(
1689 Send node,
1690 TypeConstantExpression constant,
1691 AssignmentOperator operator,
1692 Node rhs,
1693 A arg);
1694
1695 /// Compound assignment expression of [rhs] with [operator] on the index
1696 /// operators of [receiver] whose getter and setter are defined by
1697 /// [getterSelector] and [setterSelector], respectively.
1698 ///
1699 /// For instance:
1700 /// m(receiver, index, rhs) => receiver[index] += rhs;
1701 ///
1702 R visitCompoundIndexSet(
1703 Send node,
1704 Node receiver,
1705 Node index,
1706 AssignmentOperator operator,
1707 Node rhs,
1708 A arg);
1709
1710 /// Compound assignment expression of [rhs] with [operator] on the index
1711 /// operators of a super class defined by [getter] and [setter].
1712 ///
1713 /// For instance:
1714 /// class B {
1715 /// operator [](index) {}
1716 /// operator [](index, value) {}
1717 /// }
1718 /// class C extends B {
1719 /// m(index, rhs) => super[index] += rhs;
1720 /// }
1721 ///
1722 R visitSuperCompoundIndexSet(
1723 Send node,
1724 FunctionElement getter,
1725 FunctionElement setter,
1726 Node index,
1727 AssignmentOperator operator,
1728 Node rhs,
1729 A arg);
1730
1731 /// Prefix expression with [operator] of the property on [receiver] whose
1732 /// getter and setter are defined by [getterSelector] and [setterSelector],
1733 /// respectively.
1734 ///
1735 /// For instance:
1736 /// m(receiver) => ++receiver.foo;
1737 ///
1738 R visitDynamicPropertyPrefix(
1739 Send node,
1740 Node receiver,
1741 IncDecOperator operator,
1742 Selector getterSelector,
1743 Selector setterSelector,
1744 A arg);
1745
1746 /// Prefix expression with [operator] on a [parameter].
1747 ///
1748 /// For instance:
1749 /// m(parameter) => ++parameter;
1750 ///
1751 R visitParameterPrefix(
1752 Send node,
1753 ParameterElement parameter,
1754 IncDecOperator operator,
1755 A arg);
1756
1757 /// Prefix expression with [operator] on a local [variable].
1758 ///
1759 /// For instance:
1760 /// m() {
1761 /// var variable;
1762 /// ++variable;
1763 /// }
1764 ///
1765 R visitLocalVariablePrefix(
1766 Send node,
1767 LocalVariableElement variable,
1768 IncDecOperator operator,
1769 A arg);
1770
1771 /// Prefix expression with [operator] on a local [function].
1772 ///
1773 /// For instance:
1774 /// m() {
1775 /// function() {}
1776 /// ++function;
1777 /// }
1778 ///
1779 R errorLocalFunctionPrefix(
1780 Send node,
1781 LocalFunctionElement function,
1782 IncDecOperator operator,
1783 A arg);
1784
1785
1786 /// Prefix expression with [operator] of the property on `this` whose getter
1787 /// and setter are defined by [getterSelector] and [setterSelector],
1788 /// respectively.
1789 ///
1790 /// For instance:
1791 /// class C {
1792 /// m() => ++foo;
1793 /// }
1794 /// or
1795 /// class C {
1796 /// m() => ++this.foo;
1797 /// }
1798 ///
1799 R visitThisPropertyPrefix(
1800 Send node,
1801 IncDecOperator operator,
1802 Selector getterSelector,
1803 Selector setterSelector,
1804 A arg);
1805
1806 /// Prefix expression with [operator] on a static [field].
1807 ///
1808 /// For instance:
1809 /// class C {
1810 /// static var field;
1811 /// m() => ++field;
1812 /// }
1813 ///
1814 R visitStaticFieldPrefix(
1815 Send node,
1816 FieldElement field,
1817 IncDecOperator operator,
1818 A arg);
1819
1820 /// Prefix expression with [operator] reading from a static [getter] and
1821 /// writing to a static [setter].
1822 ///
1823 /// For instance:
1824 /// class C {
1825 /// static get o => 0;
1826 /// static set o(_) {}
1827 /// m() => ++o;
1828 /// }
1829 ///
1830 R visitStaticGetterSetterPrefix(
1831 Send node,
1832 FunctionElement getter,
1833 FunctionElement setter,
1834 IncDecOperator operator,
1835 A arg);
1836
1837
1838 /// Prefix expression with [operator] reading from a static [method], that is,
1839 /// closurizing [method], and writing to a static [setter].
1840 ///
1841 /// For instance:
1842 /// class C {
1843 /// static o() {}
1844 /// static set o(_) {}
1845 /// m() => ++o;
1846 /// }
1847 ///
1848 R visitStaticMethodSetterPrefix(
1849 Send node,
1850 FunctionElement getter,
1851 FunctionElement setter,
1852 IncDecOperator operator,
1853 A arg);
1854
1855 /// Prefix expression with [operator] on a top level [field].
1856 ///
1857 /// For instance:
1858 /// var field;
1859 /// m() => ++field;
1860 ///
1861 R visitTopLevelFieldPrefix(
1862 Send node,
1863 FieldElement field,
1864 IncDecOperator operator,
1865 A arg);
1866
1867 /// Prefix expression with [operator] reading from a top level [getter] and
1868 /// writing to a top level [setter].
1869 ///
1870 /// For instance:
1871 /// get o => 0;
1872 /// set o(_) {}
1873 /// m() => ++o;
1874 ///
1875 R visitTopLevelGetterSetterPrefix(
1876 Send node,
1877 FunctionElement getter,
1878 FunctionElement setter,
1879 IncDecOperator operator,
1880 A arg);
1881
1882 /// Prefix expression with [operator] reading from a top level [method], that
1883 /// is, closurizing [method], and writing to a top level [setter].
1884 ///
1885 /// For instance:
1886 /// o() {}
1887 /// set o(_) {}
1888 /// m() => ++o;
1889 ///
1890 R visitTopLevelMethodSetterPrefix(
1891 Send node,
1892 FunctionElement method,
1893 FunctionElement setter,
1894 IncDecOperator operator,
1895 A arg);
1896
1897 /// Prefix expression with [operator] on a super [field].
1898 ///
1899 /// For instance:
1900 /// class B {
1901 /// var field;
1902 /// }
1903 /// class C extends B {
1904 /// m() => ++super.field;
1905 /// }
1906 ///
1907 R visitSuperFieldPrefix(
1908 Send node,
1909 FieldElement field,
1910 IncDecOperator operator,
1911 A arg);
1912
1913 /// Prefix expression with [operator] reading from the super field [readField]
1914 /// and writing to the different super field [writtenField].
1915 ///
1916 /// For instance:
1917 /// class A {
1918 /// var field;
1919 /// }
1920 /// class B extends A {
1921 /// final field;
1922 /// }
1923 /// class C extends B {
1924 /// m() => ++super.field;
1925 /// }
1926 ///
1927 R visitSuperFieldFieldPrefix(
1928 Send node,
1929 FieldElement readField,
1930 FieldElement writtenField,
1931 IncDecOperator operator,
1932 A arg);
1933
1934 /// Prefix expression with [operator] reading from a super [field] and writing
1935 /// to a super [setter].
1936 ///
1937 /// For instance:
1938 /// class A {
1939 /// var field;
1940 /// }
1941 /// class B extends A {
1942 /// set field(_) {}
1943 /// }
1944 /// class C extends B {
1945 /// m() => ++super.field;
1946 /// }
1947 ///
1948 R visitSuperFieldSetterPrefix(
1949 Send node,
1950 FieldElement field,
1951 FunctionElement setter,
1952 IncDecOperator operator,
1953 A arg);
1954
1955
1956 /// Prefix expression with [operator] reading from a super [getter] and
1957 /// writing to a super [setter].
1958 ///
1959 /// For instance:
1960 /// class B {
1961 /// get field => 0;
1962 /// set field(_) {}
1963 /// }
1964 /// class C extends B {
1965 /// m() => ++super.field;
1966 /// }
1967 ///
1968 R visitSuperGetterSetterPrefix(
1969 Send node,
1970 FunctionElement getter,
1971 FunctionElement setter,
1972 IncDecOperator operator,
1973 A arg);
1974
1975 /// Prefix expression with [operator] reading from a super [getter] and
1976 /// writing to a super [field].
1977 ///
1978 /// For instance:
1979 /// class A {
1980 /// var field;
1981 /// }
1982 /// class B extends A {
1983 /// get field => 0;
1984 /// }
1985 /// class C extends B {
1986 /// m() => ++super.field;
1987 /// }
1988 ///
1989 R visitSuperGetterFieldPrefix(
1990 Send node,
1991 FunctionElement getter,
1992 FieldElement field,
1993 IncDecOperator operator,
1994 A arg);
1995
1996 /// Prefix expression with [operator] reading from a super [method], that is,
1997 /// closurizing [method], and writing to a super [setter].
1998 ///
1999 /// For instance:
2000 /// class B {
2001 /// o() {}
2002 /// set o(_) {}
2003 /// }
2004 /// class C extends B {
2005 /// m() => ++super.o;
2006 /// }
2007 ///
2008 R visitSuperMethodSetterPrefix(
2009 Send node,
2010 FunctionElement method,
2011 FunctionElement setter,
2012 IncDecOperator operator,
2013 A arg);
2014
2015 /// Prefix expression with [operator] on a type literal for a class [element].
2016 ///
2017 /// For instance:
2018 /// class C {}
2019 /// m() => ++C;
2020 ///
2021 R visitClassTypeLiteralPrefix(
2022 Send node,
2023 TypeConstantExpression constant,
2024 IncDecOperator operator,
2025 A arg);
2026
2027 /// Prefix expression with [operator] on a type literal for a typedef
2028 /// [element].
2029 ///
2030 /// For instance:
2031 /// typedef F();
2032 /// m() => ++F;
2033 ///
2034 R visitTypedefTypeLiteralPrefix(
2035 Send node,
2036 TypeConstantExpression constant,
2037 IncDecOperator operator,
2038 A arg);
2039
2040 /// Prefix expression with [operator] on a type literal for a type variable
2041 /// [element].
2042 ///
2043 /// For instance:
2044 /// class C<T> {
2045 /// m() => ++T;
2046 /// }
2047 ///
2048 R visitTypeVariableTypeLiteralPrefix(
2049 Send node,
2050 TypeVariableElement element,
2051 IncDecOperator operator,
2052 A arg);
2053
2054 /// Prefix expression with [operator] on the type literal for `dynamic`.
2055 ///
2056 /// For instance:
2057 /// m() => ++dynamic;
2058 ///
2059 R visitDynamicTypeLiteralPrefix(
2060 Send node,
2061 TypeConstantExpression constant,
2062 IncDecOperator operator,
2063 A arg);
2064
2065 /// Postfix expression with [operator] of the property on [receiver] whose
2066 /// getter and setter are defined by [getterSelector] and [setterSelector],
2067 /// respectively.
2068 ///
2069 /// For instance:
2070 /// m(receiver) => receiver.foo++;
2071 ///
2072 R visitDynamicPropertyPostfix(
2073 Send node,
2074 Node receiver,
2075 IncDecOperator operator,
2076 Selector getterSelector,
2077 Selector setterSelector,
2078 A arg);
2079
2080 /// Postfix expression with [operator] on a [parameter].
2081 ///
2082 /// For instance:
2083 /// m(parameter) => parameter++;
2084 ///
2085 R visitParameterPostfix(
2086 Send node,
2087 ParameterElement parameter,
2088 IncDecOperator operator,
2089 A arg);
2090
2091 /// Postfix expression with [operator] on a local [variable].
2092 ///
2093 /// For instance:
2094 /// m() {
2095 /// var variable;
2096 /// variable++;
2097 /// }
2098 ///
2099 R visitLocalVariablePostfix(
2100 Send node,
2101 LocalVariableElement variable,
2102 IncDecOperator operator,
2103 A arg);
2104
2105 /// Postfix expression with [operator] on a local [function].
2106 ///
2107 /// For instance:
2108 /// m() {
2109 /// function() {}
2110 /// function++;
2111 /// }
2112 ///
2113 R errorLocalFunctionPostfix(
2114 Send node,
2115 LocalFunctionElement function,
2116 IncDecOperator operator,
2117 A arg);
2118
2119
2120 /// Postfix expression with [operator] of the property on `this` whose getter
2121 /// and setter are defined by [getterSelector] and [setterSelector],
2122 /// respectively.
2123 ///
2124 /// For instance:
2125 /// class C {
2126 /// m() => foo++;
2127 /// }
2128 /// or
2129 /// class C {
2130 /// m() => this.foo++;
2131 /// }
2132 ///
2133 R visitThisPropertyPostfix(
2134 Send node,
2135 IncDecOperator operator,
2136 Selector getterSelector,
2137 Selector setterSelector,
2138 A arg);
2139
2140 /// Postfix expression with [operator] on a static [field].
2141 ///
2142 /// For instance:
2143 /// class C {
2144 /// static var field;
2145 /// m() => field++;
2146 /// }
2147 ///
2148 R visitStaticFieldPostfix(
2149 Send node,
2150 FieldElement field,
2151 IncDecOperator operator,
2152 A arg);
2153
2154 /// Postfix expression with [operator] reading from a static [getter] and
2155 /// writing to a static [setter].
2156 ///
2157 /// For instance:
2158 /// class C {
2159 /// static get o => 0;
2160 /// static set o(_) {}
2161 /// m() => o++;
2162 /// }
2163 ///
2164 R visitStaticGetterSetterPostfix(
2165 Send node,
2166 FunctionElement getter,
2167 FunctionElement setter,
2168 IncDecOperator operator,
2169 A arg);
2170
2171
2172 /// Postfix expression with [operator] reading from a static [method], that
2173 /// is, closurizing [method], and writing to a static [setter].
2174 ///
2175 /// For instance:
2176 /// class C {
2177 /// static o() {}
2178 /// static set o(_) {}
2179 /// m() => o++;
2180 /// }
2181 ///
2182 R visitStaticMethodSetterPostfix(
2183 Send node,
2184 FunctionElement getter,
2185 FunctionElement setter,
2186 IncDecOperator operator,
2187 A arg);
2188
2189 /// Postfix expression with [operator] on a top level [field].
2190 ///
2191 /// For instance:
2192 /// var field;
2193 /// m() => field++;
2194 ///
2195 R visitTopLevelFieldPostfix(
2196 Send node,
2197 FieldElement field,
2198 IncDecOperator operator,
2199 A arg);
2200
2201 /// Postfix expression with [operator] reading from a top level [getter] and
2202 /// writing to a top level [setter].
2203 ///
2204 /// For instance:
2205 /// get o => 0;
2206 /// set o(_) {}
2207 /// m() => o++;
2208 ///
2209 R visitTopLevelGetterSetterPostfix(
2210 Send node,
2211 FunctionElement getter,
2212 FunctionElement setter,
2213 IncDecOperator operator,
2214 A arg);
2215
2216 /// Postfix expression with [operator] reading from a top level [method], that
2217 /// is, closurizing [method], and writing to a top level [setter].
2218 ///
2219 /// For instance:
2220 /// o() {}
2221 /// set o(_) {}
2222 /// m() => o++;
2223 ///
2224 R visitTopLevelMethodSetterPostfix(
2225 Send node,
2226 FunctionElement method,
2227 FunctionElement setter,
2228 IncDecOperator operator,
2229 A arg);
2230
2231 /// Postfix expression with [operator] on a super [field].
2232 ///
2233 /// For instance:
2234 /// class B {
2235 /// var field;
2236 /// }
2237 /// class C extends B {
2238 /// m() => super.field++;
2239 /// }
2240 ///
2241 R visitSuperFieldPostfix(
2242 Send node,
2243 FieldElement field,
2244 IncDecOperator operator,
2245 A arg);
2246
2247 /// Postfix expression with [operator] reading from the super field
2248 /// [readField] and writing to the different super field [writtenField].
2249 ///
2250 /// For instance:
2251 /// class A {
2252 /// var field;
2253 /// }
2254 /// class B extends A {
2255 /// final field;
2256 /// }
2257 /// class C extends B {
2258 /// m() => super.field++;
2259 /// }
2260 ///
2261 R visitSuperFieldFieldPostfix(
2262 Send node,
2263 FieldElement readField,
2264 FieldElement writtenField,
2265 IncDecOperator operator,
2266 A arg);
2267
2268 /// Postfix expression with [operator] reading from a super [field] and
2269 /// writing to a super [setter].
2270 ///
2271 /// For instance:
2272 /// class A {
2273 /// var field;
2274 /// }
2275 /// class B extends A {
2276 /// set field(_) {}
2277 /// }
2278 /// class C extends B {
2279 /// m() => super.field++;
2280 /// }
2281 ///
2282 R visitSuperFieldSetterPostfix(
2283 Send node,
2284 FieldElement field,
2285 FunctionElement setter,
2286 IncDecOperator operator,
2287 A arg);
2288
2289
2290 /// Postfix expression with [operator] reading from a super [getter] and
2291 /// writing to a super [setter].
2292 ///
2293 /// For instance:
2294 /// class B {
2295 /// get field => 0;
2296 /// set field(_) {}
2297 /// }
2298 /// class C extends B {
2299 /// m() => super.field++;
2300 /// }
2301 ///
2302 R visitSuperGetterSetterPostfix(
2303 Send node,
2304 FunctionElement getter,
2305 FunctionElement setter,
2306 IncDecOperator operator,
2307 A arg);
2308
2309 /// Postfix expression with [operator] reading from a super [getter] and
2310 /// writing to a super [field].
2311 ///
2312 /// For instance:
2313 /// class A {
2314 /// var field;
2315 /// }
2316 /// class B extends A {
2317 /// get field => 0;
2318 /// }
2319 /// class C extends B {
2320 /// m() => super.field++;
2321 /// }
2322 ///
2323 R visitSuperGetterFieldPostfix(
2324 Send node,
2325 FunctionElement getter,
2326 FieldElement field,
2327 IncDecOperator operator,
2328 A arg);
2329
2330 /// Postfix expression with [operator] reading from a super [method], that is,
2331 /// closurizing [method], and writing to a super [setter].
2332 ///
2333 /// For instance:
2334 /// class B {
2335 /// o() {}
2336 /// set o(_) {}
2337 /// }
2338 /// class C extends B {
2339 /// m() => super.o++;
2340 /// }
2341 ///
2342 R visitSuperMethodSetterPostfix(
2343 Send node,
2344 FunctionElement method,
2345 FunctionElement setter,
2346 IncDecOperator operator,
2347 A arg);
2348
2349 /// Postfix expression with [operator] on a type literal for a class
2350 /// [element].
2351 ///
2352 /// For instance:
2353 /// class C {}
2354 /// m() => C++;
2355 ///
2356 R visitClassTypeLiteralPostfix(
2357 Send node,
2358 TypeConstantExpression constant,
2359 IncDecOperator operator,
2360 A arg);
2361
2362 /// Postfix expression with [operator] on a type literal for a typedef
2363 /// [element].
2364 ///
2365 /// For instance:
2366 /// typedef F();
2367 /// m() => F++;
2368 ///
2369 R visitTypedefTypeLiteralPostfix(
2370 Send node,
2371 TypeConstantExpression constant,
2372 IncDecOperator operator,
2373 A arg);
2374
2375 /// Postfix expression with [operator] on a type literal for a type variable
2376 /// [element].
2377 ///
2378 /// For instance:
2379 /// class C<T> {
2380 /// m() => T++;
2381 /// }
2382 ///
2383 R visitTypeVariableTypeLiteralPostfix(
2384 Send node,
2385 TypeVariableElement element,
2386 IncDecOperator operator,
2387 A arg);
2388
2389 /// Postfix expression with [operator] on the type literal for `dynamic`.
2390 ///
2391 /// For instance:
2392 /// m() => dynamic++;
2393 ///
2394 R visitDynamicTypeLiteralPostfix(
2395 Send node,
2396 TypeConstantExpression constant,
2397 IncDecOperator operator,
2398 A arg);
2399
2400 /// Read of the [constant].
2401 ///
2402 /// For instance
2403 /// const c = c;
2404 /// m() => c;
2405 ///
2406 R visitConstantGet(
2407 Send node,
2408 ConstantExpression constant,
2409 A arg);
2410
2411 /// Invocation of the [constant] with [arguments].
2412 ///
2413 /// For instance
2414 /// const c = null;
2415 /// m() => c(null, 42);
2416 ///
2417 R visitConstantInvoke(
2418 Send node,
2419 ConstantExpression constant,
2420 NodeList arguments,
2421 Selector selector,
2422 A arg);
2423
2424 /// Read of the unresolved [element].
2425 ///
2426 /// For instance
2427 /// class C {}
2428 /// m1() => unresolved;
2429 /// m2() => prefix.unresolved;
2430 /// m3() => Unresolved.foo;
2431 /// m4() => unresolved.foo;
2432 /// m5() => unresolved.Foo.bar;
2433 /// m6() => C.unresolved;
2434 /// m7() => prefix.C.unresolved;
2435 ///
2436 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2437 R errorUnresolvedGet(
2438 Send node,
2439 Element element,
2440 A arg);
2441
2442 /// Assignment of [rhs] to the unresolved [element].
2443 ///
2444 /// For instance
2445 /// class C {}
2446 /// m1() => unresolved = 42;
2447 /// m2() => prefix.unresolved = 42;
2448 /// m3() => Unresolved.foo = 42;
2449 /// m4() => unresolved.foo = 42;
2450 /// m5() => unresolved.Foo.bar = 42;
2451 /// m6() => C.unresolved = 42;
2452 /// m7() => prefix.C.unresolved = 42;
2453 ///
2454 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2455 R errorUnresolvedSet(
2456 Send node,
2457 Element element,
2458 Node rhs,
2459 A arg);
2460
2461 /// Invocation of the unresolved [element] with [arguments].
2462 ///
2463 /// For instance
2464 /// class C {}
2465 /// m1() => unresolved(null, 42);
2466 /// m2() => prefix.unresolved(null, 42);
2467 /// m3() => Unresolved.foo(null, 42);
2468 /// m4() => unresolved.foo(null, 42);
2469 /// m5() => unresolved.Foo.bar(null, 42);
2470 /// m6() => C.unresolved(null, 42);
2471 /// m7() => prefix.C.unresolved(null, 42);
2472 ///
2473 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2474 R errorUnresolvedInvoke(
2475 Send node,
2476 Element element,
2477 NodeList arguments,
2478 Selector selector,
2479 A arg);
2480
2481 /// Compound assignment of [rhs] on the unresolved [element].
2482 ///
2483 /// For instance
2484 /// class C {}
2485 /// m1() => unresolved += 42;
2486 /// m2() => prefix.unresolved += 42;
2487 /// m3() => Unresolved.foo += 42;
2488 /// m4() => unresolved.foo += 42;
2489 /// m5() => unresolved.Foo.bar += 42;
2490 /// m6() => C.unresolved += 42;
2491 /// m7() => prefix.C.unresolved += 42;
2492 ///
2493 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2494 R errorUnresolvedCompound(
2495 Send node,
2496 Element element,
2497 AssignmentOperator operator,
2498 Node rhs,
2499 A arg);
2500
2501 /// Prefix operation on the unresolved [element].
2502 ///
2503 /// For instance
2504 /// class C {}
2505 /// m1() => ++unresolved;
2506 /// m2() => ++prefix.unresolved;
2507 /// m3() => ++Unresolved.foo;
2508 /// m4() => ++unresolved.foo;
2509 /// m5() => ++unresolved.Foo.bar;
2510 /// m6() => ++C.unresolved;
2511 /// m7() => ++prefix.C.unresolved;
2512 ///
2513 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2514 R errorUnresolvedPrefix(
2515 Send node,
2516 Element element,
2517 IncDecOperator operator,
2518 A arg);
2519
2520 /// Postfix operation on the unresolved [element].
2521 ///
2522 /// For instance
2523 /// class C {}
2524 /// m1() => unresolved++;
2525 /// m2() => prefix.unresolved++;
2526 /// m3() => Unresolved.foo++;
2527 /// m4() => unresolved.foo++;
2528 /// m5() => unresolved.Foo.bar++;
2529 /// m6() => C.unresolved++;
2530 /// m7() => prefix.C.unresolved++;
2531 ///
2532 // TODO(johnniwinther): Split the cases in which a prefix is resolved.
2533 R errorUnresolvedPostfix(
2534 Send node,
2535 Element element,
2536 IncDecOperator operator,
2537 A arg);
2538
2539 /// Index set operation on the unresolved super [element].
2540 ///
2541 /// For instance
2542 /// class B {
2543 /// }
2544 /// class C extends B {
2545 /// m() => super[1] = 42;
2546 /// }
2547 ///
2548 R errorUnresolvedSuperIndexSet(
2549 Send node,
2550 Element element,
2551 Node index,
2552 Node rhs,
2553 A arg);
2554
2555 /// Compound index set operation on the unresolved super [element].
2556 ///
2557 /// For instance
2558 /// class B {
2559 /// }
2560 /// class C extends B {
2561 /// m() => super[1] += 42;
2562 /// }
2563 ///
2564 // TODO(johnniwinther): Split this case into unresolved getter/setter cases.
2565 R errorUnresolvedSuperCompoundIndexSet(
2566 Send node,
2567 Element element,
2568 Node index,
2569 AssignmentOperator operator,
2570 Node rhs,
2571 A arg);
2572
2573 /// Unary operation on the unresolved super [element].
2574 ///
2575 /// For instance
2576 /// class B {
2577 /// }
2578 /// class C extends B {
2579 /// m() => -super;
2580 /// }
2581 ///
2582 R errorUnresolvedSuperUnary(
2583 Send node,
2584 UnaryOperator operator,
2585 Element element,
2586 A arg);
2587
2588 /// Binary operation on the unresolved super [element].
2589 ///
2590 /// For instance
2591 /// class B {
2592 /// }
2593 /// class C extends B {
2594 /// m() => super + 42;
2595 /// }
2596 ///
2597 R errorUnresolvedSuperBinary(
2598 Send node,
2599 Element element,
2600 BinaryOperator operator,
2601 Node argument,
2602 A arg);
2603
2604 /// Invocation of an undefined unary [operator] on [expression].
2605 R errorUndefinedUnaryExpression(
2606 Send node,
2607 Operator operator,
2608 Node expression,
2609 A arg);
2610
2611 /// Invocation of an undefined unary [operator] with operands
2612 /// [left] and [right].
2613 R errorUndefinedBinaryExpression(
2614 Send node,
2615 Node left,
2616 Operator operator,
2617 Node right,
2618 A arg);
2619 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698