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