pep8analysis: remove old-style accessors in the AST
[nit.git] / contrib / pep8analysis / src / parser / parser_prod.nit
1 # Production AST nodes full definition.
2 # This file was generated by SableCC (http://www.sablecc.org/).
3 module parser_prod
4
5 import lexer
6 intrude import parser_nodes
7 private import tables
8
9 redef class ANode
10 # Parent of the node in the AST
11 var _parent: nullable ANode
12 fun parent: nullable ANode do return _parent
13 fun parent=(p: nullable ANode) do _parent = p
14
15 # Remove a child from the AST
16 fun remove_child(child: ANode)
17 do
18 replace_child(child, null)
19 end
20
21 # Replace a child with an other node in the AST
22 fun replace_child(old_child: ANode, new_child: nullable ANode) is abstract
23
24 # Replace itself with an other node in the AST
25 fun replace_with(node: ANode)
26 do
27 if _parent != null then
28 _parent.replace_child(self, node)
29 end
30 end
31
32 # Visit all nodes in order.
33 # Thus, call "v.visit(e)" for each node e
34 fun visit_all(v: Visitor) is abstract
35 end
36
37 redef class Token
38 redef fun visit_all(v: Visitor) do end
39 redef fun replace_child(old_child: ANode, new_child: nullable ANode) do end
40 end
41
42 redef class Prod
43 redef fun replace_with(n: ANode)
44 do
45 super
46 assert n isa Prod
47 n.location = location
48 end
49 end
50
51 # Abstract standard visitor
52 abstract class Visitor
53 # What the visitor do when a node is visited
54 # Concrete visitors should redefine this method.
55 protected fun visit(e: nullable ANode) is abstract
56
57 # Ask the visitor to visit a given node.
58 # Usually automatically called by visit_all* methods.
59 # This methos should not be redefined
60 fun enter_visit(e: nullable ANode)
61 do
62 var old = current_node
63 current_node = e
64 visit(e)
65 current_node = old
66 end
67
68 # The current visited node
69 var current_node: nullable ANode = null
70 end
71
72 redef class AListing
73 private init empty_init do end
74
75 init init_alisting (
76 n_lines: Collection[Object], # Should be Collection[ALine]
77 n_label_decl: nullable ALabelDecl,
78 n_end_block: nullable TEndBlock
79 )
80 do
81 empty_init
82 for n in n_lines do
83 assert n isa ALine
84 _n_lines.add(n)
85 n.parent = self
86 end
87 _n_label_decl = n_label_decl
88 if n_label_decl != null then
89 n_label_decl.parent = self
90 end
91 _n_end_block = n_end_block.as(not null)
92 n_end_block.parent = self
93 end
94
95 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
96 do
97 for i in [0.._n_lines.length[ do
98 if _n_lines[i] == old_child then
99 if new_child != null then
100 assert new_child isa ALine
101 _n_lines[i] = new_child
102 new_child.parent = self
103 else
104 _n_lines.remove_at(i)
105 end
106 return
107 end
108 end
109 if _n_label_decl == old_child then
110 if new_child != null then
111 new_child.parent = self
112 assert new_child isa ALabelDecl
113 _n_label_decl = new_child
114 else
115 _n_label_decl = null
116 end
117 return
118 end
119 if _n_end_block == old_child then
120 if new_child != null then
121 new_child.parent = self
122 assert new_child isa TEndBlock
123 _n_end_block = new_child
124 else
125 abort
126 end
127 return
128 end
129 end
130
131 redef fun visit_all(v: Visitor)
132 do
133 for n in _n_lines do
134 v.enter_visit(n)
135 end
136 if _n_label_decl != null then
137 v.enter_visit(_n_label_decl.as(not null))
138 end
139 v.enter_visit(_n_end_block)
140 end
141 end
142 redef class AEmptyLine
143 private init empty_init do end
144
145 init init_aemptyline (
146 n_label_decl: nullable ALabelDecl,
147 n_comment: nullable TComment,
148 n_eol: nullable TEol
149 )
150 do
151 empty_init
152 _n_label_decl = n_label_decl
153 if n_label_decl != null then
154 n_label_decl.parent = self
155 end
156 _n_comment = n_comment
157 if n_comment != null then
158 n_comment.parent = self
159 end
160 _n_eol = n_eol.as(not null)
161 n_eol.parent = self
162 end
163
164 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
165 do
166 if _n_label_decl == old_child then
167 if new_child != null then
168 new_child.parent = self
169 assert new_child isa ALabelDecl
170 _n_label_decl = new_child
171 else
172 _n_label_decl = null
173 end
174 return
175 end
176 if _n_comment == old_child then
177 if new_child != null then
178 new_child.parent = self
179 assert new_child isa TComment
180 _n_comment = new_child
181 else
182 _n_comment = null
183 end
184 return
185 end
186 if _n_eol == old_child then
187 if new_child != null then
188 new_child.parent = self
189 assert new_child isa TEol
190 _n_eol = new_child
191 else
192 abort
193 end
194 return
195 end
196 end
197
198 redef fun visit_all(v: Visitor)
199 do
200 if _n_label_decl != null then
201 v.enter_visit(_n_label_decl.as(not null))
202 end
203 if _n_comment != null then
204 v.enter_visit(_n_comment.as(not null))
205 end
206 v.enter_visit(_n_eol)
207 end
208 end
209 redef class AInstructionLine
210 private init empty_init do end
211
212 init init_ainstructionline (
213 n_label_decl: nullable ALabelDecl,
214 n_instruction: nullable AInstruction,
215 n_comment: nullable TComment,
216 n_eol: nullable TEol
217 )
218 do
219 empty_init
220 _n_label_decl = n_label_decl
221 if n_label_decl != null then
222 n_label_decl.parent = self
223 end
224 _n_instruction = n_instruction.as(not null)
225 n_instruction.parent = self
226 _n_comment = n_comment
227 if n_comment != null then
228 n_comment.parent = self
229 end
230 _n_eol = n_eol.as(not null)
231 n_eol.parent = self
232 end
233
234 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
235 do
236 if _n_label_decl == old_child then
237 if new_child != null then
238 new_child.parent = self
239 assert new_child isa ALabelDecl
240 _n_label_decl = new_child
241 else
242 _n_label_decl = null
243 end
244 return
245 end
246 if _n_instruction == old_child then
247 if new_child != null then
248 new_child.parent = self
249 assert new_child isa AInstruction
250 _n_instruction = new_child
251 else
252 abort
253 end
254 return
255 end
256 if _n_comment == old_child then
257 if new_child != null then
258 new_child.parent = self
259 assert new_child isa TComment
260 _n_comment = new_child
261 else
262 _n_comment = null
263 end
264 return
265 end
266 if _n_eol == old_child then
267 if new_child != null then
268 new_child.parent = self
269 assert new_child isa TEol
270 _n_eol = new_child
271 else
272 abort
273 end
274 return
275 end
276 end
277
278 redef fun visit_all(v: Visitor)
279 do
280 if _n_label_decl != null then
281 v.enter_visit(_n_label_decl.as(not null))
282 end
283 v.enter_visit(_n_instruction)
284 if _n_comment != null then
285 v.enter_visit(_n_comment.as(not null))
286 end
287 v.enter_visit(_n_eol)
288 end
289 end
290 redef class ADirectiveLine
291 private init empty_init do end
292
293 init init_adirectiveline (
294 n_label_decl: nullable ALabelDecl,
295 n_directive: nullable ADirective,
296 n_comment: nullable TComment,
297 n_eol: nullable TEol
298 )
299 do
300 empty_init
301 _n_label_decl = n_label_decl
302 if n_label_decl != null then
303 n_label_decl.parent = self
304 end
305 _n_directive = n_directive.as(not null)
306 n_directive.parent = self
307 _n_comment = n_comment
308 if n_comment != null then
309 n_comment.parent = self
310 end
311 _n_eol = n_eol.as(not null)
312 n_eol.parent = self
313 end
314
315 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
316 do
317 if _n_label_decl == old_child then
318 if new_child != null then
319 new_child.parent = self
320 assert new_child isa ALabelDecl
321 _n_label_decl = new_child
322 else
323 _n_label_decl = null
324 end
325 return
326 end
327 if _n_directive == old_child then
328 if new_child != null then
329 new_child.parent = self
330 assert new_child isa ADirective
331 _n_directive = new_child
332 else
333 abort
334 end
335 return
336 end
337 if _n_comment == old_child then
338 if new_child != null then
339 new_child.parent = self
340 assert new_child isa TComment
341 _n_comment = new_child
342 else
343 _n_comment = null
344 end
345 return
346 end
347 if _n_eol == old_child then
348 if new_child != null then
349 new_child.parent = self
350 assert new_child isa TEol
351 _n_eol = new_child
352 else
353 abort
354 end
355 return
356 end
357 end
358
359 redef fun visit_all(v: Visitor)
360 do
361 if _n_label_decl != null then
362 v.enter_visit(_n_label_decl.as(not null))
363 end
364 v.enter_visit(_n_directive)
365 if _n_comment != null then
366 v.enter_visit(_n_comment.as(not null))
367 end
368 v.enter_visit(_n_eol)
369 end
370 end
371 redef class ALabelDecl
372 private init empty_init do end
373
374 init init_alabeldecl (
375 n_id: nullable TId,
376 n_colon: nullable TColon
377 )
378 do
379 empty_init
380 _n_id = n_id.as(not null)
381 n_id.parent = self
382 _n_colon = n_colon.as(not null)
383 n_colon.parent = self
384 end
385
386 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
387 do
388 if _n_id == old_child then
389 if new_child != null then
390 new_child.parent = self
391 assert new_child isa TId
392 _n_id = new_child
393 else
394 abort
395 end
396 return
397 end
398 if _n_colon == old_child then
399 if new_child != null then
400 new_child.parent = self
401 assert new_child isa TColon
402 _n_colon = new_child
403 else
404 abort
405 end
406 return
407 end
408 end
409
410 redef fun visit_all(v: Visitor)
411 do
412 v.enter_visit(_n_id)
413 v.enter_visit(_n_colon)
414 end
415 end
416 redef class AUnaryInstruction
417 private init empty_init do end
418
419 init init_aunaryinstruction (
420 n_id: nullable TId
421 )
422 do
423 empty_init
424 _n_id = n_id.as(not null)
425 n_id.parent = self
426 end
427
428 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
429 do
430 if _n_id == old_child then
431 if new_child != null then
432 new_child.parent = self
433 assert new_child isa TId
434 _n_id = new_child
435 else
436 abort
437 end
438 return
439 end
440 end
441
442 redef fun visit_all(v: Visitor)
443 do
444 v.enter_visit(_n_id)
445 end
446 end
447 redef class ABinaryInstruction
448 private init empty_init do end
449
450 init init_abinaryinstruction (
451 n_id: nullable TId,
452 n_operand: nullable AOperand
453 )
454 do
455 empty_init
456 _n_id = n_id.as(not null)
457 n_id.parent = self
458 _n_operand = n_operand.as(not null)
459 n_operand.parent = self
460 end
461
462 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
463 do
464 if _n_id == old_child then
465 if new_child != null then
466 new_child.parent = self
467 assert new_child isa TId
468 _n_id = new_child
469 else
470 abort
471 end
472 return
473 end
474 if _n_operand == old_child then
475 if new_child != null then
476 new_child.parent = self
477 assert new_child isa AOperand
478 _n_operand = new_child
479 else
480 abort
481 end
482 return
483 end
484 end
485
486 redef fun visit_all(v: Visitor)
487 do
488 v.enter_visit(_n_id)
489 v.enter_visit(_n_operand)
490 end
491 end
492 redef class AImmediateOperand
493 private init empty_init do end
494
495 init init_aimmediateoperand (
496 n_value: nullable AValue
497 )
498 do
499 empty_init
500 _n_value = n_value.as(not null)
501 n_value.parent = self
502 end
503
504 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
505 do
506 if _n_value == old_child then
507 if new_child != null then
508 new_child.parent = self
509 assert new_child isa AValue
510 _n_value = new_child
511 else
512 abort
513 end
514 return
515 end
516 end
517
518 redef fun visit_all(v: Visitor)
519 do
520 v.enter_visit(_n_value)
521 end
522 end
523 redef class AAnyOperand
524 private init empty_init do end
525
526 init init_aanyoperand (
527 n_value: nullable AValue,
528 n_comma: nullable TComma,
529 n_id: nullable TId
530 )
531 do
532 empty_init
533 _n_value = n_value.as(not null)
534 n_value.parent = self
535 _n_comma = n_comma.as(not null)
536 n_comma.parent = self
537 _n_id = n_id.as(not null)
538 n_id.parent = self
539 end
540
541 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
542 do
543 if _n_value == old_child then
544 if new_child != null then
545 new_child.parent = self
546 assert new_child isa AValue
547 _n_value = new_child
548 else
549 abort
550 end
551 return
552 end
553 if _n_comma == old_child then
554 if new_child != null then
555 new_child.parent = self
556 assert new_child isa TComma
557 _n_comma = new_child
558 else
559 abort
560 end
561 return
562 end
563 if _n_id == old_child then
564 if new_child != null then
565 new_child.parent = self
566 assert new_child isa TId
567 _n_id = new_child
568 else
569 abort
570 end
571 return
572 end
573 end
574
575 redef fun visit_all(v: Visitor)
576 do
577 v.enter_visit(_n_value)
578 v.enter_visit(_n_comma)
579 v.enter_visit(_n_id)
580 end
581 end
582 redef class ALabelValue
583 private init empty_init do end
584
585 init init_alabelvalue (
586 n_id: nullable TId
587 )
588 do
589 empty_init
590 _n_id = n_id.as(not null)
591 n_id.parent = self
592 end
593
594 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
595 do
596 if _n_id == old_child then
597 if new_child != null then
598 new_child.parent = self
599 assert new_child isa TId
600 _n_id = new_child
601 else
602 abort
603 end
604 return
605 end
606 end
607
608 redef fun visit_all(v: Visitor)
609 do
610 v.enter_visit(_n_id)
611 end
612 end
613 redef class ANumberValue
614 private init empty_init do end
615
616 init init_anumbervalue (
617 n_number: nullable TNumber
618 )
619 do
620 empty_init
621 _n_number = n_number.as(not null)
622 n_number.parent = self
623 end
624
625 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
626 do
627 if _n_number == old_child then
628 if new_child != null then
629 new_child.parent = self
630 assert new_child isa TNumber
631 _n_number = new_child
632 else
633 abort
634 end
635 return
636 end
637 end
638
639 redef fun visit_all(v: Visitor)
640 do
641 v.enter_visit(_n_number)
642 end
643 end
644 redef class ACharValue
645 private init empty_init do end
646
647 init init_acharvalue (
648 n_char: nullable TChar
649 )
650 do
651 empty_init
652 _n_char = n_char.as(not null)
653 n_char.parent = self
654 end
655
656 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
657 do
658 if _n_char == old_child then
659 if new_child != null then
660 new_child.parent = self
661 assert new_child isa TChar
662 _n_char = new_child
663 else
664 abort
665 end
666 return
667 end
668 end
669
670 redef fun visit_all(v: Visitor)
671 do
672 v.enter_visit(_n_char)
673 end
674 end
675 redef class AStringValue
676 private init empty_init do end
677
678 init init_astringvalue (
679 n_string: nullable TString
680 )
681 do
682 empty_init
683 _n_string = n_string.as(not null)
684 n_string.parent = self
685 end
686
687 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
688 do
689 if _n_string == old_child then
690 if new_child != null then
691 new_child.parent = self
692 assert new_child isa TString
693 _n_string = new_child
694 else
695 abort
696 end
697 return
698 end
699 end
700
701 redef fun visit_all(v: Visitor)
702 do
703 v.enter_visit(_n_string)
704 end
705 end
706 redef class AHexValue
707 private init empty_init do end
708
709 init init_ahexvalue (
710 n_hex: nullable THex
711 )
712 do
713 empty_init
714 _n_hex = n_hex.as(not null)
715 n_hex.parent = self
716 end
717
718 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
719 do
720 if _n_hex == old_child then
721 if new_child != null then
722 new_child.parent = self
723 assert new_child isa THex
724 _n_hex = new_child
725 else
726 abort
727 end
728 return
729 end
730 end
731
732 redef fun visit_all(v: Visitor)
733 do
734 v.enter_visit(_n_hex)
735 end
736 end
737 redef class AByteDirective
738 private init empty_init do end
739
740 init init_abytedirective (
741 n_tk_byte: nullable TTkByte,
742 n_value: nullable AValue
743 )
744 do
745 empty_init
746 _n_tk_byte = n_tk_byte.as(not null)
747 n_tk_byte.parent = self
748 _n_value = n_value.as(not null)
749 n_value.parent = self
750 end
751
752 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
753 do
754 if _n_tk_byte == old_child then
755 if new_child != null then
756 new_child.parent = self
757 assert new_child isa TTkByte
758 _n_tk_byte = new_child
759 else
760 abort
761 end
762 return
763 end
764 if _n_value == old_child then
765 if new_child != null then
766 new_child.parent = self
767 assert new_child isa AValue
768 _n_value = new_child
769 else
770 abort
771 end
772 return
773 end
774 end
775
776 redef fun visit_all(v: Visitor)
777 do
778 v.enter_visit(_n_tk_byte)
779 v.enter_visit(_n_value)
780 end
781 end
782 redef class AWordDirective
783 private init empty_init do end
784
785 init init_aworddirective (
786 n_tk_word: nullable TTkWord,
787 n_value: nullable AValue
788 )
789 do
790 empty_init
791 _n_tk_word = n_tk_word.as(not null)
792 n_tk_word.parent = self
793 _n_value = n_value.as(not null)
794 n_value.parent = self
795 end
796
797 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
798 do
799 if _n_tk_word == old_child then
800 if new_child != null then
801 new_child.parent = self
802 assert new_child isa TTkWord
803 _n_tk_word = new_child
804 else
805 abort
806 end
807 return
808 end
809 if _n_value == old_child then
810 if new_child != null then
811 new_child.parent = self
812 assert new_child isa AValue
813 _n_value = new_child
814 else
815 abort
816 end
817 return
818 end
819 end
820
821 redef fun visit_all(v: Visitor)
822 do
823 v.enter_visit(_n_tk_word)
824 v.enter_visit(_n_value)
825 end
826 end
827 redef class ABlockDirective
828 private init empty_init do end
829
830 init init_ablockdirective (
831 n_tk_block: nullable TTkBlock,
832 n_value: nullable AValue
833 )
834 do
835 empty_init
836 _n_tk_block = n_tk_block.as(not null)
837 n_tk_block.parent = self
838 _n_value = n_value.as(not null)
839 n_value.parent = self
840 end
841
842 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
843 do
844 if _n_tk_block == old_child then
845 if new_child != null then
846 new_child.parent = self
847 assert new_child isa TTkBlock
848 _n_tk_block = new_child
849 else
850 abort
851 end
852 return
853 end
854 if _n_value == old_child then
855 if new_child != null then
856 new_child.parent = self
857 assert new_child isa AValue
858 _n_value = new_child
859 else
860 abort
861 end
862 return
863 end
864 end
865
866 redef fun visit_all(v: Visitor)
867 do
868 v.enter_visit(_n_tk_block)
869 v.enter_visit(_n_value)
870 end
871 end
872 redef class AAsciiDirective
873 private init empty_init do end
874
875 init init_aasciidirective (
876 n_tk_ascii: nullable TTkAscii,
877 n_value: nullable AValue
878 )
879 do
880 empty_init
881 _n_tk_ascii = n_tk_ascii.as(not null)
882 n_tk_ascii.parent = self
883 _n_value = n_value.as(not null)
884 n_value.parent = self
885 end
886
887 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
888 do
889 if _n_tk_ascii == old_child then
890 if new_child != null then
891 new_child.parent = self
892 assert new_child isa TTkAscii
893 _n_tk_ascii = new_child
894 else
895 abort
896 end
897 return
898 end
899 if _n_value == old_child then
900 if new_child != null then
901 new_child.parent = self
902 assert new_child isa AValue
903 _n_value = new_child
904 else
905 abort
906 end
907 return
908 end
909 end
910
911 redef fun visit_all(v: Visitor)
912 do
913 v.enter_visit(_n_tk_ascii)
914 v.enter_visit(_n_value)
915 end
916 end
917 redef class AAddrssDirective
918 private init empty_init do end
919
920 init init_aaddrssdirective (
921 n_tk_addrss: nullable TTkAddrss,
922 n_value: nullable AValue
923 )
924 do
925 empty_init
926 _n_tk_addrss = n_tk_addrss.as(not null)
927 n_tk_addrss.parent = self
928 _n_value = n_value.as(not null)
929 n_value.parent = self
930 end
931
932 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
933 do
934 if _n_tk_addrss == old_child then
935 if new_child != null then
936 new_child.parent = self
937 assert new_child isa TTkAddrss
938 _n_tk_addrss = new_child
939 else
940 abort
941 end
942 return
943 end
944 if _n_value == old_child then
945 if new_child != null then
946 new_child.parent = self
947 assert new_child isa AValue
948 _n_value = new_child
949 else
950 abort
951 end
952 return
953 end
954 end
955
956 redef fun visit_all(v: Visitor)
957 do
958 v.enter_visit(_n_tk_addrss)
959 v.enter_visit(_n_value)
960 end
961 end
962 redef class AEquateDirective
963 private init empty_init do end
964
965 init init_aequatedirective (
966 n_tk_equate: nullable TTkEquate,
967 n_value: nullable AValue
968 )
969 do
970 empty_init
971 _n_tk_equate = n_tk_equate.as(not null)
972 n_tk_equate.parent = self
973 _n_value = n_value.as(not null)
974 n_value.parent = self
975 end
976
977 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
978 do
979 if _n_tk_equate == old_child then
980 if new_child != null then
981 new_child.parent = self
982 assert new_child isa TTkEquate
983 _n_tk_equate = new_child
984 else
985 abort
986 end
987 return
988 end
989 if _n_value == old_child then
990 if new_child != null then
991 new_child.parent = self
992 assert new_child isa AValue
993 _n_value = new_child
994 else
995 abort
996 end
997 return
998 end
999 end
1000
1001 redef fun visit_all(v: Visitor)
1002 do
1003 v.enter_visit(_n_tk_equate)
1004 v.enter_visit(_n_value)
1005 end
1006 end
1007 redef class ABurnDirective
1008 private init empty_init do end
1009
1010 init init_aburndirective (
1011 n_tk_burn: nullable TTkBurn,
1012 n_value: nullable AValue
1013 )
1014 do
1015 empty_init
1016 _n_tk_burn = n_tk_burn.as(not null)
1017 n_tk_burn.parent = self
1018 _n_value = n_value.as(not null)
1019 n_value.parent = self
1020 end
1021
1022 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1023 do
1024 if _n_tk_burn == old_child then
1025 if new_child != null then
1026 new_child.parent = self
1027 assert new_child isa TTkBurn
1028 _n_tk_burn = new_child
1029 else
1030 abort
1031 end
1032 return
1033 end
1034 if _n_value == old_child then
1035 if new_child != null then
1036 new_child.parent = self
1037 assert new_child isa AValue
1038 _n_value = new_child
1039 else
1040 abort
1041 end
1042 return
1043 end
1044 end
1045
1046 redef fun visit_all(v: Visitor)
1047 do
1048 v.enter_visit(_n_tk_burn)
1049 v.enter_visit(_n_value)
1050 end
1051 end
1052
1053 redef class Start
1054 redef fun replace_child(old_child: ANode, new_child: nullable ANode)
1055 do
1056 if _n_base == old_child then
1057 if new_child == null then
1058 else
1059 new_child.parent = self
1060 assert new_child isa AListing
1061 _n_base = new_child
1062 end
1063 old_child.parent = null
1064 return
1065 end
1066 end
1067
1068 redef fun visit_all(v: Visitor)
1069 do
1070 if _n_base != null then
1071 v.enter_visit(_n_base.as(not null))
1072 end
1073 v.enter_visit(_n_eof)
1074 end
1075 end