Merge branch 'bench'
[nit.git] / src / parser / parser_nodes.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2008-2009 Jean Privat <jean@pryen.org>
4 # Copyright 2009 Jean-Sebastien Gelinas <calestar@gmail.com>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 # AST nodes of the Nit language
19 # Was previously based on parser_abs.nit.
20 package parser_nodes
21
22 import location
23
24 # Root of the AST hierarchy
25 abstract class ANode
26 var _location: nullable Location
27 # Location is set during AST building. Once built, location cannon be null
28 # However, manual instanciated nodes may need mode care
29 fun location: Location do return _location.as(not null)
30 # The location of the important part of the node (identifier or whatever)
31 fun hot_location: Location do return location
32 init do end
33
34 # Display a message for the colored location of the node
35 fun debug(message: String)
36 do
37 print "{hot_location} {self.class_name}: {message}\n{hot_location.colored_line("0;32")}"
38 end
39 end
40
41 # Ancestor of all tokens
42 abstract class Token
43 super ANode
44 fun text: String is abstract
45 fun text=(text: String) is abstract
46
47 redef fun to_s: String do
48 return "'{text}'"
49 end
50 end
51
52 # Ancestor of all productions
53 abstract class Prod
54 super ANode
55 fun location=(l: Location) do _location = l
56 readable var _n_annotations: nullable AAnnotations = null
57 end
58 class TEol
59 super Token
60 redef fun to_s
61 do
62 return "end of line"
63 end
64 end
65 class TComment
66 super Token
67 end
68 abstract class TokenKeyword
69 super Token
70 redef fun to_s
71 do
72 return "keyword '{text}'"
73 end
74 end
75 class TKwmodule
76 super TokenKeyword
77 end
78 class TKwimport
79 super TokenKeyword
80 end
81 class TKwclass
82 super TokenKeyword
83 end
84 class TKwabstract
85 super TokenKeyword
86 end
87 class TKwinterface
88 super TokenKeyword
89 end
90 class TKwenum
91 super TokenKeyword
92 end
93 class TKwend
94 super TokenKeyword
95 end
96 class TKwmeth
97 super TokenKeyword
98 end
99 class TKwtype
100 super TokenKeyword
101 end
102 class TKwinit
103 super TokenKeyword
104 end
105 class TKwredef
106 super TokenKeyword
107 end
108 class TKwis
109 super TokenKeyword
110 end
111 class TKwdo
112 super TokenKeyword
113 end
114 class TKwreadable
115 super TokenKeyword
116 end
117 class TKwwritable
118 super TokenKeyword
119 end
120 class TKwvar
121 super TokenKeyword
122 end
123 class TKwintern
124 super TokenKeyword
125 end
126 class TKwextern
127 super TokenKeyword
128 end
129 class TKwprotected
130 super TokenKeyword
131 end
132 class TKwprivate
133 super TokenKeyword
134 end
135 class TKwintrude
136 super TokenKeyword
137 end
138 class TKwif
139 super TokenKeyword
140 end
141 class TKwthen
142 super TokenKeyword
143 end
144 class TKwelse
145 super TokenKeyword
146 end
147 class TKwwhile
148 super TokenKeyword
149 end
150 class TKwloop
151 super TokenKeyword
152 end
153 class TKwfor
154 super TokenKeyword
155 end
156 class TKwin
157 super TokenKeyword
158 end
159 class TKwand
160 super TokenKeyword
161 end
162 class TKwor
163 super TokenKeyword
164 end
165 class TKwnot
166 super TokenKeyword
167 end
168 class TKwreturn
169 super TokenKeyword
170 end
171 class TKwcontinue
172 super TokenKeyword
173 end
174 class TKwbreak
175 super TokenKeyword
176 end
177 class TKwabort
178 super TokenKeyword
179 end
180 class TKwassert
181 super TokenKeyword
182 end
183 class TKwnew
184 super TokenKeyword
185 end
186 class TKwisa
187 super TokenKeyword
188 end
189 class TKwonce
190 super TokenKeyword
191 end
192 class TKwsuper
193 super TokenKeyword
194 end
195 class TKwself
196 super TokenKeyword
197 end
198 class TKwtrue
199 super TokenKeyword
200 end
201 class TKwfalse
202 super TokenKeyword
203 end
204 class TKwnull
205 super TokenKeyword
206 end
207 class TKwas
208 super TokenKeyword
209 end
210 class TKwnullable
211 super TokenKeyword
212 end
213 class TKwisset
214 super TokenKeyword
215 end
216 class TKwlabel
217 super TokenKeyword
218 end
219 class TKwdebug
220 super Token
221 end
222 class TOpar
223 super Token
224 end
225 class TCpar
226 super Token
227 end
228 class TObra
229 super Token
230 end
231 class TCbra
232 super Token
233 end
234 class TComma
235 super Token
236 end
237 class TColumn
238 super Token
239 end
240 class TQuad
241 super Token
242 end
243 class TAssign
244 super Token
245 end
246 abstract class TokenOperator
247 super Token
248 redef fun to_s
249 do
250 return "operator '{text}'"
251 end
252 end
253 class TPluseq
254 super TokenOperator
255 end
256 class TMinuseq
257 super TokenOperator
258 end
259 class TDotdotdot
260 super TokenOperator
261 end
262 class TDotdot
263 super TokenOperator
264 end
265 class TDot
266 super TokenOperator
267 end
268 class TPlus
269 super TokenOperator
270 end
271 class TMinus
272 super TokenOperator
273 end
274 class TStar
275 super TokenOperator
276 end
277 class TSlash
278 super TokenOperator
279 end
280 class TPercent
281 super TokenOperator
282 end
283 class TEq
284 super TokenOperator
285 end
286 class TNe
287 super TokenOperator
288 end
289 class TLt
290 super TokenOperator
291 end
292 class TLe
293 super TokenOperator
294 end
295 class TLl
296 super TokenOperator
297 end
298 class TGt
299 super TokenOperator
300 end
301 class TGe
302 super TokenOperator
303 end
304 class TGg
305 super TokenOperator
306 end
307 class TStarship
308 super TokenOperator
309 end
310 class TBang
311 super TokenOperator
312 end
313 class TAt
314 super Token
315 end
316 class TClassid
317 super Token
318 redef fun to_s
319 do
320 do return "type identifier '{text}'"
321 end
322 end
323 class TId
324 super Token
325 redef fun to_s
326 do
327 do return "identifier '{text}'"
328 end
329 end
330 class TAttrid
331 super Token
332 redef fun to_s
333 do
334 do return "attribute '{text}'"
335 end
336 end
337 abstract class TokenLiteral
338 super Token
339 redef fun to_s
340 do
341 do return "literal value '{text}'"
342 end
343 end
344 class TNumber
345 super TokenLiteral
346 end
347 class TFloat
348 super TokenLiteral
349 end
350 class TChar
351 super TokenLiteral
352 end
353 class TString
354 super TokenLiteral
355 end
356 class TStartString
357 super TokenLiteral
358 end
359 class TMidString
360 super TokenLiteral
361 end
362 class TEndString
363 super Token
364 end
365 class TBadString
366 super Token
367 redef fun to_s
368 do
369 do return "malformed string {text}"
370 end
371 end
372 class TBadChar
373 super Token
374 redef fun to_s
375 do
376 do return "malformed character {text}"
377 end
378 end
379 class TExternCodeSegment
380 super Token
381 end
382 class EOF
383 super Token
384 redef fun to_s
385 do
386 return "end of file"
387 end
388 end
389 class AError
390 super EOF
391 end
392 class ALexerError
393 super AError
394 end
395 class AParserError
396 super AError
397 end
398
399 class AModule
400 super Prod
401 readable var _n_moduledecl: nullable AModuledecl = null
402 readable var _n_imports: List[AImport] = new List[AImport]
403 readable var _n_extern_code_blocks: List[AExternCodeBlock] = new List[AExternCodeBlock]
404 readable var _n_classdefs: List[AClassdef] = new List[AClassdef]
405 end
406 class AModuledecl
407 super Prod
408 readable var _n_doc: nullable ADoc = null
409 readable var _n_kwmodule: TKwmodule
410 readable var _n_name: AModuleName
411 end
412 abstract class AImport super Prod end
413 class AStdImport
414 super AImport
415 readable var _n_visibility: AVisibility
416 readable var _n_kwimport: TKwimport
417 readable var _n_name: AModuleName
418 end
419 class ANoImport
420 super AImport
421 readable var _n_visibility: AVisibility
422 readable var _n_kwimport: TKwimport
423 readable var _n_kwend: TKwend
424 end
425 abstract class AVisibility super Prod end
426 class APublicVisibility
427 super AVisibility
428 end
429 class APrivateVisibility
430 super AVisibility
431 readable var _n_kwprivate: TKwprivate
432 end
433 class AProtectedVisibility
434 super AVisibility
435 readable var _n_kwprotected: TKwprotected
436 end
437 class AIntrudeVisibility
438 super AVisibility
439 readable var _n_kwintrude: TKwintrude
440 end
441 abstract class AClassdef super Prod
442 readable var _n_propdefs: List[APropdef] = new List[APropdef]
443 end
444 class AStdClassdef
445 super AClassdef
446 readable var _n_doc: nullable ADoc = null
447 readable var _n_kwredef: nullable TKwredef = null
448 readable var _n_visibility: AVisibility
449 readable var _n_classkind: AClasskind
450 readable var _n_id: nullable TClassid = null
451 readable var _n_formaldefs: List[AFormaldef] = new List[AFormaldef]
452 readable var _n_extern_code_block: nullable AExternCodeBlock = null
453 readable var _n_superclasses: List[ASuperclass] = new List[ASuperclass]
454 readable var _n_kwend: TKwend
455 redef fun hot_location do return n_id.location
456 end
457 class ATopClassdef
458 super AClassdef
459 end
460 class AMainClassdef
461 super AClassdef
462 end
463 abstract class AClasskind super Prod end
464 class AConcreteClasskind
465 super AClasskind
466 readable var _n_kwclass: TKwclass
467 end
468 class AAbstractClasskind
469 super AClasskind
470 readable var _n_kwabstract: TKwabstract
471 readable var _n_kwclass: TKwclass
472 end
473 class AInterfaceClasskind
474 super AClasskind
475 readable var _n_kwinterface: TKwinterface
476 end
477 class AEnumClasskind
478 super AClasskind
479 readable var _n_kwenum: TKwenum
480 end
481 class AExternClasskind
482 super AClasskind
483 readable var _n_kwextern: TKwextern
484 readable var _n_kwclass: nullable TKwclass = null
485 end
486 class AFormaldef
487 super Prod
488 readable var _n_id: TClassid
489 readable var _n_type: nullable AType = null
490 end
491 class ASuperclass
492 super Prod
493 readable var _n_kwsuper: TKwsuper
494 readable var _n_type: AType
495 end
496 abstract class APropdef super Prod
497 readable var _n_doc: nullable ADoc = null
498 end
499 class AAttrPropdef
500 super APropdef
501 readable var _n_kwredef: nullable TKwredef = null
502 readable var _n_visibility: AVisibility
503 readable var _n_kwvar: TKwvar
504 readable var _n_id: nullable TAttrid
505 readable var _n_id2: nullable TId
506 readable var _n_type: nullable AType = null
507 readable var _n_readable: nullable AAble = null
508 readable var _n_writable: nullable AAble = null
509 readable var _n_expr: nullable AExpr = null
510 redef fun hot_location
511 do
512 if n_id != null then return n_id.location else return n_id2.location
513 end
514 end
515 abstract class AMethPropdef
516 super APropdef
517 readable var _n_kwredef: nullable TKwredef = null
518 readable var _n_visibility: nullable AVisibility
519 readable var _n_methid: nullable AMethid = null
520 readable var _n_signature: nullable ASignature
521 redef fun hot_location
522 do
523 if n_methid != null then
524 return n_methid.location
525 else
526 return location
527 end
528 end
529 end
530 class ADeferredMethPropdef
531 super AMethPropdef
532 readable var _n_kwmeth: TKwmeth
533 end
534 class AInternMethPropdef
535 super AMethPropdef
536 readable var _n_kwmeth: TKwmeth
537 end
538 abstract class AExternPropdef
539 super AMethPropdef
540 readable var _n_extern: nullable TString = null
541 readable var _n_extern_calls: nullable AExternCalls = null
542 readable var _n_extern_code_block: nullable AExternCodeBlock = null
543 end
544 class AExternMethPropdef
545 super AMethPropdef
546 super AExternPropdef
547 readable var _n_kwmeth: TKwmeth
548 end
549 class AConcreteMethPropdef
550 super AMethPropdef
551 readable var _n_kwmeth: nullable TKwmeth
552 readable var _n_block: nullable AExpr = null
553 end
554 abstract class AInitPropdef
555 super AMethPropdef
556 end
557 class AConcreteInitPropdef
558 super AConcreteMethPropdef
559 super AInitPropdef
560 readable var _n_kwinit: TKwinit
561 redef fun hot_location do return n_kwinit.location
562 end
563 class AExternInitPropdef
564 super AExternPropdef
565 super AInitPropdef
566 readable var _n_kwnew: TKwnew
567 end
568 class AMainMethPropdef
569 super AConcreteMethPropdef
570 end
571 class AExternCalls
572 super Prod
573 readable var _n_kwimport: TKwimport
574 readable var _n_extern_calls: List[AExternCall] = new List[AExternCall]
575 end
576 abstract class AExternCall
577 super Prod
578 end
579 abstract class APropExternCall
580 super AExternCall
581 end
582 class ALocalPropExternCall
583 super APropExternCall
584 readable var _n_methid: AMethid
585 end
586 class AFullPropExternCall
587 super APropExternCall
588 readable var _n_classid: TClassid
589 readable var _n_quad: nullable TQuad = null
590 readable var _n_methid: AMethid
591 end
592 class AInitPropExternCall
593 super APropExternCall
594 readable var _n_classid: TClassid
595 end
596 class ASuperExternCall
597 super AExternCall
598 readable var _n_kwsuper: TKwsuper
599 end
600 abstract class ACastExternCall
601 super AExternCall
602 end
603 class ACastAsExternCall
604 super ACastExternCall
605 readable var _n_from_type: AType
606 readable var _n_kwas: TKwas
607 readable var _n_to_type: AType
608 end
609 class AAsNullableExternCall
610 super ACastExternCall
611 readable var _n_type: AType
612 readable var _n_kwas: TKwas
613 readable var _n_kwnullable: TKwnullable
614 end
615 class AAsNotNullableExternCall
616 super ACastExternCall
617 readable var _n_type: AType
618 readable var _n_kwas: TKwas
619 readable var _n_kwnot: TKwnot
620 readable var _n_kwnullable: TKwnullable
621 end
622 class ATypePropdef
623 super APropdef
624 readable var _n_kwredef: nullable TKwredef = null
625 readable var _n_visibility: AVisibility
626 readable var _n_kwtype: TKwtype
627 readable var _n_id: TClassid
628 readable var _n_type: AType
629 end
630 abstract class AAble super Prod
631 readable var _n_visibility: nullable AVisibility = null
632 readable var _n_kwredef: nullable TKwredef = null
633 end
634 class AReadAble
635 super AAble
636 readable var _n_kwreadable: TKwreadable
637 end
638 class AWriteAble
639 super AAble
640 readable var _n_kwwritable: TKwwritable
641 end
642 abstract class AMethid super Prod end
643 class AIdMethid
644 super AMethid
645 readable var _n_id: TId
646 end
647 class APlusMethid
648 super AMethid
649 readable var _n_plus: TPlus
650 end
651 class AMinusMethid
652 super AMethid
653 readable var _n_minus: TMinus
654 end
655 class AStarMethid
656 super AMethid
657 readable var _n_star: TStar
658 end
659 class ASlashMethid
660 super AMethid
661 readable var _n_slash: TSlash
662 end
663 class APercentMethid
664 super AMethid
665 readable var _n_percent: TPercent
666 end
667 class AEqMethid
668 super AMethid
669 readable var _n_eq: TEq
670 end
671 class ANeMethid
672 super AMethid
673 readable var _n_ne: TNe
674 end
675 class ALeMethid
676 super AMethid
677 readable var _n_le: TLe
678 end
679 class AGeMethid
680 super AMethid
681 readable var _n_ge: TGe
682 end
683 class ALtMethid
684 super AMethid
685 readable var _n_lt: TLt
686 end
687 class AGtMethid
688 super AMethid
689 readable var _n_gt: TGt
690 end
691 class ALlMethid
692 super AMethid
693 readable writable var _n_ll: TLl
694 end
695 class AGgMethid
696 super AMethid
697 readable writable var _n_gg: TGg
698 end
699 class ABraMethid
700 super AMethid
701 readable var _n_obra: TObra
702 readable var _n_cbra: TCbra
703 end
704 class AStarshipMethid
705 super AMethid
706 readable var _n_starship: TStarship
707 end
708 class AAssignMethid
709 super AMethid
710 readable var _n_id: TId
711 readable var _n_assign: TAssign
712 end
713 class ABraassignMethid
714 super AMethid
715 readable var _n_obra: TObra
716 readable var _n_cbra: TCbra
717 readable var _n_assign: TAssign
718 end
719 class ASignature
720 super Prod
721 readable var _n_opar: nullable TOpar = null
722 readable var _n_params: List[AParam] = new List[AParam]
723 readable var _n_cpar: nullable TCpar = null
724 readable var _n_type: nullable AType = null
725 readable var _n_closure_decls: List[AClosureDecl] = new List[AClosureDecl]
726 end
727 class AParam
728 super Prod
729 readable var _n_id: TId
730 readable var _n_type: nullable AType = null
731 readable var _n_dotdotdot: nullable TDotdotdot = null
732 end
733 class AClosureDecl
734 super Prod
735 readable var _n_kwbreak: nullable TKwbreak = null
736 readable var _n_bang: TBang
737 readable var _n_id: TId
738 readable var _n_signature: ASignature
739 readable var _n_expr: nullable AExpr = null
740 end
741 class AType
742 super Prod
743 readable var _n_kwnullable: nullable TKwnullable = null
744 readable var _n_id: TClassid
745 readable var _n_types: List[AType] = new List[AType]
746 end
747 class ALabel
748 super Prod
749 readable var _n_kwlabel: TKwlabel
750 readable var _n_id: TId
751 end
752 abstract class AExpr super Prod end
753 class ABlockExpr
754 super AExpr
755 readable var _n_expr: List[AExpr] = new List[AExpr]
756 readable var _n_kwend: nullable TKwend = null
757 end
758 class AVardeclExpr
759 super AExpr
760 readable var _n_kwvar: TKwvar
761 readable var _n_id: TId
762 readable var _n_type: nullable AType = null
763 readable var _n_assign: nullable TAssign = null
764 readable var _n_expr: nullable AExpr = null
765 end
766 class AReturnExpr
767 super AExpr
768 readable var _n_kwreturn: nullable TKwreturn = null
769 readable var _n_expr: nullable AExpr = null
770 end
771 abstract class ALabelable
772 super Prod
773 readable var _n_label: nullable ALabel = null
774 end
775 class ABreakExpr
776 super AExpr
777 super ALabelable
778 readable var _n_kwbreak: TKwbreak
779 readable var _n_expr: nullable AExpr = null
780 end
781 class AAbortExpr
782 super AExpr
783 readable var _n_kwabort: TKwabort
784 end
785 class AContinueExpr
786 super AExpr
787 super ALabelable
788 readable var _n_kwcontinue: nullable TKwcontinue = null
789 readable var _n_expr: nullable AExpr = null
790 end
791 class ADoExpr
792 super AExpr
793 super ALabelable
794 readable var _n_kwdo: TKwdo
795 readable var _n_block: nullable AExpr = null
796 end
797 class AIfExpr
798 super AExpr
799 readable var _n_kwif: TKwif
800 readable var _n_expr: AExpr
801 readable var _n_then: nullable AExpr = null
802 readable var _n_else: nullable AExpr = null
803 end
804 class AIfexprExpr
805 super AExpr
806 readable var _n_kwif: TKwif
807 readable var _n_expr: AExpr
808 readable var _n_kwthen: TKwthen
809 readable var _n_then: AExpr
810 readable var _n_kwelse: TKwelse
811 readable var _n_else: AExpr
812 end
813 class AWhileExpr
814 super AExpr
815 super ALabelable
816 readable var _n_kwwhile: TKwwhile
817 readable var _n_expr: AExpr
818 readable var _n_kwdo: TKwdo
819 readable var _n_block: nullable AExpr = null
820 end
821 class ALoopExpr
822 super AExpr
823 super ALabelable
824 readable var _n_kwloop: TKwloop
825 readable var _n_block: nullable AExpr = null
826 end
827 class AForExpr
828 super AExpr
829 super ALabelable
830 readable var _n_kwfor: TKwfor
831 readable var _n_ids: List[TId] = new List[TId]
832 readable var _n_expr: AExpr
833 readable var _n_kwdo: TKwdo
834 readable var _n_block: nullable AExpr = null
835 end
836 class AAssertExpr
837 super AExpr
838 readable var _n_kwassert: TKwassert
839 readable var _n_id: nullable TId = null
840 readable var _n_expr: AExpr
841 readable var _n_else: nullable AExpr = null
842 end
843 abstract class AAssignFormExpr
844 super AExpr
845 readable var _n_assign: TAssign
846 readable var _n_value: AExpr
847 end
848 abstract class AReassignFormExpr
849 super AExpr
850 readable var _n_assign_op: AAssignOp
851 readable var _n_value: AExpr
852 end
853 class AOnceExpr
854 super AProxyExpr
855 readable var _n_kwonce: TKwonce
856 end
857 abstract class ASendExpr
858 super AExpr
859 readable var _n_expr: AExpr
860 readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
861 end
862 abstract class ABinopExpr
863 super ASendExpr
864 readable var _n_expr2: AExpr
865 end
866 abstract class ABoolExpr
867 super AExpr
868 end
869 class AOrExpr
870 super ABoolExpr
871 readable var _n_expr: AExpr
872 readable var _n_expr2: AExpr
873 end
874 class AAndExpr
875 super ABoolExpr
876 readable var _n_expr: AExpr
877 readable var _n_expr2: AExpr
878 end
879 class AOrElseExpr
880 super ABoolExpr
881 readable var _n_expr: AExpr
882 readable var _n_expr2: AExpr
883 end
884 class ANotExpr
885 super ABoolExpr
886 readable var _n_kwnot: TKwnot
887 readable var _n_expr: AExpr
888 end
889 class AEqExpr
890 super ABinopExpr
891 end
892 class AEeExpr
893 super ABoolExpr
894 readable var _n_expr: AExpr
895 readable var _n_expr2: AExpr
896 end
897 class ANeExpr
898 super ABinopExpr
899 end
900 class ALtExpr
901 super ABinopExpr
902 end
903 class ALeExpr
904 super ABinopExpr
905 end
906 class ALlExpr
907 super ABinopExpr
908 end
909 class AGtExpr
910 super ABinopExpr
911 end
912 class AGeExpr
913 super ABinopExpr
914 end
915 class AGgExpr
916 super ABinopExpr
917 end
918 class AIsaExpr
919 super ABoolExpr
920 readable var _n_expr: AExpr
921 readable var _n_type: AType
922 end
923 class APlusExpr
924 super ABinopExpr
925 end
926 class AMinusExpr
927 super ABinopExpr
928 end
929 class AStarshipExpr
930 super ABinopExpr
931 end
932 class AStarExpr
933 super ABinopExpr
934 end
935 class ASlashExpr
936 super ABinopExpr
937 end
938 class APercentExpr
939 super ABinopExpr
940 end
941 class AUminusExpr
942 super ASendExpr
943 readable var _n_minus: TMinus
944 end
945 class ANewExpr
946 super AExpr
947 readable var _n_kwnew: TKwnew
948 readable var _n_type: AType
949 readable var _n_id: nullable TId = null
950 readable var _n_args: AExprs
951 end
952 abstract class AAttrFormExpr
953 super AExpr
954 readable var _n_expr: AExpr
955 readable var _n_id: TAttrid
956 end
957 class AAttrExpr
958 super AAttrFormExpr
959 end
960 class AAttrAssignExpr
961 super AAttrFormExpr
962 super AAssignFormExpr
963 end
964 abstract class ACallFormExpr
965 super ASendExpr
966 readable var _n_id: TId
967 readable var _n_args: AExprs
968 end
969 abstract class ASendReassignFormExpr
970 super ASendExpr
971 super AReassignFormExpr
972 end
973 class AAttrReassignExpr
974 super AExpr
975 super AAttrFormExpr
976 super AReassignFormExpr
977 end
978 class ACallExpr
979 super ACallFormExpr
980 end
981 class ACallAssignExpr
982 super ACallFormExpr
983 super AAssignFormExpr
984 end
985 class ACallReassignExpr
986 super AExpr
987 super ACallFormExpr
988 super ASendReassignFormExpr
989 end
990 class ASuperExpr
991 super AExpr
992 readable var _n_qualified: nullable AQualified = null
993 readable var _n_kwsuper: TKwsuper
994 readable var _n_args: AExprs
995 end
996 class AInitExpr
997 super ASendExpr
998 readable var _n_kwinit: TKwinit
999 readable var _n_args: AExprs
1000 end
1001 abstract class ABraFormExpr
1002 super ASendExpr
1003 readable var _n_args: AExprs
1004 end
1005 class ABraExpr
1006 super ABraFormExpr
1007 end
1008 class ABraAssignExpr
1009 super ABraFormExpr
1010 super AAssignFormExpr
1011 end
1012 abstract class AVarFormExpr
1013 super AExpr
1014 readable var _n_id: TId
1015 end
1016 class ABraReassignExpr
1017 super ABraFormExpr
1018 super ASendReassignFormExpr
1019 end
1020 class AClosureCallExpr
1021 super AExpr
1022 readable var _n_id: TId
1023 readable var _n_args: AExprs
1024 readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
1025 end
1026 class AVarExpr
1027 super AVarFormExpr
1028 end
1029 class AVarAssignExpr
1030 super AVarFormExpr
1031 super AAssignFormExpr
1032 end
1033 class AVarReassignExpr
1034 super AVarFormExpr
1035 super AReassignFormExpr
1036 end
1037 abstract class ARangeExpr
1038 super AExpr
1039 readable var _n_expr: AExpr
1040 readable var _n_expr2: AExpr
1041 end
1042 class ACrangeExpr
1043 super ARangeExpr
1044 readable var _n_obra: TObra
1045 readable var _n_cbra: TCbra
1046 end
1047 class AOrangeExpr
1048 super ARangeExpr
1049 readable var _n_obra: TObra
1050 readable var _n_cbra: TObra
1051 end
1052 class AArrayExpr
1053 super AExpr
1054 readable var _n_exprs: AExprs
1055 end
1056 class ASelfExpr
1057 super AExpr
1058 readable var _n_kwself: nullable TKwself
1059 end
1060 class AImplicitSelfExpr
1061 super ASelfExpr
1062 end
1063 class ATrueExpr
1064 super ABoolExpr
1065 readable var _n_kwtrue: TKwtrue
1066 end
1067 class AFalseExpr
1068 super ABoolExpr
1069 readable var _n_kwfalse: TKwfalse
1070 end
1071 class ANullExpr
1072 super AExpr
1073 readable var _n_kwnull: TKwnull
1074 end
1075 class AIntExpr
1076 super AExpr
1077 readable var _n_number: TNumber
1078 end
1079 class AFloatExpr
1080 super AExpr
1081 readable var _n_float: TFloat
1082 end
1083 class ACharExpr
1084 super AExpr
1085 readable var _n_char: TChar
1086 end
1087 abstract class AStringFormExpr
1088 super AExpr
1089 readable var _n_string: Token
1090 end
1091 class AStringExpr
1092 super AStringFormExpr
1093 end
1094 class AStartStringExpr
1095 super AStringFormExpr
1096 end
1097 class AMidStringExpr
1098 super AStringFormExpr
1099 end
1100 class AEndStringExpr
1101 super AStringFormExpr
1102 end
1103 class ASuperstringExpr
1104 super AExpr
1105 readable var _n_exprs: List[AExpr] = new List[AExpr]
1106 end
1107 class AParExpr
1108 super AProxyExpr
1109 readable var _n_opar: TOpar
1110 readable var _n_cpar: TCpar
1111 end
1112 abstract class AProxyExpr
1113 super AExpr
1114 readable var _n_expr: AExpr
1115 end
1116 class AAsCastExpr
1117 super AExpr
1118 readable var _n_expr: AExpr
1119 readable var _n_kwas: TKwas
1120 readable var _n_opar: TOpar
1121 readable var _n_type: AType
1122 readable var _n_cpar: TCpar
1123 end
1124 class AAsNotnullExpr
1125 super AExpr
1126 readable var _n_expr: AExpr
1127 readable var _n_kwas: TKwas
1128 readable var _n_opar: TOpar
1129 readable var _n_kwnot: TKwnot
1130 readable var _n_kwnull: TKwnull
1131 readable var _n_cpar: TCpar
1132 end
1133 class AIssetAttrExpr
1134 super AAttrFormExpr
1135 readable var _n_kwisset: TKwisset
1136 end
1137 abstract class AExprs
1138 super Prod
1139 readable var _n_exprs: List[AExpr] = new List[AExpr]
1140 end
1141 class ADebugTypeExpr
1142 super AExpr
1143 readable var _n_kwdebug: TKwdebug
1144 readable var _n_kwtype: TKwtype
1145 readable var _n_expr: AExpr
1146 readable var _n_type: AType
1147 end
1148 class AListExprs
1149 super AExprs
1150 end
1151 class AParExprs
1152 super AExprs
1153 readable var _n_opar: TOpar
1154 readable var _n_cpar: TCpar
1155 end
1156 class ABraExprs
1157 super AExprs
1158 readable var _n_obra: TObra
1159 readable var _n_cbra: TCbra
1160 end
1161 abstract class AAssignOp super Prod end
1162 class APlusAssignOp
1163 super AAssignOp
1164 readable var _n_pluseq: TPluseq
1165 end
1166 class AMinusAssignOp
1167 super AAssignOp
1168 readable var _n_minuseq: TMinuseq
1169 end
1170 class AClosureDef
1171 super ALabelable
1172 readable var _n_bang: TBang
1173 readable var _n_id: AClosureId
1174 readable var _n_ids: List[TId] = new List[TId]
1175 readable var _n_kwdo: nullable TKwdo = null
1176 readable var _n_expr: nullable AExpr = null
1177 redef fun hot_location do return n_id.location
1178 end
1179 abstract class AClosureId
1180 super Prod
1181 end
1182 class ASimpleClosureId
1183 super AClosureId
1184 readable var _n_id: TId
1185 end
1186 class ABreakClosureId
1187 super AClosureId
1188 readable var _n_kwbreak: TKwbreak
1189 end
1190 class AModuleName
1191 super Prod
1192 readable var _n_quad: nullable TQuad = null
1193 readable var _n_path: List[TId] = new List[TId]
1194 readable var _n_id: TId
1195 end
1196 class AInLanguage
1197 super Prod
1198 readable var _n_kwin: TKwin
1199 readable var _n_string: TString
1200 end
1201 class AExternCodeBlock
1202 super Prod
1203 readable var _n_in_language: nullable AInLanguage = null
1204 readable var _n_extern_code_segment: TExternCodeSegment
1205 end
1206 class AQualified
1207 super Prod
1208 readable var _n_quad: nullable TQuad = null
1209 readable var _n_id: List[TId] = new List[TId]
1210 readable var _n_classid: nullable TClassid = null
1211 end
1212 class ADoc
1213 super Prod
1214 readable var _n_comment: List[TComment] = new List[TComment]
1215 end
1216
1217 class AAnnotations
1218 super Prod
1219 readable var _n_at: nullable TAt = null
1220 readable var _n_opar: nullable TOpar = null
1221 readable var _n_items: List[AAnnotation] = new List[AAnnotation]
1222 readable var _n_cpar: nullable TCpar = null
1223 end
1224 class AAnnotation
1225 super Prod
1226 readable var _n_atid: AAtid
1227 readable var _n_opar: nullable TOpar = null
1228 readable var _n_args: List[AAtArg] = new List[AAtArg]
1229 readable var _n_cpar: nullable TCpar = null
1230 end
1231 abstract class AAtArg
1232 super Prod
1233 end
1234 class ATypeAtArg
1235 super AAtArg
1236 readable var _n_type: AType
1237 end
1238 class AExprAtArg
1239 super AAtArg
1240 readable var _n_expr: AExpr
1241 end
1242 class AAtAtArg
1243 super AAtArg
1244 end
1245 abstract class AAtid
1246 super Prod
1247 readable var _n_id: Token
1248 end
1249 class AIdAtid
1250 super AAtid
1251 end
1252 class AKwexternAtid
1253 super AAtid
1254 end
1255 class AKwinternAtid
1256 super AAtid
1257 end
1258 class AKwreadableAtid
1259 super AAtid
1260 end
1261 class AKwwritableAtid
1262 super AAtid
1263 end
1264 class AKwimportAtid
1265 super AAtid
1266 end
1267
1268 class Start
1269 super Prod
1270 readable var _n_base: nullable AModule
1271 readable var _n_eof: EOF
1272 init(n_base: nullable AModule, n_eof: EOF)
1273 do
1274 self._n_base = n_base
1275 self._n_eof = n_eof
1276 end
1277 end