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