/[eiffelstudio]/branches/eth/eve/Src/framework/eiffel_transform/Visitors/Printers/etr_ast_structure_printer.e
ViewVC logotype

Contents of /branches/eth/eve/Src/framework/eiffel_transform/Visitors/Printers/etr_ast_structure_printer.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 85849 - (show annotations)
Fri Mar 11 14:12:42 2011 UTC (8 years, 7 months ago) by msteindorfer
File size: 45401 byte(s)
Refactoring to make `output' configurable even after object creation.
1 ´╗┐note
2 description: "Prints an ast while depending purely on structure information (no matchlist needed)."
3 date: "$Date$"
4 revision: "$Revision$"
5
6 class
7 ETR_AST_STRUCTURE_PRINTER
8
9 inherit
10 SHARED_NAMES_HEAP
11 export
12 {NONE} all
13 end
14
15 AST_ITERATOR
16 export
17 {AST_EIFFEL} all
18 redefine
19 process_bool_as,
20 process_char_as,
21 process_typed_char_as,
22 process_result_as,
23 process_retry_as,
24 process_unique_as,
25 process_deferred_as,
26 process_void_as,
27 process_string_as,
28 process_verbatim_string_as,
29 process_current_as,
30 process_integer_as,
31 process_real_as,
32 process_id_as,
33 process_access_feat_as,
34 process_paran_as,
35 process_binary_as,
36 process_unary_as,
37 process_nested_as,
38 process_if_as,
39 process_elseif_as,
40 process_loop_as,
41 process_tagged_as,
42 process_class_as,
43 process_feature_clause_as,
44 process_class_list_as,
45 process_feature_as,
46 process_body_as,
47 process_type_dec_as,
48 process_feat_name_id_as,
49 process_assigner_call_as,
50 process_assign_as,
51 process_check_as,
52 process_creation_as,
53 process_debug_as,
54 process_inspect_as,
55 process_instr_call_as,
56 process_do_as,
57 process_once_as,
58 process_routine_as,
59 process_constant_as,
60 process_require_as,
61 process_require_else_as,
62 process_ensure_as,
63 process_ensure_then_as,
64 process_invariant_as,
65 process_eiffel_list,
66 process_parent_as,
67 process_rename_as,
68 process_export_item_as,
69 process_all_as,
70 process_feature_name_alias_as,
71 process_bits_as,
72 process_class_type_as,
73 process_generic_class_type_as,
74 process_formal_as,
75 process_like_cur_as,
76 process_like_id_as,
77 process_named_tuple_type_as,
78 process_constraining_type_as,
79 process_access_inv_as,
80 process_creation_expr_as,
81 process_tuple_as,
82 process_rename_clause_as,
83 process_formal_dec_as,
84 process_object_test_as,
85 process_case_as,
86 process_interval_as,
87 process_external_as,
88 process_inline_agent_creation_as,
89 process_operand_as,
90 process_agent_routine_creation_as,
91 process_attribute_as,
92 process_index_as,
93 process_bit_const_as,
94 process_array_as,
95 process_nested_expr_as,
96 process_precursor_as,
97 process_bracket_as,
98 process_variant_as,
99 process_none_type_as,
100 process_export_clause_as,
101 process_undefine_clause_as,
102 process_redefine_clause_as,
103 process_select_clause_as,
104 process_convert_feat_as,
105 process_create_as,
106 process_client_as,
107 process_custom_attribute_as,
108 process_static_access_as,
109 process_expr_call_as,
110 process_expr_address_as,
111 process_type_expr_as,
112 process_address_as,
113 process_address_current_as,
114 process_address_result_as,
115 process_un_strip_as,
116 process_converted_expr_as,
117 process_infix_prefix_as,
118 process_reverse_as,
119 process_formal_argu_dec_list_as,
120 process_loop_expr_as,
121 process_iteration_as,
122 process_there_exists_as,
123 process_for_all_as
124 end
125
126 SHARED_TEXT_ITEMS
127 export
128 {NONE} all
129 end
130
131 INTERNAL_COMPILER_STRING_EXPORTER
132
133 create
134 make_with_output
135
136 feature {NONE} -- Creation
137
138 make_with_output (a_output: like output)
139 -- Make with `a_output'
140 do
141 set_output (a_output)
142 end
143
144 feature -- Configuration
145
146 set_output (a_output: like output)
147 -- Configure with `a_output'.
148 require
149 a_output_attached: a_output /= Void
150 do
151 output := a_output
152 ensure
153 a_output_attached: output /= Void
154 end
155
156 feature {NONE} -- Implementation (Attributes)
157
158 is_in_agent_target: BOOLEAN
159 -- Hack needed to process agent OPERANDS
160
161 is_in_inline_agent: BOOLEAN
162 -- Currently processing an inline agent?
163
164 feature {NONE} -- Implementation (Processing)
165
166 processing_needed (an_ast: detachable AST_EIFFEL; a_parent: AST_EIFFEL; a_branch: INTEGER): BOOLEAN
167 -- should `an_ast' be processed
168 do
169 Result := attached an_ast
170 end
171
172 process (l_as: detachable AST_EIFFEL; a_parent: detachable AST_EIFFEL; a_branch: INTEGER)
173 -- Process `l_as'
174 do
175 l_as.process (Current)
176 end
177
178 process_child_list (l_as: EIFFEL_LIST[AST_EIFFEL]; separator: STRING; a_parent: AST_EIFFEL; a_branch: INTEGER)
179 -- Process `l_as' and use `separator' for string output
180 do
181 output.enter_child (l_as)
182 process_list_with_separator (l_as, separator, a_parent, a_branch)
183 output.exit_child
184 end
185
186 process_child_block_list (l_as: EIFFEL_LIST[AST_EIFFEL]; separator: STRING; a_parent: AST_EIFFEL; a_branch: INTEGER)
187 -- Process `l_as' and use `separator' for string output
188 do
189 output.enter_child (l_as)
190 output.enter_block
191 process_list_with_separator (l_as, separator, a_parent, a_branch)
192 output.exit_block
193 output.exit_child
194 end
195
196 process_list_with_separator (l_as: detachable EIFFEL_LIST[AST_EIFFEL]; separator: detachable STRING; a_parent: AST_EIFFEL; a_branch: INTEGER)
197 -- Process `l_as' and use `separator' for string output
198 local
199 l_cursor: INTEGER
200 do
201 from
202 l_cursor := l_as.index
203 l_as.start
204 until
205 l_as.after
206 loop
207 process_child (l_as.item, l_as, l_as.index)
208 if attached separator and l_as.index /= l_as.count then
209 output.append_string(separator)
210 end
211 l_as.forth
212 end
213 l_as.go_i_th (l_cursor)
214 end
215
216 process_identifier_list (l_as: IDENTIFIER_LIST)
217 -- Process `l_as'
218 local
219 l_cursor: INTEGER
220 do
221 -- process the id's list
222 -- which is not an ast but an array of indexes into the names heap
223 from
224 l_cursor := l_as.index
225 l_as.start
226 until
227 l_as.after
228 loop
229 output.append_string(names_heap.item (l_as.item))
230 if l_as.index /= l_as.count then
231 output.append_string(ti_comma+ti_Space)
232 end
233
234 l_as.forth
235 end
236 l_as.go_i_th (l_cursor)
237 end
238
239 process_block (l_as: AST_EIFFEL; a_parent: AST_EIFFEL; a_branch: INTEGER)
240 -- Process as block
241 do
242 output.enter_block
243 process(l_as, a_parent, a_branch)
244 output.exit_block
245 end
246
247 process_child (l_as: AST_EIFFEL; a_parent: AST_EIFFEL; a_branch: INTEGER)
248 -- Process as child
249 do
250 output.enter_child (l_as)
251 process(l_as, a_parent, a_branch)
252 output.exit_child
253 end
254
255 process_child_if_needed (l_as: AST_EIFFEL; a_parent: AST_EIFFEL; a_branch: INTEGER)
256 -- Process if needed
257 do
258 if processing_needed (l_as, a_parent, a_branch) then
259 process_child (l_as, a_parent, a_branch)
260 end
261 end
262
263 process_child_block (l_as: AST_EIFFEL; a_parent: AST_EIFFEL; a_branch: INTEGER)
264 -- Process as child and block
265 do
266 output.enter_block
267 output.enter_child (l_as)
268 process(l_as, a_parent, a_branch)
269 output.exit_child
270 output.exit_block
271 end
272
273 feature -- Output
274
275 output: ETR_AST_STRUCTURE_OUTPUT_I
276
277 print_ast_to_output (a_ast: detachable AST_EIFFEL)
278 -- Prints `a_ast' to `output'.
279 do
280 process_child (a_ast, void, 0)
281 end
282
283 feature {AST_EIFFEL} -- Roundtrip: Atomic
284
285 process_bit_const_as (l_as: BIT_CONST_AS)
286 do
287 output.append_string (l_as.value.name)
288 output.append_string ("b")
289 end
290
291 process_bool_as (l_as: BOOL_AS)
292 do
293 output.append_string (l_as.string_value)
294 end
295
296 process_char_as (l_as: CHAR_AS)
297 do
298 output.append_string (l_as.string_value)
299 end
300
301 process_typed_char_as (l_as: TYPED_CHAR_AS)
302 do
303 output.append_string (ti_L_curly)
304 process_child_if_needed(l_as.type, l_as, 1)
305 output.append_string (ti_R_curly)
306 output.append_string (l_as.string_value)
307 end
308
309 process_string_as (l_as: STRING_AS)
310 do
311 output.append_string (l_as.string_value)
312 end
313
314 process_verbatim_string_as (l_as: VERBATIM_STRING_AS)
315 local
316 l_lines: LIST[STRING]
317 l_depth: INTEGER
318 do
319 if l_as.is_once_string then
320 output.append_string (ti_once_keyword+ti_space)
321 end
322
323 output.append_string (ti_Double_quote+l_as.verbatim_marker)
324
325 if l_as.is_indentable then
326 output.append_string (ti_l_bracket)
327 else
328 output.append_string (ti_l_curly)
329 end
330
331 output.append_string (ti_new_line)
332
333 output.enter_block
334 output.enter_block
335
336 if not l_as.is_indentable then
337 l_depth := output.block_depth
338 output.set_block_depth (0)
339 end
340
341 if not l_as.value.is_empty then
342 from
343 l_lines := l_as.value.split ('%N')
344 l_lines.start
345 until
346 l_lines.after
347 loop
348 output.append_string (l_lines.item)
349 l_lines.forth
350 if not l_lines.after then
351 output.append_string (ti_new_line)
352 end
353 end
354 end
355
356 if not l_as.is_indentable then
357 output.set_block_depth (l_depth)
358 end
359
360 output.exit_block
361
362 output.append_string (ti_new_line)
363
364 if l_as.is_indentable then
365 output.append_string (ti_r_bracket)
366 else
367 output.append_string (ti_r_curly)
368 end
369
370 output.append_string (l_as.verbatim_marker + ti_double_quote)
371
372 output.exit_block
373 end
374
375 process_integer_as (l_as: INTEGER_AS)
376 do
377 if processing_needed (l_as.constant_type, l_as, 1) then
378 output.append_string (ti_l_curly)
379 process_child (l_as.constant_type, l_as, 1)
380 output.append_string (ti_r_curly+ti_space)
381 end
382
383 if l_as.has_integer (32) then
384 output.append_string (l_as.string_value)
385 elseif l_as.has_integer (64) then
386 -- Can't be represented as 32bit INT
387 -- string_value will fail, use 64bit value
388 output.append_string (l_as.integer_64_value.out)
389 else
390 -- Use NATURAL_64 value
391 output.append_string (l_as.natural_64_value.out)
392 end
393 end
394
395 process_real_as (l_as: REAL_AS)
396 do
397 if processing_needed (l_as.constant_type, l_as, 1) then
398 output.append_string (ti_l_curly)
399 process_child (l_as.constant_type, l_as, 1)
400 output.append_string (ti_r_curly+ti_space)
401 end
402
403 output.append_string (l_as.value)
404 end
405
406 process_id_as (l_as: ID_AS)
407 do
408 output.append_string (l_as.name)
409 end
410
411 process_unique_as (l_as: UNIQUE_AS)
412 do
413 output.append_string (ti_unique_keyword)
414 end
415
416 feature {AST_EIFFEL} -- Roundtrip: Instructions
417
418 process_case_as (l_as: CASE_AS)
419 do
420 output.append_string (ti_When_keyword+ti_Space)
421 process_child_list (l_as.interval, ti_comma+ti_space, l_as, 1)
422 output.append_string (ti_Space+ti_Then_keyword+ti_New_line)
423 if processing_needed (l_as.compound, l_as, 2) then
424 process_child_block (l_as.compound, l_as, 2)
425 end
426 end
427
428 process_interval_as (l_as: INTERVAL_AS)
429 do
430 process_child(l_as.lower, l_as, 1)
431 if processing_needed (l_as.upper, l_as, 2) then
432 output.append_string (ti_Dotdot)
433 process_child(l_as.upper, l_as, 2)
434 end
435 end
436
437 process_inspect_as (l_as: INSPECT_AS)
438 do
439 output.append_string (ti_inspect_keyword+ti_New_line)
440 process_child_block (l_as.switch, l_as, 1)
441 output.append_string (ti_New_line)
442
443 if processing_needed (l_as.case_list, l_as, 2) then
444 process_child (l_as.case_list, l_as, 2)
445 end
446
447 if processing_needed (l_as.else_part, l_as, 3) then
448 output.append_string (ti_else_keyword+ti_New_line)
449 process_child_block (l_as.else_part, l_as, 3)
450 end
451
452 output.append_string (ti_End_keyword+ti_New_line)
453 end
454
455 process_instr_call_as (l_as: INSTR_CALL_AS)
456 do
457 process_child (l_as.call, l_as, 1)
458 output.append_string(ti_New_line)
459 end
460
461 process_assigner_call_as (l_as: ASSIGNER_CALL_AS)
462 do
463 process_child (l_as.target, l_as, 1)
464 output.append_string(ti_Space+ti_Assign+ti_Space)
465 process_child (l_as.source, l_as, 2)
466 output.append_string(ti_New_line)
467 end
468
469 process_assign_as (l_as: ASSIGN_AS)
470 do
471 process_child (l_as.target, l_as, 1)
472 output.append_string(ti_Space+ti_Assign+ti_Space)
473 process_child (l_as.source, l_as, 2)
474 output.append_string(ti_New_line)
475 end
476
477 process_reverse_as (l_as: REVERSE_AS)
478 do
479 process_child (l_as.target, l_as, 1)
480 output.append_string(ti_Space+ti_Reverse_assign+ti_Space)
481 process_child (l_as.source, l_as, 2)
482 output.append_string(ti_New_line)
483 end
484
485 process_creation_as (l_as: CREATION_AS)
486 do
487 output.append_string (ti_create_keyword+ti_Space)
488
489 if processing_needed (l_as.type, l_as, 2) then
490 output.append_string(ti_l_curly)
491 process_child (l_as.type, l_as, 2)
492 output.append_string(ti_r_curly+ti_Space)
493 end
494 process(l_as.target, l_as, 1)
495 if processing_needed (l_as.call, l_as, 3) then
496 output.append_string (ti_dot)
497 process_child (l_as.call, l_as, 3)
498 end
499
500 output.append_string(ti_New_line)
501 end
502
503 process_debug_as (l_as: DEBUG_AS)
504 do
505 if processing_needed (l_as.internal_keys, l_as, 1) then
506 process_child_list (l_as.internal_keys.keys, ", ", l_as, 1)
507 end
508
509 output.append_string(ti_debug_keyword+ti_New_line)
510 if processing_needed (l_as.compound, l_as, 2) then
511 process_child_block(l_as.compound, l_as, 2)
512 end
513
514 output.append_string(ti_End_keyword+ti_New_line)
515 end
516
517 process_check_as (l_as: CHECK_AS)
518 do
519 output.append_string (ti_check_keyword+ti_New_line)
520 if processing_needed (l_as.check_list, l_as, 1) then
521 process_child_block (l_as.check_list, l_as, 1)
522 end
523 output.append_string (ti_End_keyword+ti_New_line)
524 end
525
526 process_retry_as (l_as: RETRY_AS)
527 do
528 output.append_string (ti_retry_keyword+ti_New_line)
529 end
530
531 process_if_as (l_as: IF_AS)
532 do
533 output.append_string (ti_if_keyword+ti_Space)
534 process_child (l_as.condition, l_as, 1)
535 output.append_string (ti_Space+ti_then_keyword+ti_New_line)
536
537 if processing_needed (l_as.compound, l_as, 2) then
538 process_child_block_list (l_as.compound, void, l_as, 2)
539 end
540
541 if processing_needed (l_as.elsif_list, l_as, 3) then
542 process_child (l_as.elsif_list, l_as, 3)
543 end
544
545 if processing_needed (l_as.else_part, l_as, 4) then
546 output.append_string(ti_else_keyword+ti_New_line)
547 process_child_block_list(l_as.else_part, void, l_as, 4)
548 end
549 output.append_string (ti_End_keyword+ti_New_line)
550 end
551
552 process_elseif_as (l_as: ELSIF_AS)
553 do
554 output.append_string (ti_elseif_keyword+ti_Space)
555 process_child(l_as.expr, l_as, 1)
556 output.append_string (ti_Space+ti_then_keyword+ti_New_line)
557 if processing_needed (l_as.compound, l_as, 2) then
558 process_child_block_list(l_as.compound, void, l_as, 2)
559 end
560 end
561
562 process_loop_as (l_as: LOOP_AS)
563 do
564 if processing_needed (l_as.iteration, l_as, 6) then
565 output.append_string(ti_across_keyword+ti_New_line)
566 process_child_block(l_as.iteration, l_as, 6)
567 output.append_string (ti_New_line)
568 end
569
570 if processing_needed (l_as.from_part, l_as, 1) or not processing_needed (l_as.iteration, l_as, 6) then
571 output.append_string(ti_from_keyword+ti_New_line)
572 end
573
574 if processing_needed (l_as.from_part, l_as, 1) then
575 process_child_block(l_as.from_part, l_as, 1)
576 end
577
578 if processing_needed (l_as.full_invariant_list, l_as, 2) then
579 output.append_string (ti_invariant_keyword+ti_New_line)
580 process_child_block_list(l_as.full_invariant_list, void, l_as, 2)
581 output.append_string (ti_New_line)
582 end
583
584 if processing_needed (l_as.variant_part, l_as, 5) then
585 output.append_string (ti_variant_keyword+ti_New_line)
586 process_child_block(l_as.variant_part, l_as, 5)
587 output.append_string (ti_New_line)
588 end
589
590 if processing_needed (l_as.stop, l_as, 3) then
591 output.append_string (ti_until_keyword+ti_New_line)
592 process_child_block (l_as.stop, l_as, 3)
593 output.append_string (ti_New_line)
594 end
595
596 output.append_string (ti_loop_keyword+ti_New_line)
597
598 if processing_needed (l_as.compound, l_as, 4) then
599 process_child_block_list(l_as.compound, void, l_as, 4)
600 end
601
602 output.append_string (ti_End_keyword+ti_New_line)
603 end
604
605 feature {AST_EIFFEL} -- Roundtrip: Inheritance
606
607 process_rename_as (l_as: RENAME_AS)
608 do
609 process(l_as.old_name, l_as, 1)
610 output.append_string (ti_Space+ti_as_keyword+ti_Space)
611 process (l_as.new_name, l_as, 2)
612 end
613
614 process_export_item_as (l_as: EXPORT_ITEM_AS)
615 do
616 process_child (l_as.clients, l_as, 1)
617 output.append_string (ti_Space)
618 process_child (l_as.features, l_as, 2)
619 output.append_string (ti_New_line)
620 end
621
622 process_all_as (l_as: ALL_AS)
623 do
624 output.append_string (ti_all_keyword)
625 end
626
627 process_parent_as (l_as: PARENT_AS)
628 local
629 was_processed: BOOLEAN
630 do
631 process_child(l_as.type, l_as, 1)
632
633 output.append_string (ti_New_line)
634
635 output.enter_block
636
637 if processing_needed (l_as.renaming, l_as, 2) then
638 output.append_string (ti_rename_keyword+ti_New_line)
639 output.enter_block
640 process_child_list(l_as.renaming, ti_comma+ti_New_line, l_as, 2)
641 output.append_string (ti_New_line)
642 output.exit_block
643 was_processed := true
644 end
645
646 if processing_needed (l_as.exports, l_as, 3) then
647 output.append_string (ti_export_keyword+ti_New_line)
648 process_child_block_list(l_as.exports, void, l_as, 3)
649 was_processed := true
650 end
651
652 if processing_needed (l_as.undefining, l_as, 4) then
653 output.append_string (ti_undefine_keyword+ti_New_line)
654 output.enter_block
655 process_child_list (l_as.undefining, ti_comma+ti_New_line, l_as, 4)
656 output.append_string (ti_New_line)
657 output.exit_block
658 was_processed := true
659 end
660
661 if processing_needed (l_as.redefining, l_as, 5) then
662 output.append_string (ti_redefine_keyword+ti_New_line)
663 output.enter_block
664 process_child_list (l_as.redefining, ti_comma+ti_New_line, l_as, 5)
665 output.append_string (ti_New_line)
666 output.exit_block
667 was_processed := true
668 end
669
670 if processing_needed (l_as.selecting, l_as, 6) then
671 output.append_string (ti_select_keyword+ti_New_line)
672 output.enter_block
673 process_child_list (l_as.selecting, ti_comma+ti_New_line, l_as, 6)
674 output.append_string (ti_New_line)
675 output.exit_block
676 was_processed := true
677 end
678
679 if was_processed then
680 output.append_string (ti_End_keyword+ti_New_line)
681 end
682
683 output.exit_block
684 end
685
686 feature {AST_EIFFEL} -- Roundtrip: Contracts
687
688 process_variant_as (l_as: VARIANT_AS)
689 do
690 process_child(l_as.expr, l_as, 1)
691 end
692
693 process_invariant_as (l_as: INVARIANT_AS)
694 do
695 output.append_string (ti_invariant_keyword+ti_New_line)
696 if processing_needed(l_as.full_assertion_list, l_as, 1) then
697 process_child_block_list(l_as.full_assertion_list, void, l_as, 1)
698 end
699 end
700
701 process_require_as (l_as: REQUIRE_AS)
702 do
703 output.append_string (ti_require_keyword+ti_New_line)
704 if processing_needed(l_as.full_assertion_list, l_as, 1) then
705 process_child_block (l_as.full_assertion_list, l_as, 1)
706 end
707 end
708
709 process_require_else_as (l_as: REQUIRE_ELSE_AS)
710 do
711
712 output.append_string (ti_require_else_keyword+ti_New_line)
713 if processing_needed(l_as.full_assertion_list, l_as, 1) then
714 process_child_block (l_as.full_assertion_list, l_as, 1)
715 end
716 end
717
718 process_ensure_as (l_as: ENSURE_AS)
719 do
720 output.append_string (ti_ensure_keyword+ti_New_line)
721 if processing_needed(l_as.full_assertion_list, l_as, 1) then
722 process_child_block (l_as.full_assertion_list, l_as, 1)
723 end
724 end
725
726 process_ensure_then_as (l_as: ENSURE_THEN_AS)
727 do
728 output.append_string (ti_ensure_then_keyword+ti_New_line)
729 if processing_needed(l_as.full_assertion_list, l_as, 1) then
730 process_child_block (l_as.full_assertion_list, l_as, 1)
731 end
732 end
733
734 feature {AST_EIFFEL} -- Roundtrip: Types
735
736 process_bits_as (l_as: BITS_AS)
737 do
738 output.append_string (ti_Bit_class+ti_Space)
739 process(l_as.bits_value, l_as, 1)
740 end
741
742 process_none_type_as (l_as: NONE_TYPE_AS)
743 do
744 output.append_string (ti_none_class)
745 end
746
747 process_class_type_as (l_as: CLASS_TYPE_AS)
748 do
749 if l_as.has_separate_mark then
750 output.append_string (ti_separate_keyword+ti_Space)
751 end
752
753 if l_as.has_attached_mark then
754 output.append_string (ti_attached_keyword+ti_Space)
755 elseif l_as.has_detachable_mark then
756 output.append_string (ti_detachable_keyword+ti_Space)
757 end
758
759 process_child(l_as.class_name, l_as, 1)
760 end
761
762 process_generic_class_type_as (l_as: GENERIC_CLASS_TYPE_AS)
763 do
764 if l_as.has_separate_mark then
765 output.append_string (ti_separate_keyword+ti_Space)
766 end
767
768 if l_as.has_attached_mark then
769 output.append_string (ti_attached_keyword+ti_Space)
770 elseif l_as.has_detachable_mark then
771 output.append_string (ti_detachable_keyword+ti_Space)
772 end
773
774 process_child(l_as.class_name, l_as, 1)
775 if processing_needed (l_as.generics, l_as, 2) then
776 output.append_string (ti_L_bracket)
777 process_child_list (l_as.generics, ti_comma+ti_Space, l_as, 2)
778 output.append_string (ti_R_bracket)
779 end
780 end
781
782 process_formal_argu_dec_list_as (l_as: FORMAL_ARGU_DEC_LIST_AS)
783 do
784 process_child_list (l_as.arguments, ti_semi_colon+ti_space, l_as, 1)
785 end
786
787 process_named_tuple_type_as (l_as: NAMED_TUPLE_TYPE_AS)
788 do
789 if l_as.has_separate_mark then
790 output.append_string (ti_separate_keyword+ti_Space)
791 end
792
793 if l_as.has_attached_mark then
794 output.append_string (ti_attached_keyword+ti_Space)
795 elseif l_as.has_detachable_mark then
796 output.append_string (ti_detachable_keyword+ti_Space)
797 end
798
799 process_child(l_as.class_name, l_as, 1)
800
801 if processing_needed (l_as.parameters, l_as, 2) then
802 output.append_string (ti_l_bracket)
803 process_child(l_as.parameters, l_as, 2)
804 output.append_string (ti_r_bracket)
805 end
806
807 end
808
809 process_constraining_type_as (l_as: CONSTRAINING_TYPE_AS)
810 do
811 process_child(l_as.type, l_as, 1)
812 if processing_needed(l_as.renaming, l_as, 2) then
813 process_child(l_as.renaming, l_as, 2)
814 end
815 end
816
817 process_like_id_as (l_as: LIKE_ID_AS)
818 do
819 if l_as.has_attached_mark then
820 output.append_string (ti_attached_keyword+ti_Space)
821 elseif l_as.has_detachable_mark then
822 output.append_string (ti_detachable_keyword+ti_Space)
823 end
824
825 output.append_string (ti_like_keyword+ti_Space)
826 process(l_as.anchor, l_as, 1)
827 end
828
829 process_like_cur_as (l_as: LIKE_CUR_AS)
830 do
831 if l_as.has_attached_mark then
832 output.append_string (ti_attached_keyword+ti_Space)
833 elseif l_as.has_detachable_mark then
834 output.append_string (ti_detachable_keyword+ti_Space)
835 end
836 output.append_string (ti_like_keyword+ti_Space+ti_current)
837 end
838
839 process_formal_as (l_as: FORMAL_AS)
840 do
841 process (l_as.name, l_as, 1)
842 end
843
844 feature {AST_EIFFEL} -- Roundtrip: Expressions
845
846 process_converted_expr_as (l_as: CONVERTED_EXPR_AS)
847 do
848 process_child(l_as.expr, l_as, 1)
849 end
850
851 process_address_result_as (l_as: ADDRESS_RESULT_AS)
852 do
853 output.append_string (ti_dollar+ti_result)
854 end
855
856 process_address_current_as (l_as: ADDRESS_CURRENT_AS)
857 do
858 output.append_string (ti_dollar+ti_current)
859 end
860
861 process_un_strip_as (l_as: UN_STRIP_AS)
862 do
863 output.append_string (ti_strip_keyword+ti_Space+ti_l_parenthesis)
864 process_identifier_list (l_as.id_list)
865 output.append_string (ti_r_parenthesis)
866 end
867
868 process_address_as (l_as: ADDRESS_AS)
869 do
870 output.append_string (ti_Dollar)
871 process_child(l_as.feature_name, l_as, 1)
872 end
873
874 process_expr_call_as (l_as: EXPR_CALL_AS)
875 do
876 process_child(l_as.call, l_as, 1)
877 end
878
879 process_expr_address_as (l_as: EXPR_ADDRESS_AS)
880 do
881 output.append_string (ti_Dollar+ti_l_parenthesis)
882 process_child(l_as.expr, l_as, 1)
883 output.append_string (ti_r_parenthesis)
884 end
885
886 process_type_expr_as (l_as: TYPE_EXPR_AS)
887 do
888 output.append_string (ti_l_curly)
889 process_child (l_as.type, l_as, 1)
890 output.append_string (ti_r_curly)
891 end
892
893 process_custom_attribute_as (l_as: CUSTOM_ATTRIBUTE_AS)
894 do
895 process_child (l_as.creation_expr, l_as, 1)
896 process_child (l_as.tuple, l_as, 2)
897 end
898
899 process_array_as (l_as: ARRAY_AS)
900 do
901 output.append_string (ti_l_array+ti_Space)
902 process_child_list (l_as.expressions, ti_comma+ti_Space, l_as, 1)
903 output.append_string (ti_Space+ti_r_array)
904 end
905
906 process_bracket_as (l_as: BRACKET_AS)
907 do
908 process_child(l_as.target, l_as, 1)
909 output.append_string (ti_l_bracket)
910
911 process_child_list (l_as.operands, ti_comma+ti_Space, l_as, 2)
912
913 output.append_string (ti_r_bracket)
914 end
915
916 process_nested_expr_as (l_as: NESTED_EXPR_AS)
917 do
918 if attached {BRACKET_AS}l_as.target then
919 process_child(l_as.target, l_as, 1)
920 else
921 output.append_string (ti_l_parenthesis)
922 process_child(l_as.target, l_as, 1)
923 output.append_string (ti_r_parenthesis)
924 end
925
926 output.append_string (ti_dot)
927 process_child(l_as.message, l_as, 2)
928 end
929
930 process_tuple_as (l_as: TUPLE_AS)
931 do
932 output.append_string (ti_l_bracket)
933 process_child_list (l_as.expressions, ti_comma+ti_Space, l_as, 1)
934 output.append_string (ti_r_bracket)
935 end
936
937 process_tagged_as (l_as: TAGGED_AS)
938 do
939 if processing_needed (l_as.tag, l_as, 1) then
940 process(l_as.tag, l_as, 1)
941 output.append_string(ti_colon+ti_Space)
942 end
943 process_child_if_needed (l_as.expr, l_as, 2)
944 output.append_string (ti_New_line)
945 end
946
947 process_void_as (l_as: VOID_AS)
948 do
949 output.append_string (ti_void)
950 end
951
952 process_paran_as (l_as: PARAN_AS)
953 do
954 output.append_string (ti_l_parenthesis)
955 process_child(l_as.expr, l_as, 1)
956 output.append_string (ti_r_parenthesis)
957 end
958
959 process_binary_as (l_as: BINARY_AS)
960 do
961 process_child (l_as.left, l_as, 1)
962 output.append_string (ti_Space)
963 process_child (l_as.op_name, l_as, 2)
964 output.append_string (ti_Space)
965 process_child (l_as.right, l_as, 3)
966 end
967
968 process_unary_as (l_as: UNARY_AS)
969 do
970 process_child (l_as.operator_ast, l_as, 1)
971 output.append_string (ti_Space)
972 process_child (l_as.expr, l_as, 2)
973 end
974
975 process_object_test_as (l_as: OBJECT_TEST_AS)
976 do
977 if l_as.is_attached_keyword then
978 output.append_string (ti_attached_keyword+ti_Space)
979 if processing_needed (l_as.type, l_as, 1) then
980 output.append_string (ti_l_curly)
981 process_child (l_as.type, l_as, 1)
982 output.append_string (ti_r_curly)
983 end
984 process_child (l_as.expression, l_as, 2)
985 if processing_needed (l_as.name, l_as, 3) then
986 output.append_string (ti_Space+ti_as_keyword+ti_Space)
987 output.append_string (l_as.name.name)
988 end
989 else
990 -- looks like this:
991 -- {name: TYPE} expr
992
993 output.append_string (ti_l_curly)
994
995 if processing_needed (l_as.name, l_as, 3) then
996 output.append_string (l_as.name.name+ti_colon+ti_space)
997 end
998
999 process_child_if_needed (l_as.type, l_as, 1)
1000 output.append_string (ti_r_curly+ti_space)
1001 process_child_if_needed (l_as.expression, l_as, 2)
1002 end
1003 end
1004
1005 process_loop_expr_as (l_as: LOOP_EXPR_AS)
1006 do
1007 output.append_string(ti_across_keyword+ti_space)
1008 process_child_block (l_as.iteration, l_as, 1)
1009 output.append_string (ti_space)
1010
1011 if processing_needed (l_as.full_invariant_list, l_as, 2) then
1012 output.append_string (ti_invariant_keyword+ti_space)
1013 process_child_block_list(l_as.full_invariant_list, void, l_as, 2)
1014 output.append_string (ti_space)
1015 end
1016
1017 if processing_needed (l_as.exit_condition, l_as, 3) then
1018 output.append_string (ti_until_keyword+ti_space)
1019 process_child_block(l_as.exit_condition, l_as, 3)
1020 output.append_string (ti_space)
1021 end
1022
1023 if l_as.is_all then
1024 output.append_string (ti_all_keyword+ti_space)
1025 else
1026 output.append_string (ti_some_keyword+ti_space)
1027 end
1028 process_child_block(l_as.expression, l_as, 4)
1029 output.append_string (ti_space)
1030
1031 if processing_needed (l_as.variant_part, l_as, 5) then
1032 output.append_string (ti_variant_keyword+ti_space)
1033 process_child_block(l_as.variant_part, l_as, 5)
1034 output.append_string (ti_space)
1035 end
1036
1037 output.append_string (ti_End_keyword)
1038 end
1039
1040 feature {AST_EIFFEL} -- Roundtrip: Access
1041
1042 process_static_access_as (l_as: STATIC_ACCESS_AS)
1043 do
1044 output.append_string (ti_feature_keyword+ti_Space+ti_l_curly)
1045 process_child_if_needed(l_as.class_type, l_as, 1)
1046 output.append_string (ti_r_curly+ti_dot)
1047 output.append_string (l_as.feature_name.name)
1048 if processing_needed (l_as.parameters, l_as, 2) then
1049 output.append_string (ti_l_parenthesis)
1050 process_child_list (l_as.parameters, ti_comma+ti_Space, l_as, 2)
1051 output.append_string (ti_r_parenthesis)
1052 end
1053 end
1054
1055 process_precursor_as (l_as: PRECURSOR_AS)
1056 do
1057 output.append_string (ti_precursor_keyword+ti_Space)
1058 if processing_needed (l_as.parent_base_class,l_as,1) then
1059 output.append_string (ti_l_curly)
1060 process_child(l_as.parent_base_class, l_as, 1)
1061 output.append_string (ti_r_curly)
1062 end
1063 if processing_needed (l_as.parameters,l_as,2) then
1064 output.append_string (ti_Space+ti_l_parenthesis)
1065 process_child_list(l_as.parameters, ti_comma+ti_Space,l_as,2)
1066 output.append_string (ti_r_parenthesis)
1067 end
1068 end
1069
1070 process_result_as (l_as: RESULT_AS)
1071 do
1072 output.append_string (ti_result)
1073 end
1074
1075 process_current_as (l_as: CURRENT_AS)
1076 do
1077 output.append_string (ti_current)
1078 end
1079
1080 process_access_inv_as (l_as: ACCESS_INV_AS)
1081 do
1082 process(l_as.feature_name, l_as, 1)
1083 if processing_needed (l_as.parameters,l_as,2) then
1084 output.append_string (ti_Space+ti_l_parenthesis)
1085 process_child_list(l_as.parameters, ti_comma+ti_Space,l_as,2)
1086 output.append_string (ti_r_parenthesis)
1087 end
1088 end
1089
1090 process_access_feat_as (l_as: ACCESS_FEAT_AS)
1091 do
1092 output.append_string (l_as.access_name)
1093
1094 if processing_needed (l_as.parameters,l_as,1) then
1095 output.append_string (ti_Space+ti_l_parenthesis)
1096 process_child_list(l_as.parameters, ti_comma+ti_Space, l_as, 1)
1097 output.append_string (ti_r_parenthesis)
1098 end
1099 end
1100
1101 feature {AST_EIFFEL} -- Roundtrip: Inheritance clauses
1102
1103 process_rename_clause_as (l_as: RENAME_CLAUSE_AS)
1104 do
1105 output.append_string (ti_Space+ti_rename_keyword+ti_Space)
1106 process_child_list(l_as.content, ti_comma+ti_space, l_as, 1)
1107 output.append_string (ti_Space+ti_end_keyword+ti_Space)
1108 end
1109
1110 process_export_clause_as (l_as: EXPORT_CLAUSE_AS)
1111 do
1112 process_child(l_as.content, l_as, 1)
1113 end
1114
1115 process_undefine_clause_as (l_as: UNDEFINE_CLAUSE_AS)
1116 do
1117 process_child(l_as.content, l_as, 1)
1118 end
1119
1120 process_redefine_clause_as (l_as: REDEFINE_CLAUSE_AS)
1121 do
1122 process_child(l_as.content, l_as, 1)
1123 end
1124
1125 process_select_clause_as (l_as: SELECT_CLAUSE_AS)
1126 do
1127 process_child(l_as.content, l_as, 1)
1128 end
1129
1130 feature {AST_EIFFEL} -- Roundtrip: Misc
1131
1132 process_iteration_as (l_as: ITERATION_AS)
1133 do
1134 process_child (l_as.expression, l_as, 1)
1135
1136 output.append_string (ti_space+ti_as_keyword+ti_space)
1137 process_child (l_as.identifier, l_as, 2)
1138 end
1139
1140 process_infix_prefix_as (l_as: INFIX_PREFIX_AS)
1141 do
1142 if l_as.is_frozen then
1143 output.append_string (ti_frozen_keyword+ti_Space)
1144 end
1145
1146 if l_as.is_prefix then
1147 output.append_string (ti_prefix_keyword+ti_Space)
1148 elseif l_as.is_infix then
1149 output.append_string (ti_infix_keyword+ti_Space)
1150 end
1151
1152 process(l_as.alias_name, l_as, 1)
1153 end
1154
1155 process_formal_dec_as (l_as: FORMAL_DEC_AS)
1156 do
1157 if l_as.formal.is_expanded then
1158 output.append_string (ti_expanded_keyword+ti_Space)
1159 elseif l_as.formal.is_reference then
1160 output.append_string (ti_reference_keyword+ti_Space)
1161 end
1162
1163 process_child(l_as.formal, l_as, 1)
1164
1165 output.append_string (ti_Space+ti_Constraint+ti_Space)
1166
1167 if l_as.constraints.count>1 then
1168 output.append_string (ti_l_curly)
1169 end
1170 process_child_list (l_as.constraints, ti_comma+ti_Space, l_as, 2)
1171 if l_as.constraints.count>1 then
1172 output.append_string (ti_r_curly)
1173 end
1174
1175 if processing_needed (l_as.creation_feature_list, l_as, 3) then
1176 output.append_string (ti_Space+ti_create_keyword+ti_Space)
1177 process_child_list(l_as.creation_feature_list, ti_comma+ti_Space, l_as, 3)
1178 output.append_string (ti_Space+ti_end_keyword)
1179 end
1180 end
1181
1182 process_creation_expr_as (l_as: CREATION_EXPR_AS)
1183 do
1184 output.append_string (ti_create_keyword+ti_Space)
1185 output.append_string(ti_l_curly)
1186 process_child (l_as.type, l_as, 1)
1187 output.append_string(ti_r_curly)
1188 if processing_needed (l_as.call, l_as, 1) then
1189 output.append_string (ti_dot)
1190 process(l_as.call, l_as, 2)
1191 end
1192 end
1193
1194 process_routine_as (l_as: ROUTINE_AS)
1195 do
1196 if processing_needed (l_as.obsolete_message, l_as, 1) then
1197 output.append_string (ti_obsolete_keyword+ti_New_line)
1198 process_block (l_as.obsolete_message, l_as, 1)
1199 output.append_string (ti_New_line)
1200 end
1201
1202 if processing_needed (l_as.precondition, l_as, 2) then
1203 process_child (l_as.precondition, l_as, 2)
1204 end
1205
1206 if processing_needed (l_as.locals, l_as, 3) then
1207 output.append_string (ti_local_keyword+ti_New_line)
1208 output.enter_block
1209 process_child_list (l_as.locals, ti_New_line, l_as, 3)
1210 output.append_string (ti_New_line)
1211 output.exit_block
1212 end
1213
1214 process_child(l_as.routine_body, l_as, 4)
1215
1216 if processing_needed (l_as.postcondition, l_as, 5) then
1217 process_child (l_as.postcondition, l_as, 5)
1218 end
1219
1220 if processing_needed (l_as.rescue_clause, l_as, 6) then
1221 output.append_string(ti_rescue_keyword+ti_New_line)
1222 process_child_block (l_as.rescue_clause, l_as, 6)
1223 end
1224
1225 output.append_string(ti_End_keyword)
1226
1227 if not is_in_inline_agent then
1228 output.append_string (ti_new_line)
1229 end
1230 end
1231
1232 process_constant_as (l_as: CONSTANT_AS)
1233 do
1234 process (l_as.value, l_as, 1)
1235 output.append_string (ti_new_line)
1236 end
1237
1238 process_eiffel_list (l_as: EIFFEL_LIST [AST_EIFFEL])
1239 local
1240 l_cursor: INTEGER
1241 do
1242 from
1243 l_cursor := l_as.index
1244 l_as.start
1245 until
1246 l_as.after
1247 loop
1248 process_child(l_as.item, l_as, l_as.index)
1249 l_as.forth
1250 end
1251 l_as.go_i_th (l_cursor)
1252 end
1253
1254 process_convert_feat_as (l_as: CONVERT_FEAT_AS)
1255 do
1256 process_child(l_as.feature_name, l_as, 1)
1257 output.append_string (ti_colon+ti_Space+ti_l_curly)
1258 process_child_list(l_as.conversion_types, ti_comma+ti_Space, l_as, 2)
1259 output.append_string (ti_r_curly)
1260 end
1261
1262 process_feature_name_alias_as (l_as: FEATURE_NAME_ALIAS_AS)
1263 do
1264 if l_as.is_frozen then
1265 output.append_string(ti_frozen_keyword+ti_Space)
1266 end
1267
1268 process(l_as.feature_name, l_as, 1)
1269
1270 if processing_needed (l_as.alias_name,l_as,2) then
1271 output.append_string (ti_Space+ti_alias_keyword+ti_Space)
1272 process_child (l_as.alias_name, l_as, 2)
1273 end
1274 end
1275
1276 process_feat_name_id_as (l_as: FEAT_NAME_ID_AS)
1277 do
1278 if l_as.is_frozen then
1279 output.append_string(ti_frozen_keyword+ti_Space)
1280 end
1281
1282 process(l_as.feature_name, l_as, 1)
1283
1284 if processing_needed (l_as.alias_name, l_as, 2) then
1285 output.append_string (ti_Space+ti_alias_keyword+ti_Space)
1286 process_child (l_as.alias_name, l_as, 2)
1287 end
1288 end
1289
1290 process_type_dec_as (l_as: TYPE_DEC_AS)
1291 do
1292 process_identifier_list (l_as.id_list)
1293 output.append_string(ti_colon+ti_Space)
1294 process_child(l_as.type, l_as, 1)
1295 end
1296
1297 process_body_as (l_as: BODY_AS)
1298 do
1299 if processing_needed (l_as.arguments, l_as, 1) then
1300 output.append_string (ti_space+ti_l_parenthesis)
1301 process_child_list(l_as.arguments, ti_semi_colon+ti_Space, l_as, 1)
1302 output.append_string (ti_r_parenthesis)
1303 end
1304
1305 if processing_needed (l_as.type, l_as, 2) then
1306 output.append_string (ti_colon+ti_space)
1307 process_child (l_as.type, l_as, 2)
1308 end
1309
1310 if l_as.is_constant then
1311 output.append_string(ti_Space+ti_equal+ti_space)
1312 elseif processing_needed (l_as.assigner, l_as, 3) then
1313 output.append_string (ti_Space+ti_assign_keyword+ti_Space)
1314 process_child (l_as.assigner, l_as, 3)
1315 output.append_string(ti_New_line)
1316 elseif l_as.is_unique then
1317 output.append_string (ti_Space+ti_is_keyword+ti_Space+ti_unique_keyword)
1318 else
1319 output.append_string(ti_New_line)
1320 end
1321
1322 output.enter_block
1323
1324 if processing_needed (l_as.indexing_clause, l_as, 5) then
1325 output.append_string (ti_indexing_keyword+ti_new_line)
1326 process_child_block_list (l_as.indexing_clause, ti_new_line, l_as, 5)
1327 output.append_string (ti_new_line)
1328 end
1329
1330 if processing_needed (l_as.content, l_as, 4) then
1331 process_child(l_as.content, l_as, 4)
1332 end
1333
1334 output.exit_block
1335 end
1336
1337 process_feature_as (l_as: FEATURE_AS)
1338 do
1339 process_child_list(l_as.feature_names, ti_comma+ti_Space, l_as, 1)
1340 process_child(l_as.body, l_as, 2)
1341 end
1342
1343 process_feature_clause_as (l_as: FEATURE_CLAUSE_AS)
1344 do
1345 output.append_string(ti_feature_keyword+ti_Space)
1346 if processing_needed (l_as.clients, l_as, 1) then
1347 process_child(l_as.clients, l_as, 1)
1348 end
1349 output.append_string(ti_New_line+ti_new_line)
1350 process_child_block_list (l_as.features, ti_new_line, l_as, 2)
1351 end
1352
1353 process_class_list_as (l_as: CLASS_LIST_AS)
1354 -- Process `l_as'.
1355 do
1356 output.append_string(ti_l_curly)
1357 process_child_list(l_as, ti_comma+ti_Space, l_as, 1)
1358 output.append_string (ti_r_curly)
1359 end
1360
1361 process_class_as (l_as: CLASS_AS)
1362 do
1363 if processing_needed (l_as.top_indexes, l_as, 1) then
1364 output.append_string (ti_note_keyword+ti_new_line)
1365 process_child_block_list (l_as.top_indexes, ti_new_line, l_as, 1)
1366 output.append_string (ti_new_line+ti_new_line)
1367 end
1368
1369 if l_as.is_deferred then
1370 output.append_string(ti_deferred_keyword+ti_Space)
1371 end
1372
1373 if l_as.is_frozen then
1374 output.append_string(ti_frozen_keyword+ti_Space)
1375 end
1376
1377 if l_as.is_expanded then
1378 output.append_string(ti_expanded_keyword+ti_Space)
1379 end
1380
1381 if l_as.is_partial then
1382 output.append_string("partial"+ti_Space)
1383 end
1384
1385 output.append_string (ti_class_keyword+ti_New_line)
1386 output.enter_block
1387 process_child(l_as.class_name, l_as, 2)
1388 output.append_string (ti_new_line)
1389
1390 if processing_needed (l_as.generics, l_as, 3) then
1391 output.append_string (ti_l_bracket)
1392 process_child_list (l_as.generics, ti_comma+ti_Space, l_as, 3)
1393 output.append_string (ti_r_bracket)
1394 end
1395 output.append_string(ti_New_line)
1396 output.exit_block
1397
1398 if processing_needed (l_as.obsolete_message, l_as, 4) then
1399 output.append_string(ti_obsolete_keyword+ti_New_line)
1400 process_child_block(l_as.obsolete_message, l_as, 4)
1401 end
1402
1403 if processing_needed (l_as.conforming_parents, l_as, 5) then
1404 output.append_string (ti_inherit_keyword+ti_new_line)
1405 process_child_block_list (l_as.conforming_parents, ti_new_line, l_as, 5)
1406 end
1407
1408 if processing_needed (l_as.non_conforming_parents, l_as, 6) then
1409 output.append_string (ti_inherit_keyword+ti_space+ti_l_curly+ti_none_class+ti_r_curly+ti_new_line)
1410 process_child_block_list (l_as.non_conforming_parents, ti_new_line, l_as, 6)
1411 end
1412
1413 if processing_needed (l_as.creators, l_as, 7) then
1414 process_child (l_as.creators, l_as, 7)
1415 end
1416
1417 if processing_needed (l_as.convertors, l_as, 8) then
1418 output.append_string (ti_convert_keyword+ti_New_line)
1419 output.enter_block
1420 process_child_list(l_as.convertors, ti_comma+ti_New_line, l_as, 8)
1421 output.append_string (ti_New_line)
1422 output.exit_block
1423 end
1424
1425 output.append_string(ti_New_line)
1426
1427 if processing_needed (l_as.features, l_as, 9) then
1428 process_child_list (l_as.features, ti_new_line, l_as, 9)
1429 output.append_string (ti_new_line)
1430 end
1431
1432 if processing_needed (l_as.invariant_part, l_as, 10) then
1433 process_child(l_as.invariant_part, l_as, 10)
1434 end
1435
1436 if processing_needed (l_as.bottom_indexes, l_as, 11) then
1437 -- Semicolon is necessary if there was an attribute or constant before
1438 if l_as.features /= void and then not l_as.features.is_empty and then not l_as.features.last.features.is_empty and then (l_as.features.last.features.last.is_attribute or l_as.features.last.features.last.is_constant) then
1439 output.append_string (ti_semi_colon)
1440 end
1441
1442 output.append_string (ti_note_keyword+ti_new_line)
1443 process_child_block_list (l_as.bottom_indexes, ti_new_line, l_as, 11)
1444 output.append_string (ti_new_line)
1445 end
1446
1447 output.append_string (ti_End_keyword+ti_New_line)
1448 end
1449
1450 process_index_as (l_as: INDEX_AS)
1451 do
1452 process_child (l_as.tag, l_as, 1)
1453 output.append_string (": ")
1454 process_child_list (l_as.index_list, ti_comma+ti_space, l_as, 2)
1455 end
1456
1457 process_nested_as (l_as: NESTED_AS)
1458 do
1459 process_child (l_as.target, l_as, 1)
1460 output.append_string (ti_dot)
1461 process_child (l_as.message, l_as, 2)
1462 end
1463
1464 process_create_as (l_as: CREATE_AS)
1465 do
1466 output.append_string (ti_create_keyword+ti_Space)
1467 if processing_needed (l_as.clients, l_as, 1) then
1468 process_child(l_as.clients, l_as, 1)
1469 end
1470 output.append_string (ti_New_line)
1471
1472 output.enter_block
1473 process_child_list (l_as.feature_list, ti_comma+ti_New_line, l_as, 2)
1474 output.append_string (ti_New_line)
1475 output.exit_block
1476 end
1477
1478 process_client_as (l_as: CLIENT_AS)
1479 do
1480 output.append_string (ti_l_curly)
1481 process_child_list (l_as.clients, ti_comma+ti_Space, l_as, 1)
1482 output.append_string (ti_r_curly)
1483 end
1484
1485 feature {AST_EIFFEL} -- Roundtrip: Routine body
1486
1487 process_attribute_as (l_as: ATTRIBUTE_AS)
1488 do
1489 output.append_string (ti_attribute_keyword+ti_New_line)
1490 if processing_needed (l_as.compound, l_as, 1) then
1491 process_child_block (l_as.compound, l_as, 1)
1492 end
1493 output.append_string (ti_New_line)
1494 end
1495
1496 process_deferred_as (l_as: DEFERRED_AS)
1497 do
1498 output.append_string (ti_deferred_keyword+ti_New_line)
1499 end
1500
1501 process_do_as (l_as: DO_AS)
1502 do
1503 output.append_string (ti_do_keyword+ti_New_line)
1504 if processing_needed (l_as.compound, l_as, 1) then
1505 process_child_block_list (l_as.compound, void, l_as, 1)
1506 end
1507 output.append_string (ti_end_keyword+ti_New_line)
1508 end
1509
1510 process_once_as (l_as: ONCE_AS)
1511 do
1512 output.append_string (ti_once_keyword+ti_New_line)
1513 if processing_needed (l_as.compound, l_as, 1) then
1514 process_child_block (l_as.compound, l_as, 1)
1515 end
1516 end
1517
1518 process_external_as (l_as: EXTERNAL_AS)
1519 do
1520 output.append_string (ti_external_keyword+ti_New_line)
1521 output.enter_block
1522 if l_as.is_built_in then
1523 output.append_string ("%"built_in%"")
1524 else
1525 process(l_as.language_name.language_name, l_as, 1)
1526 end
1527 output.exit_block
1528 output.append_string (ti_New_line)
1529
1530 if processing_needed (l_as.alias_name_literal, l_as, 2) then
1531 output.append_string (ti_alias_keyword+ti_New_line)
1532 process_block (l_as.alias_name_literal, l_as, 2)
1533 output.append_string (ti_New_line)
1534 end
1535 end
1536
1537 feature {AST_EIFFEL} -- Roundtrip: Agents
1538
1539 process_inline_agent_creation_as (l_as: INLINE_AGENT_CREATION_AS)
1540 do
1541 output.enter_block
1542 output.append_string (ti_agent_keyword+ti_Space)
1543
1544 is_in_inline_agent := true
1545 process_child(l_as.body, l_as, 1)
1546 is_in_inline_agent := false
1547
1548 if processing_needed(l_as.operands, l_as, 2) then
1549 output.append_string (ti_l_parenthesis)
1550 process_child_list (l_as.operands, ti_comma+ti_Space, l_as, 2)
1551 output.append_string (ti_r_parenthesis)
1552 end
1553 output.exit_block
1554 end
1555
1556 process_agent_routine_creation_as (l_as: AGENT_ROUTINE_CREATION_AS)
1557 do
1558 output.append_string (ti_agent_keyword+ti_Space)
1559
1560 if processing_needed (l_as.target,l_as,1) then
1561 is_in_agent_target := true
1562 process_child(l_as.target,l_as, 1)
1563 is_in_agent_target := false
1564 output.append_string (ti_dot)
1565 end
1566
1567 process_child(l_as.feature_name,l_as, 2)
1568 if processing_needed (l_as.operands,l_as,3) then
1569 output.append_string (ti_l_parenthesis)
1570 process_child_list(l_as.operands, ti_comma+ti_Space, l_as, 3)
1571 output.append_string (ti_r_parenthesis)
1572 end
1573 end
1574
1575 process_operand_as (l_as: OPERAND_AS)
1576 do
1577 if l_as.is_open then
1578 if processing_needed (l_as.class_type, l_as, 1) then
1579 output.append_string (ti_l_curly)
1580 process_child (l_as.class_type, l_as, 1)
1581 output.append_string (ti_r_curly)
1582 end
1583 if not is_in_agent_target then
1584 output.append_string (ti_Question)
1585 end
1586 else
1587 if processing_needed(l_as.target, l_as, 3) then
1588 process_child(l_as.target, l_as, 3)
1589 end
1590
1591 if processing_needed (l_as.expression, l_as, 2) then
1592 output.append_string (ti_l_parenthesis)
1593 process_child(l_as.expression, l_as, 2)
1594 output.append_string (ti_r_parenthesis)
1595 end
1596 end
1597 end
1598
1599 feature -- Quantifications
1600
1601 process_there_exists_as (a_as: THERE_EXISTS_AS)
1602 -- Process `a_as'.
1603 do
1604 output.append_string (ti_there_exists_keyword)
1605 output.append_string (ti_space)
1606 process_child_list(a_as.variables, ti_comma + ti_Space, a_as, 1)
1607 output.append_string (ti_space)
1608 output.append_string (ti_comma)
1609 output.append_string (ti_space)
1610 process_child (a_as.expression, a_as, 1)
1611 end
1612
1613 process_for_all_as (a_as: FOR_ALL_AS)
1614 -- Process `a_as'.
1615 do
1616 output.append_string (ti_for_all_keyword)
1617 output.append_string (ti_space)
1618 process_child_list(a_as.variables, ti_comma + ti_Space, a_as, 1)
1619 output.append_string (ti_space)
1620 output.append_string (ti_comma)
1621 output.append_string (ti_space)
1622 process_child (a_as.expression, a_as, 1)
1623 end
1624
1625 note
1626 copyright: "Copyright (c) 1984-2011, Eiffel Software"
1627 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
1628 licensing_options: "http://www.eiffel.com/licensing"
1629 copying: "[
1630 This file is part of Eiffel Software's Eiffel Development Environment.
1631
1632 Eiffel Software's Eiffel Development Environment is free
1633 software; you can redistribute it and/or modify it under
1634 the terms of the GNU General Public License as published
1635 by the Free Software Foundation, version 2 of the License
1636 (available at the URL listed under "license" above).
1637
1638 Eiffel Software's Eiffel Development Environment is
1639 distributed in the hope that it will be useful, but
1640 WITHOUT ANY WARRANTY; without even the implied warranty
1641 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1642 See the GNU General Public License for more details.
1643
1644 You should have received a copy of the GNU General Public
1645 License along with Eiffel Software's Eiffel Development
1646 Environment; if not, write to the Free Software Foundation,
1647 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1648 ]"
1649 source: "[
1650 Eiffel Software
1651 5949 Hollister Ave., Goleta, CA 93117 USA
1652 Telephone 805-685-1006, Fax 805-685-6869
1653 Website http://www.eiffel.com
1654 Customer support http://support.eiffel.com
1655 ]"
1656 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23