Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 73.0% 923 / 0 / 1264
Functions: -% 0 / 1 / 1
Branches: 67.3% 74 / 0 / 110

build_cmake/OMCompiler/Compiler/generated-mo/Template/AbsynDumpTpl.mo
Line Branch Exec Source
1 encapsulated package AbsynDumpTpl
2 "
3 file: AbsynDumpTpl.mo
4 package: AbsynDumpTpl
5 description: Generated by Susan.
6 "
7
8 public import Tpl;
9
10 public import Absyn;
11 public import AbsynUtil;
12 public import Util;
13 public import Config;
14 public import Dump;
15 public import System;
16 public import Flags;
17
18 protected function lm_9
19 input output Tpl.Text txt;
20 input list<Absyn.Class> items;
21 input Dump.DumpOptions a_options;
22 algorithm
23
2/2
✓ Branch 0 taken 200 times.
✓ Branch 1 taken 196 times.
396 for lstElt_9 in items loop
24 txt := match lstElt_9
25 local
26 Absyn.Class i_cls;
27
28 case i_cls
29 algorithm
30 200 txt := dumpClass(txt, i_cls, ";", a_options);
31 200 txt := Tpl.nextIter(txt);
32 then txt;
33 end match;
34 end for;
35 end lm_9;
36
37 public function dump
38 input Tpl.Text in_txt;
39 input Absyn.Program in_a_program;
40 input Dump.DumpOptions in_a_options;
41
42 output Tpl.Text out_txt;
43 algorithm
44 out_txt :=
45 match(in_txt, in_a_program, in_a_options)
46 local
47 Tpl.Text txt;
48 Dump.DumpOptions a_options;
49 list<Absyn.Class> i_classes;
50 Absyn.Within i_within__;
51 Tpl.Text l_cls__str;
52 Tpl.Text l_within__str;
53
54 case ( txt,
55 Absyn.PROGRAM(classes = {}),
56 _ )
57 then txt;
58
59 case ( txt,
60 Absyn.PROGRAM(within_ = i_within__, classes = i_classes),
61 a_options )
62 algorithm
63 196 l_within__str := dumpWithin(Tpl.emptyTxt, i_within__);
64 196 l_cls__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING_LIST({
65 "\n",
66 "\n"
67 }, true)), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
68 196 l_cls__str := lm_9(l_cls__str, i_classes, a_options);
69 196 l_cls__str := Tpl.popIter(l_cls__str);
70 196 txt := Tpl.writeText(txt, l_within__str);
71 196 txt := Tpl.writeText(txt, l_cls__str);
72 then txt;
73
74 case ( txt,
75 _,
76 _ )
77 then txt;
78 end match;
79 end dump;
80
81 public function dumpClass
82 input Tpl.Text txt;
83 input Absyn.Class a_cls;
84 input String a_sc;
85 input Dump.DumpOptions a_options;
86
87 output Tpl.Text out_txt;
88 algorithm
89 201 out_txt := dumpClassElement(txt, a_cls, "", "", "", "", a_sc, a_options);
90 end dumpClass;
91
92 public function dumpWithin
93 input Tpl.Text in_txt;
94 input Absyn.Within in_a_within;
95
96 output Tpl.Text out_txt;
97 algorithm
98 out_txt :=
99 match(in_txt, in_a_within)
100 local
101 Tpl.Text txt;
102 Absyn.Path i_path;
103 Tpl.Text l_path__str;
104
105 case ( txt,
106 Absyn.TOP() )
107 then txt;
108
109 case ( txt,
110 Absyn.WITHIN(path = i_path) )
111 algorithm
112 4 l_path__str := dumpPath(Tpl.emptyTxt, i_path);
113 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("within "));
114 4 txt := Tpl.writeText(txt, l_path__str);
115 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
116 ";\n",
117 "\n"
118 }, true));
119 then txt;
120
121 case ( txt,
122 _ )
123 algorithm
124 ✗ Tpl.addSourceTemplateError("Unknown operation", Tpl.sourceInfo("AbsynDumpTpl.tpl", 64, 56));
125 then txt;
126 end match;
127 end dumpWithin;
128
129 public function dumpClassHeader
130 input Tpl.Text in_txt;
131 input Absyn.Class in_a_cls;
132 input String in_a_final__str;
133 input String in_a_redecl__str;
134 input String in_a_repl__str;
135 input String in_a_io__str;
136
137 output Tpl.Text out_txt;
138 algorithm
139 out_txt :=
140 match(in_txt, in_a_cls, in_a_final__str, in_a_redecl__str, in_a_repl__str, in_a_io__str)
141 local
142 Tpl.Text txt;
143 String a_final__str;
144 String a_redecl__str;
145 String a_repl__str;
146 String a_io__str;
147 Absyn.Class i_cls;
148 Absyn.Restriction i_restriction;
149 Tpl.Text l_pref__str;
150 Tpl.Text l_res__str;
151
152 case ( txt,
153 (i_cls as Absyn.CLASS(restriction = i_restriction)),
154 a_final__str,
155 a_redecl__str,
156 a_repl__str,
157 a_io__str )
158 algorithm
159 7085 l_res__str := dumpRestriction(Tpl.emptyTxt, i_restriction);
160 7085 l_pref__str := dumpClassPrefixes(Tpl.emptyTxt, i_cls, a_final__str, a_redecl__str, a_repl__str, a_io__str);
161 7085 txt := Tpl.writeText(txt, l_pref__str);
162 7085 txt := Tpl.writeText(txt, l_res__str);
163 then txt;
164
165 case ( txt,
166 _,
167 _,
168 _,
169 _,
170 _ )
171 then txt;
172 end match;
173 end dumpClassHeader;
174
175 protected function lm_14
176 input output Tpl.Text txt;
177 input list<String> items;
178 algorithm
179
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
7 for lstElt_14 in items loop
180 txt := match lstElt_14
181 local
182 String i_cmt;
183
184 case i_cmt
185 algorithm
186 6 txt := Tpl.writeStr(txt, i_cmt);
187 then txt;
188 end match;
189 end for;
190 end lm_14;
191
192 protected function fun_15
193 input Tpl.Text in_txt;
194 input list<String> in_a_commentsBeforeClass;
195
196 output Tpl.Text out_txt;
197 algorithm
198 out_txt :=
199 match(in_txt, in_a_commentsBeforeClass)
200 local
201 Tpl.Text txt;
202 list<String> i_commentsBeforeClass;
203
204 case ( txt,
205 {} )
206 then txt;
207
208 case ( txt,
209 i_commentsBeforeClass )
210 algorithm
211 1 txt := lm_14(txt, i_commentsBeforeClass);
212 1 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
213 then txt;
214 end match;
215 end fun_15;
216
217 protected function lm_16
218 input output Tpl.Text txt;
219 input list<String> items;
220 algorithm
221 ✗ for lstElt_16 in items loop
222 txt := match lstElt_16
223 local
224 String i_it;
225
226 case i_it
227 algorithm
228 ✗ txt := Tpl.writeStr(txt, i_it);
229 then txt;
230 end match;
231 end for;
232 end lm_16;
233
234 protected function fun_17
235 input Tpl.Text in_txt;
236 input list<String> in_a_commentsAfterEnd;
237
238 output Tpl.Text out_txt;
239 algorithm
240 out_txt :=
241 match(in_txt, in_a_commentsAfterEnd)
242 local
243 Tpl.Text txt;
244 list<String> i_commentsAfterEnd;
245
246 case ( txt,
247 {} )
248 then txt;
249
250 case ( txt,
251 i_commentsAfterEnd )
252 algorithm
253 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
254 ✗ txt := lm_16(txt, i_commentsAfterEnd);
255 then txt;
256 end match;
257 end fun_17;
258
259 protected function smf_18
260 input Tpl.Text in_txt;
261 input Tpl.Text in_it;
262
263 output Tpl.Text out_txt;
264 algorithm
265 out_txt :=
266 match(in_txt, in_it)
267 local
268 Tpl.Text txt;
269 Tpl.Text i_cmt;
270
271 case ( txt,
272 i_cmt )
273 algorithm
274 7085 txt := Tpl.writeText(txt, i_cmt);
275 then txt;
276 end match;
277 end smf_18;
278
279 public function dumpClassElement
280 input Tpl.Text in_txt;
281 input Absyn.Class in_a_cls;
282 input String in_a_final__str;
283 input String in_a_redecl__str;
284 input String in_a_repl__str;
285 input String in_a_io__str;
286 input String in_a_sc;
287 input Dump.DumpOptions in_a_options;
288
289 output Tpl.Text out_txt;
290 algorithm
291 out_txt :=
292 match(in_txt, in_a_cls, in_a_final__str, in_a_redecl__str, in_a_repl__str, in_a_io__str, in_a_sc, in_a_options)
293 local
294 Tpl.Text txt;
295 String a_final__str;
296 String a_redecl__str;
297 String a_repl__str;
298 String a_io__str;
299 String a_sc;
300 Dump.DumpOptions a_options;
301 list<String> i_commentsAfterEnd;
302 list<String> i_commentsBeforeClass;
303 list<String> i_commentsBeforeEnd;
304 Absyn.Ident i_name;
305 Absyn.ClassDef i_body;
306 Absyn.Class i_cls;
307 Tpl.Text txt_3;
308 Tpl.Text l_beforeComment;
309 Tpl.Text l_body__str;
310 Tpl.Text l_header__str;
311
312 case ( txt,
313 (i_cls as Absyn.CLASS(body = i_body, name = i_name, commentsBeforeEnd = i_commentsBeforeEnd, commentsBeforeClass = i_commentsBeforeClass, commentsAfterEnd = i_commentsAfterEnd)),
314 a_final__str,
315 a_redecl__str,
316 a_repl__str,
317 a_io__str,
318 a_sc,
319 a_options )
320 algorithm
321 7085 l_header__str := dumpClassHeader(Tpl.emptyTxt, i_cls, a_final__str, a_redecl__str, a_repl__str, a_io__str);
322 7085 l_body__str := dumpClassDef(Tpl.emptyTxt, i_body, i_name, i_commentsBeforeEnd, a_options);
323 7085 l_beforeComment := fun_15(Tpl.emptyTxt, i_commentsBeforeClass);
324 7085 txt := Tpl.writeText(txt, l_beforeComment);
325 7085 txt := Tpl.writeText(txt, l_header__str);
326 7085 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
327 7085 txt := Tpl.writeText(txt, l_body__str);
328 7085 txt := Tpl.writeStr(txt, a_sc);
329 7085 txt_3 := fun_17(Tpl.emptyTxt, i_commentsAfterEnd);
330 7085 txt := smf_18(txt, txt_3);
331 then txt;
332
333 case ( txt,
334 _,
335 _,
336 _,
337 _,
338 _,
339 _,
340 _ )
341 then txt;
342 end match;
343 end dumpClassElement;
344
345 protected function lm_20
346 input output Tpl.Text txt;
347 input list<String> items;
348 algorithm
349
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
2 for lstElt_20 in items loop
350 txt := match lstElt_20
351 local
352 String i_typevar;
353
354 case i_typevar
355 algorithm
356 1 txt := Tpl.writeStr(txt, i_typevar);
357 1 txt := Tpl.nextIter(txt);
358 then txt;
359 end match;
360 end for;
361 end lm_20;
362
363 protected function fun_21
364 input Tpl.Text in_txt;
365 input list<String> in_a_typeVars;
366
367 output Tpl.Text out_txt;
368 algorithm
369 out_txt :=
370 match(in_txt, in_a_typeVars)
371 local
372 Tpl.Text txt;
373 list<String> i_typeVars;
374
375 case ( txt,
376 {} )
377 then txt;
378
379 case ( txt,
380 i_typeVars )
381 algorithm
382 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<"));
383 1 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
384 1 txt := lm_20(txt, i_typeVars);
385 1 txt := Tpl.popIter(txt);
386 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
387 then txt;
388 end match;
389 end fun_21;
390
391 protected function lm_22
392 input output Tpl.Text txt;
393 input list<Absyn.Annotation> items;
394 algorithm
395
2/2
✓ Branch 0 taken 4459 times.
✓ Branch 1 taken 5538 times.
9997 for lstElt_22 in items loop
396 txt := match lstElt_22
397 local
398 Absyn.Annotation i_a;
399
400 case i_a
401 algorithm
402 4459 txt := dumpAnnotation(txt, i_a);
403 4459 txt := Tpl.nextIter(txt);
404 then txt;
405 end match;
406 end for;
407 end lm_22;
408
409 protected function lm_23
410 input output Tpl.Text txt;
411 input list<Absyn.ClassPart> items;
412 input Dump.DumpOptions a_options;
413 algorithm
414
2/2
✓ Branch 0 taken 10633 times.
✓ Branch 1 taken 5538 times.
16171 for lstElt_23 in items loop
415 txt := match lstElt_23
416 local
417 Integer x_idx;
418 Absyn.ClassPart i_class__part;
419
420 case i_class__part
421 algorithm
422 10633 x_idx := Tpl.getIteri_i0(txt);
423 10633 txt := dumpClassPart(txt, i_class__part, x_idx, a_options);
424 10633 txt := Tpl.nextIter(txt);
425 then txt;
426 end match;
427 end for;
428 end lm_23;
429
430 protected function fun_24
431 input Tpl.Text in_txt;
432 input Boolean in_mArg;
433 input Tpl.Text in_a_ann__str;
434
435 output Tpl.Text out_txt;
436 algorithm
437 out_txt :=
438 match(in_txt, in_mArg, in_a_ann__str)
439 local
440 Tpl.Text txt;
441 Tpl.Text a_ann__str;
442
443 case ( txt,
444 true,
445 _ )
446 then txt;
447
448 case ( txt,
449 _,
450 a_ann__str )
451 algorithm
452 4459 txt := Tpl.writeText(txt, a_ann__str);
453 4459 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
454 then txt;
455 end match;
456 end fun_24;
457
458 protected function lm_25
459 input output Tpl.Text txt;
460 input list<String> items;
461 algorithm
462
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5538 times.
5538 for lstElt_25 in items loop
463 txt := match lstElt_25
464 local
465 String i_cmt;
466
467 case i_cmt
468 algorithm
469 ✗ txt := Tpl.writeStr(txt, i_cmt);
470 then txt;
471 end match;
472 end for;
473 end lm_25;
474
475 protected function fun_26
476 input Tpl.Text in_txt;
477 input list<Absyn.ElementArg> in_a_arguments;
478
479 output Tpl.Text out_txt;
480 algorithm
481 out_txt :=
482 match(in_txt, in_a_arguments)
483 local
484 Tpl.Text txt;
485 list<Absyn.ElementArg> i_arguments;
486
487 case ( txt,
488 {} )
489 then txt;
490
491 case ( txt,
492 i_arguments )
493 algorithm
494 593 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
495 593 (txt, _) := dumpElementArgList(txt, i_arguments, Tpl.strTokText(Tpl.ST_STRING(", ")));
496 593 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
497 then txt;
498 end match;
499 end fun_26;
500
501 protected function lm_27
502 input output Tpl.Text txt;
503 input list<String> items;
504 algorithm
505
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1123 times.
1123 for lstElt_27 in items loop
506 txt := match lstElt_27
507 local
508 String i_cmt;
509
510 case i_cmt
511 algorithm
512 ✗ txt := Tpl.writeStr(txt, i_cmt);
513 then txt;
514 end match;
515 end for;
516 end lm_27;
517
518 protected function lm_28
519 input output Tpl.Text txt;
520 input list<Absyn.ClassPart> items;
521 input Dump.DumpOptions a_options;
522 algorithm
523
2/2
✓ Branch 0 taken 767 times.
✓ Branch 1 taken 366 times.
1133 for lstElt_28 in items loop
524 txt := match lstElt_28
525 local
526 Integer x_idx;
527 Absyn.ClassPart i_class__part;
528
529 case i_class__part
530 algorithm
531 767 x_idx := Tpl.getIteri_i0(txt);
532 767 txt := dumpClassPart(txt, i_class__part, x_idx, a_options);
533 767 txt := Tpl.nextIter(txt);
534 then txt;
535 end match;
536 end for;
537 end lm_28;
538
539 protected function fun_29
540 input Tpl.Text in_txt;
541 input list<Absyn.ElementArg> in_a_modifications;
542
543 output Tpl.Text out_txt;
544 algorithm
545 out_txt :=
546 match(in_txt, in_a_modifications)
547 local
548 Tpl.Text txt;
549 list<Absyn.ElementArg> i_modifications;
550
551 case ( txt,
552 {} )
553 then txt;
554
555 case ( txt,
556 i_modifications )
557 algorithm
558 13 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
559 13 (txt, _) := dumpElementArgList(txt, i_modifications, Tpl.strTokText(Tpl.ST_STRING(", ")));
560 13 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
561 then txt;
562 end match;
563 end fun_29;
564
565 protected function lm_30
566 input output Tpl.Text txt;
567 input list<Absyn.Annotation> items;
568 algorithm
569
2/2
✓ Branch 0 taken 223 times.
✓ Branch 1 taken 366 times.
589 for lstElt_30 in items loop
570 txt := match lstElt_30
571 local
572 Absyn.Annotation i_a;
573
574 case i_a
575 algorithm
576 223 txt := dumpAnnotation(txt, i_a);
577 223 txt := Tpl.nextIter(txt);
578 then txt;
579 end match;
580 end for;
581 end lm_30;
582
583 protected function fun_31
584 input Tpl.Text in_txt;
585 input Boolean in_mArg;
586 input Tpl.Text in_a_ann__str;
587
588 output Tpl.Text out_txt;
589 algorithm
590 out_txt :=
591 match(in_txt, in_mArg, in_a_ann__str)
592 local
593 Tpl.Text txt;
594 Tpl.Text a_ann__str;
595
596 case ( txt,
597 true,
598 _ )
599 then txt;
600
601 case ( txt,
602 _,
603 a_ann__str )
604 algorithm
605 223 txt := Tpl.writeText(txt, a_ann__str);
606 223 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
607 then txt;
608 end match;
609 end fun_31;
610
611 protected function lm_32
612 input output Tpl.Text txt;
613 input list<String> items;
614 algorithm
615
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 366 times.
366 for lstElt_32 in items loop
616 txt := match lstElt_32
617 local
618 String i_cmt;
619
620 case i_cmt
621 algorithm
622 ✗ txt := Tpl.writeStr(txt, i_cmt);
623 then txt;
624 end match;
625 end for;
626 end lm_32;
627
628 protected function lm_33
629 input output Tpl.Text txt;
630 input list<String> items;
631 algorithm
632
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 58 times.
58 for lstElt_33 in items loop
633 txt := match lstElt_33
634 local
635 String i_cmt;
636
637 case i_cmt
638 algorithm
639 ✗ txt := Tpl.writeStr(txt, i_cmt);
640 then txt;
641 end match;
642 end for;
643 end lm_33;
644
645 protected function lm_34
646 input output Tpl.Text txt;
647 input list<Absyn.Path> items;
648 algorithm
649 ✗ for lstElt_34 in items loop
650 txt := match lstElt_34
651 local
652 Absyn.Path i_fn;
653
654 case i_fn
655 algorithm
656 ✗ txt := dumpPath(txt, i_fn);
657 ✗ txt := Tpl.nextIter(txt);
658 then txt;
659 end match;
660 end for;
661 end lm_34;
662
663 protected function lm_35
664 input output Tpl.Text txt;
665 input list<String> items;
666 algorithm
667 ✗ for lstElt_35 in items loop
668 txt := match lstElt_35
669 local
670 String i_cmt;
671
672 case i_cmt
673 algorithm
674 ✗ txt := Tpl.writeStr(txt, i_cmt);
675 then txt;
676 end match;
677 end for;
678 end lm_35;
679
680 protected function lm_36
681 input output Tpl.Text txt;
682 input list<Absyn.Ident> items;
683 algorithm
684 ✗ for lstElt_36 in items loop
685 txt := match lstElt_36
686 local
687 Absyn.Ident i_var;
688
689 case i_var
690 algorithm
691 ✗ txt := Tpl.writeStr(txt, i_var);
692 ✗ txt := Tpl.nextIter(txt);
693 then txt;
694 end match;
695 end for;
696 end lm_36;
697
698 protected function lm_37
699 input output Tpl.Text txt;
700 input list<String> items;
701 algorithm
702 ✗ for lstElt_37 in items loop
703 txt := match lstElt_37
704 local
705 String i_cmt;
706
707 case i_cmt
708 algorithm
709 ✗ txt := Tpl.writeStr(txt, i_cmt);
710 then txt;
711 end match;
712 end for;
713 end lm_37;
714
715 public function dumpClassDef
716 input Tpl.Text in_txt;
717 input Absyn.ClassDef in_a_cdef;
718 input String in_a_cls__name;
719 input list<String> in_a_commentsBeforeEnd;
720 input Dump.DumpOptions in_a_options;
721
722 output Tpl.Text out_txt;
723 algorithm
724 out_txt :=
725 match(in_txt, in_a_cdef, in_a_cls__name, in_a_commentsBeforeEnd, in_a_options)
726 local
727 Tpl.Text txt;
728 String a_cls__name;
729 list<String> a_commentsBeforeEnd;
730 Dump.DumpOptions a_options;
731 list<Absyn.Ident> i_vars;
732 Absyn.Path i_functionName;
733 list<Absyn.Path> i_functionNames;
734 Absyn.EnumDef i_enumLiterals;
735 Absyn.Ident i_baseClassName;
736 list<Absyn.ElementArg> i_modifications;
737 list<Absyn.ClassPart> i_parts;
738 Option<Absyn.Comment> i_comment_1;
739 list<Absyn.ElementArg> i_arguments;
740 Absyn.TypeSpec i_typeSpec;
741 Absyn.ElementAttributes i_attributes;
742 list<Absyn.ClassPart> i_classParts;
743 Option<String> i_comment;
744 list<Absyn.Annotation> i_ann;
745 list<String> i_typeVars;
746 Tpl.Text l_vars__str;
747 Tpl.Text l_fn__str;
748 Tpl.Text l_funcs__str;
749 Tpl.Text l_enum__str;
750 Boolean ret_10;
751 list<Absyn.Annotation> ret_9;
752 Tpl.Text l_mod__str;
753 Tpl.Text l_ty__str;
754 Tpl.Text l_attr__str;
755 Boolean ret_5;
756 Tpl.Text l_body__str;
757 Tpl.Text l_cmt__str;
758 list<Absyn.Annotation> ret_2;
759 Tpl.Text l_ann__str;
760 Tpl.Text l_tvs__str;
761
762 case ( txt,
763 Absyn.PARTS(typeVars = i_typeVars, ann = i_ann, comment = i_comment, classParts = i_classParts),
764 a_cls__name,
765 a_commentsBeforeEnd,
766 a_options )
767 algorithm
768 5538 l_tvs__str := fun_21(Tpl.emptyTxt, i_typeVars);
769 5538 ret_2 := listReverse(i_ann);
770 5538 l_ann__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_LINE(";\n")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
771 5538 l_ann__str := lm_22(l_ann__str, ret_2);
772 5538 l_ann__str := Tpl.popIter(l_ann__str);
773 5538 l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
774 5538 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING("")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
775 5538 l_body__str := lm_23(l_body__str, i_classParts, a_options);
776 5538 l_body__str := Tpl.popIter(l_body__str);
777 5538 txt := Tpl.writeStr(txt, a_cls__name);
778 5538 txt := Tpl.writeText(txt, l_tvs__str);
779 5538 txt := Tpl.writeText(txt, l_cmt__str);
780 5538 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
781 5538 txt := Tpl.writeText(txt, l_body__str);
782 5538 txt := Tpl.softNewLine(txt);
783 5538 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
784 5538 ret_5 := Tpl.isEmpty(l_ann__str);
785 5538 txt := fun_24(txt, ret_5, l_ann__str);
786 5538 txt := Tpl.softNewLine(txt);
787 5538 txt := lm_25(txt, a_commentsBeforeEnd);
788 5538 txt := Tpl.softNewLine(txt);
789 5538 txt := Tpl.popBlock(txt);
790 5538 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
791 5538 txt := Tpl.writeStr(txt, a_cls__name);
792 then txt;
793
794 case ( txt,
795 Absyn.DERIVED(attributes = i_attributes, typeSpec = i_typeSpec, arguments = i_arguments, comment = i_comment_1),
796 a_cls__name,
797 a_commentsBeforeEnd,
798 _ )
799 algorithm
800 1123 l_attr__str := dumpElementAttr(Tpl.emptyTxt, i_attributes);
801 1123 l_ty__str := dumpTypeSpec(Tpl.emptyTxt, i_typeSpec);
802 1123 l_mod__str := fun_26(Tpl.emptyTxt, i_arguments);
803 1123 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment_1);
804 1123 txt := Tpl.writeStr(txt, a_cls__name);
805 1123 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
806 1123 txt := Tpl.writeText(txt, l_attr__str);
807 1123 txt := Tpl.writeText(txt, l_ty__str);
808 1123 txt := Tpl.writeText(txt, l_mod__str);
809 1123 txt := Tpl.writeText(txt, l_cmt__str);
810 1123 txt := lm_27(txt, a_commentsBeforeEnd);
811 then txt;
812
813 case ( txt,
814 Absyn.CLASS_EXTENDS(parts = i_parts, modifications = i_modifications, comment = i_comment, ann = i_ann, baseClassName = i_baseClassName),
815 a_cls__name,
816 a_commentsBeforeEnd,
817 a_options )
818 algorithm
819 366 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
820 366 l_body__str := lm_28(l_body__str, i_parts, a_options);
821 366 l_body__str := Tpl.popIter(l_body__str);
822 366 l_mod__str := fun_29(Tpl.emptyTxt, i_modifications);
823 366 l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
824 366 ret_9 := listReverse(i_ann);
825 366 l_ann__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_LINE(";\n")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
826 366 l_ann__str := lm_30(l_ann__str, ret_9);
827 366 l_ann__str := Tpl.popIter(l_ann__str);
828 366 txt := Tpl.writeTok(txt, Tpl.ST_STRING("extends "));
829 366 txt := Tpl.writeStr(txt, i_baseClassName);
830 366 txt := Tpl.writeText(txt, l_mod__str);
831 366 txt := Tpl.writeText(txt, l_cmt__str);
832 366 txt := Tpl.softNewLine(txt);
833 366 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
834 366 txt := Tpl.writeText(txt, l_body__str);
835 366 txt := Tpl.softNewLine(txt);
836 366 ret_10 := Tpl.isEmpty(l_ann__str);
837 366 txt := fun_31(txt, ret_10, l_ann__str);
838 366 txt := Tpl.softNewLine(txt);
839 366 txt := lm_32(txt, a_commentsBeforeEnd);
840 366 txt := Tpl.softNewLine(txt);
841 366 txt := Tpl.popBlock(txt);
842 366 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
843 366 txt := Tpl.writeStr(txt, a_cls__name);
844 then txt;
845
846 case ( txt,
847 Absyn.ENUMERATION(enumLiterals = i_enumLiterals, comment = i_comment_1),
848 a_cls__name,
849 a_commentsBeforeEnd,
850 _ )
851 algorithm
852 58 l_enum__str := dumpEnumDef(Tpl.emptyTxt, i_enumLiterals);
853 58 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment_1);
854 58 txt := Tpl.writeStr(txt, a_cls__name);
855 58 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = enumeration("));
856 58 txt := Tpl.writeText(txt, l_enum__str);
857 58 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
858 58 txt := Tpl.writeText(txt, l_cmt__str);
859 58 txt := lm_33(txt, a_commentsBeforeEnd);
860 then txt;
861
862 case ( txt,
863 Absyn.OVERLOAD(functionNames = i_functionNames, comment = i_comment_1),
864 a_cls__name,
865 a_commentsBeforeEnd,
866 _ )
867 algorithm
868 ✗ l_funcs__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
869 ✗ l_funcs__str := lm_34(l_funcs__str, i_functionNames);
870 ✗ l_funcs__str := Tpl.popIter(l_funcs__str);
871 ✗ l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment_1);
872 ✗ txt := Tpl.writeStr(txt, a_cls__name);
873 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = $overload("));
874 ✗ txt := Tpl.writeText(txt, l_funcs__str);
875 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
876 ✗ txt := Tpl.writeText(txt, l_cmt__str);
877 ✗ txt := lm_35(txt, a_commentsBeforeEnd);
878 then txt;
879
880 case ( txt,
881 Absyn.PDER(functionName = i_functionName, vars = i_vars),
882 a_cls__name,
883 a_commentsBeforeEnd,
884 _ )
885 algorithm
886 ✗ l_fn__str := dumpPath(Tpl.emptyTxt, i_functionName);
887 ✗ l_vars__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
888 ✗ l_vars__str := lm_36(l_vars__str, i_vars);
889 ✗ l_vars__str := Tpl.popIter(l_vars__str);
890 ✗ txt := Tpl.writeStr(txt, a_cls__name);
891 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = der("));
892 ✗ txt := Tpl.writeText(txt, l_fn__str);
893 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
894 ✗ txt := Tpl.writeText(txt, l_vars__str);
895 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
896 ✗ txt := lm_37(txt, a_commentsBeforeEnd);
897 then txt;
898
899 case ( txt,
900 _,
901 _,
902 _,
903 _ )
904 then txt;
905 end match;
906 end dumpClassDef;
907
908 protected function lm_39
909 input output Tpl.Text txt;
910 input list<Absyn.EnumLiteral> items;
911 algorithm
912
2/2
✓ Branch 0 taken 227 times.
✓ Branch 1 taken 58 times.
285 for lstElt_39 in items loop
913 txt := match lstElt_39
914 local
915 Absyn.EnumLiteral i_lit;
916
917 case i_lit
918 algorithm
919 227 txt := dumpEnumLiteral(txt, i_lit);
920 227 txt := Tpl.nextIter(txt);
921 then txt;
922 end match;
923 end for;
924 end lm_39;
925
926 public function dumpEnumDef
927 input Tpl.Text in_txt;
928 input Absyn.EnumDef in_a_enum__def;
929
930 output Tpl.Text out_txt;
931 algorithm
932 out_txt :=
933 match(in_txt, in_a_enum__def)
934 local
935 Tpl.Text txt;
936 list<Absyn.EnumLiteral> i_enumLiterals;
937
938 case ( txt,
939 Absyn.ENUMLITERALS(enumLiterals = i_enumLiterals) )
940 algorithm
941 58 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
942 58 txt := lm_39(txt, i_enumLiterals);
943 58 txt := Tpl.popIter(txt);
944 then txt;
945
946 case ( txt,
947 Absyn.ENUM_COLON() )
948 algorithm
949 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
950 then txt;
951
952 case ( txt,
953 _ )
954 then txt;
955 end match;
956 end dumpEnumDef;
957
958 public function dumpEnumLiteral
959 input Tpl.Text in_txt;
960 input Absyn.EnumLiteral in_a_lit;
961
962 output Tpl.Text out_txt;
963 algorithm
964 out_txt :=
965 match(in_txt, in_a_lit)
966 local
967 Tpl.Text txt;
968 Absyn.Ident i_literal;
969 Option<Absyn.Comment> i_comment;
970 Tpl.Text l_cmt__str;
971
972 case ( txt,
973 Absyn.ENUMLITERAL(comment = i_comment, literal = i_literal) )
974 algorithm
975 227 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
976 227 txt := Tpl.writeStr(txt, i_literal);
977 227 txt := Tpl.writeText(txt, l_cmt__str);
978 then txt;
979
980 case ( txt,
981 _ )
982 then txt;
983 end match;
984 end dumpEnumLiteral;
985
986 protected function fun_42
987 input Tpl.Text in_txt;
988 input Boolean in_a_encapsulatedPrefix;
989
990 output Tpl.Text out_txt;
991 algorithm
992 out_txt :=
993 match(in_txt, in_a_encapsulatedPrefix)
994 local
995 Tpl.Text txt;
996
997 case ( txt,
998 false )
999 then txt;
1000
1001 case ( txt,
1002 _ )
1003 algorithm
1004 40 txt := Tpl.writeTok(txt, Tpl.ST_STRING("encapsulated "));
1005 then txt;
1006 end match;
1007 end fun_42;
1008
1009 protected function fun_43
1010 input Tpl.Text in_txt;
1011 input Boolean in_a_partialPrefix;
1012
1013 output Tpl.Text out_txt;
1014 algorithm
1015 out_txt :=
1016 match(in_txt, in_a_partialPrefix)
1017 local
1018 Tpl.Text txt;
1019
1020 case ( txt,
1021 false )
1022 then txt;
1023
1024 case ( txt,
1025 _ )
1026 algorithm
1027 473 txt := Tpl.writeTok(txt, Tpl.ST_STRING("partial "));
1028 then txt;
1029 end match;
1030 end fun_43;
1031
1032 protected function fun_44
1033 input Tpl.Text in_txt;
1034 input Absyn.Class in_a_cls;
1035 input String in_a_redecl__str;
1036 input String in_a_repl__str;
1037 input String in_a_io__str;
1038
1039 output Tpl.Text out_txt;
1040 algorithm
1041 out_txt :=
1042 match(in_txt, in_a_cls, in_a_redecl__str, in_a_repl__str, in_a_io__str)
1043 local
1044 Tpl.Text txt;
1045 String a_redecl__str;
1046 String a_repl__str;
1047 String a_io__str;
1048 Boolean i_finalPrefix;
1049 Boolean i_partialPrefix;
1050 Boolean i_encapsulatedPrefix;
1051 Tpl.Text l_fin__str;
1052 Tpl.Text l_partial__str;
1053 Tpl.Text l_enc__str;
1054
1055 case ( txt,
1056 Absyn.CLASS(encapsulatedPrefix = i_encapsulatedPrefix, partialPrefix = i_partialPrefix, finalPrefix = i_finalPrefix),
1057 a_redecl__str,
1058 a_repl__str,
1059 a_io__str )
1060 algorithm
1061 7085 l_enc__str := fun_42(Tpl.emptyTxt, i_encapsulatedPrefix);
1062 7085 l_partial__str := fun_43(Tpl.emptyTxt, i_partialPrefix);
1063 7085 l_fin__str := dumpFinal(Tpl.emptyTxt, i_finalPrefix);
1064 7085 txt := Tpl.writeStr(txt, a_redecl__str);
1065 7085 txt := Tpl.writeText(txt, l_fin__str);
1066 7085 txt := Tpl.writeStr(txt, a_io__str);
1067 7085 txt := Tpl.writeStr(txt, a_repl__str);
1068 7085 txt := Tpl.writeText(txt, l_enc__str);
1069 7085 txt := Tpl.writeText(txt, l_partial__str);
1070 then txt;
1071
1072 case ( txt,
1073 _,
1074 _,
1075 _,
1076 _ )
1077 then txt;
1078 end match;
1079 end fun_44;
1080
1081 public function dumpClassPrefixes
1082 input Tpl.Text txt;
1083 input Absyn.Class a_cls;
1084 input String a_final__str;
1085 input String a_redecl__str;
1086 input String a_repl__str;
1087 input String a_io__str;
1088
1089 output Tpl.Text out_txt;
1090 algorithm
1091 7085 out_txt := fun_44(txt, a_cls, a_redecl__str, a_repl__str, a_io__str);
1092 end dumpClassPrefixes;
1093
1094 public function dumpPurity
1095 input Tpl.Text in_txt;
1096 input Absyn.FunctionPurity in_a_purity;
1097
1098 output Tpl.Text out_txt;
1099 algorithm
1100 out_txt :=
1101 match(in_txt, in_a_purity)
1102 local
1103 Tpl.Text txt;
1104
1105 case ( txt,
1106 Absyn.PURE() )
1107 algorithm
1108 81 txt := Tpl.writeTok(txt, Tpl.ST_STRING("pure "));
1109 then txt;
1110
1111 case ( txt,
1112 Absyn.IMPURE() )
1113 algorithm
1114 47 txt := Tpl.writeTok(txt, Tpl.ST_STRING("impure "));
1115 then txt;
1116
1117 case ( txt,
1118 Absyn.NO_PURITY() )
1119 then txt;
1120
1121 case ( txt,
1122 _ )
1123 then txt;
1124 end match;
1125 end dumpPurity;
1126
1127 protected function fun_47
1128 input Tpl.Text in_txt;
1129 input Absyn.FunctionRestriction in_a_functionRestriction;
1130
1131 output Tpl.Text out_txt;
1132 algorithm
1133 out_txt :=
1134 match(in_txt, in_a_functionRestriction)
1135 local
1136 Tpl.Text txt;
1137 Absyn.FunctionPurity i_purity;
1138
1139 case ( txt,
1140 Absyn.FR_NORMAL_FUNCTION(purity = i_purity) )
1141 algorithm
1142 1875 txt := dumpPurity(txt, i_purity);
1143 then txt;
1144
1145 case ( txt,
1146 Absyn.FR_OPERATOR_FUNCTION() )
1147 algorithm
1148 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("operator "));
1149 then txt;
1150
1151 case ( txt,
1152 Absyn.FR_PARALLEL_FUNCTION() )
1153 algorithm
1154 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parallel "));
1155 then txt;
1156
1157 case ( txt,
1158 Absyn.FR_KERNEL_FUNCTION() )
1159 algorithm
1160 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("kernel "));
1161 then txt;
1162
1163 case ( txt,
1164 _ )
1165 then txt;
1166 end match;
1167 end fun_47;
1168
1169 protected function lm_48
1170 input output Tpl.Text txt;
1171 input list<String> items;
1172 algorithm
1173 ✗ for lstElt_48 in items loop
1174 txt := match lstElt_48
1175 local
1176 String i_tv;
1177
1178 case i_tv
1179 algorithm
1180 ✗ txt := Tpl.writeStr(txt, i_tv);
1181 ✗ txt := Tpl.nextIter(txt);
1182 then txt;
1183 end match;
1184 end for;
1185 end lm_48;
1186
1187 protected function fun_49
1188 input Tpl.Text in_txt;
1189 input list<String> in_a_typeVars;
1190
1191 output Tpl.Text out_txt;
1192 algorithm
1193 out_txt :=
1194 match(in_txt, in_a_typeVars)
1195 local
1196 Tpl.Text txt;
1197 list<String> i_typeVars;
1198
1199 case ( txt,
1200 {} )
1201 then txt;
1202
1203 case ( txt,
1204 i_typeVars )
1205 algorithm
1206 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("<"));
1207 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1208 ✗ txt := lm_48(txt, i_typeVars);
1209 ✗ txt := Tpl.popIter(txt);
1210 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
1211 then txt;
1212 end match;
1213 end fun_49;
1214
1215 public function dumpRestriction
1216 input Tpl.Text in_txt;
1217 input Absyn.Restriction in_a_restriction;
1218
1219 output Tpl.Text out_txt;
1220 algorithm
1221 out_txt :=
1222 match(in_txt, in_a_restriction)
1223 local
1224 Tpl.Text txt;
1225 list<String> i_typeVars;
1226 Absyn.FunctionRestriction i_functionRestriction;
1227 Tpl.Text l_prefix__str;
1228
1229 case ( txt,
1230 Absyn.R_CLASS() )
1231 algorithm
1232 250 txt := Tpl.writeTok(txt, Tpl.ST_STRING("class"));
1233 then txt;
1234
1235 case ( txt,
1236 Absyn.R_OPTIMIZATION() )
1237 algorithm
1238 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("optimization"));
1239 then txt;
1240
1241 case ( txt,
1242 Absyn.R_MODEL() )
1243 algorithm
1244 2129 txt := Tpl.writeTok(txt, Tpl.ST_STRING("model"));
1245 then txt;
1246
1247 case ( txt,
1248 Absyn.R_RECORD() )
1249 algorithm
1250 333 txt := Tpl.writeTok(txt, Tpl.ST_STRING("record"));
1251 then txt;
1252
1253 case ( txt,
1254 Absyn.R_BLOCK() )
1255 algorithm
1256 499 txt := Tpl.writeTok(txt, Tpl.ST_STRING("block"));
1257 then txt;
1258
1259 case ( txt,
1260 Absyn.R_CONNECTOR() )
1261 algorithm
1262 111 txt := Tpl.writeTok(txt, Tpl.ST_STRING("connector"));
1263 then txt;
1264
1265 case ( txt,
1266 Absyn.R_EXP_CONNECTOR() )
1267 algorithm
1268 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING("expandable connector"));
1269 then txt;
1270
1271 case ( txt,
1272 Absyn.R_TYPE() )
1273 algorithm
1274 707 txt := Tpl.writeTok(txt, Tpl.ST_STRING("type"));
1275 then txt;
1276
1277 case ( txt,
1278 Absyn.R_PACKAGE() )
1279 algorithm
1280 1144 txt := Tpl.writeTok(txt, Tpl.ST_STRING("package"));
1281 then txt;
1282
1283 case ( txt,
1284 Absyn.R_FUNCTION(functionRestriction = i_functionRestriction) )
1285 algorithm
1286 1881 l_prefix__str := fun_47(Tpl.emptyTxt, i_functionRestriction);
1287 1881 txt := Tpl.writeText(txt, l_prefix__str);
1288 1881 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function"));
1289 then txt;
1290
1291 case ( txt,
1292 Absyn.R_OPERATOR() )
1293 algorithm
1294 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("operator"));
1295 then txt;
1296
1297 case ( txt,
1298 Absyn.R_OPERATOR_RECORD() )
1299 algorithm
1300 24 txt := Tpl.writeTok(txt, Tpl.ST_STRING("operator record"));
1301 then txt;
1302
1303 case ( txt,
1304 Absyn.R_ENUMERATION() )
1305 algorithm
1306 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("enumeration"));
1307 then txt;
1308
1309 case ( txt,
1310 Absyn.R_PREDEFINED_INTEGER() )
1311 algorithm
1312 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer"));
1313 then txt;
1314
1315 case ( txt,
1316 Absyn.R_PREDEFINED_REAL() )
1317 algorithm
1318 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real"));
1319 then txt;
1320
1321 case ( txt,
1322 Absyn.R_PREDEFINED_STRING() )
1323 algorithm
1324 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String"));
1325 then txt;
1326
1327 case ( txt,
1328 Absyn.R_PREDEFINED_BOOLEAN() )
1329 algorithm
1330 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean"));
1331 then txt;
1332
1333 case ( txt,
1334 Absyn.R_PREDEFINED_ENUMERATION() )
1335 algorithm
1336 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("enumeration(:)"));
1337 then txt;
1338
1339 case ( txt,
1340 Absyn.R_UNIONTYPE() )
1341 algorithm
1342 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("uniontype"));
1343 then txt;
1344
1345 case ( txt,
1346 Absyn.R_METARECORD(typeVars = i_typeVars) )
1347 algorithm
1348 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("metarecord"));
1349 ✗ txt := fun_49(txt, i_typeVars);
1350 then txt;
1351
1352 case ( txt,
1353 Absyn.R_UNKNOWN() )
1354 algorithm
1355 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("*unknown*"));
1356 then txt;
1357
1358 case ( txt,
1359 _ )
1360 then txt;
1361 end match;
1362 end dumpRestriction;
1363
1364 protected function fun_51
1365 input Tpl.Text in_txt;
1366 input Integer in_a_idx;
1367
1368 output Tpl.Text out_txt;
1369 algorithm
1370 out_txt :=
1371 match(in_txt, in_a_idx)
1372 local
1373 Tpl.Text txt;
1374
1375 case ( txt,
1376 0 )
1377 then txt;
1378
1379 case ( txt,
1380 _ )
1381 algorithm
1382 76 txt := Tpl.writeTok(txt, Tpl.ST_STRING("public"));
1383 then txt;
1384 end match;
1385 end fun_51;
1386
1387 protected function lm_52
1388 input output Tpl.Text txt;
1389 input list<Absyn.Exp> items;
1390 algorithm
1391 ✗ for lstElt_52 in items loop
1392 txt := match lstElt_52
1393 local
1394 Absyn.Exp i_exp;
1395
1396 case i_exp
1397 algorithm
1398 ✗ txt := dumpExp(txt, i_exp);
1399 ✗ txt := Tpl.nextIter(txt);
1400 then txt;
1401 end match;
1402 end for;
1403 end lm_52;
1404
1405 protected function lm_53
1406 input output Tpl.Text txt;
1407 input list<Absyn.EquationItem> items;
1408 algorithm
1409
2/2
✓ Branch 0 taken 14266 times.
✓ Branch 1 taken 2132 times.
16398 for lstElt_53 in items loop
1410 txt := match lstElt_53
1411 local
1412 Absyn.EquationItem i_eq;
1413
1414 case i_eq
1415 algorithm
1416 14266 txt := dumpEquationItem(txt, i_eq);
1417 14266 txt := Tpl.nextIter(txt);
1418 then txt;
1419 end match;
1420 end for;
1421 end lm_53;
1422
1423 protected function lm_54
1424 input output Tpl.Text txt;
1425 input list<Absyn.EquationItem> items;
1426 algorithm
1427
2/2
✓ Branch 0 taken 419 times.
✓ Branch 1 taken 212 times.
631 for lstElt_54 in items loop
1428 txt := match lstElt_54
1429 local
1430 Absyn.EquationItem i_eq;
1431
1432 case i_eq
1433 algorithm
1434 419 txt := dumpEquationItem(txt, i_eq);
1435 419 txt := Tpl.nextIter(txt);
1436 then txt;
1437 end match;
1438 end for;
1439 end lm_54;
1440
1441 protected function lm_55
1442 input output Tpl.Text txt;
1443 input list<Absyn.AlgorithmItem> items;
1444 algorithm
1445
2/2
✓ Branch 0 taken 5515 times.
✓ Branch 1 taken 1698 times.
7213 for lstElt_55 in items loop
1446 txt := match lstElt_55
1447 local
1448 Absyn.AlgorithmItem i_eq;
1449
1450 case i_eq
1451 algorithm
1452 5515 txt := dumpAlgorithmItem(txt, i_eq);
1453 5515 txt := Tpl.nextIter(txt);
1454 then txt;
1455 end match;
1456 end for;
1457 end lm_55;
1458
1459 protected function lm_56
1460 input output Tpl.Text txt;
1461 input list<Absyn.AlgorithmItem> items;
1462 algorithm
1463
2/2
✓ Branch 0 taken 36 times.
✓ Branch 1 taken 15 times.
51 for lstElt_56 in items loop
1464 txt := match lstElt_56
1465 local
1466 Absyn.AlgorithmItem i_eq;
1467
1468 case i_eq
1469 algorithm
1470 36 txt := dumpAlgorithmItem(txt, i_eq);
1471 36 txt := Tpl.nextIter(txt);
1472 then txt;
1473 end match;
1474 end for;
1475 end lm_56;
1476
1477 protected function fun_57
1478 input Tpl.Text in_txt;
1479 input Option<Absyn.Annotation> in_a_annotation__;
1480
1481 output Tpl.Text out_txt;
1482 algorithm
1483 out_txt :=
1484 match(in_txt, in_a_annotation__)
1485 local
1486 Tpl.Text txt;
1487 Absyn.Annotation i_ann;
1488
1489 case ( txt,
1490 SOME(i_ann) )
1491 algorithm
1492 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
1493 ✗ txt := dumpAnnotation(txt, i_ann);
1494 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
1495 ✗ txt := Tpl.popBlock(txt);
1496 then txt;
1497
1498 case ( txt,
1499 _ )
1500 then txt;
1501 end match;
1502 end fun_57;
1503
1504 protected function fun_58
1505 input Tpl.Text in_txt;
1506 input Option<Absyn.Ident> in_a_funcName;
1507
1508 output Tpl.Text out_txt;
1509 algorithm
1510 out_txt :=
1511 match(in_txt, in_a_funcName)
1512 local
1513 Tpl.Text txt;
1514 Absyn.Ident i_fn;
1515
1516 case ( txt,
1517 SOME(i_fn) )
1518 algorithm
1519 114 txt := Tpl.writeStr(txt, i_fn);
1520 then txt;
1521
1522 case ( txt,
1523 _ )
1524 then txt;
1525 end match;
1526 end fun_58;
1527
1528 protected function fun_59
1529 input Tpl.Text in_txt;
1530 input Option<String> in_a_lang;
1531
1532 output Tpl.Text out_txt;
1533 algorithm
1534 out_txt :=
1535 match(in_txt, in_a_lang)
1536 local
1537 Tpl.Text txt;
1538 String i_l;
1539
1540 case ( txt,
1541 SOME(i_l) )
1542 algorithm
1543 114 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
1544 114 txt := Tpl.writeStr(txt, i_l);
1545 114 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\" "));
1546 then txt;
1547
1548 case ( txt,
1549 _ )
1550 then txt;
1551 end match;
1552 end fun_59;
1553
1554 protected function fun_60
1555 input Tpl.Text in_txt;
1556 input Option<Absyn.ComponentRef> in_a_output__;
1557
1558 output Tpl.Text out_txt;
1559 algorithm
1560 out_txt :=
1561 match(in_txt, in_a_output__)
1562 local
1563 Tpl.Text txt;
1564 Absyn.ComponentRef i_o;
1565
1566 case ( txt,
1567 SOME(i_o) )
1568 algorithm
1569 45 txt := dumpCref(txt, i_o);
1570 45 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
1571 then txt;
1572
1573 case ( txt,
1574 _ )
1575 then txt;
1576 end match;
1577 end fun_60;
1578
1579 protected function fun_61
1580 input Tpl.Text in_txt;
1581 input Boolean in_mArg;
1582
1583 output Tpl.Text out_txt;
1584 algorithm
1585 out_txt :=
1586 match(in_txt, in_mArg)
1587 local
1588 Tpl.Text txt;
1589
1590 case ( txt,
1591 true )
1592 then txt;
1593
1594 case ( txt,
1595 _ )
1596 algorithm
1597 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("()"));
1598 then txt;
1599 end match;
1600 end fun_61;
1601
1602 protected function lm_62
1603 input output Tpl.Text txt;
1604 input list<Absyn.Exp> items;
1605 algorithm
1606
2/2
✓ Branch 0 taken 733 times.
✓ Branch 1 taken 112 times.
845 for lstElt_62 in items loop
1607 txt := match lstElt_62
1608 local
1609 Absyn.Exp i_arg;
1610
1611 case i_arg
1612 algorithm
1613 733 txt := dumpExp(txt, i_arg);
1614 733 txt := Tpl.nextIter(txt);
1615 then txt;
1616 end match;
1617 end for;
1618 end lm_62;
1619
1620 protected function fun_63
1621 input Tpl.Text in_txt;
1622 input list<Absyn.Exp> in_a_args;
1623 input Tpl.Text in_a_fn__str;
1624
1625 output Tpl.Text out_txt;
1626 algorithm
1627 out_txt :=
1628 match(in_txt, in_a_args, in_a_fn__str)
1629 local
1630 Tpl.Text txt;
1631 Tpl.Text a_fn__str;
1632 list<Absyn.Exp> i_args;
1633 Boolean ret_0;
1634
1635 case ( txt,
1636 {},
1637 a_fn__str )
1638 algorithm
1639 2 ret_0 := Tpl.isEmpty(a_fn__str);
1640 2 txt := fun_61(txt, ret_0);
1641 then txt;
1642
1643 case ( txt,
1644 i_args,
1645 _ )
1646 algorithm
1647 112 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1648 112 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1649 112 txt := lm_62(txt, i_args);
1650 112 txt := Tpl.popIter(txt);
1651 112 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1652 then txt;
1653 end match;
1654 end fun_63;
1655
1656 protected function fun_64
1657 input Tpl.Text in_txt;
1658 input Absyn.ExternalDecl in_a_externalDecl;
1659 input Tpl.Text in_a_ann__str;
1660
1661 output Tpl.Text out_txt;
1662 algorithm
1663 out_txt :=
1664 match(in_txt, in_a_externalDecl, in_a_ann__str)
1665 local
1666 Tpl.Text txt;
1667 Tpl.Text a_ann__str;
1668 Option<Absyn.Annotation> i_annotation__;
1669 list<Absyn.Exp> i_args;
1670 Option<Absyn.ComponentRef> i_output__;
1671 Option<String> i_lang;
1672 Option<Absyn.Ident> i_funcName;
1673 Tpl.Text l_ann2__str;
1674 Tpl.Text l_args__str;
1675 Tpl.Text l_output__str;
1676 Tpl.Text l_lang__str;
1677 Tpl.Text l_fn__str;
1678
1679 case ( txt,
1680 Absyn.EXTERNALDECL(funcName = i_funcName, lang = i_lang, output_ = i_output__, args = i_args, annotation_ = i_annotation__),
1681 a_ann__str )
1682 algorithm
1683 114 l_fn__str := fun_58(Tpl.emptyTxt, i_funcName);
1684 114 l_lang__str := fun_59(Tpl.emptyTxt, i_lang);
1685 114 l_output__str := fun_60(Tpl.emptyTxt, i_output__);
1686 114 l_args__str := fun_63(Tpl.emptyTxt, i_args, l_fn__str);
1687 114 l_ann2__str := dumpAnnotationOptSpace(Tpl.emptyTxt, i_annotation__);
1688 114 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1689 114 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1690 114 txt := Tpl.writeTok(txt, Tpl.ST_STRING("external "));
1691 114 txt := Tpl.writeText(txt, l_lang__str);
1692 114 txt := Tpl.writeText(txt, l_output__str);
1693 114 txt := Tpl.writeText(txt, l_fn__str);
1694 114 txt := Tpl.writeText(txt, l_args__str);
1695 114 txt := Tpl.writeText(txt, l_ann2__str);
1696 114 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
1697 114 txt := Tpl.writeText(txt, a_ann__str);
1698 114 txt := Tpl.popBlock(txt);
1699 then txt;
1700
1701 case ( txt,
1702 _,
1703 _ )
1704 then txt;
1705 end match;
1706 end fun_64;
1707
1708 public function dumpClassPart
1709 input Tpl.Text in_txt;
1710 input Absyn.ClassPart in_a_class__part;
1711 input Integer in_a_idx;
1712 input Dump.DumpOptions in_a_options;
1713
1714 output Tpl.Text out_txt;
1715 algorithm
1716 out_txt :=
1717 match(in_txt, in_a_class__part, in_a_idx, in_a_options)
1718 local
1719 Tpl.Text txt;
1720 Integer a_idx;
1721 Dump.DumpOptions a_options;
1722 Absyn.ExternalDecl i_externalDecl;
1723 Option<Absyn.Annotation> i_annotation__;
1724 list<Absyn.AlgorithmItem> i_contents_3;
1725 list<Absyn.EquationItem> i_contents_2;
1726 list<Absyn.Exp> i_contents_1;
1727 list<Absyn.ElementItem> i_contents;
1728 Tpl.Text l_ann__str;
1729 Tpl.Text l_el__str;
1730 Tpl.Text l_section__str;
1731
1732 case ( txt,
1733 Absyn.PUBLIC(contents = i_contents),
1734 a_idx,
1735 a_options )
1736 algorithm
1737 5980 l_section__str := fun_51(Tpl.emptyTxt, a_idx);
1738 5980 l_el__str := dumpElementItems(Tpl.emptyTxt, i_contents, "", true, a_options);
1739 5980 txt := Tpl.writeText(txt, l_section__str);
1740 5980 txt := Tpl.softNewLine(txt);
1741 5980 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1742 5980 txt := Tpl.writeText(txt, l_el__str);
1743 5980 txt := Tpl.popBlock(txt);
1744 then txt;
1745
1746 case ( txt,
1747 Absyn.PROTECTED(contents = i_contents),
1748 _,
1749 a_options )
1750 algorithm
1751 1249 l_el__str := dumpElementItems(Tpl.emptyTxt, i_contents, "", true, a_options);
1752 1249 txt := Tpl.writeTok(txt, Tpl.ST_LINE("protected\n"));
1753 1249 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1754 1249 txt := Tpl.writeText(txt, l_el__str);
1755 1249 txt := Tpl.popBlock(txt);
1756 then txt;
1757
1758 case ( txt,
1759 Absyn.CONSTRAINTS(contents = i_contents_1),
1760 _,
1761 _ )
1762 algorithm
1763 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE("constraint\n"));
1764 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1765 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING("; ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1766 ✗ txt := lm_52(txt, i_contents_1);
1767 ✗ txt := Tpl.popIter(txt);
1768 ✗ txt := Tpl.popBlock(txt);
1769 then txt;
1770
1771 case ( txt,
1772 Absyn.EQUATIONS(contents = i_contents_2),
1773 _,
1774 _ )
1775 algorithm
1776 2132 txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
1777 2132 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1778 2132 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1779 2132 txt := lm_53(txt, i_contents_2);
1780 2132 txt := Tpl.popIter(txt);
1781 2132 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1782 2132 txt := Tpl.popBlock(txt);
1783 then txt;
1784
1785 case ( txt,
1786 Absyn.INITIALEQUATIONS(contents = i_contents_2),
1787 _,
1788 _ )
1789 algorithm
1790 212 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
1791 212 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1792 212 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1793 212 txt := lm_54(txt, i_contents_2);
1794 212 txt := Tpl.popIter(txt);
1795 212 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1796 212 txt := Tpl.popBlock(txt);
1797 then txt;
1798
1799 case ( txt,
1800 Absyn.ALGORITHMS(contents = i_contents_3),
1801 _,
1802 _ )
1803 algorithm
1804 1698 txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
1805 1698 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1806 1698 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1807 1698 txt := lm_55(txt, i_contents_3);
1808 1698 txt := Tpl.popIter(txt);
1809 1698 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1810 1698 txt := Tpl.popBlock(txt);
1811 then txt;
1812
1813 case ( txt,
1814 Absyn.INITIALALGORITHMS(contents = i_contents_3),
1815 _,
1816 _ )
1817 algorithm
1818 15 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial algorithm\n"));
1819 15 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1820 15 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1821 15 txt := lm_56(txt, i_contents_3);
1822 15 txt := Tpl.popIter(txt);
1823 15 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1824 15 txt := Tpl.popBlock(txt);
1825 then txt;
1826
1827 case ( txt,
1828 Absyn.EXTERNAL(annotation_ = i_annotation__, externalDecl = i_externalDecl),
1829 _,
1830 _ )
1831 algorithm
1832 114 l_ann__str := fun_57(Tpl.emptyTxt, i_annotation__);
1833 114 txt := fun_64(txt, i_externalDecl, l_ann__str);
1834 then txt;
1835
1836 case ( txt,
1837 _,
1838 _,
1839 _ )
1840 then txt;
1841 end match;
1842 end dumpClassPart;
1843
1844 protected function fun_66
1845 input Tpl.Text in_txt;
1846 input Boolean in_a_first;
1847 input String in_a_prevSpacing;
1848 input Tpl.Text in_a_spacing;
1849
1850 output Tpl.Text out_txt;
1851 algorithm
1852 out_txt :=
1853 match(in_txt, in_a_first, in_a_prevSpacing, in_a_spacing)
1854 local
1855 Tpl.Text txt;
1856 String a_prevSpacing;
1857 Tpl.Text a_spacing;
1858
1859 case ( txt,
1860 false,
1861 a_prevSpacing,
1862 a_spacing )
1863 algorithm
1864 40081 txt := dumpElementItemPreSpacing(txt, Tpl.textString(a_spacing), a_prevSpacing);
1865 then txt;
1866
1867 case ( txt,
1868 _,
1869 _,
1870 _ )
1871 then txt;
1872 end match;
1873 end fun_66;
1874
1875 protected function fun_67
1876 input Tpl.Text in_txt;
1877 input Boolean in_mArg;
1878 input Tpl.Text in_a_spacing;
1879
1880 output Tpl.Text out_txt;
1881 algorithm
1882 out_txt :=
1883 match(in_txt, in_mArg, in_a_spacing)
1884 local
1885 Tpl.Text txt;
1886 Tpl.Text a_spacing;
1887
1888 case ( txt,
1889 true,
1890 _ )
1891 then txt;
1892
1893 case ( txt,
1894 _,
1895 a_spacing )
1896 algorithm
1897 40081 txt := Tpl.writeText(txt, a_spacing);
1898 then txt;
1899 end match;
1900 end fun_67;
1901
1902 protected function fun_68
1903 input Tpl.Text in_txt;
1904 input Boolean in_mArg;
1905 input Tpl.Text in_a_rest__str;
1906
1907 output Tpl.Text out_txt;
1908 algorithm
1909 out_txt :=
1910 match(in_txt, in_mArg, in_a_rest__str)
1911 local
1912 Tpl.Text txt;
1913 Tpl.Text a_rest__str;
1914
1915 case ( txt,
1916 true,
1917 _ )
1918 then txt;
1919
1920 case ( txt,
1921 _,
1922 a_rest__str )
1923 algorithm
1924 40081 txt := Tpl.writeText(txt, a_rest__str);
1925 then txt;
1926 end match;
1927 end fun_68;
1928
1929 public function dumpElementItems
1930 input Tpl.Text in_txt;
1931 input list<Absyn.ElementItem> in_a_items;
1932 input String in_a_prevSpacing;
1933 input Boolean in_a_first;
1934 input Dump.DumpOptions in_a_options;
1935
1936 output Tpl.Text out_txt;
1937 algorithm
1938 out_txt :=
1939 match(in_txt, in_a_items, in_a_prevSpacing, in_a_first, in_a_options)
1940 local
1941 Tpl.Text txt;
1942 String a_prevSpacing;
1943 Boolean a_first;
1944 Dump.DumpOptions a_options;
1945 list<Absyn.ElementItem> i_rest__items;
1946 Absyn.ElementItem i_item;
1947 Boolean ret_6;
1948 Boolean ret_5;
1949 Tpl.Text l_post__spacing;
1950 Tpl.Text l_rest__str;
1951 Tpl.Text l_item__str;
1952 Tpl.Text l_pre__spacing;
1953 Tpl.Text l_spacing;
1954
1955 case ( txt,
1956 i_item :: i_rest__items,
1957 a_prevSpacing,
1958 a_first,
1959 a_options )
1960 algorithm
1961 46907 l_spacing := dumpElementItemSpacing(Tpl.emptyTxt, i_item);
1962 46907 l_pre__spacing := fun_66(Tpl.emptyTxt, a_first, a_prevSpacing, l_spacing);
1963 46907 l_item__str := dumpElementItem(Tpl.emptyTxt, i_item, a_options);
1964 46907 l_rest__str := dumpElementItems(Tpl.emptyTxt, i_rest__items, Tpl.textString(l_spacing), false, a_options);
1965 46907 ret_5 := Tpl.isEmpty(l_rest__str);
1966 46907 l_post__spacing := fun_67(Tpl.emptyTxt, ret_5, l_spacing);
1967 46907 txt := Tpl.writeText(txt, l_pre__spacing);
1968 46907 txt := Tpl.softNewLine(txt);
1969 46907 txt := Tpl.writeText(txt, l_item__str);
1970 46907 txt := Tpl.writeText(txt, l_post__spacing);
1971 46907 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1972 46907 ret_6 := Tpl.isEmpty(l_rest__str);
1973 46907 txt := fun_68(txt, ret_6, l_rest__str);
1974 then txt;
1975
1976 case ( txt,
1977 _,
1978 _,
1979 _,
1980 _ )
1981 then txt;
1982 end match;
1983 end dumpElementItems;
1984
1985 protected function fun_70
1986 input Tpl.Text in_txt;
1987 input String in_a_prevSpacing;
1988 input String in_a_curSpacing;
1989
1990 output Tpl.Text out_txt;
1991 algorithm
1992 out_txt :=
1993 match(in_txt, in_a_prevSpacing, in_a_curSpacing)
1994 local
1995 Tpl.Text txt;
1996 String a_curSpacing;
1997
1998 case ( txt,
1999 "",
2000 a_curSpacing )
2001 algorithm
2002 35166 txt := Tpl.writeStr(txt, a_curSpacing);
2003 then txt;
2004
2005 case ( txt,
2006 _,
2007 _ )
2008 then txt;
2009 end match;
2010 end fun_70;
2011
2012 public function dumpElementItemPreSpacing
2013 input Tpl.Text txt;
2014 input String a_curSpacing;
2015 input String a_prevSpacing;
2016
2017 output Tpl.Text out_txt;
2018 algorithm
2019 40081 out_txt := fun_70(txt, a_prevSpacing, a_curSpacing);
2020 end dumpElementItemPreSpacing;
2021
2022 public function dumpElementItemSpacing
2023 input Tpl.Text in_txt;
2024 input Absyn.ElementItem in_a_item;
2025
2026 output Tpl.Text out_txt;
2027 algorithm
2028 out_txt :=
2029 match(in_txt, in_a_item)
2030 local
2031 Tpl.Text txt;
2032 Absyn.ClassDef i_cdef;
2033
2034 case ( txt,
2035 Absyn.ELEMENTITEM(element = Absyn.ELEMENT(specification = Absyn.CLASSDEF(class_ = Absyn.CLASS(body = i_cdef)))) )
2036 algorithm
2037 6565 txt := dumpClassDefSpacing(txt, i_cdef);
2038 then txt;
2039
2040 case ( txt,
2041 _ )
2042 then txt;
2043 end match;
2044 end dumpElementItemSpacing;
2045
2046 public function dumpClassDefSpacing
2047 input Tpl.Text in_txt;
2048 input Absyn.ClassDef in_a_cdef;
2049
2050 output Tpl.Text out_txt;
2051 algorithm
2052 out_txt :=
2053 match(in_txt, in_a_cdef)
2054 local
2055 Tpl.Text txt;
2056
2057 case ( txt,
2058 Absyn.PARTS(typeVars = _) )
2059 algorithm
2060 5337 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
2061 then txt;
2062
2063 case ( txt,
2064 Absyn.CLASS_EXTENDS(baseClassName = _) )
2065 algorithm
2066 366 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
2067 then txt;
2068
2069 case ( txt,
2070 _ )
2071 then txt;
2072 end match;
2073 end dumpClassDefSpacing;
2074
2075 public function dumpElementItem
2076 input Tpl.Text in_txt;
2077 input Absyn.ElementItem in_a_eitem;
2078 input Dump.DumpOptions in_a_options;
2079
2080 output Tpl.Text out_txt;
2081 algorithm
2082 out_txt :=
2083 match(in_txt, in_a_eitem, in_a_options)
2084 local
2085 Tpl.Text txt;
2086 Dump.DumpOptions a_options;
2087 String i_comment;
2088 Absyn.Element i_element;
2089 String ret_0;
2090
2091 case ( txt,
2092 Absyn.ELEMENTITEM(element = i_element),
2093 a_options )
2094 algorithm
2095 45547 txt := dumpElement(txt, i_element, a_options);
2096 then txt;
2097
2098 case ( txt,
2099 Absyn.LEXER_COMMENT(comment = i_comment),
2100 _ )
2101 algorithm
2102 1360 ret_0 := System.trimWhitespace(i_comment);
2103 1360 txt := Tpl.writeStr(txt, ret_0);
2104 then txt;
2105
2106 case ( txt,
2107 _,
2108 _ )
2109 then txt;
2110 end match;
2111 end dumpElementItem;
2112
2113 protected function fun_75
2114 input Tpl.Text in_txt;
2115 input Option<Absyn.RedeclareKeywords> in_a_redeclareKeywords;
2116
2117 output Tpl.Text out_txt;
2118 algorithm
2119 out_txt :=
2120 match(in_txt, in_a_redeclareKeywords)
2121 local
2122 Tpl.Text txt;
2123 Absyn.RedeclareKeywords i_re;
2124
2125 case ( txt,
2126 SOME(i_re) )
2127 algorithm
2128 643 txt := dumpRedeclare(txt, i_re);
2129 then txt;
2130
2131 case ( txt,
2132 _ )
2133 then txt;
2134 end match;
2135 end fun_75;
2136
2137 protected function fun_76
2138 input Tpl.Text in_txt;
2139 input Option<Absyn.RedeclareKeywords> in_a_redeclareKeywords;
2140
2141 output Tpl.Text out_txt;
2142 algorithm
2143 out_txt :=
2144 match(in_txt, in_a_redeclareKeywords)
2145 local
2146 Tpl.Text txt;
2147 Absyn.RedeclareKeywords i_re;
2148
2149 case ( txt,
2150 SOME(i_re) )
2151 algorithm
2152 643 txt := dumpReplaceable(txt, i_re);
2153 then txt;
2154
2155 case ( txt,
2156 _ )
2157 then txt;
2158 end match;
2159 end fun_76;
2160
2161 protected function fun_77
2162 input Tpl.Text in_txt;
2163 input Option<Absyn.ConstrainClass> in_a_constrainClass;
2164
2165 output Tpl.Text out_txt;
2166 algorithm
2167 out_txt :=
2168 match(in_txt, in_a_constrainClass)
2169 local
2170 Tpl.Text txt;
2171 Absyn.ConstrainClass i_cc;
2172
2173 case ( txt,
2174 SOME(i_cc) )
2175 algorithm
2176 36 txt := dumpConstrainClass(txt, i_cc);
2177 then txt;
2178
2179 case ( txt,
2180 _ )
2181 then txt;
2182 end match;
2183 end fun_77;
2184
2185 protected function fun_78
2186 input Tpl.Text in_txt;
2187 input Boolean in_mArg;
2188 input Option<Absyn.ConstrainClass> in_a_constrainClass;
2189 input Dump.DumpOptions in_a_options;
2190 input Absyn.ElementSpec in_a_specification;
2191 input Absyn.InnerOuter in_a_innerOuter;
2192 input Option<Absyn.RedeclareKeywords> in_a_redeclareKeywords;
2193 input Boolean in_a_finalPrefix;
2194
2195 output Tpl.Text out_txt;
2196 algorithm
2197 out_txt :=
2198 match(in_txt, in_mArg, in_a_constrainClass, in_a_options, in_a_specification, in_a_innerOuter, in_a_redeclareKeywords, in_a_finalPrefix)
2199 local
2200 Tpl.Text txt;
2201 Option<Absyn.ConstrainClass> a_constrainClass;
2202 Dump.DumpOptions a_options;
2203 Absyn.ElementSpec a_specification;
2204 Absyn.InnerOuter a_innerOuter;
2205 Option<Absyn.RedeclareKeywords> a_redeclareKeywords;
2206 Boolean a_finalPrefix;
2207 Tpl.Text l_cc__str;
2208 Tpl.Text l_ec__str;
2209 Tpl.Text l_io__str;
2210 Tpl.Text l_repl__str;
2211 Tpl.Text l_redecl__str;
2212 Tpl.Text l_final__str;
2213
2214 case ( txt,
2215 false,
2216 _,
2217 _,
2218 _,
2219 _,
2220 _,
2221 _ )
2222 then txt;
2223
2224 case ( txt,
2225 _,
2226 a_constrainClass,
2227 a_options,
2228 a_specification,
2229 a_innerOuter,
2230 a_redeclareKeywords,
2231 a_finalPrefix )
2232 algorithm
2233 45547 l_final__str := dumpFinal(Tpl.emptyTxt, a_finalPrefix);
2234 45547 l_redecl__str := fun_75(Tpl.emptyTxt, a_redeclareKeywords);
2235 45547 l_repl__str := fun_76(Tpl.emptyTxt, a_redeclareKeywords);
2236 45547 l_io__str := dumpInnerOuter(Tpl.emptyTxt, a_innerOuter);
2237 45547 l_ec__str := dumpElementSpec(Tpl.emptyTxt, a_specification, Tpl.textString(l_final__str), Tpl.textString(l_redecl__str), Tpl.textString(l_repl__str), Tpl.textString(l_io__str), a_options);
2238 45547 l_cc__str := fun_77(Tpl.emptyTxt, a_constrainClass);
2239 45547 txt := Tpl.writeText(txt, l_ec__str);
2240 45547 txt := Tpl.writeText(txt, l_cc__str);
2241 45547 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
2242 then txt;
2243 end match;
2244 end fun_78;
2245
2246 protected function lm_79
2247 input output Tpl.Text txt;
2248 input list<Absyn.NamedArg> items;
2249 algorithm
2250 ✗ for lstElt_79 in items loop
2251 txt := match lstElt_79
2252 local
2253 Absyn.NamedArg i_arg;
2254
2255 case i_arg
2256 algorithm
2257 ✗ txt := dumpNamedArg(txt, i_arg);
2258 then txt;
2259 end match;
2260 end for;
2261 end lm_79;
2262
2263 protected function fun_80
2264 input Tpl.Text in_txt;
2265 input list<Absyn.NamedArg> in_a_args;
2266
2267 output Tpl.Text out_txt;
2268 algorithm
2269 out_txt :=
2270 match(in_txt, in_a_args)
2271 local
2272 Tpl.Text txt;
2273 list<Absyn.NamedArg> i_args;
2274
2275 case ( txt,
2276 {} )
2277 then txt;
2278
2279 case ( txt,
2280 i_args )
2281 algorithm
2282 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2283 ✗ txt := lm_79(txt, i_args);
2284 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2285 then txt;
2286 end match;
2287 end fun_80;
2288
2289 protected function fun_81
2290 input Tpl.Text in_txt;
2291 input Option<Absyn.Ident> in_a_optName;
2292
2293 output Tpl.Text out_txt;
2294 algorithm
2295 out_txt :=
2296 match(in_txt, in_a_optName)
2297 local
2298 Tpl.Text txt;
2299 Absyn.Ident i_name;
2300
2301 case ( txt,
2302 SOME(i_name) )
2303 algorithm
2304 ✗ txt := Tpl.writeStr(txt, i_name);
2305 then txt;
2306
2307 case ( txt,
2308 _ )
2309 then txt;
2310 end match;
2311 end fun_81;
2312
2313 protected function fun_82
2314 input Tpl.Text in_txt;
2315 input Boolean in_mArg;
2316 input String in_a_string;
2317 input SourceInfo in_a_info;
2318 input Option<Absyn.Ident> in_a_optName;
2319
2320 output Tpl.Text out_txt;
2321 algorithm
2322 out_txt :=
2323 match(in_txt, in_mArg, in_a_string, in_a_info, in_a_optName)
2324 local
2325 Tpl.Text txt;
2326 String a_string;
2327 SourceInfo a_info;
2328 Option<Absyn.Ident> a_optName;
2329 Tpl.Text l_info__str;
2330 Tpl.Text l_name__str;
2331
2332 case ( txt,
2333 false,
2334 _,
2335 _,
2336 _ )
2337 then txt;
2338
2339 case ( txt,
2340 _,
2341 a_string,
2342 a_info,
2343 a_optName )
2344 algorithm
2345 ✗ l_name__str := fun_81(Tpl.emptyTxt, a_optName);
2346 ✗ l_info__str := dumpInfo(Tpl.emptyTxt, a_info);
2347 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* Absyn.TEXT(SOME(\""));
2348 ✗ txt := Tpl.writeText(txt, l_name__str);
2349 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"), \""));
2350 ✗ txt := Tpl.writeStr(txt, a_string);
2351 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\", \""));
2352 ✗ txt := Tpl.writeText(txt, l_info__str);
2353 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\"); */"));
2354 then txt;
2355 end match;
2356 end fun_82;
2357
2358 public function dumpElement
2359 input Tpl.Text in_txt;
2360 input Absyn.Element in_a_elem;
2361 input Dump.DumpOptions in_a_options;
2362
2363 output Tpl.Text out_txt;
2364 algorithm
2365 out_txt :=
2366 match(in_txt, in_a_elem, in_a_options)
2367 local
2368 Tpl.Text txt;
2369 Dump.DumpOptions a_options;
2370 String i_string;
2371 Option<Absyn.Ident> i_optName;
2372 Absyn.Ident i_name;
2373 list<Absyn.NamedArg> i_args;
2374 Option<Absyn.ConstrainClass> i_constrainClass;
2375 Absyn.ElementSpec i_specification;
2376 Absyn.InnerOuter i_innerOuter;
2377 Option<Absyn.RedeclareKeywords> i_redeclareKeywords;
2378 Boolean i_finalPrefix;
2379 Absyn.Element i_elem;
2380 SourceInfo i_info;
2381 Boolean ret_5;
2382 Tpl.Text l_args__str;
2383 Boolean ret_3;
2384 Boolean ret_2;
2385 Boolean ret_1;
2386 Boolean ret_0;
2387
2388 case ( txt,
2389 (i_elem as Absyn.ELEMENT(info = i_info, finalPrefix = i_finalPrefix, redeclareKeywords = i_redeclareKeywords, innerOuter = i_innerOuter, specification = i_specification, constrainClass = i_constrainClass)),
2390 a_options )
2391 algorithm
2392 45547 ret_0 := Dump.boolUnparseFileFromInfo(i_info, a_options);
2393 45547 ret_1 := AbsynUtil.isClassdef(i_elem);
2394 45547 ret_2 := boolNot(ret_1);
2395 45547 ret_3 := boolOr(ret_0, ret_2);
2396 45547 txt := fun_78(txt, ret_3, i_constrainClass, a_options, i_specification, i_innerOuter, i_redeclareKeywords, i_finalPrefix);
2397 then txt;
2398
2399 case ( txt,
2400 Absyn.DEFINEUNIT(args = i_args, name = i_name),
2401 _ )
2402 algorithm
2403 ✗ l_args__str := fun_80(Tpl.emptyTxt, i_args);
2404 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("defineunit "));
2405 ✗ txt := Tpl.writeStr(txt, i_name);
2406 ✗ txt := Tpl.writeText(txt, l_args__str);
2407 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
2408 then txt;
2409
2410 case ( txt,
2411 Absyn.TEXT(info = i_info, optName = i_optName, string = i_string),
2412 a_options )
2413 algorithm
2414 ✗ ret_5 := Dump.boolUnparseFileFromInfo(i_info, a_options);
2415 ✗ txt := fun_82(txt, ret_5, i_string, i_info, i_optName);
2416 then txt;
2417
2418 case ( txt,
2419 _,
2420 _ )
2421 then txt;
2422 end match;
2423 end dumpElement;
2424
2425 protected function fun_84
2426 input Tpl.Text in_txt;
2427 input Boolean in_a_isReadOnly;
2428
2429 output Tpl.Text out_txt;
2430 algorithm
2431 out_txt :=
2432 match(in_txt, in_a_isReadOnly)
2433 local
2434 Tpl.Text txt;
2435
2436 case ( txt,
2437 false )
2438 algorithm
2439 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("writable"));
2440 then txt;
2441
2442 case ( txt,
2443 _ )
2444 algorithm
2445 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("readonly"));
2446 then txt;
2447 end match;
2448 end fun_84;
2449
2450 public function dumpInfo
2451 input Tpl.Text in_txt;
2452 input SourceInfo in_a_info;
2453
2454 output Tpl.Text out_txt;
2455 algorithm
2456 out_txt :=
2457 match(in_txt, in_a_info)
2458 local
2459 Tpl.Text txt;
2460 Integer i_columnNumberEnd;
2461 Integer i_lineNumberEnd;
2462 Integer i_columnNumberStart;
2463 Integer i_lineNumberStart;
2464 String i_fileName;
2465 Boolean i_isReadOnly;
2466 Tpl.Text l_rm__str;
2467
2468 case ( txt,
2469 SOURCEINFO(isReadOnly = i_isReadOnly, fileName = i_fileName, lineNumberStart = i_lineNumberStart, columnNumberStart = i_columnNumberStart, lineNumberEnd = i_lineNumberEnd, columnNumberEnd = i_columnNumberEnd) )
2470 algorithm
2471 ✗ l_rm__str := fun_84(Tpl.emptyTxt, i_isReadOnly);
2472 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("SOURCEINFO(\""));
2473 ✗ txt := Tpl.writeStr(txt, i_fileName);
2474 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\", "));
2475 ✗ txt := Tpl.writeText(txt, l_rm__str);
2476 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
2477 ✗ txt := Tpl.writeStr(txt, intString(i_lineNumberStart));
2478 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
2479 ✗ txt := Tpl.writeStr(txt, intString(i_columnNumberStart));
2480 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
2481 ✗ txt := Tpl.writeStr(txt, intString(i_lineNumberEnd));
2482 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
2483 ✗ txt := Tpl.writeStr(txt, intString(i_columnNumberEnd));
2484 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")\\n"));
2485 then txt;
2486
2487 case ( txt,
2488 _ )
2489 then txt;
2490 end match;
2491 end dumpInfo;
2492
2493 public function dumpAnnotation
2494 input Tpl.Text in_txt;
2495 input Absyn.Annotation in_a_ann;
2496
2497 output Tpl.Text out_txt;
2498 algorithm
2499 out_txt :=
2500 match(in_txt, in_a_ann)
2501 local
2502 Tpl.Text txt;
2503 list<Absyn.ElementArg> i_elementArgs;
2504 Tpl.Text txt_0;
2505
2506 case ( txt,
2507 Absyn.ANNOTATION(elementArgs = {}) )
2508 algorithm
2509 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation()"));
2510 then txt;
2511
2512 case ( txt,
2513 Absyn.ANNOTATION(elementArgs = i_elementArgs) )
2514 algorithm
2515 26751 txt := Tpl.writeTok(txt, Tpl.ST_LINE("annotation(\n"));
2516 26751 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
2517 26751 txt_0 := Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING(","));
2518 26751 txt_0 := Tpl.writeTok(txt_0, Tpl.ST_NEW_LINE());
2519 26751 (txt, txt_0) := dumpElementArgList(txt, i_elementArgs, txt_0);
2520 26751 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2521 26751 txt := Tpl.popBlock(txt);
2522 then txt;
2523
2524 case ( txt,
2525 _ )
2526 then txt;
2527 end match;
2528 end dumpAnnotation;
2529
2530 public function dumpAnnotationOpt
2531 input Tpl.Text in_txt;
2532 input Option<Absyn.Annotation> in_a_oann;
2533
2534 output Tpl.Text out_txt;
2535 algorithm
2536 out_txt :=
2537 match(in_txt, in_a_oann)
2538 local
2539 Tpl.Text txt;
2540 Absyn.Annotation i_ann;
2541
2542 case ( txt,
2543 SOME(i_ann) )
2544 algorithm
2545 ✗ txt := dumpAnnotation(txt, i_ann);
2546 then txt;
2547
2548 case ( txt,
2549 _ )
2550 then txt;
2551 end match;
2552 end dumpAnnotationOpt;
2553
2554 public function dumpAnnotationOptSpace
2555 input Tpl.Text in_txt;
2556 input Option<Absyn.Annotation> in_a_oann;
2557
2558 output Tpl.Text out_txt;
2559 algorithm
2560 out_txt :=
2561 match(in_txt, in_a_oann)
2562 local
2563 Tpl.Text txt;
2564 Absyn.Annotation i_ann;
2565
2566 case ( txt,
2567 SOME(i_ann) )
2568 algorithm
2569 22070 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
2570 22070 txt := dumpAnnotation(txt, i_ann);
2571 then txt;
2572
2573 case ( txt,
2574 _ )
2575 then txt;
2576 end match;
2577 end dumpAnnotationOptSpace;
2578
2579 public function dumpComment
2580 input Tpl.Text in_txt;
2581 input Absyn.Comment in_a_cmt;
2582
2583 output Tpl.Text out_txt;
2584 algorithm
2585 out_txt :=
2586 match(in_txt, in_a_cmt)
2587 local
2588 Tpl.Text txt;
2589 Option<Absyn.Annotation> i_annotation__;
2590 Option<String> i_comment;
2591
2592 case ( txt,
2593 Absyn.COMMENT(comment = i_comment, annotation_ = i_annotation__) )
2594 algorithm
2595 37014 txt := dumpStringCommentOption(txt, i_comment);
2596 37014 txt := dumpAnnotationOptSpace(txt, i_annotation__);
2597 then txt;
2598
2599 case ( txt,
2600 _ )
2601 then txt;
2602 end match;
2603 end dumpComment;
2604
2605 public function dumpCommentOpt
2606 input Tpl.Text in_txt;
2607 input Option<Absyn.Comment> in_a_ocmt;
2608
2609 output Tpl.Text out_txt;
2610 algorithm
2611 out_txt :=
2612 match(in_txt, in_a_ocmt)
2613 local
2614 Tpl.Text txt;
2615 Absyn.Comment i_cmt;
2616
2617 case ( txt,
2618 SOME(i_cmt) )
2619 algorithm
2620 37014 txt := dumpComment(txt, i_cmt);
2621 then txt;
2622
2623 case ( txt,
2624 _ )
2625 then txt;
2626 end match;
2627 end dumpCommentOpt;
2628
2629 protected function fun_91
2630 input Tpl.Text in_txt;
2631 input Boolean in_a_b;
2632 input Tpl.Text in_a_separator;
2633
2634 output Tpl.Text out_txt;
2635 algorithm
2636 out_txt :=
2637 match(in_txt, in_a_b, in_a_separator)
2638 local
2639 Tpl.Text txt;
2640 Tpl.Text a_separator;
2641
2642 case ( txt,
2643 false,
2644 _ )
2645 then txt;
2646
2647 case ( txt,
2648 _,
2649 a_separator )
2650 algorithm
2651 54382 txt := Tpl.writeText(txt, a_separator);
2652 then txt;
2653 end match;
2654 end fun_91;
2655
2656 protected function lm_92
2657 input output Tpl.Text txt;
2658 input list<tuple<Absyn.ElementArg, Boolean>> items;
2659 input Tpl.Text a_separator;
2660 algorithm
2661
2/2
✓ Branch 0 taken 135138 times.
✓ Branch 1 taken 85279 times.
220417 for lstElt_92 in items loop
2662 txt := match lstElt_92
2663 local
2664 Boolean i_b;
2665 Absyn.ElementArg i_earg;
2666
2667 case (i_earg, i_b)
2668 algorithm
2669 135138 txt := dumpElementArg(txt, i_earg);
2670 135138 txt := fun_91(txt, i_b, a_separator);
2671 then txt;
2672 end match;
2673 end for;
2674 end lm_92;
2675
2676 public function dumpElementArgList
2677 input Tpl.Text txt;
2678 input list<Absyn.ElementArg> a_elementArgs;
2679 input Tpl.Text a_separator;
2680
2681 output Tpl.Text out_txt;
2682 output Tpl.Text out_a_separator;
2683 protected
2684 list<tuple<Absyn.ElementArg, Boolean>> ret_0;
2685 algorithm
2686 85279 ret_0 := Dump.shouldSeparateAfterElementArg(a_elementArgs);
2687 85279 out_txt := lm_92(txt, ret_0, a_separator);
2688 out_a_separator := a_separator;
2689 end dumpElementArgList;
2690
2691 protected function fun_94
2692 input Tpl.Text in_txt;
2693 input Option<Absyn.Modification> in_a_modification;
2694
2695 output Tpl.Text out_txt;
2696 algorithm
2697 out_txt :=
2698 match(in_txt, in_a_modification)
2699 local
2700 Tpl.Text txt;
2701 Absyn.Modification i_mod;
2702
2703 case ( txt,
2704 SOME(i_mod) )
2705 algorithm
2706 134439 txt := dumpModification(txt, i_mod);
2707 then txt;
2708
2709 case ( txt,
2710 _ )
2711 then txt;
2712 end match;
2713 end fun_94;
2714
2715 protected function fun_95
2716 input Tpl.Text in_txt;
2717 input Option<Absyn.ConstrainClass> in_a_constrainClass;
2718
2719 output Tpl.Text out_txt;
2720 algorithm
2721 out_txt :=
2722 match(in_txt, in_a_constrainClass)
2723 local
2724 Tpl.Text txt;
2725 Absyn.ConstrainClass i_cc;
2726
2727 case ( txt,
2728 SOME(i_cc) )
2729 algorithm
2730 2 txt := dumpConstrainClass(txt, i_cc);
2731 then txt;
2732
2733 case ( txt,
2734 _ )
2735 then txt;
2736 end match;
2737 end fun_95;
2738
2739 public function dumpElementArg
2740 input Tpl.Text in_txt;
2741 input Absyn.ElementArg in_a_earg;
2742
2743 output Tpl.Text out_txt;
2744 algorithm
2745 out_txt :=
2746 match(in_txt, in_a_earg)
2747 local
2748 Tpl.Text txt;
2749 String i_comment_1;
2750 Option<Absyn.ConstrainClass> i_constrainClass;
2751 Absyn.ElementSpec i_elementSpec;
2752 Absyn.RedeclareKeywords i_redeclareKeywords;
2753 Option<String> i_comment;
2754 Option<Absyn.Modification> i_modification;
2755 Absyn.Path i_path;
2756 Boolean i_finalPrefix;
2757 Absyn.Each i_eachPrefix;
2758 Tpl.Text l_cc__str;
2759 Tpl.Text l_elem__str;
2760 Tpl.Text l_eredecl__str;
2761 Tpl.Text l_repl__str;
2762 Tpl.Text l_redecl__str;
2763 Tpl.Text l_cmt__str;
2764 Tpl.Text l_mod__str;
2765 Tpl.Text l_path__str;
2766 Tpl.Text l_final__str;
2767 Tpl.Text l_each__str;
2768
2769 case ( txt,
2770 Absyn.MODIFICATION(eachPrefix = i_eachPrefix, finalPrefix = i_finalPrefix, path = i_path, modification = i_modification, comment = i_comment) )
2771 algorithm
2772 134618 l_each__str := dumpEach(Tpl.emptyTxt, i_eachPrefix);
2773 134618 l_final__str := dumpFinal(Tpl.emptyTxt, i_finalPrefix);
2774 134618 l_path__str := dumpPath(Tpl.emptyTxt, i_path);
2775 134618 l_mod__str := fun_94(Tpl.emptyTxt, i_modification);
2776 134618 l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
2777 134618 txt := Tpl.writeText(txt, l_each__str);
2778 134618 txt := Tpl.writeText(txt, l_final__str);
2779 134618 txt := Tpl.writeText(txt, l_path__str);
2780 134618 txt := Tpl.writeText(txt, l_mod__str);
2781 134618 txt := Tpl.writeText(txt, l_cmt__str);
2782 then txt;
2783
2784 case ( txt,
2785 Absyn.REDECLARATION(eachPrefix = i_eachPrefix, finalPrefix = i_finalPrefix, redeclareKeywords = i_redeclareKeywords, elementSpec = i_elementSpec, constrainClass = i_constrainClass) )
2786 algorithm
2787 527 l_each__str := dumpEach(Tpl.emptyTxt, i_eachPrefix);
2788 527 l_final__str := dumpFinal(Tpl.emptyTxt, i_finalPrefix);
2789 527 l_redecl__str := dumpRedeclare(Tpl.emptyTxt, i_redeclareKeywords);
2790 527 l_repl__str := dumpReplaceable(Tpl.emptyTxt, i_redeclareKeywords);
2791 527 l_eredecl__str := Tpl.writeText(Tpl.emptyTxt, l_redecl__str);
2792 527 l_eredecl__str := Tpl.writeText(l_eredecl__str, l_each__str);
2793 527 l_elem__str := dumpElementSpec(Tpl.emptyTxt, i_elementSpec, Tpl.textString(l_final__str), Tpl.textString(l_eredecl__str), Tpl.textString(l_repl__str), "", Dump.defaultDumpOptions);
2794 527 l_cc__str := fun_95(Tpl.emptyTxt, i_constrainClass);
2795 527 txt := Tpl.writeText(txt, l_elem__str);
2796 527 txt := Tpl.writeText(txt, l_cc__str);
2797 then txt;
2798
2799 case ( txt,
2800 Absyn.ELEMENTARGCOMMENT(comment = i_comment_1) )
2801 algorithm
2802 1 txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
2803 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
2804 1 txt := Tpl.writeStr(txt, i_comment_1);
2805 1 txt := Tpl.popBlock(txt);
2806 then txt;
2807
2808 case ( txt,
2809 _ )
2810 then txt;
2811 end match;
2812 end dumpElementArg;
2813
2814 public function dumpEach
2815 input Tpl.Text in_txt;
2816 input Absyn.Each in_a_each;
2817
2818 output Tpl.Text out_txt;
2819 algorithm
2820 out_txt :=
2821 match(in_txt, in_a_each)
2822 local
2823 Tpl.Text txt;
2824
2825 case ( txt,
2826 Absyn.EACH() )
2827 algorithm
2828 788 txt := Tpl.writeTok(txt, Tpl.ST_STRING("each "));
2829 then txt;
2830
2831 case ( txt,
2832 _ )
2833 then txt;
2834 end match;
2835 end dumpEach;
2836
2837 public function dumpFinal
2838 input Tpl.Text in_txt;
2839 input Boolean in_a_final;
2840
2841 output Tpl.Text out_txt;
2842 algorithm
2843 out_txt :=
2844 match(in_txt, in_a_final)
2845 local
2846 Tpl.Text txt;
2847
2848 case ( txt,
2849 false )
2850 then txt;
2851
2852 case ( txt,
2853 _ )
2854 algorithm
2855 5648 txt := Tpl.writeTok(txt, Tpl.ST_STRING("final "));
2856 then txt;
2857 end match;
2858 end dumpFinal;
2859
2860 public function dumpRedeclare
2861 input Tpl.Text in_txt;
2862 input Absyn.RedeclareKeywords in_a_redecl;
2863
2864 output Tpl.Text out_txt;
2865 algorithm
2866 out_txt :=
2867 match(in_txt, in_a_redecl)
2868 local
2869 Tpl.Text txt;
2870
2871 case ( txt,
2872 Absyn.REDECLARE() )
2873 algorithm
2874 913 txt := Tpl.writeTok(txt, Tpl.ST_STRING("redeclare "));
2875 then txt;
2876
2877 case ( txt,
2878 Absyn.REDECLARE_REPLACEABLE() )
2879 algorithm
2880 52 txt := Tpl.writeTok(txt, Tpl.ST_STRING("redeclare "));
2881 then txt;
2882
2883 case ( txt,
2884 _ )
2885 then txt;
2886 end match;
2887 end dumpRedeclare;
2888
2889 public function dumpReplaceable
2890 input Tpl.Text in_txt;
2891 input Absyn.RedeclareKeywords in_a_repl;
2892
2893 output Tpl.Text out_txt;
2894 algorithm
2895 out_txt :=
2896 match(in_txt, in_a_repl)
2897 local
2898 Tpl.Text txt;
2899
2900 case ( txt,
2901 Absyn.REPLACEABLE() )
2902 algorithm
2903 205 txt := Tpl.writeTok(txt, Tpl.ST_STRING("replaceable "));
2904 then txt;
2905
2906 case ( txt,
2907 Absyn.REDECLARE_REPLACEABLE() )
2908 algorithm
2909 52 txt := Tpl.writeTok(txt, Tpl.ST_STRING("replaceable "));
2910 then txt;
2911
2912 case ( txt,
2913 _ )
2914 then txt;
2915 end match;
2916 end dumpReplaceable;
2917
2918 public function dumpInnerOuter
2919 input Tpl.Text in_txt;
2920 input Absyn.InnerOuter in_a_io;
2921
2922 output Tpl.Text out_txt;
2923 algorithm
2924 out_txt :=
2925 match(in_txt, in_a_io)
2926 local
2927 Tpl.Text txt;
2928
2929 case ( txt,
2930 Absyn.INNER() )
2931 algorithm
2932 89 txt := Tpl.writeTok(txt, Tpl.ST_STRING("inner "));
2933 then txt;
2934
2935 case ( txt,
2936 Absyn.OUTER() )
2937 algorithm
2938 43 txt := Tpl.writeTok(txt, Tpl.ST_STRING("outer "));
2939 then txt;
2940
2941 case ( txt,
2942 Absyn.INNER_OUTER() )
2943 algorithm
2944 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("inner outer "));
2945 then txt;
2946
2947 case ( txt,
2948 _ )
2949 then txt;
2950 end match;
2951 end dumpInnerOuter;
2952
2953 protected function fun_102
2954 input Tpl.Text in_txt;
2955 input list<Absyn.ElementArg> in_a_elementArgLst;
2956
2957 output Tpl.Text out_txt;
2958 algorithm
2959 out_txt :=
2960 match(in_txt, in_a_elementArgLst)
2961 local
2962 Tpl.Text txt;
2963 list<Absyn.ElementArg> i_elementArgLst;
2964
2965 case ( txt,
2966 {} )
2967 then txt;
2968
2969 case ( txt,
2970 i_elementArgLst )
2971 algorithm
2972 52801 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2973 52801 (txt, _) := dumpElementArgList(txt, i_elementArgLst, Tpl.strTokText(Tpl.ST_STRING(", ")));
2974 52801 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2975 then txt;
2976 end match;
2977 end fun_102;
2978
2979 public function dumpModification
2980 input Tpl.Text in_txt;
2981 input Absyn.Modification in_a_mod;
2982
2983 output Tpl.Text out_txt;
2984 algorithm
2985 out_txt :=
2986 match(in_txt, in_a_mod)
2987 local
2988 Tpl.Text txt;
2989 Absyn.EqMod i_eqMod;
2990 list<Absyn.ElementArg> i_elementArgLst;
2991 Tpl.Text l_eq__str;
2992 Tpl.Text l_arg__str;
2993
2994 case ( txt,
2995 Absyn.CLASSMOD(elementArgLst = i_elementArgLst, eqMod = i_eqMod) )
2996 algorithm
2997 154406 l_arg__str := fun_102(Tpl.emptyTxt, i_elementArgLst);
2998 154406 l_eq__str := dumpEqMod(Tpl.emptyTxt, i_eqMod);
2999 154406 txt := Tpl.writeText(txt, l_arg__str);
3000 154406 txt := Tpl.writeText(txt, l_eq__str);
3001 then txt;
3002
3003 case ( txt,
3004 _ )
3005 then txt;
3006 end match;
3007 end dumpModification;
3008
3009 public function dumpEqMod
3010 input Tpl.Text in_txt;
3011 input Absyn.EqMod in_a_eqmod;
3012
3013 output Tpl.Text out_txt;
3014 algorithm
3015 out_txt :=
3016 match(in_txt, in_a_eqmod)
3017 local
3018 Tpl.Text txt;
3019 Absyn.Exp i_exp;
3020
3021 case ( txt,
3022 Absyn.EQMOD(exp = i_exp) )
3023 algorithm
3024 102823 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3025 102823 txt := Tpl.writeTok(txt, Tpl.ST_STRING("= "));
3026 102823 txt := dumpExp(txt, i_exp);
3027 then txt;
3028
3029 case ( txt,
3030 _ )
3031 then txt;
3032 end match;
3033 end dumpEqMod;
3034
3035 protected function fun_105
3036 input Tpl.Text in_txt;
3037 input Boolean in_mArg;
3038 input Tpl.Text in_a_args__str;
3039
3040 output Tpl.Text out_txt;
3041 algorithm
3042 out_txt :=
3043 match(in_txt, in_mArg, in_a_args__str)
3044 local
3045 Tpl.Text txt;
3046 Tpl.Text a_args__str;
3047
3048 case ( txt,
3049 true,
3050 _ )
3051 then txt;
3052
3053 case ( txt,
3054 _,
3055 a_args__str )
3056 algorithm
3057 596 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3058 596 txt := Tpl.writeText(txt, a_args__str);
3059 596 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3060 then txt;
3061 end match;
3062 end fun_105;
3063
3064 protected function lm_106
3065 input output Tpl.Text txt;
3066 input list<Absyn.ComponentItem> items;
3067 algorithm
3068
2/2
✓ Branch 0 taken 33088 times.
✓ Branch 1 taken 33057 times.
66145 for lstElt_106 in items loop
3069 txt := match lstElt_106
3070 local
3071 Absyn.ComponentItem i_comp;
3072
3073 case i_comp
3074 algorithm
3075 33088 txt := dumpComponentItem(txt, i_comp);
3076 33088 txt := Tpl.nextIter(txt);
3077 then txt;
3078 end match;
3079 end for;
3080 end lm_106;
3081
3082 public function dumpElementSpec
3083 input Tpl.Text in_txt;
3084 input Absyn.ElementSpec in_a_elem;
3085 input String in_a_final;
3086 input String in_a_redecl;
3087 input String in_a_repl;
3088 input String in_a_io;
3089 input Dump.DumpOptions in_a_options;
3090
3091 output Tpl.Text out_txt;
3092 algorithm
3093 out_txt :=
3094 match(in_txt, in_a_elem, in_a_final, in_a_redecl, in_a_repl, in_a_io, in_a_options)
3095 local
3096 Tpl.Text txt;
3097 String a_final;
3098 String a_redecl;
3099 String a_repl;
3100 String a_io;
3101 Dump.DumpOptions a_options;
3102 Option<Absyn.Comment> i_comment;
3103 Absyn.Import i_import__;
3104 list<Absyn.ComponentItem> i_components;
3105 Absyn.ElementAttributes i_attributes;
3106 Absyn.TypeSpec i_typeSpec;
3107 Option<Absyn.Annotation> i_annotationOpt;
3108 list<Absyn.ElementArg> i_elementArg;
3109 Absyn.Path i_path;
3110 Absyn.Class i_class__;
3111 Tpl.Text l_imp__str;
3112 Tpl.Text l_prefix__str;
3113 Tpl.Text l_comps__str;
3114 Tpl.Text l_dim__str;
3115 Tpl.Text l_attr__str;
3116 Tpl.Text l_ty__str;
3117 Tpl.Text l_ann__str;
3118 Boolean ret_3;
3119 Tpl.Text l_mod__str;
3120 Tpl.Text l_args__str;
3121 Tpl.Text l_bc__str;
3122
3123 case ( txt,
3124 Absyn.CLASSDEF(class_ = i_class__),
3125 a_final,
3126 a_redecl,
3127 a_repl,
3128 a_io,
3129 a_options )
3130 algorithm
3131 6884 txt := dumpClassElement(txt, i_class__, a_final, a_redecl, a_repl, a_io, "", a_options);
3132 then txt;
3133
3134 case ( txt,
3135 Absyn.EXTENDS(path = i_path, elementArg = i_elementArg, annotationOpt = i_annotationOpt),
3136 _,
3137 _,
3138 _,
3139 _,
3140 _ )
3141 algorithm
3142 5120 l_bc__str := dumpPath(Tpl.emptyTxt, i_path);
3143 5120 (l_args__str, _) := dumpElementArgList(Tpl.emptyTxt, i_elementArg, Tpl.strTokText(Tpl.ST_STRING(", ")));
3144 5120 ret_3 := Tpl.isEmpty(l_args__str);
3145 5120 l_mod__str := fun_105(Tpl.emptyTxt, ret_3, l_args__str);
3146 5120 l_ann__str := dumpAnnotationOptSpace(Tpl.emptyTxt, i_annotationOpt);
3147 5120 txt := Tpl.writeTok(txt, Tpl.ST_STRING("extends "));
3148 5120 txt := Tpl.writeText(txt, l_bc__str);
3149 5120 txt := Tpl.writeText(txt, l_mod__str);
3150 5120 txt := Tpl.writeText(txt, l_ann__str);
3151 then txt;
3152
3153 case ( txt,
3154 Absyn.COMPONENTS(typeSpec = i_typeSpec, attributes = i_attributes, components = i_components),
3155 a_final,
3156 a_redecl,
3157 a_repl,
3158 a_io,
3159 _ )
3160 algorithm
3161 33057 l_ty__str := dumpTypeSpec(Tpl.emptyTxt, i_typeSpec);
3162 33057 l_attr__str := dumpElementAttr(Tpl.emptyTxt, i_attributes);
3163 33057 l_dim__str := dumpElementAttrDim(Tpl.emptyTxt, i_attributes);
3164 33057 l_comps__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3165 33057 l_comps__str := lm_106(l_comps__str, i_components);
3166 33057 l_comps__str := Tpl.popIter(l_comps__str);
3167 33057 l_prefix__str := Tpl.writeStr(Tpl.emptyTxt, a_redecl);
3168 33057 l_prefix__str := Tpl.writeStr(l_prefix__str, a_final);
3169 33057 l_prefix__str := Tpl.writeStr(l_prefix__str, a_io);
3170 33057 l_prefix__str := Tpl.writeStr(l_prefix__str, a_repl);
3171 33057 txt := Tpl.writeText(txt, l_prefix__str);
3172 33057 txt := Tpl.writeText(txt, l_attr__str);
3173 33057 txt := Tpl.writeText(txt, l_ty__str);
3174 33057 txt := Tpl.writeText(txt, l_dim__str);
3175 33057 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3176 33057 txt := Tpl.writeText(txt, l_comps__str);
3177 then txt;
3178
3179 case ( txt,
3180 Absyn.IMPORT(import_ = i_import__, comment = i_comment),
3181 _,
3182 _,
3183 _,
3184 _,
3185 _ )
3186 algorithm
3187 1013 l_imp__str := dumpImport(Tpl.emptyTxt, i_import__);
3188 1013 txt := Tpl.writeTok(txt, Tpl.ST_STRING("import "));
3189 1013 txt := Tpl.writeText(txt, l_imp__str);
3190 1013 txt := dumpCommentOpt(txt, i_comment);
3191 then txt;
3192
3193 case ( txt,
3194 _,
3195 _,
3196 _,
3197 _,
3198 _,
3199 _ )
3200 then txt;
3201 end match;
3202 end dumpElementSpec;
3203
3204 protected function fun_108
3205 input Tpl.Text in_txt;
3206 input Boolean in_a_flowPrefix;
3207
3208 output Tpl.Text out_txt;
3209 algorithm
3210 out_txt :=
3211 match(in_txt, in_a_flowPrefix)
3212 local
3213 Tpl.Text txt;
3214
3215 case ( txt,
3216 false )
3217 then txt;
3218
3219 case ( txt,
3220 _ )
3221 algorithm
3222 25 txt := Tpl.writeTok(txt, Tpl.ST_STRING("flow "));
3223 then txt;
3224 end match;
3225 end fun_108;
3226
3227 protected function fun_109
3228 input Tpl.Text in_txt;
3229 input Boolean in_a_streamPrefix;
3230
3231 output Tpl.Text out_txt;
3232 algorithm
3233 out_txt :=
3234 match(in_txt, in_a_streamPrefix)
3235 local
3236 Tpl.Text txt;
3237
3238 case ( txt,
3239 false )
3240 then txt;
3241
3242 case ( txt,
3243 _ )
3244 algorithm
3245 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING("stream "));
3246 then txt;
3247 end match;
3248 end fun_109;
3249
3250 public function dumpElementAttr
3251 input Tpl.Text in_txt;
3252 input Absyn.ElementAttributes in_a_attr;
3253
3254 output Tpl.Text out_txt;
3255 algorithm
3256 out_txt :=
3257 match(in_txt, in_a_attr)
3258 local
3259 Tpl.Text txt;
3260 Absyn.Direction i_direction;
3261 Absyn.Variability i_variability;
3262 Absyn.IsField i_isField;
3263 Absyn.Parallelism i_parallelism;
3264 Boolean i_streamPrefix;
3265 Boolean i_flowPrefix;
3266 Tpl.Text l_dir__str;
3267 Tpl.Text l_var__str;
3268 Tpl.Text l_field__str;
3269 Tpl.Text l_par__str;
3270 Tpl.Text l_stream__str;
3271 Tpl.Text l_flow__str;
3272
3273 case ( txt,
3274 Absyn.ATTR(flowPrefix = i_flowPrefix, streamPrefix = i_streamPrefix, parallelism = i_parallelism, isField = i_isField, variability = i_variability, direction = i_direction) )
3275 algorithm
3276 34180 l_flow__str := fun_108(Tpl.emptyTxt, i_flowPrefix);
3277 34180 l_stream__str := fun_109(Tpl.emptyTxt, i_streamPrefix);
3278 34180 l_par__str := dumpParallelism(Tpl.emptyTxt, i_parallelism);
3279 34180 l_field__str := dumpIsField(Tpl.emptyTxt, i_isField);
3280 34180 l_var__str := dumpVariability(Tpl.emptyTxt, i_variability);
3281 34180 l_dir__str := dumpDirection(Tpl.emptyTxt, i_direction);
3282 34180 txt := Tpl.writeText(txt, l_flow__str);
3283 34180 txt := Tpl.writeText(txt, l_stream__str);
3284 34180 txt := Tpl.writeText(txt, l_par__str);
3285 34180 txt := Tpl.writeText(txt, l_field__str);
3286 34180 txt := Tpl.writeText(txt, l_var__str);
3287 34180 txt := Tpl.writeText(txt, l_dir__str);
3288 then txt;
3289
3290 case ( txt,
3291 _ )
3292 then txt;
3293 end match;
3294 end dumpElementAttr;
3295
3296 public function dumpParallelism
3297 input Tpl.Text in_txt;
3298 input Absyn.Parallelism in_a_par;
3299
3300 output Tpl.Text out_txt;
3301 algorithm
3302 out_txt :=
3303 match(in_txt, in_a_par)
3304 local
3305 Tpl.Text txt;
3306
3307 case ( txt,
3308 Absyn.PARGLOBAL() )
3309 algorithm
3310 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parglobal "));
3311 then txt;
3312
3313 case ( txt,
3314 Absyn.PARLOCAL() )
3315 algorithm
3316 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parlocal "));
3317 then txt;
3318
3319 case ( txt,
3320 Absyn.NON_PARALLEL() )
3321 then txt;
3322
3323 case ( txt,
3324 _ )
3325 then txt;
3326 end match;
3327 end dumpParallelism;
3328
3329 public function dumpIsField
3330 input Tpl.Text in_txt;
3331 input Absyn.IsField in_a_isField;
3332
3333 output Tpl.Text out_txt;
3334 algorithm
3335 out_txt :=
3336 match(in_txt, in_a_isField)
3337 local
3338 Tpl.Text txt;
3339
3340 case ( txt,
3341 Absyn.NONFIELD() )
3342 then txt;
3343
3344 case ( txt,
3345 Absyn.FIELD() )
3346 algorithm
3347 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("field "));
3348 then txt;
3349
3350 case ( txt,
3351 _ )
3352 then txt;
3353 end match;
3354 end dumpIsField;
3355
3356 public function dumpVariability
3357 input Tpl.Text in_txt;
3358 input Absyn.Variability in_a_var;
3359
3360 output Tpl.Text out_txt;
3361 algorithm
3362 out_txt :=
3363 match(in_txt, in_a_var)
3364 local
3365 Tpl.Text txt;
3366
3367 case ( txt,
3368 Absyn.VAR() )
3369 then txt;
3370
3371 case ( txt,
3372 Absyn.DISCRETE() )
3373 algorithm
3374 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING("discrete "));
3375 then txt;
3376
3377 case ( txt,
3378 Absyn.PARAM() )
3379 algorithm
3380 7004 txt := Tpl.writeTok(txt, Tpl.ST_STRING("parameter "));
3381 then txt;
3382
3383 case ( txt,
3384 Absyn.CONST() )
3385 algorithm
3386 2277 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant "));
3387 then txt;
3388
3389 case ( txt,
3390 _ )
3391 then txt;
3392 end match;
3393 end dumpVariability;
3394
3395 public function dumpDirection
3396 input Tpl.Text in_txt;
3397 input Absyn.Direction in_a_dir;
3398
3399 output Tpl.Text out_txt;
3400 algorithm
3401 out_txt :=
3402 match(in_txt, in_a_dir)
3403 local
3404 Tpl.Text txt;
3405
3406 case ( txt,
3407 Absyn.BIDIR() )
3408 then txt;
3409
3410 case ( txt,
3411 Absyn.INPUT() )
3412 algorithm
3413 4252 txt := Tpl.writeTok(txt, Tpl.ST_STRING("input "));
3414 then txt;
3415
3416 case ( txt,
3417 Absyn.OUTPUT() )
3418 algorithm
3419 2261 txt := Tpl.writeTok(txt, Tpl.ST_STRING("output "));
3420 then txt;
3421
3422 case ( txt,
3423 Absyn.INPUT_OUTPUT() )
3424 algorithm
3425 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("input output "));
3426 then txt;
3427
3428 case ( txt,
3429 _ )
3430 then txt;
3431 end match;
3432 end dumpDirection;
3433
3434 public function dumpElementAttrDim
3435 input Tpl.Text in_txt;
3436 input Absyn.ElementAttributes in_a_attr;
3437
3438 output Tpl.Text out_txt;
3439 algorithm
3440 out_txt :=
3441 match(in_txt, in_a_attr)
3442 local
3443 Tpl.Text txt;
3444 Absyn.ArrayDim i_arrayDim;
3445
3446 case ( txt,
3447 Absyn.ATTR(arrayDim = i_arrayDim) )
3448 algorithm
3449 33057 txt := dumpSubscripts(txt, i_arrayDim);
3450 then txt;
3451
3452 case ( txt,
3453 _ )
3454 then txt;
3455 end match;
3456 end dumpElementAttrDim;
3457
3458 protected function fun_116
3459 input Tpl.Text in_txt;
3460 input list<Absyn.ElementArg> in_a_el;
3461
3462 output Tpl.Text out_txt;
3463 algorithm
3464 out_txt :=
3465 match(in_txt, in_a_el)
3466 local
3467 Tpl.Text txt;
3468 list<Absyn.ElementArg> i_el;
3469
3470 case ( txt,
3471 {} )
3472 then txt;
3473
3474 case ( txt,
3475 i_el )
3476 algorithm
3477 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3478 1 (txt, _) := dumpElementArgList(txt, i_el, Tpl.strTokText(Tpl.ST_STRING(", ")));
3479 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3480 then txt;
3481 end match;
3482 end fun_116;
3483
3484 public function dumpConstrainClass
3485 input Tpl.Text in_txt;
3486 input Absyn.ConstrainClass in_a_cc;
3487
3488 output Tpl.Text out_txt;
3489 algorithm
3490 out_txt :=
3491 match(in_txt, in_a_cc)
3492 local
3493 Tpl.Text txt;
3494 Option<Absyn.Comment> i_comment;
3495 list<Absyn.ElementArg> i_el;
3496 Absyn.Path i_p;
3497 Tpl.Text l_cmt__str;
3498 Tpl.Text l_el__str;
3499 Tpl.Text l_path__str;
3500
3501 case ( txt,
3502 Absyn.CONSTRAINCLASS(elementSpec = Absyn.EXTENDS(path = i_p, elementArg = i_el), comment = i_comment) )
3503 algorithm
3504 38 l_path__str := dumpPath(Tpl.emptyTxt, i_p);
3505 38 l_el__str := fun_116(Tpl.emptyTxt, i_el);
3506 38 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
3507 38 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
3508 38 txt := Tpl.writeTok(txt, Tpl.ST_STRING("constrainedby "));
3509 38 txt := Tpl.writeText(txt, l_path__str);
3510 38 txt := Tpl.writeText(txt, l_el__str);
3511 38 txt := Tpl.writeText(txt, l_cmt__str);
3512 38 txt := Tpl.popBlock(txt);
3513 then txt;
3514
3515 case ( txt,
3516 _ )
3517 then txt;
3518 end match;
3519 end dumpConstrainClass;
3520
3521 public function dumpComponentItem
3522 input Tpl.Text in_txt;
3523 input Absyn.ComponentItem in_a_comp;
3524
3525 output Tpl.Text out_txt;
3526 algorithm
3527 out_txt :=
3528 match(in_txt, in_a_comp)
3529 local
3530 Tpl.Text txt;
3531 Option<Absyn.Comment> i_comment;
3532 Option<Absyn.ComponentCondition> i_condition;
3533 Absyn.Component i_component;
3534 Tpl.Text l_cmt;
3535 Tpl.Text l_cond__str;
3536 Tpl.Text l_comp__str;
3537
3538 case ( txt,
3539 Absyn.COMPONENTITEM(component = i_component, condition = i_condition, comment = i_comment) )
3540 algorithm
3541 33088 l_comp__str := dumpComponent(Tpl.emptyTxt, i_component);
3542 33088 l_cond__str := dumpComponentCondition(Tpl.emptyTxt, i_condition);
3543 33088 l_cmt := dumpCommentOpt(Tpl.emptyTxt, i_comment);
3544 33088 txt := Tpl.writeText(txt, l_comp__str);
3545 33088 txt := Tpl.writeText(txt, l_cond__str);
3546 33088 txt := Tpl.writeText(txt, l_cmt);
3547 then txt;
3548
3549 case ( txt,
3550 _ )
3551 then txt;
3552 end match;
3553 end dumpComponentItem;
3554
3555 protected function fun_119
3556 input Tpl.Text in_txt;
3557 input Option<Absyn.Modification> in_a_modification;
3558
3559 output Tpl.Text out_txt;
3560 algorithm
3561 out_txt :=
3562 match(in_txt, in_a_modification)
3563 local
3564 Tpl.Text txt;
3565 Absyn.Modification i_mod;
3566
3567 case ( txt,
3568 SOME(i_mod) )
3569 algorithm
3570 19944 txt := dumpModification(txt, i_mod);
3571 then txt;
3572
3573 case ( txt,
3574 _ )
3575 then txt;
3576 end match;
3577 end fun_119;
3578
3579 public function dumpComponent
3580 input Tpl.Text in_txt;
3581 input Absyn.Component in_a_comp;
3582
3583 output Tpl.Text out_txt;
3584 algorithm
3585 out_txt :=
3586 match(in_txt, in_a_comp)
3587 local
3588 Tpl.Text txt;
3589 Absyn.Ident i_name;
3590 Option<Absyn.Modification> i_modification;
3591 Absyn.ArrayDim i_arrayDim;
3592 Tpl.Text l_mod__str;
3593 Tpl.Text l_dim__str;
3594
3595 case ( txt,
3596 Absyn.COMPONENT(arrayDim = i_arrayDim, modification = i_modification, name = i_name) )
3597 algorithm
3598 33088 l_dim__str := dumpSubscripts(Tpl.emptyTxt, i_arrayDim);
3599 33088 l_mod__str := fun_119(Tpl.emptyTxt, i_modification);
3600 33088 txt := Tpl.writeStr(txt, i_name);
3601 33088 txt := Tpl.writeText(txt, l_dim__str);
3602 33088 txt := Tpl.writeText(txt, l_mod__str);
3603 then txt;
3604
3605 case ( txt,
3606 _ )
3607 then txt;
3608 end match;
3609 end dumpComponent;
3610
3611 public function dumpComponentCondition
3612 input Tpl.Text in_txt;
3613 input Option<Absyn.ComponentCondition> in_a_cond;
3614
3615 output Tpl.Text out_txt;
3616 algorithm
3617 out_txt :=
3618 match(in_txt, in_a_cond)
3619 local
3620 Tpl.Text txt;
3621 Absyn.ComponentCondition i_cexp;
3622 Tpl.Text l_exp__str;
3623
3624 case ( txt,
3625 SOME(i_cexp) )
3626 algorithm
3627 594 l_exp__str := dumpExp(Tpl.emptyTxt, i_cexp);
3628 594 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
3629 594 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if "));
3630 594 txt := Tpl.writeText(txt, l_exp__str);
3631 594 txt := Tpl.popBlock(txt);
3632 then txt;
3633
3634 case ( txt,
3635 _ )
3636 then txt;
3637 end match;
3638 end dumpComponentCondition;
3639
3640 protected function lm_122
3641 input output Tpl.Text txt;
3642 input list<Absyn.GroupImport> items;
3643 algorithm
3644
2/2
✓ Branch 0 taken 42 times.
✓ Branch 1 taken 14 times.
56 for lstElt_122 in items loop
3645 txt := match lstElt_122
3646 local
3647 Absyn.GroupImport i_group;
3648
3649 case i_group
3650 algorithm
3651 42 txt := dumpGroupImport(txt, i_group);
3652 42 txt := Tpl.nextIter(txt);
3653 then txt;
3654 end match;
3655 end for;
3656 end lm_122;
3657
3658 public function dumpImport
3659 input Tpl.Text in_txt;
3660 input Absyn.Import in_a_imp;
3661
3662 output Tpl.Text out_txt;
3663 algorithm
3664 out_txt :=
3665 match(in_txt, in_a_imp)
3666 local
3667 Tpl.Text txt;
3668 list<Absyn.GroupImport> i_groups;
3669 Absyn.Path i_prefix;
3670 Absyn.Path i_path;
3671 Absyn.Ident i_name;
3672 Tpl.Text l_groups__str;
3673 Tpl.Text l_prefix__str;
3674
3675 case ( txt,
3676 Absyn.NAMED_IMPORT(name = i_name, path = i_path) )
3677 algorithm
3678 242 txt := Tpl.writeStr(txt, i_name);
3679 242 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3680 242 txt := dumpPath(txt, i_path);
3681 then txt;
3682
3683 case ( txt,
3684 Absyn.QUAL_IMPORT(path = i_path) )
3685 algorithm
3686 757 txt := dumpPath(txt, i_path);
3687 then txt;
3688
3689 case ( txt,
3690 Absyn.UNQUAL_IMPORT(path = i_path) )
3691 algorithm
3692 ✗ txt := dumpPath(txt, i_path);
3693 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".*"));
3694 then txt;
3695
3696 case ( txt,
3697 Absyn.GROUP_IMPORT(prefix = i_prefix, groups = i_groups) )
3698 algorithm
3699 14 l_prefix__str := dumpPath(Tpl.emptyTxt, i_prefix);
3700 14 l_groups__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3701 14 l_groups__str := lm_122(l_groups__str, i_groups);
3702 14 l_groups__str := Tpl.popIter(l_groups__str);
3703 14 txt := Tpl.writeText(txt, l_prefix__str);
3704 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".{"));
3705 14 txt := Tpl.writeText(txt, l_groups__str);
3706 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
3707 then txt;
3708
3709 case ( txt,
3710 _ )
3711 then txt;
3712 end match;
3713 end dumpImport;
3714
3715 public function dumpGroupImport
3716 input Tpl.Text in_txt;
3717 input Absyn.GroupImport in_a_gimp;
3718
3719 output Tpl.Text out_txt;
3720 algorithm
3721 out_txt :=
3722 match(in_txt, in_a_gimp)
3723 local
3724 Tpl.Text txt;
3725 String i_rename;
3726 String i_name;
3727
3728 case ( txt,
3729 Absyn.GROUP_IMPORT_NAME(name = i_name) )
3730 algorithm
3731 42 txt := Tpl.writeStr(txt, i_name);
3732 then txt;
3733
3734 case ( txt,
3735 Absyn.GROUP_IMPORT_RENAME(rename = i_rename, name = i_name) )
3736 algorithm
3737 ✗ txt := Tpl.writeStr(txt, i_rename);
3738 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3739 ✗ txt := Tpl.writeStr(txt, i_name);
3740 then txt;
3741
3742 case ( txt,
3743 _ )
3744 then txt;
3745 end match;
3746 end dumpGroupImport;
3747
3748 public function dumpEquationItem
3749 input Tpl.Text in_txt;
3750 input Absyn.EquationItem in_a_eq;
3751
3752 output Tpl.Text out_txt;
3753 algorithm
3754 out_txt :=
3755 match(in_txt, in_a_eq)
3756 local
3757 Tpl.Text txt;
3758 String i_comment_1;
3759 Option<Absyn.Comment> i_comment;
3760 Absyn.Equation i_equation__;
3761 String ret_2;
3762 Tpl.Text l_cmt__str;
3763 Tpl.Text l_eq__str;
3764
3765 case ( txt,
3766 Absyn.EQUATIONITEM(equation_ = i_equation__, comment = i_comment) )
3767 algorithm
3768 15818 l_eq__str := dumpEquation(Tpl.emptyTxt, i_equation__);
3769 15818 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
3770 15818 txt := Tpl.writeText(txt, l_eq__str);
3771 15818 txt := Tpl.writeText(txt, l_cmt__str);
3772 15818 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
3773 then txt;
3774
3775 case ( txt,
3776 Absyn.EQUATIONITEMCOMMENT(comment = i_comment_1) )
3777 algorithm
3778 885 txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
3779 885 ret_2 := System.trimWhitespace(i_comment_1);
3780 885 txt := Tpl.writeStr(txt, ret_2);
3781 885 txt := Tpl.popBlock(txt);
3782 then txt;
3783
3784 case ( txt,
3785 _ )
3786 then txt;
3787 end match;
3788 end dumpEquationItem;
3789
3790 protected function lm_126
3791 input output Tpl.Text txt;
3792 input list<Absyn.EquationItem> items;
3793 algorithm
3794
2/2
✓ Branch 0 taken 861 times.
✓ Branch 1 taken 666 times.
1527 for lstElt_126 in items loop
3795 txt := match lstElt_126
3796 local
3797 Absyn.EquationItem i_eq;
3798
3799 case i_eq
3800 algorithm
3801 861 txt := dumpEquationItem(txt, i_eq);
3802 861 txt := Tpl.nextIter(txt);
3803 then txt;
3804 end match;
3805 end for;
3806 end lm_126;
3807
3808 public function dumpEquationItems
3809 input Tpl.Text txt;
3810 input list<Absyn.EquationItem> a_eql;
3811
3812 output Tpl.Text out_txt;
3813 algorithm
3814 666 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3815 666 out_txt := lm_126(out_txt, a_eql);
3816 666 out_txt := Tpl.popIter(out_txt);
3817 end dumpEquationItems;
3818
3819 protected function lm_128
3820 input output Tpl.Text txt;
3821 input list<tuple<Absyn.Exp, list<Absyn.EquationItem>>> items;
3822 algorithm
3823
2/2
✓ Branch 0 taken 147 times.
✓ Branch 1 taken 482 times.
629 for lstElt_128 in items loop
3824 txt := match lstElt_128
3825 local
3826 list<Absyn.EquationItem> i_b;
3827 Absyn.Exp i_c;
3828
3829 case (i_c, i_b)
3830 algorithm
3831 147 txt := dumpEquationBranch(txt, i_c, i_b, "elseif");
3832 147 txt := Tpl.nextIter(txt);
3833 then txt;
3834 end match;
3835 end for;
3836 end lm_128;
3837
3838 protected function fun_129
3839 input Tpl.Text in_txt;
3840 input Boolean in_mArg;
3841 input Tpl.Text in_a_else__branch__str;
3842
3843 output Tpl.Text out_txt;
3844 algorithm
3845 out_txt :=
3846 match(in_txt, in_mArg, in_a_else__branch__str)
3847 local
3848 Tpl.Text txt;
3849 Tpl.Text a_else__branch__str;
3850
3851 case ( txt,
3852 true,
3853 _ )
3854 then txt;
3855
3856 case ( txt,
3857 _,
3858 a_else__branch__str )
3859 algorithm
3860 306 txt := Tpl.writeTok(txt, Tpl.ST_LINE("else\n"));
3861 306 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
3862 306 txt := Tpl.writeText(txt, a_else__branch__str);
3863 306 txt := Tpl.popBlock(txt);
3864 then txt;
3865 end match;
3866 end fun_129;
3867
3868 protected function lm_130
3869 input output Tpl.Text txt;
3870 input list<tuple<Absyn.Exp, list<Absyn.EquationItem>>> items;
3871 algorithm
3872
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 77 times.
81 for lstElt_130 in items loop
3873 txt := match lstElt_130
3874 local
3875 list<Absyn.EquationItem> i_b;
3876 Absyn.Exp i_c;
3877
3878 case (i_c, i_b)
3879 algorithm
3880 4 txt := dumpEquationBranch(txt, i_c, i_b, "elsewhen");
3881 4 txt := Tpl.nextIter(txt);
3882 then txt;
3883 end match;
3884 end for;
3885 end lm_130;
3886
3887 public function dumpEquation
3888 input Tpl.Text in_txt;
3889 input Absyn.Equation in_a_eq;
3890
3891 output Tpl.Text out_txt;
3892 algorithm
3893 out_txt :=
3894 match(in_txt, in_a_eq)
3895 local
3896 Tpl.Text txt;
3897 Absyn.EquationItem i_equ;
3898 Absyn.FunctionArgs i_functionArgs;
3899 Absyn.ComponentRef i_functionName;
3900 list<tuple<Absyn.Exp, list<Absyn.EquationItem>>> i_elseWhenEquations;
3901 list<Absyn.EquationItem> i_whenEquations;
3902 Absyn.Exp i_whenExp;
3903 list<Absyn.EquationItem> i_forEquations;
3904 Absyn.ForIterators i_iterators;
3905 Absyn.ComponentRef i_connector2;
3906 Absyn.ComponentRef i_connector1;
3907 Absyn.ComponentRef i_domain;
3908 Absyn.Exp i_rightSide;
3909 Absyn.Exp i_leftSide;
3910 list<Absyn.EquationItem> i_equationElseItems;
3911 list<tuple<Absyn.Exp, list<Absyn.EquationItem>>> i_elseIfBranches;
3912 list<Absyn.EquationItem> i_equationTrueItems;
3913 Absyn.Exp i_ifExp;
3914 Tpl.Text l_eq__str;
3915 Tpl.Text l_args__str;
3916 Tpl.Text l_name__str;
3917 Tpl.Text l_elsewhen__str;
3918 Tpl.Text l_when__str;
3919 Tpl.Text l_body__str;
3920 Tpl.Text l_iter__str;
3921 Tpl.Text l_c2__str;
3922 Tpl.Text l_c1__str;
3923 Tpl.Text l_domain__str;
3924 Tpl.Text l_rhs;
3925 Tpl.Text l_lhs;
3926 Boolean ret_4;
3927 Tpl.Text l_else__str;
3928 Tpl.Text l_else__branch__str;
3929 Tpl.Text l_elseif__str;
3930 Tpl.Text l_if__str;
3931
3932 case ( txt,
3933 Absyn.EQ_IF(ifExp = i_ifExp, equationTrueItems = i_equationTrueItems, elseIfBranches = i_elseIfBranches, equationElseItems = i_equationElseItems) )
3934 algorithm
3935 482 l_if__str := dumpEquationBranch(Tpl.emptyTxt, i_ifExp, i_equationTrueItems, "if");
3936 482 l_elseif__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
3937 482 l_elseif__str := lm_128(l_elseif__str, i_elseIfBranches);
3938 482 l_elseif__str := Tpl.popIter(l_elseif__str);
3939 482 l_else__branch__str := dumpEquationItems(Tpl.emptyTxt, i_equationElseItems);
3940 482 ret_4 := Tpl.isEmpty(l_else__branch__str);
3941 482 l_else__str := fun_129(Tpl.emptyTxt, ret_4, l_else__branch__str);
3942 482 txt := Tpl.writeText(txt, l_if__str);
3943 482 txt := Tpl.softNewLine(txt);
3944 482 txt := Tpl.writeText(txt, l_elseif__str);
3945 482 txt := Tpl.softNewLine(txt);
3946 482 txt := Tpl.writeText(txt, l_else__str);
3947 482 txt := Tpl.softNewLine(txt);
3948 482 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end if"));
3949 then txt;
3950
3951 case ( txt,
3952 Absyn.EQ_EQUALS(leftSide = i_leftSide, rightSide = i_rightSide) )
3953 algorithm
3954 5081 l_lhs := dumpLhsExp(Tpl.emptyTxt, i_leftSide);
3955 5081 l_rhs := dumpExp(Tpl.emptyTxt, i_rightSide);
3956 5081 txt := Tpl.writeText(txt, l_lhs);
3957 5081 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3958 5081 txt := Tpl.writeText(txt, l_rhs);
3959 then txt;
3960
3961 case ( txt,
3962 Absyn.EQ_PDE(leftSide = i_leftSide, rightSide = i_rightSide, domain = i_domain) )
3963 algorithm
3964 ✗ l_lhs := dumpLhsExp(Tpl.emptyTxt, i_leftSide);
3965 ✗ l_rhs := dumpExp(Tpl.emptyTxt, i_rightSide);
3966 ✗ l_domain__str := dumpCref(Tpl.emptyTxt, i_domain);
3967 ✗ txt := Tpl.writeText(txt, l_lhs);
3968 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3969 ✗ txt := Tpl.writeText(txt, l_rhs);
3970 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" indomain "));
3971 ✗ txt := Tpl.writeText(txt, l_domain__str);
3972 then txt;
3973
3974 case ( txt,
3975 Absyn.EQ_CONNECT(connector1 = i_connector1, connector2 = i_connector2) )
3976 algorithm
3977 9637 l_c1__str := dumpCref(Tpl.emptyTxt, i_connector1);
3978 9637 l_c2__str := dumpCref(Tpl.emptyTxt, i_connector2);
3979 9637 txt := Tpl.writeTok(txt, Tpl.ST_STRING("connect("));
3980 9637 txt := Tpl.writeText(txt, l_c1__str);
3981 9637 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
3982 9637 txt := Tpl.writeText(txt, l_c2__str);
3983 9637 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3984 then txt;
3985
3986 case ( txt,
3987 Absyn.EQ_FOR(iterators = i_iterators, forEquations = i_forEquations) )
3988 algorithm
3989 184 l_iter__str := dumpForIterators(Tpl.emptyTxt, i_iterators);
3990 184 l_body__str := dumpEquationItems(Tpl.emptyTxt, i_forEquations);
3991 184 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
3992 184 txt := Tpl.writeText(txt, l_iter__str);
3993 184 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
3994 184 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
3995 184 txt := Tpl.writeText(txt, l_body__str);
3996 184 txt := Tpl.softNewLine(txt);
3997 184 txt := Tpl.popBlock(txt);
3998 184 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
3999 then txt;
4000
4001 case ( txt,
4002 Absyn.EQ_WHEN_E(whenExp = i_whenExp, whenEquations = i_whenEquations, elseWhenEquations = i_elseWhenEquations) )
4003 algorithm
4004 77 l_when__str := dumpEquationBranch(Tpl.emptyTxt, i_whenExp, i_whenEquations, "when");
4005 77 l_elsewhen__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4006 77 l_elsewhen__str := lm_130(l_elsewhen__str, i_elseWhenEquations);
4007 77 l_elsewhen__str := Tpl.popIter(l_elsewhen__str);
4008 77 txt := Tpl.writeText(txt, l_when__str);
4009 77 txt := Tpl.softNewLine(txt);
4010 77 txt := Tpl.writeText(txt, l_elsewhen__str);
4011 77 txt := Tpl.softNewLine(txt);
4012 77 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end when"));
4013 then txt;
4014
4015 case ( txt,
4016 Absyn.EQ_NORETCALL(functionName = i_functionName, functionArgs = i_functionArgs) )
4017 algorithm
4018 357 l_name__str := dumpCref(Tpl.emptyTxt, i_functionName);
4019 357 l_args__str := dumpFunctionArgs(Tpl.emptyTxt, i_functionArgs);
4020 357 txt := Tpl.writeText(txt, l_name__str);
4021 357 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
4022 357 txt := Tpl.writeText(txt, l_args__str);
4023 357 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
4024 then txt;
4025
4026 case ( txt,
4027 Absyn.EQ_FAILURE(equ = i_equ) )
4028 algorithm
4029 ✗ l_eq__str := dumpEquationItem(Tpl.emptyTxt, i_equ);
4030 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("failure("));
4031 ✗ txt := Tpl.writeText(txt, l_eq__str);
4032 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
4033 then txt;
4034
4035 case ( txt,
4036 _ )
4037 then txt;
4038 end match;
4039 end dumpEquation;
4040
4041 protected function lm_132
4042 input output Tpl.Text txt;
4043 input list<Absyn.EquationItem> items;
4044 algorithm
4045
2/2
✓ Branch 0 taken 1157 times.
✓ Branch 1 taken 710 times.
1867 for lstElt_132 in items loop
4046 txt := match lstElt_132
4047 local
4048 Absyn.EquationItem i_eq;
4049
4050 case i_eq
4051 algorithm
4052 1157 txt := dumpEquationItem(txt, i_eq);
4053 1157 txt := Tpl.nextIter(txt);
4054 then txt;
4055 end match;
4056 end for;
4057 end lm_132;
4058
4059 public function dumpEquationBranch
4060 input Tpl.Text txt;
4061 input Absyn.Exp a_cond;
4062 input list<Absyn.EquationItem> a_body;
4063 input String a_header;
4064
4065 output Tpl.Text out_txt;
4066 protected
4067 Tpl.Text l_body__str;
4068 Tpl.Text l_cond__str;
4069 algorithm
4070 710 l_cond__str := dumpExp(Tpl.emptyTxt, a_cond);
4071 710 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4072 710 l_body__str := lm_132(l_body__str, a_body);
4073 710 l_body__str := Tpl.popIter(l_body__str);
4074 710 out_txt := Tpl.writeStr(txt, a_header);
4075 710 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" "));
4076 710 out_txt := Tpl.writeText(out_txt, l_cond__str);
4077 710 out_txt := Tpl.writeTok(out_txt, Tpl.ST_LINE(" then\n"));
4078 710 out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2));
4079 710 out_txt := Tpl.writeText(out_txt, l_body__str);
4080 710 out_txt := Tpl.popBlock(out_txt);
4081 end dumpEquationBranch;
4082
4083 protected function lm_134
4084 input output Tpl.Text txt;
4085 input list<Absyn.AlgorithmItem> items;
4086 algorithm
4087
2/2
✓ Branch 0 taken 1711 times.
✓ Branch 1 taken 1090 times.
2801 for lstElt_134 in items loop
4088 txt := match lstElt_134
4089 local
4090 Absyn.AlgorithmItem i_alg;
4091
4092 case i_alg
4093 algorithm
4094 1711 txt := dumpAlgorithmItem(txt, i_alg);
4095 1711 txt := Tpl.nextIter(txt);
4096 then txt;
4097 end match;
4098 end for;
4099 end lm_134;
4100
4101 public function dumpAlgorithmItems
4102 input Tpl.Text txt;
4103 input list<Absyn.AlgorithmItem> a_algs;
4104
4105 output Tpl.Text out_txt;
4106 algorithm
4107 1090 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4108 1090 out_txt := lm_134(out_txt, a_algs);
4109 1090 out_txt := Tpl.popIter(out_txt);
4110 end dumpAlgorithmItems;
4111
4112 public function dumpAlgorithmItem
4113 input Tpl.Text in_txt;
4114 input Absyn.AlgorithmItem in_a_alg;
4115
4116 output Tpl.Text out_txt;
4117 algorithm
4118 out_txt :=
4119 match(in_txt, in_a_alg)
4120 local
4121 Tpl.Text txt;
4122 String i_comment_1;
4123 Option<Absyn.Comment> i_comment;
4124 Absyn.Algorithm i_algorithm__;
4125 String ret_2;
4126 Tpl.Text l_cmt__str;
4127 Tpl.Text l_alg__str;
4128
4129 case ( txt,
4130 Absyn.ALGORITHMITEM(algorithm_ = i_algorithm__, comment = i_comment) )
4131 algorithm
4132 10020 l_alg__str := dumpAlgorithm(Tpl.emptyTxt, i_algorithm__);
4133 10020 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
4134 10020 txt := Tpl.writeText(txt, l_alg__str);
4135 10020 txt := Tpl.writeText(txt, l_cmt__str);
4136 10020 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
4137 then txt;
4138
4139 case ( txt,
4140 Absyn.ALGORITHMITEMCOMMENT(comment = i_comment_1) )
4141 algorithm
4142 948 txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
4143 948 ret_2 := System.trimWhitespace(i_comment_1);
4144 948 txt := Tpl.writeStr(txt, ret_2);
4145 948 txt := Tpl.popBlock(txt);
4146 then txt;
4147
4148 case ( txt,
4149 _ )
4150 then txt;
4151 end match;
4152 end dumpAlgorithmItem;
4153
4154 protected function lm_137
4155 input output Tpl.Text txt;
4156 input list<tuple<Absyn.Exp, list<Absyn.AlgorithmItem>>> items;
4157 algorithm
4158
2/2
✓ Branch 0 taken 278 times.
✓ Branch 1 taken 845 times.
1123 for lstElt_137 in items loop
4159 txt := match lstElt_137
4160 local
4161 list<Absyn.AlgorithmItem> i_b;
4162 Absyn.Exp i_c;
4163
4164 case (i_c, i_b)
4165 algorithm
4166 278 txt := dumpAlgorithmBranch(txt, i_c, i_b, "elseif", "then");
4167 278 txt := Tpl.nextIter(txt);
4168 then txt;
4169 end match;
4170 end for;
4171 end lm_137;
4172
4173 protected function fun_138
4174 input Tpl.Text in_txt;
4175 input Boolean in_mArg;
4176 input Tpl.Text in_a_else__branch__str;
4177
4178 output Tpl.Text out_txt;
4179 algorithm
4180 out_txt :=
4181 match(in_txt, in_mArg, in_a_else__branch__str)
4182 local
4183 Tpl.Text txt;
4184 Tpl.Text a_else__branch__str;
4185
4186 case ( txt,
4187 true,
4188 _ )
4189 then txt;
4190
4191 case ( txt,
4192 _,
4193 a_else__branch__str )
4194 algorithm
4195 517 txt := Tpl.writeTok(txt, Tpl.ST_LINE("else\n"));
4196 517 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4197 517 txt := Tpl.writeText(txt, a_else__branch__str);
4198 517 txt := Tpl.popBlock(txt);
4199 then txt;
4200 end match;
4201 end fun_138;
4202
4203 protected function lm_139
4204 input output Tpl.Text txt;
4205 input list<tuple<Absyn.Exp, list<Absyn.AlgorithmItem>>> items;
4206 algorithm
4207
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 17 times.
23 for lstElt_139 in items loop
4208 txt := match lstElt_139
4209 local
4210 list<Absyn.AlgorithmItem> i_b;
4211 Absyn.Exp i_c;
4212
4213 case (i_c, i_b)
4214 algorithm
4215 6 txt := dumpAlgorithmBranch(txt, i_c, i_b, "elsewhen", "then");
4216 6 txt := Tpl.nextIter(txt);
4217 then txt;
4218 end match;
4219 end for;
4220 end lm_139;
4221
4222 protected function fun_140
4223 input Tpl.Text in_txt;
4224 input list<Absyn.AlgorithmItem> in_a_equ;
4225
4226 output Tpl.Text out_txt;
4227 algorithm
4228 out_txt :=
4229 match(in_txt, in_a_equ)
4230 local
4231 Tpl.Text txt;
4232 list<Absyn.AlgorithmItem> i_equ;
4233
4234 case ( txt,
4235 {} )
4236 algorithm
4237 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("..."));
4238 then txt;
4239
4240 case ( txt,
4241 i_equ )
4242 algorithm
4243 ✗ txt := dumpAlgorithmItems(txt, i_equ);
4244 then txt;
4245 end match;
4246 end fun_140;
4247
4248 public function dumpAlgorithm
4249 input Tpl.Text in_txt;
4250 input Absyn.Algorithm in_a_alg;
4251
4252 output Tpl.Text out_txt;
4253 algorithm
4254 out_txt :=
4255 match(in_txt, in_a_alg)
4256 local
4257 Tpl.Text txt;
4258 list<Absyn.AlgorithmItem> i_elseBody;
4259 list<Absyn.AlgorithmItem> i_body;
4260 list<Absyn.AlgorithmItem> i_equ;
4261 Absyn.FunctionArgs i_functionArgs;
4262 Absyn.ComponentRef i_functionCall;
4263 list<tuple<Absyn.Exp, list<Absyn.AlgorithmItem>>> i_elseWhenAlgorithmBranch;
4264 list<Absyn.AlgorithmItem> i_whenBody;
4265 list<Absyn.AlgorithmItem> i_whileBody;
4266 Absyn.Exp i_boolExpr;
4267 list<Absyn.AlgorithmItem> i_parforBody;
4268 list<Absyn.AlgorithmItem> i_forBody;
4269 Absyn.ForIterators i_iterators;
4270 list<Absyn.AlgorithmItem> i_elseBranch;
4271 list<tuple<Absyn.Exp, list<Absyn.AlgorithmItem>>> i_elseIfAlgorithmBranch;
4272 list<Absyn.AlgorithmItem> i_trueBranch;
4273 Absyn.Exp i_ifExp;
4274 Absyn.Exp i_value;
4275 Absyn.Exp i_assignComponent;
4276 Tpl.Text l_arg2;
4277 Tpl.Text l_arg1;
4278 Tpl.Text l_arg__str;
4279 Tpl.Text l_args__str;
4280 Tpl.Text l_name__str;
4281 Tpl.Text l_elsewhen__str;
4282 Tpl.Text l_when__str;
4283 Tpl.Text l_while__str;
4284 Tpl.Text l_body__str;
4285 Tpl.Text l_iter__str;
4286 Boolean ret_6;
4287 Tpl.Text l_else__str;
4288 Tpl.Text l_else__branch__str;
4289 Tpl.Text l_elseif__str;
4290 Tpl.Text l_if__str;
4291 Tpl.Text l_rhs__str;
4292 Tpl.Text l_lhs__str;
4293
4294 case ( txt,
4295 Absyn.ALG_ASSIGN(assignComponent = i_assignComponent, value = i_value) )
4296 algorithm
4297 8429 l_lhs__str := dumpLhsExp(Tpl.emptyTxt, i_assignComponent);
4298 8429 l_rhs__str := dumpExp(Tpl.emptyTxt, i_value);
4299 8429 txt := Tpl.writeText(txt, l_lhs__str);
4300 8429 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" := "));
4301 8429 txt := Tpl.writeText(txt, l_rhs__str);
4302 then txt;
4303
4304 case ( txt,
4305 Absyn.ALG_IF(ifExp = i_ifExp, trueBranch = i_trueBranch, elseIfAlgorithmBranch = i_elseIfAlgorithmBranch, elseBranch = i_elseBranch) )
4306 algorithm
4307 845 l_if__str := dumpAlgorithmBranch(Tpl.emptyTxt, i_ifExp, i_trueBranch, "if", "then");
4308 845 l_elseif__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4309 845 l_elseif__str := lm_137(l_elseif__str, i_elseIfAlgorithmBranch);
4310 845 l_elseif__str := Tpl.popIter(l_elseif__str);
4311 845 l_else__branch__str := dumpAlgorithmItems(Tpl.emptyTxt, i_elseBranch);
4312 845 ret_6 := Tpl.isEmpty(l_else__branch__str);
4313 845 l_else__str := fun_138(Tpl.emptyTxt, ret_6, l_else__branch__str);
4314 845 txt := Tpl.writeText(txt, l_if__str);
4315 845 txt := Tpl.softNewLine(txt);
4316 845 txt := Tpl.writeText(txt, l_elseif__str);
4317 845 txt := Tpl.softNewLine(txt);
4318 845 txt := Tpl.writeText(txt, l_else__str);
4319 845 txt := Tpl.softNewLine(txt);
4320 845 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end if"));
4321 then txt;
4322
4323 case ( txt,
4324 Absyn.ALG_FOR(iterators = i_iterators, forBody = i_forBody) )
4325 algorithm
4326 243 l_iter__str := dumpForIterators(Tpl.emptyTxt, i_iterators);
4327 243 l_body__str := dumpAlgorithmItems(Tpl.emptyTxt, i_forBody);
4328 243 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
4329 243 txt := Tpl.writeText(txt, l_iter__str);
4330 243 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
4331 243 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4332 243 txt := Tpl.writeText(txt, l_body__str);
4333 243 txt := Tpl.softNewLine(txt);
4334 243 txt := Tpl.popBlock(txt);
4335 243 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
4336 then txt;
4337
4338 case ( txt,
4339 Absyn.ALG_PARFOR(iterators = i_iterators, parforBody = i_parforBody) )
4340 algorithm
4341 ✗ l_iter__str := dumpForIterators(Tpl.emptyTxt, i_iterators);
4342 ✗ l_body__str := dumpAlgorithmItems(Tpl.emptyTxt, i_parforBody);
4343 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parfor "));
4344 ✗ txt := Tpl.writeText(txt, l_iter__str);
4345 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
4346 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4347 ✗ txt := Tpl.writeText(txt, l_body__str);
4348 ✗ txt := Tpl.softNewLine(txt);
4349 ✗ txt := Tpl.popBlock(txt);
4350 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("end parfor"));
4351 then txt;
4352
4353 case ( txt,
4354 Absyn.ALG_WHILE(boolExpr = i_boolExpr, whileBody = i_whileBody) )
4355 algorithm
4356 80 l_while__str := dumpAlgorithmBranch(Tpl.emptyTxt, i_boolExpr, i_whileBody, "while", "loop");
4357 80 txt := Tpl.writeText(txt, l_while__str);
4358 80 txt := Tpl.softNewLine(txt);
4359 80 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end while"));
4360 then txt;
4361
4362 case ( txt,
4363 Absyn.ALG_WHEN_A(boolExpr = i_boolExpr, whenBody = i_whenBody, elseWhenAlgorithmBranch = i_elseWhenAlgorithmBranch) )
4364 algorithm
4365 17 l_when__str := dumpAlgorithmBranch(Tpl.emptyTxt, i_boolExpr, i_whenBody, "when", "then");
4366 17 l_elsewhen__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4367 17 l_elsewhen__str := lm_139(l_elsewhen__str, i_elseWhenAlgorithmBranch);
4368 17 l_elsewhen__str := Tpl.popIter(l_elsewhen__str);
4369 17 txt := Tpl.writeText(txt, l_when__str);
4370 17 txt := Tpl.softNewLine(txt);
4371 17 txt := Tpl.writeText(txt, l_elsewhen__str);
4372 17 txt := Tpl.softNewLine(txt);
4373 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end when"));
4374 then txt;
4375
4376 case ( txt,
4377 Absyn.ALG_NORETCALL(functionCall = i_functionCall, functionArgs = i_functionArgs) )
4378 algorithm
4379 375 l_name__str := dumpCref(Tpl.emptyTxt, i_functionCall);
4380 375 l_args__str := dumpFunctionArgs(Tpl.emptyTxt, i_functionArgs);
4381 375 txt := Tpl.writeText(txt, l_name__str);
4382 375 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
4383 375 txt := Tpl.writeText(txt, l_args__str);
4384 375 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
4385 then txt;
4386
4387 case ( txt,
4388 Absyn.ALG_RETURN() )
4389 algorithm
4390 14 txt := Tpl.writeTok(txt, Tpl.ST_STRING("return"));
4391 then txt;
4392
4393 case ( txt,
4394 Absyn.ALG_BREAK() )
4395 algorithm
4396 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING("break"));
4397 then txt;
4398
4399 case ( txt,
4400 Absyn.ALG_FAILURE(equ = i_equ) )
4401 algorithm
4402 ✗ l_arg__str := fun_140(Tpl.emptyTxt, i_equ);
4403 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("failure("));
4404 ✗ txt := Tpl.writeText(txt, l_arg__str);
4405 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
4406 then txt;
4407
4408 case ( txt,
4409 Absyn.ALG_TRY(body = i_body, elseBody = i_elseBody) )
4410 algorithm
4411 1 l_arg1 := dumpAlgorithmItems(Tpl.emptyTxt, i_body);
4412 1 l_arg2 := dumpAlgorithmItems(Tpl.emptyTxt, i_elseBody);
4413 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("try\n"));
4414 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4415 1 txt := Tpl.writeText(txt, l_arg1);
4416 1 txt := Tpl.softNewLine(txt);
4417 1 txt := Tpl.popBlock(txt);
4418 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE("else\n"));
4419 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4420 1 txt := Tpl.writeText(txt, l_arg2);
4421 1 txt := Tpl.softNewLine(txt);
4422 1 txt := Tpl.popBlock(txt);
4423 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end try;"));
4424 then txt;
4425
4426 case ( txt,
4427 Absyn.ALG_CONTINUE() )
4428 algorithm
4429 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("continue"));
4430 then txt;
4431
4432 case ( txt,
4433 _ )
4434 then txt;
4435 end match;
4436 end dumpAlgorithm;
4437
4438 protected function lm_142
4439 input output Tpl.Text txt;
4440 input list<Absyn.AlgorithmItem> items;
4441 algorithm
4442
2/2
✓ Branch 0 taken 3706 times.
✓ Branch 1 taken 1226 times.
4932 for lstElt_142 in items loop
4443 txt := match lstElt_142
4444 local
4445 Absyn.AlgorithmItem i_eq;
4446
4447 case i_eq
4448 algorithm
4449 3706 txt := dumpAlgorithmItem(txt, i_eq);
4450 3706 txt := Tpl.nextIter(txt);
4451 then txt;
4452 end match;
4453 end for;
4454 end lm_142;
4455
4456 public function dumpAlgorithmBranch
4457 input Tpl.Text txt;
4458 input Absyn.Exp a_cond;
4459 input list<Absyn.AlgorithmItem> a_body;
4460 input String a_header;
4461 input String a_exec__str;
4462
4463 output Tpl.Text out_txt;
4464 protected
4465 Tpl.Text l_body__str;
4466 Tpl.Text l_cond__str;
4467 algorithm
4468 1226 l_cond__str := dumpExp(Tpl.emptyTxt, a_cond);
4469 1226 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4470 1226 l_body__str := lm_142(l_body__str, a_body);
4471 1226 l_body__str := Tpl.popIter(l_body__str);
4472 1226 out_txt := Tpl.writeStr(txt, a_header);
4473 1226 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" "));
4474 1226 out_txt := Tpl.writeText(out_txt, l_cond__str);
4475 1226 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" "));
4476 1226 out_txt := Tpl.writeStr(out_txt, a_exec__str);
4477 1226 out_txt := Tpl.softNewLine(out_txt);
4478 1226 out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2));
4479 1226 out_txt := Tpl.writeText(out_txt, l_body__str);
4480 1226 out_txt := Tpl.popBlock(out_txt);
4481 end dumpAlgorithmBranch;
4482
4483 protected function fun_144
4484 input Tpl.Text in_txt;
4485 input Boolean in_mArg;
4486 input Absyn.Path in_a_path;
4487 input Absyn.Ident in_a_name;
4488
4489 output Tpl.Text out_txt;
4490 algorithm
4491 out_txt :=
4492 match(in_txt, in_mArg, in_a_path, in_a_name)
4493 local
4494 Tpl.Text txt;
4495 Absyn.Path a_path;
4496 Absyn.Ident a_name;
4497
4498 case ( txt,
4499 false,
4500 a_path,
4501 a_name )
4502 algorithm
4503 622754 txt := Tpl.writeStr(txt, a_name);
4504 622754 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
4505 622754 txt := dumpPath(txt, a_path);
4506 then txt;
4507
4508 case ( txt,
4509 _,
4510 a_path,
4511 a_name )
4512 algorithm
4513 ✗ txt := Tpl.writeStr(txt, a_name);
4514 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("__"));
4515 ✗ txt := dumpPath(txt, a_path);
4516 then txt;
4517 end match;
4518 end fun_144;
4519
4520 public function dumpPath
4521 input Tpl.Text in_txt;
4522 input Absyn.Path in_a_path;
4523
4524 output Tpl.Text out_txt;
4525 algorithm
4526 out_txt :=
4527 match(in_txt, in_a_path)
4528 local
4529 Tpl.Text txt;
4530 Absyn.Ident i_name;
4531 Absyn.Path i_path;
4532 Boolean ret_0;
4533
4534 case ( txt,
4535 Absyn.FULLYQUALIFIED(path = i_path) )
4536 algorithm
4537 29 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
4538 29 txt := dumpPath(txt, i_path);
4539 then txt;
4540
4541 case ( txt,
4542 Absyn.QUALIFIED(name = i_name, path = i_path) )
4543 algorithm
4544 622754 ret_0 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
4545 622754 txt := fun_144(txt, ret_0, i_path, i_name);
4546 then txt;
4547
4548 case ( txt,
4549 Absyn.IDENT(name = i_name) )
4550 algorithm
4551 467851 txt := Tpl.writeStr(txt, i_name);
4552 then txt;
4553
4554 case ( txt,
4555 _ )
4556 algorithm
4557 ✗ txt := errorMsg(txt, "SCodeDump.dumpPath: Unknown path.");
4558 then txt;
4559 end match;
4560 end dumpPath;
4561
4562 public function dumpPathNoQual
4563 input Tpl.Text in_txt;
4564 input Absyn.Path in_a_path;
4565
4566 output Tpl.Text out_txt;
4567 algorithm
4568 out_txt :=
4569 match(in_txt, in_a_path)
4570 local
4571 Tpl.Text txt;
4572 Absyn.Path i_path;
4573
4574 case ( txt,
4575 Absyn.FULLYQUALIFIED(path = i_path) )
4576 algorithm
4577 7425 txt := dumpPath(txt, i_path);
4578 then txt;
4579
4580 case ( txt,
4581 i_path )
4582 algorithm
4583 203009 txt := dumpPath(txt, i_path);
4584 then txt;
4585 end match;
4586 end dumpPathNoQual;
4587
4588 public function dumpStringCommentOption
4589 input Tpl.Text in_txt;
4590 input Option<String> in_a_cmt;
4591
4592 output Tpl.Text out_txt;
4593 algorithm
4594 out_txt :=
4595 match(in_txt, in_a_cmt)
4596 local
4597 Tpl.Text txt;
4598 String i_str;
4599
4600 case ( txt,
4601 SOME(i_str) )
4602 algorithm
4603 26004 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
4604 26004 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
4605 26004 txt := Tpl.writeStr(txt, i_str);
4606 26004 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
4607 then txt;
4608
4609 case ( txt,
4610 _ )
4611 then txt;
4612 end match;
4613 end dumpStringCommentOption;
4614
4615 protected function lm_148
4616 input output Tpl.Text txt;
4617 input list<Absyn.TypeSpec> items;
4618 algorithm
4619
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
2 for lstElt_148 in items loop
4620 txt := match lstElt_148
4621 local
4622 Absyn.TypeSpec i_ty;
4623
4624 case i_ty
4625 algorithm
4626 1 txt := dumpTypeSpec(txt, i_ty);
4627 1 txt := Tpl.nextIter(txt);
4628 then txt;
4629 end match;
4630 end for;
4631 end lm_148;
4632
4633 public function dumpTypeSpec
4634 input Tpl.Text in_txt;
4635 input Absyn.TypeSpec in_a_typeSpec;
4636
4637 output Tpl.Text out_txt;
4638 algorithm
4639 out_txt :=
4640 match(in_txt, in_a_typeSpec)
4641 local
4642 Tpl.Text txt;
4643 list<Absyn.TypeSpec> i_typeSpecs;
4644 Option<Absyn.ArrayDim> i_arrayDim;
4645 Absyn.Path i_path;
4646 Tpl.Text l_ty__str;
4647 Tpl.Text l_arraydim__str;
4648 Tpl.Text l_path__str;
4649
4650 case ( txt,
4651 Absyn.TPATH(path = i_path, arrayDim = i_arrayDim) )
4652 algorithm
4653 36157 l_path__str := dumpPath(Tpl.emptyTxt, i_path);
4654 36157 l_arraydim__str := dumpArrayDimOpt(Tpl.emptyTxt, i_arrayDim);
4655 36157 txt := Tpl.writeText(txt, l_path__str);
4656 36157 txt := Tpl.writeText(txt, l_arraydim__str);
4657 then txt;
4658
4659 case ( txt,
4660 Absyn.TCOMPLEX(path = i_path, typeSpecs = i_typeSpecs, arrayDim = i_arrayDim) )
4661 algorithm
4662 1 l_path__str := dumpPath(Tpl.emptyTxt, i_path);
4663 1 l_ty__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4664 1 l_ty__str := lm_148(l_ty__str, i_typeSpecs);
4665 1 l_ty__str := Tpl.popIter(l_ty__str);
4666 1 l_arraydim__str := dumpArrayDimOpt(Tpl.emptyTxt, i_arrayDim);
4667 1 txt := Tpl.writeText(txt, l_path__str);
4668 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<"));
4669 1 txt := Tpl.writeText(txt, l_ty__str);
4670 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
4671 1 txt := Tpl.writeText(txt, l_arraydim__str);
4672 then txt;
4673
4674 case ( txt,
4675 _ )
4676 then txt;
4677 end match;
4678 end dumpTypeSpec;
4679
4680 public function dumpArrayDimOpt
4681 input Tpl.Text in_txt;
4682 input Option<Absyn.ArrayDim> in_a_arraydim;
4683
4684 output Tpl.Text out_txt;
4685 algorithm
4686 out_txt :=
4687 match(in_txt, in_a_arraydim)
4688 local
4689 Tpl.Text txt;
4690 Absyn.ArrayDim i_ad;
4691
4692 case ( txt,
4693 SOME(i_ad) )
4694 algorithm
4695 8 txt := dumpSubscripts(txt, i_ad);
4696 then txt;
4697
4698 case ( txt,
4699 _ )
4700 then txt;
4701 end match;
4702 end dumpArrayDimOpt;
4703
4704 protected function lm_151
4705 input output Tpl.Text txt;
4706 input list<Absyn.Subscript> items;
4707 algorithm
4708
2/2
✓ Branch 0 taken 16842 times.
✓ Branch 1 taken 14487 times.
31329 for lstElt_151 in items loop
4709 txt := match lstElt_151
4710 local
4711 Absyn.Subscript i_s;
4712
4713 case i_s
4714 algorithm
4715 16842 txt := dumpSubscript(txt, i_s);
4716 16842 txt := Tpl.nextIter(txt);
4717 then txt;
4718 end match;
4719 end for;
4720 end lm_151;
4721
4722 public function dumpSubscripts
4723 input Tpl.Text in_txt;
4724 input list<Absyn.Subscript> in_a_subscripts;
4725
4726 output Tpl.Text out_txt;
4727 algorithm
4728 out_txt :=
4729 match(in_txt, in_a_subscripts)
4730 local
4731 Tpl.Text txt;
4732 list<Absyn.Subscript> i_subscripts;
4733 Tpl.Text l_sub__str;
4734
4735 case ( txt,
4736 {} )
4737 then txt;
4738
4739 case ( txt,
4740 i_subscripts )
4741 algorithm
4742 14487 l_sub__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4743 14487 l_sub__str := lm_151(l_sub__str, i_subscripts);
4744 14487 l_sub__str := Tpl.popIter(l_sub__str);
4745 14487 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
4746 14487 txt := Tpl.writeText(txt, l_sub__str);
4747 14487 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
4748 then txt;
4749 end match;
4750 end dumpSubscripts;
4751
4752 public function dumpSubscript
4753 input Tpl.Text in_txt;
4754 input Absyn.Subscript in_a_subscript;
4755
4756 output Tpl.Text out_txt;
4757 algorithm
4758 out_txt :=
4759 match(in_txt, in_a_subscript)
4760 local
4761 Tpl.Text txt;
4762 Absyn.Exp i_subscript;
4763
4764 case ( txt,
4765 Absyn.NOSUB() )
4766 algorithm
4767 973 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
4768 then txt;
4769
4770 case ( txt,
4771 Absyn.SUBSCRIPT(subscript = i_subscript) )
4772 algorithm
4773 15869 txt := dumpExp(txt, i_subscript);
4774 then txt;
4775
4776 case ( txt,
4777 _ )
4778 then txt;
4779 end match;
4780 end dumpSubscript;
4781
4782 protected function lm_154
4783 input output Tpl.Text txt;
4784 input list<Absyn.Path> items;
4785 algorithm
4786 ✗ for lstElt_154 in items loop
4787 txt := match lstElt_154
4788 local
4789 Absyn.Path i_v;
4790
4791 case i_v
4792 algorithm
4793 ✗ txt := dumpPath(txt, i_v);
4794 ✗ txt := Tpl.nextIter(txt);
4795 then txt;
4796 end match;
4797 end for;
4798 end lm_154;
4799
4800 protected function fun_155
4801 input Tpl.Text in_txt;
4802 input list<Absyn.Path> in_a_typeVars;
4803
4804 output Tpl.Text out_txt;
4805 algorithm
4806 out_txt :=
4807 match(in_txt, in_a_typeVars)
4808 local
4809 Tpl.Text txt;
4810 list<Absyn.Path> i_typeVars;
4811
4812 case ( txt,
4813 {} )
4814 then txt;
4815
4816 case ( txt,
4817 i_typeVars )
4818 algorithm
4819 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("<"));
4820 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4821 ✗ txt := lm_154(txt, i_typeVars);
4822 ✗ txt := Tpl.popIter(txt);
4823 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
4824 then txt;
4825 end match;
4826 end fun_155;
4827
4828 protected function lm_156
4829 input output Tpl.Text txt;
4830 input list<Absyn.Exp> items;
4831 algorithm
4832
2/2
✓ Branch 0 taken 382697 times.
✓ Branch 1 taken 151753 times.
534450 for lstElt_156 in items loop
4833 txt := match lstElt_156
4834 local
4835 Absyn.Exp i_e;
4836
4837 case i_e
4838 algorithm
4839 382697 txt := dumpExp(txt, i_e);
4840 382697 txt := Tpl.nextIter(txt);
4841 then txt;
4842 end match;
4843 end for;
4844 end lm_156;
4845
4846 protected function lm_157
4847 input output Tpl.Text txt;
4848 input list<Absyn.Exp> items;
4849 algorithm
4850
2/2
✓ Branch 0 taken 8009 times.
✓ Branch 1 taken 2879 times.
10888 for lstElt_157 in items loop
4851 txt := match lstElt_157
4852 local
4853 Absyn.Exp i_e;
4854
4855 case i_e
4856 algorithm
4857 8009 txt := dumpExp(txt, i_e);
4858 8009 txt := Tpl.nextIter(txt);
4859 then txt;
4860 end match;
4861 end for;
4862 end lm_157;
4863
4864 protected function lm_158
4865 input output Tpl.Text txt;
4866 input list<list<Absyn.Exp>> items;
4867 algorithm
4868
2/2
✓ Branch 0 taken 2879 times.
✓ Branch 1 taken 284 times.
3163 for lstElt_158 in items loop
4869 txt := match lstElt_158
4870 local
4871 list<Absyn.Exp> i_row;
4872
4873 case i_row
4874 algorithm
4875 2879 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4876 2879 txt := lm_157(txt, i_row);
4877 2879 txt := Tpl.popIter(txt);
4878 2879 txt := Tpl.nextIter(txt);
4879 then txt;
4880 end match;
4881 end for;
4882 end lm_158;
4883
4884 protected function lm_159
4885 input output Tpl.Text txt;
4886 input list<Absyn.Exp> items;
4887 algorithm
4888
2/2
✓ Branch 0 taken 9046 times.
✓ Branch 1 taken 8702 times.
17748 for lstElt_159 in items loop
4889 txt := match lstElt_159
4890 local
4891 Absyn.Exp i_e;
4892
4893 case i_e
4894 algorithm
4895 9046 txt := dumpExp(txt, i_e);
4896 9046 txt := Tpl.nextIter(txt);
4897 then txt;
4898 end match;
4899 end for;
4900 end lm_159;
4901
4902 protected function lm_160
4903 input output Tpl.Text txt;
4904 input list<Absyn.Exp> items;
4905 algorithm
4906 ✗ for lstElt_160 in items loop
4907 txt := match lstElt_160
4908 local
4909 Absyn.Exp i_e;
4910
4911 case i_e
4912 algorithm
4913 ✗ txt := dumpExp(txt, i_e);
4914 ✗ txt := Tpl.nextIter(txt);
4915 then txt;
4916 end match;
4917 end for;
4918 end lm_160;
4919
4920 protected function lm_161
4921 input output Tpl.Text txt;
4922 input list<String> items;
4923 algorithm
4924 ✗ for lstElt_161 in items loop
4925 txt := match lstElt_161
4926 local
4927 String i_cmt;
4928
4929 case i_cmt
4930 algorithm
4931 ✗ txt := Tpl.writeStr(txt, i_cmt);
4932 then txt;
4933 end match;
4934 end for;
4935 end lm_161;
4936
4937 protected function lm_162
4938 input output Tpl.Text txt;
4939 input list<String> items;
4940 algorithm
4941 ✗ for lstElt_162 in items loop
4942 txt := match lstElt_162
4943 local
4944 String i_cmt;
4945
4946 case i_cmt
4947 algorithm
4948 ✗ txt := Tpl.writeStr(txt, i_cmt);
4949 then txt;
4950 end match;
4951 end for;
4952 end lm_162;
4953
4954 public function dumpExp
4955 input Tpl.Text in_txt;
4956 input Absyn.Exp in_a_exp;
4957
4958 output Tpl.Text out_txt;
4959 algorithm
4960 out_txt :=
4961 match(in_txt, in_a_exp)
4962 local
4963 Tpl.Text txt;
4964 String i_unit;
4965 Absyn.Exp i_value_3;
4966 list<Absyn.Subscript> i_subscripts;
4967 list<String> i_commentsAfter;
4968 list<String> i_commentsBefore;
4969 Absyn.Exp i_index;
4970 list<Absyn.Exp> i_exps;
4971 Absyn.Exp i_rest;
4972 Absyn.Exp i_head;
4973 Absyn.Ident i_id;
4974 Absyn.CodeNode i_code;
4975 list<Absyn.Exp> i_expressions;
4976 Absyn.Exp i_stop;
4977 Absyn.Exp i_step;
4978 Absyn.Exp i_start;
4979 list<list<Absyn.Exp>> i_matrix;
4980 list<Absyn.Exp> i_arrayExp;
4981 list<Absyn.Path> i_typeVars;
4982 Absyn.ComponentRef i_function__;
4983 Absyn.FunctionArgs i_functionArgs;
4984 Absyn.Exp i_exp;
4985 Absyn.Operator i_op;
4986 Absyn.Exp i_exp2;
4987 Absyn.Exp i_e;
4988 Absyn.Exp i_exp1;
4989 Boolean i_value_2;
4990 Absyn.ComponentRef i_componentRef;
4991 String i_value_1;
4992 Integer i_value;
4993 Tpl.Text l_list__str;
4994 Tpl.Text l_rest__str;
4995 Tpl.Text l_head__str;
4996 Tpl.Text l_tuple__str;
4997 Tpl.Text l_stop__str;
4998 Tpl.Text l_step__str;
4999 Tpl.Text l_start__str;
5000 Tpl.Text l_matrix__str;
5001 Tpl.Text l_array__str;
5002 Tpl.Text l_tvs__str;
5003 Tpl.Text l_func__str;
5004 Tpl.Text l_args__str;
5005 Tpl.Text l_exp__str;
5006 Tpl.Text l_op__str;
5007 Tpl.Text l_rhs__str;
5008 Tpl.Text l_lhs__str;
5009
5010 case ( txt,
5011 Absyn.INTEGER(value = i_value) )
5012 algorithm
5013 264320 txt := Tpl.writeStr(txt, intString(i_value));
5014 then txt;
5015
5016 case ( txt,
5017 Absyn.REAL(value = i_value_1) )
5018 algorithm
5019 81483 txt := Tpl.writeStr(txt, i_value_1);
5020 then txt;
5021
5022 case ( txt,
5023 Absyn.CREF(componentRef = i_componentRef) )
5024 algorithm
5025 102811 txt := dumpCref(txt, i_componentRef);
5026 then txt;
5027
5028 case ( txt,
5029 Absyn.STRING(value = i_value_1) )
5030 algorithm
5031 17873 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5032 17873 txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
5033 17873 txt := Tpl.writeStr(txt, i_value_1);
5034 17873 txt := Tpl.popBlock(txt);
5035 17873 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
5036 then txt;
5037
5038 case ( txt,
5039 Absyn.BOOL(value = i_value_2) )
5040 algorithm
5041 38586 txt := Tpl.writeStr(txt, Tpl.booleanString(i_value_2));
5042 then txt;
5043
5044 case ( txt,
5045 (i_e as Absyn.BINARY(exp1 = i_exp1, exp2 = i_exp2, op = i_op)) )
5046 algorithm
5047 37849 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
5048 37849 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
5049 37849 l_op__str := dumpOperator(Tpl.emptyTxt, i_op);
5050 37849 txt := Tpl.writeText(txt, l_lhs__str);
5051 37849 txt := Tpl.writeText(txt, l_op__str);
5052 37849 txt := Tpl.writeText(txt, l_rhs__str);
5053 then txt;
5054
5055 case ( txt,
5056 (i_e as Absyn.UNARY(exp = i_exp, op = i_op)) )
5057 algorithm
5058 105725 l_exp__str := dumpOperand(Tpl.emptyTxt, i_exp, i_e, false);
5059 105725 l_op__str := dumpOperator(Tpl.emptyTxt, i_op);
5060 105725 txt := Tpl.writeText(txt, l_op__str);
5061 105725 txt := Tpl.writeText(txt, l_exp__str);
5062 then txt;
5063
5064 case ( txt,
5065 (i_e as Absyn.LBINARY(exp1 = i_exp1, exp2 = i_exp2, op = i_op)) )
5066 algorithm
5067 1305 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
5068 1305 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
5069 1305 l_op__str := dumpOperator(Tpl.emptyTxt, i_op);
5070 1305 txt := Tpl.writeText(txt, l_lhs__str);
5071 1305 txt := Tpl.writeText(txt, l_op__str);
5072 1305 txt := Tpl.writeText(txt, l_rhs__str);
5073 then txt;
5074
5075 case ( txt,
5076 (i_e as Absyn.LUNARY(exp = i_exp, op = i_op)) )
5077 algorithm
5078 794 l_exp__str := dumpOperand(Tpl.emptyTxt, i_exp, i_e, false);
5079 794 l_op__str := dumpOperator(Tpl.emptyTxt, i_op);
5080 794 txt := Tpl.writeText(txt, l_op__str);
5081 794 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
5082 794 txt := Tpl.writeText(txt, l_exp__str);
5083 then txt;
5084
5085 case ( txt,
5086 (i_e as Absyn.RELATION(exp1 = i_exp1, exp2 = i_exp2, op = i_op)) )
5087 algorithm
5088 4262 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
5089 4262 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
5090 4262 l_op__str := dumpOperator(Tpl.emptyTxt, i_op);
5091 4262 txt := Tpl.writeText(txt, l_lhs__str);
5092 4262 txt := Tpl.writeText(txt, l_op__str);
5093 4262 txt := Tpl.writeText(txt, l_rhs__str);
5094 then txt;
5095
5096 case ( txt,
5097 (i_exp as Absyn.IFEXP(ifExp = _)) )
5098 algorithm
5099 1808 txt := dumpIfExp(txt, i_exp);
5100 then txt;
5101
5102 case ( txt,
5103 Absyn.CALL(function_ = Absyn.CREF_IDENT(name = "$array"), functionArgs = i_functionArgs) )
5104 algorithm
5105 151 l_args__str := dumpFunctionArgs(Tpl.emptyTxt, i_functionArgs);
5106 151 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
5107 151 txt := Tpl.writeText(txt, l_args__str);
5108 151 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
5109 then txt;
5110
5111 case ( txt,
5112 Absyn.CALL(function_ = i_function__, functionArgs = i_functionArgs, typeVars = i_typeVars) )
5113 algorithm
5114 25344 l_func__str := dumpCref(Tpl.emptyTxt, i_function__);
5115 25344 l_args__str := dumpFunctionArgs(Tpl.emptyTxt, i_functionArgs);
5116 25344 l_tvs__str := fun_155(Tpl.emptyTxt, i_typeVars);
5117 25344 txt := Tpl.writeText(txt, l_func__str);
5118 25344 txt := Tpl.writeText(txt, l_tvs__str);
5119 25344 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5120 25344 txt := Tpl.writeText(txt, l_args__str);
5121 25344 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5122 then txt;
5123
5124 case ( txt,
5125 Absyn.PARTEVALFUNCTION(function_ = i_function__, functionArgs = i_functionArgs) )
5126 algorithm
5127 30 l_func__str := dumpCref(Tpl.emptyTxt, i_function__);
5128 30 l_args__str := dumpFunctionArgs(Tpl.emptyTxt, i_functionArgs);
5129 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
5130 30 txt := Tpl.writeText(txt, l_func__str);
5131 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5132 30 txt := Tpl.writeText(txt, l_args__str);
5133 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5134 then txt;
5135
5136 case ( txt,
5137 Absyn.ARRAY(arrayExp = i_arrayExp) )
5138 algorithm
5139 151753 l_array__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5140 151753 l_array__str := lm_156(l_array__str, i_arrayExp);
5141 151753 l_array__str := Tpl.popIter(l_array__str);
5142 151753 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
5143 151753 txt := Tpl.writeText(txt, l_array__str);
5144 151753 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
5145 then txt;
5146
5147 case ( txt,
5148 Absyn.MATRIX(matrix = i_matrix) )
5149 algorithm
5150 284 l_matrix__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING("; ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5151 284 l_matrix__str := lm_158(l_matrix__str, i_matrix);
5152 284 l_matrix__str := Tpl.popIter(l_matrix__str);
5153 284 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
5154 284 txt := Tpl.writeText(txt, l_matrix__str);
5155 284 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
5156 then txt;
5157
5158 case ( txt,
5159 (i_e as Absyn.RANGE(step = SOME(i_step), start = i_start, stop = i_stop)) )
5160 algorithm
5161 16 l_start__str := dumpOperand(Tpl.emptyTxt, i_start, i_e, false);
5162 16 l_step__str := dumpOperand(Tpl.emptyTxt, i_step, i_e, false);
5163 16 l_stop__str := dumpOperand(Tpl.emptyTxt, i_stop, i_e, false);
5164 16 txt := Tpl.writeText(txt, l_start__str);
5165 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
5166 16 txt := Tpl.writeText(txt, l_step__str);
5167 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
5168 16 txt := Tpl.writeText(txt, l_stop__str);
5169 then txt;
5170
5171 case ( txt,
5172 (i_e as Absyn.RANGE(step = NONE(), start = i_start, stop = i_stop)) )
5173 algorithm
5174 1243 l_start__str := dumpOperand(Tpl.emptyTxt, i_start, i_e, false);
5175 1243 l_stop__str := dumpOperand(Tpl.emptyTxt, i_stop, i_e, false);
5176 1243 txt := Tpl.writeText(txt, l_start__str);
5177 1243 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
5178 1243 txt := Tpl.writeText(txt, l_stop__str);
5179 then txt;
5180
5181 case ( txt,
5182 Absyn.TUPLE(expressions = i_expressions) )
5183 algorithm
5184 8702 l_tuple__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5185 8702 l_tuple__str := lm_159(l_tuple__str, i_expressions);
5186 8702 l_tuple__str := Tpl.popIter(l_tuple__str);
5187 8702 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5188 8702 txt := Tpl.writeText(txt, l_tuple__str);
5189 8702 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5190 then txt;
5191
5192 case ( txt,
5193 Absyn.END() )
5194 algorithm
5195 12 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end"));
5196 then txt;
5197
5198 case ( txt,
5199 Absyn.CODE(code = i_code) )
5200 algorithm
5201 22 txt := Tpl.writeTok(txt, Tpl.ST_STRING("$Code("));
5202 22 txt := dumpCodeNode(txt, i_code);
5203 22 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5204 then txt;
5205
5206 case ( txt,
5207 Absyn.AS(exp = i_exp, id = i_id) )
5208 algorithm
5209 4 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp);
5210 4 txt := Tpl.writeStr(txt, i_id);
5211 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" as "));
5212 4 txt := Tpl.writeText(txt, l_exp__str);
5213 then txt;
5214
5215 case ( txt,
5216 Absyn.CONS(head = i_head, rest = i_rest) )
5217 algorithm
5218 ✗ l_head__str := dumpExp(Tpl.emptyTxt, i_head);
5219 ✗ l_rest__str := dumpExp(Tpl.emptyTxt, i_rest);
5220 ✗ txt := Tpl.writeText(txt, l_head__str);
5221 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" :: "));
5222 ✗ txt := Tpl.writeText(txt, l_rest__str);
5223 then txt;
5224
5225 case ( txt,
5226 (i_exp as Absyn.MATCHEXP(matchTy = _)) )
5227 algorithm
5228 ✗ txt := dumpMatchExp(txt, i_exp);
5229 then txt;
5230
5231 case ( txt,
5232 Absyn.LIST(exps = i_exps) )
5233 algorithm
5234 ✗ l_list__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5235 ✗ l_list__str := lm_160(l_list__str, i_exps);
5236 ✗ l_list__str := Tpl.popIter(l_list__str);
5237 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
5238 ✗ txt := Tpl.writeText(txt, l_list__str);
5239 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
5240 then txt;
5241
5242 case ( txt,
5243 Absyn.DOT(exp = i_exp, index = i_index) )
5244 algorithm
5245 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5246 ✗ txt := dumpExp(txt, i_exp);
5247 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")."));
5248 ✗ txt := dumpExp(txt, i_index);
5249 then txt;
5250
5251 case ( txt,
5252 Absyn.EXPRESSIONCOMMENT(commentsBefore = i_commentsBefore, exp = i_exp, commentsAfter = i_commentsAfter) )
5253 algorithm
5254 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
5255 ✗ txt := lm_161(txt, i_commentsBefore);
5256 ✗ txt := Tpl.popBlock(txt);
5257 ✗ txt := dumpExp(txt, i_exp);
5258 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_ABS_INDENT(0));
5259 ✗ txt := lm_162(txt, i_commentsAfter);
5260 ✗ txt := Tpl.popBlock(txt);
5261 then txt;
5262
5263 case ( txt,
5264 Absyn.SUBSCRIPTED_EXP(exp = i_exp, subscripts = i_subscripts) )
5265 algorithm
5266 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5267 ✗ txt := dumpExp(txt, i_exp);
5268 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")["));
5269 ✗ txt := dumpSubscripts(txt, i_subscripts);
5270 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
5271 then txt;
5272
5273 case ( txt,
5274 Absyn.BREAK() )
5275 algorithm
5276 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("break"));
5277 then txt;
5278
5279 case ( txt,
5280 Absyn.UNITFUL_LITERAL(value = i_value_3, unit = i_unit) )
5281 algorithm
5282 ✗ txt := dumpExp(txt, i_value_3);
5283 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\'"));
5284 ✗ txt := Tpl.writeStr(txt, i_unit);
5285 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("\'"));
5286 then txt;
5287
5288 case ( txt,
5289 _ )
5290 algorithm
5291 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* AbsynDumpTpl.dumpExp: UNHANDLED Abyn.Exp */"));
5292 then txt;
5293 end match;
5294 end dumpExp;
5295
5296 public function dumpLhsExp
5297 input Tpl.Text in_txt;
5298 input Absyn.Exp in_a_lhs;
5299
5300 output Tpl.Text out_txt;
5301 algorithm
5302 out_txt :=
5303 match(in_txt, in_a_lhs)
5304 local
5305 Tpl.Text txt;
5306 Absyn.Exp i_lhs;
5307
5308 case ( txt,
5309 (i_lhs as Absyn.IFEXP(ifExp = _)) )
5310 algorithm
5311 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5312 ✗ txt := dumpExp(txt, i_lhs);
5313 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5314 then txt;
5315
5316 case ( txt,
5317 i_lhs )
5318 algorithm
5319 14029 txt := dumpExp(txt, i_lhs);
5320 then txt;
5321 end match;
5322 end dumpLhsExp;
5323
5324 public function dumpOperand
5325 input Tpl.Text txt;
5326 input Absyn.Exp a_operand;
5327 input Absyn.Exp a_operation;
5328 input Boolean a_lhs;
5329
5330 output Tpl.Text out_txt;
5331 protected
5332 Tpl.Text l_op__str;
5333 algorithm
5334 195885 l_op__str := dumpExp(Tpl.emptyTxt, a_operand);
5335 195885 out_txt := Tpl.writeText(txt, l_op__str);
5336 end dumpOperand;
5337
5338 public function dumpIfExp
5339 input Tpl.Text in_txt;
5340 input Absyn.Exp in_a_if__exp;
5341
5342 output Tpl.Text out_txt;
5343 algorithm
5344 out_txt :=
5345 match(in_txt, in_a_if__exp)
5346 local
5347 Tpl.Text txt;
5348 list<tuple<Absyn.Exp, Absyn.Exp>> i_elseIfBranch;
5349 Absyn.Exp i_elseBranch;
5350 Absyn.Exp i_trueBranch;
5351 Absyn.Exp i_ifExp;
5352 Tpl.Text l_else__if__str;
5353 Tpl.Text l_else__branch__str;
5354 Tpl.Text l_true__branch__str;
5355 Tpl.Text l_cond__str;
5356
5357 case ( txt,
5358 Absyn.IFEXP(ifExp = i_ifExp, trueBranch = i_trueBranch, elseBranch = i_elseBranch, elseIfBranch = i_elseIfBranch) )
5359 algorithm
5360 1808 l_cond__str := dumpExp(Tpl.emptyTxt, i_ifExp);
5361 1808 l_true__branch__str := dumpExp(Tpl.emptyTxt, i_trueBranch);
5362 1808 l_else__branch__str := dumpExp(Tpl.emptyTxt, i_elseBranch);
5363 1808 l_else__if__str := dumpElseIfExp(Tpl.emptyTxt, i_elseIfBranch);
5364 1808 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if "));
5365 1808 txt := Tpl.writeText(txt, l_cond__str);
5366 1808 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" then "));
5367 1808 txt := Tpl.writeText(txt, l_true__branch__str);
5368 1808 txt := Tpl.writeText(txt, l_else__if__str);
5369 1808 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" else "));
5370 1808 txt := Tpl.writeText(txt, l_else__branch__str);
5371 then txt;
5372
5373 case ( txt,
5374 _ )
5375 then txt;
5376 end match;
5377 end dumpIfExp;
5378
5379 protected function lm_167
5380 input output Tpl.Text txt;
5381 input list<tuple<Absyn.Exp, Absyn.Exp>> items;
5382 algorithm
5383
2/2
✓ Branch 0 taken 55 times.
✓ Branch 1 taken 1808 times.
1863 for lstElt_167 in items loop
5384 txt := match lstElt_167
5385 local
5386 Absyn.Exp i_branch;
5387 Absyn.Exp i_cond;
5388 Tpl.Text l_branch__str;
5389 Tpl.Text l_cond__str;
5390
5391 case (i_cond, i_branch)
5392 algorithm
5393 55 l_cond__str := dumpExp(Tpl.emptyTxt, i_cond);
5394 55 l_branch__str := dumpExp(Tpl.emptyTxt, i_branch);
5395 55 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
5396 55 txt := Tpl.writeTok(txt, Tpl.ST_STRING("elseif "));
5397 55 txt := Tpl.writeText(txt, l_cond__str);
5398 55 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" then "));
5399 55 txt := Tpl.writeText(txt, l_branch__str);
5400 55 txt := Tpl.popBlock(txt);
5401 55 txt := Tpl.nextIter(txt);
5402 then txt;
5403 end match;
5404 end for;
5405 end lm_167;
5406
5407 public function dumpElseIfExp
5408 input Tpl.Text txt;
5409 input list<tuple<Absyn.Exp, Absyn.Exp>> a_else__if;
5410
5411 output Tpl.Text out_txt;
5412 algorithm
5413 1808 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5414 1808 out_txt := lm_167(out_txt, a_else__if);
5415 1808 out_txt := Tpl.popIter(out_txt);
5416 end dumpElseIfExp;
5417
5418 protected function fun_169
5419 input Tpl.Text in_txt;
5420 input Boolean in_a_boolean;
5421
5422 output Tpl.Text out_txt;
5423 algorithm
5424 out_txt :=
5425 match(in_txt, in_a_boolean)
5426 local
5427 Tpl.Text txt;
5428
5429 case ( txt,
5430 false )
5431 then txt;
5432
5433 case ( txt,
5434 _ )
5435 algorithm
5436 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("initial "));
5437 then txt;
5438 end match;
5439 end fun_169;
5440
5441 protected function fun_170
5442 input Tpl.Text in_txt;
5443 input Boolean in_a_boolean;
5444
5445 output Tpl.Text out_txt;
5446 algorithm
5447 out_txt :=
5448 match(in_txt, in_a_boolean)
5449 local
5450 Tpl.Text txt;
5451
5452 case ( txt,
5453 false )
5454 then txt;
5455
5456 case ( txt,
5457 _ )
5458 algorithm
5459 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("initial "));
5460 then txt;
5461 end match;
5462 end fun_170;
5463
5464 protected function fun_171
5465 input Tpl.Text in_txt;
5466 input Boolean in_a_boolean;
5467
5468 output Tpl.Text out_txt;
5469 algorithm
5470 out_txt :=
5471 match(in_txt, in_a_boolean)
5472 local
5473 Tpl.Text txt;
5474
5475 case ( txt,
5476 false )
5477 then txt;
5478
5479 case ( txt,
5480 _ )
5481 algorithm
5482 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("initial "));
5483 then txt;
5484 end match;
5485 end fun_171;
5486
5487 public function dumpCodeNode
5488 input Tpl.Text in_txt;
5489 input Absyn.CodeNode in_a_code;
5490
5491 output Tpl.Text out_txt;
5492 algorithm
5493 out_txt :=
5494 match(in_txt, in_a_code)
5495 local
5496 Tpl.Text txt;
5497 Absyn.Modification i_modification;
5498 Absyn.Exp i_exp;
5499 Absyn.Element i_element;
5500 list<Absyn.AlgorithmItem> i_algorithmItemLst;
5501 list<Absyn.EquationItem> i_equationItemLst;
5502 Boolean i_boolean;
5503 Absyn.ComponentRef i_componentRef;
5504 Absyn.Path i_path;
5505 Tpl.Text l_algs__str;
5506 Tpl.Text l_eql__str;
5507 Tpl.Text l_initial__str;
5508
5509 case ( txt,
5510 Absyn.C_TYPENAME(path = i_path) )
5511 algorithm
5512 ✗ txt := dumpPath(txt, i_path);
5513 then txt;
5514
5515 case ( txt,
5516 Absyn.C_VARIABLENAME(componentRef = i_componentRef) )
5517 algorithm
5518 ✗ txt := dumpCref(txt, i_componentRef);
5519 then txt;
5520
5521 case ( txt,
5522 Absyn.C_CONSTRAINTSECTION(boolean = i_boolean, equationItemLst = i_equationItemLst) )
5523 algorithm
5524 ✗ l_initial__str := fun_169(Tpl.emptyTxt, i_boolean);
5525 ✗ l_eql__str := dumpEquationItems(Tpl.emptyTxt, i_equationItemLst);
5526 ✗ txt := Tpl.writeText(txt, l_initial__str);
5527 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE("constraint\n"));
5528 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5529 ✗ txt := Tpl.writeText(txt, l_eql__str);
5530 ✗ txt := Tpl.popBlock(txt);
5531 then txt;
5532
5533 case ( txt,
5534 Absyn.C_EQUATIONSECTION(boolean = i_boolean, equationItemLst = i_equationItemLst) )
5535 algorithm
5536 ✗ l_initial__str := fun_170(Tpl.emptyTxt, i_boolean);
5537 ✗ l_eql__str := dumpEquationItems(Tpl.emptyTxt, i_equationItemLst);
5538 ✗ txt := Tpl.writeText(txt, l_initial__str);
5539 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
5540 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5541 ✗ txt := Tpl.writeText(txt, l_eql__str);
5542 ✗ txt := Tpl.popBlock(txt);
5543 then txt;
5544
5545 case ( txt,
5546 Absyn.C_ALGORITHMSECTION(boolean = i_boolean, algorithmItemLst = i_algorithmItemLst) )
5547 algorithm
5548 ✗ l_initial__str := fun_171(Tpl.emptyTxt, i_boolean);
5549 ✗ l_algs__str := dumpAlgorithmItems(Tpl.emptyTxt, i_algorithmItemLst);
5550 ✗ txt := Tpl.writeText(txt, l_initial__str);
5551 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE("algorithm\n"));
5552 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5553 ✗ txt := Tpl.writeText(txt, l_algs__str);
5554 ✗ txt := Tpl.popBlock(txt);
5555 then txt;
5556
5557 case ( txt,
5558 Absyn.C_ELEMENT(element = i_element) )
5559 algorithm
5560 ✗ txt := dumpElement(txt, i_element, Dump.defaultDumpOptions);
5561 then txt;
5562
5563 case ( txt,
5564 Absyn.C_EXPRESSION(exp = i_exp) )
5565 algorithm
5566 ✗ txt := dumpExp(txt, i_exp);
5567 then txt;
5568
5569 case ( txt,
5570 Absyn.C_MODIFICATION(modification = i_modification) )
5571 algorithm
5572 22 txt := dumpModification(txt, i_modification);
5573 then txt;
5574
5575 case ( txt,
5576 _ )
5577 then txt;
5578 end match;
5579 end dumpCodeNode;
5580
5581 protected function lm_173
5582 input output Tpl.Text txt;
5583 input list<Absyn.Case> items;
5584 algorithm
5585 ✗ for lstElt_173 in items loop
5586 txt := match lstElt_173
5587 local
5588 Absyn.Case i_c;
5589
5590 case i_c
5591 algorithm
5592 ✗ txt := dumpMatchCase(txt, i_c);
5593 ✗ txt := Tpl.nextIter(txt);
5594 then txt;
5595 end match;
5596 end for;
5597 end lm_173;
5598
5599 public function dumpMatchExp
5600 input Tpl.Text in_txt;
5601 input Absyn.Exp in_a_match__exp;
5602
5603 output Tpl.Text out_txt;
5604 algorithm
5605 out_txt :=
5606 match(in_txt, in_a_match__exp)
5607 local
5608 Tpl.Text txt;
5609 Option<String> i_comment;
5610 list<Absyn.Case> i_cases;
5611 list<Absyn.ElementItem> i_localDecls;
5612 Absyn.Exp i_inputExp;
5613 Absyn.MatchType i_matchTy;
5614 Tpl.Text l_cmt__str;
5615 Tpl.Text l_cases__str;
5616 Tpl.Text l_locals__str;
5617 Tpl.Text l_input__str;
5618 Tpl.Text l_ty__str;
5619
5620 case ( txt,
5621 Absyn.MATCHEXP(matchTy = i_matchTy, inputExp = i_inputExp, localDecls = i_localDecls, cases = i_cases, comment = i_comment) )
5622 algorithm
5623 ✗ l_ty__str := dumpMatchType(Tpl.emptyTxt, i_matchTy);
5624 ✗ l_input__str := dumpExp(Tpl.emptyTxt, i_inputExp);
5625 ✗ l_locals__str := dumpMatchLocals(Tpl.emptyTxt, i_localDecls);
5626 ✗ l_cases__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING_LIST({
5627 "\n",
5628 "\n"
5629 }, true)), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5630 ✗ l_cases__str := lm_173(l_cases__str, i_cases);
5631 ✗ l_cases__str := Tpl.popIter(l_cases__str);
5632 ✗ l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
5633 ✗ txt := Tpl.writeText(txt, l_ty__str);
5634 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
5635 ✗ txt := Tpl.writeText(txt, l_input__str);
5636 ✗ txt := Tpl.softNewLine(txt);
5637 ✗ txt := Tpl.writeText(txt, l_locals__str);
5638 ✗ txt := Tpl.softNewLine(txt);
5639 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5640 ✗ txt := Tpl.writeText(txt, l_cases__str);
5641 ✗ txt := Tpl.writeText(txt, l_cmt__str);
5642 ✗ txt := Tpl.softNewLine(txt);
5643 ✗ txt := Tpl.popBlock(txt);
5644 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
5645 ✗ txt := Tpl.writeText(txt, l_ty__str);
5646 then txt;
5647
5648 case ( txt,
5649 _ )
5650 then txt;
5651 end match;
5652 end dumpMatchExp;
5653
5654 public function dumpMatchType
5655 input Tpl.Text in_txt;
5656 input Absyn.MatchType in_a_match__type;
5657
5658 output Tpl.Text out_txt;
5659 algorithm
5660 out_txt :=
5661 match(in_txt, in_a_match__type)
5662 local
5663 Tpl.Text txt;
5664
5665 case ( txt,
5666 Absyn.MATCH() )
5667 algorithm
5668 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("match"));
5669 then txt;
5670
5671 case ( txt,
5672 Absyn.MATCHCONTINUE() )
5673 algorithm
5674 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("matchcontinue"));
5675 then txt;
5676
5677 case ( txt,
5678 _ )
5679 then txt;
5680 end match;
5681 end dumpMatchType;
5682
5683 protected function lm_176
5684 input output Tpl.Text txt;
5685 input list<Absyn.ElementItem> items;
5686 algorithm
5687 ✗ for lstElt_176 in items loop
5688 txt := match lstElt_176
5689 local
5690 Absyn.ElementItem i_decl;
5691
5692 case i_decl
5693 algorithm
5694 ✗ txt := dumpElementItem(txt, i_decl, Dump.defaultDumpOptions);
5695 ✗ txt := Tpl.nextIter(txt);
5696 then txt;
5697 end match;
5698 end for;
5699 end lm_176;
5700
5701 public function dumpMatchLocals
5702 input Tpl.Text in_txt;
5703 input list<Absyn.ElementItem> in_a_locals;
5704
5705 output Tpl.Text out_txt;
5706 algorithm
5707 out_txt :=
5708 match(in_txt, in_a_locals)
5709 local
5710 Tpl.Text txt;
5711 list<Absyn.ElementItem> i_locals;
5712
5713 case ( txt,
5714 {} )
5715 then txt;
5716
5717 case ( txt,
5718 i_locals )
5719 algorithm
5720 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE(" local\n"));
5721 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5722 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5723 ✗ txt := lm_176(txt, i_locals);
5724 ✗ txt := Tpl.popIter(txt);
5725 ✗ txt := Tpl.softNewLine(txt);
5726 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
5727 ✗ txt := Tpl.popBlock(txt);
5728 then txt;
5729 end match;
5730 end dumpMatchLocals;
5731
5732 protected function lm_178
5733 input output Tpl.Text txt;
5734 input list<Absyn.EquationItem> items;
5735 algorithm
5736 ✗ for lstElt_178 in items loop
5737 txt := match lstElt_178
5738 local
5739 Absyn.EquationItem i_eq;
5740
5741 case i_eq
5742 algorithm
5743 ✗ txt := dumpEquationItem(txt, i_eq);
5744 ✗ txt := Tpl.nextIter(txt);
5745 then txt;
5746 end match;
5747 end for;
5748 end lm_178;
5749
5750 protected function lm_179
5751 input output Tpl.Text txt;
5752 input list<Absyn.AlgorithmItem> items;
5753 algorithm
5754 ✗ for lstElt_179 in items loop
5755 txt := match lstElt_179
5756 local
5757 Absyn.AlgorithmItem i_alg;
5758
5759 case i_alg
5760 algorithm
5761 ✗ txt := dumpAlgorithmItem(txt, i_alg);
5762 ✗ txt := Tpl.nextIter(txt);
5763 then txt;
5764 end match;
5765 end for;
5766 end lm_179;
5767
5768 public function dumpMatchEquations
5769 input Tpl.Text in_txt;
5770 input Absyn.ClassPart in_a_cp;
5771
5772 output Tpl.Text out_txt;
5773 algorithm
5774 out_txt :=
5775 match(in_txt, in_a_cp)
5776 local
5777 Tpl.Text txt;
5778 list<Absyn.AlgorithmItem> i_algs;
5779 list<Absyn.EquationItem> i_eql;
5780
5781 case ( txt,
5782 Absyn.EQUATIONS(contents = {}) )
5783 then txt;
5784
5785 case ( txt,
5786 Absyn.EQUATIONS(contents = i_eql) )
5787 algorithm
5788 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5789 "\n",
5790 " equation\n"
5791 }, true));
5792 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5793 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5794 ✗ txt := lm_178(txt, i_eql);
5795 ✗ txt := Tpl.popIter(txt);
5796 ✗ txt := Tpl.popBlock(txt);
5797 then txt;
5798
5799 case ( txt,
5800 Absyn.ALGORITHMS(contents = {}) )
5801 then txt;
5802
5803 case ( txt,
5804 Absyn.ALGORITHMS(contents = i_algs) )
5805 algorithm
5806 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5807 "\n",
5808 " algorithm\n"
5809 }, true));
5810 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5811 ✗ txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5812 ✗ txt := lm_179(txt, i_algs);
5813 ✗ txt := Tpl.popIter(txt);
5814 ✗ txt := Tpl.popBlock(txt);
5815 then txt;
5816
5817 case ( txt,
5818 _ )
5819 then txt;
5820 end match;
5821 end dumpMatchEquations;
5822
5823 protected function fun_181
5824 input Tpl.Text in_txt;
5825 input Option<Absyn.Exp> in_a_patternGuard;
5826
5827 output Tpl.Text out_txt;
5828 algorithm
5829 out_txt :=
5830 match(in_txt, in_a_patternGuard)
5831 local
5832 Tpl.Text txt;
5833 Absyn.Exp i_g;
5834
5835 case ( txt,
5836 SOME(i_g) )
5837 algorithm
5838 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("guard "));
5839 ✗ txt := dumpExp(txt, i_g);
5840 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
5841 then txt;
5842
5843 case ( txt,
5844 _ )
5845 then txt;
5846 end match;
5847 end fun_181;
5848
5849 protected function fun_182
5850 input Tpl.Text in_txt;
5851 input Boolean in_mArg;
5852 input Tpl.Text in_a_result__str;
5853
5854 output Tpl.Text out_txt;
5855 algorithm
5856 out_txt :=
5857 match(in_txt, in_mArg, in_a_result__str)
5858 local
5859 Tpl.Text txt;
5860 Tpl.Text a_result__str;
5861
5862 case ( txt,
5863 true,
5864 a_result__str )
5865 algorithm
5866 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("then "));
5867 ✗ txt := Tpl.writeText(txt, a_result__str);
5868 then txt;
5869
5870 case ( txt,
5871 _,
5872 a_result__str )
5873 algorithm
5874 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5875 "\n",
5876 " then\n"
5877 }, true));
5878 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5879 ✗ txt := Tpl.writeText(txt, a_result__str);
5880 ✗ txt := Tpl.popBlock(txt);
5881 then txt;
5882 end match;
5883 end fun_182;
5884
5885 protected function fun_183
5886 input Tpl.Text in_txt;
5887 input Boolean in_mArg;
5888 input Tpl.Text in_a_result__str;
5889
5890 output Tpl.Text out_txt;
5891 algorithm
5892 out_txt :=
5893 match(in_txt, in_mArg, in_a_result__str)
5894 local
5895 Tpl.Text txt;
5896 Tpl.Text a_result__str;
5897
5898 case ( txt,
5899 true,
5900 a_result__str )
5901 algorithm
5902 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("then "));
5903 ✗ txt := Tpl.writeText(txt, a_result__str);
5904 then txt;
5905
5906 case ( txt,
5907 _,
5908 a_result__str )
5909 algorithm
5910 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
5911 "\n",
5912 " then\n"
5913 }, true));
5914 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
5915 ✗ txt := Tpl.writeText(txt, a_result__str);
5916 ✗ txt := Tpl.popBlock(txt);
5917 then txt;
5918 end match;
5919 end fun_183;
5920
5921 public function dumpMatchCase
5922 input Tpl.Text in_txt;
5923 input Absyn.Case in_a_c;
5924
5925 output Tpl.Text out_txt;
5926 algorithm
5927 out_txt :=
5928 match(in_txt, in_a_c)
5929 local
5930 Tpl.Text txt;
5931 Option<String> i_comment;
5932 Absyn.Exp i_result;
5933 Absyn.ClassPart i_classPart;
5934 Option<Absyn.Exp> i_patternGuard;
5935 Absyn.Exp i_pattern;
5936 Boolean ret_7;
5937 Tpl.Text l_cmt__str;
5938 Boolean ret_5;
5939 Tpl.Text l_then__str;
5940 Tpl.Text l_result__str;
5941 Tpl.Text l_eql__str;
5942 Tpl.Text l_guard__str;
5943 Tpl.Text l_pattern__str;
5944
5945 case ( txt,
5946 Absyn.CASE(pattern = i_pattern, patternGuard = i_patternGuard, classPart = i_classPart, result = i_result, comment = i_comment) )
5947 algorithm
5948 ✗ l_pattern__str := dumpExp(Tpl.emptyTxt, i_pattern);
5949 ✗ l_guard__str := fun_181(Tpl.emptyTxt, i_patternGuard);
5950 ✗ l_eql__str := dumpMatchEquations(Tpl.emptyTxt, i_classPart);
5951 ✗ l_result__str := dumpExp(Tpl.emptyTxt, i_result);
5952 ✗ ret_5 := Tpl.isEmpty(l_eql__str);
5953 ✗ l_then__str := fun_182(Tpl.emptyTxt, ret_5, l_result__str);
5954 ✗ l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
5955 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case "));
5956 ✗ txt := Tpl.writeText(txt, l_pattern__str);
5957 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
5958 ✗ txt := Tpl.writeText(txt, l_guard__str);
5959 ✗ txt := Tpl.writeText(txt, l_cmt__str);
5960 ✗ txt := Tpl.writeText(txt, l_eql__str);
5961 ✗ txt := Tpl.writeText(txt, l_then__str);
5962 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5963 then txt;
5964
5965 case ( txt,
5966 Absyn.ELSE(classPart = i_classPart, result = i_result, comment = i_comment) )
5967 algorithm
5968 ✗ l_eql__str := dumpMatchEquations(Tpl.emptyTxt, i_classPart);
5969 ✗ l_result__str := dumpExp(Tpl.emptyTxt, i_result);
5970 ✗ ret_7 := Tpl.isEmpty(l_eql__str);
5971 ✗ l_then__str := fun_183(Tpl.emptyTxt, ret_7, l_result__str);
5972 ✗ l_cmt__str := dumpStringCommentOption(Tpl.emptyTxt, i_comment);
5973 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("else "));
5974 ✗ txt := Tpl.writeText(txt, l_cmt__str);
5975 ✗ txt := Tpl.writeText(txt, l_eql__str);
5976 ✗ txt := Tpl.writeText(txt, l_then__str);
5977 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5978 then txt;
5979
5980 case ( txt,
5981 _ )
5982 then txt;
5983 end match;
5984 end dumpMatchCase;
5985
5986 public function dumpOperator
5987 input Tpl.Text in_txt;
5988 input Absyn.Operator in_a_op;
5989
5990 output Tpl.Text out_txt;
5991 algorithm
5992 out_txt :=
5993 match(in_txt, in_a_op)
5994 local
5995 Tpl.Text txt;
5996
5997 case ( txt,
5998 Absyn.ADD() )
5999 algorithm
6000 7138 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" + "));
6001 then txt;
6002
6003 case ( txt,
6004 Absyn.SUB() )
6005 algorithm
6006 4653 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" - "));
6007 then txt;
6008
6009 case ( txt,
6010 Absyn.MUL() )
6011 algorithm
6012 17028 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
6013 then txt;
6014
6015 case ( txt,
6016 Absyn.DIV() )
6017 algorithm
6018 7364 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/"));
6019 then txt;
6020
6021 case ( txt,
6022 Absyn.POW() )
6023 algorithm
6024 1643 txt := Tpl.writeTok(txt, Tpl.ST_STRING("^"));
6025 then txt;
6026
6027 case ( txt,
6028 Absyn.UPLUS() )
6029 algorithm
6030 106 txt := Tpl.writeTok(txt, Tpl.ST_STRING("+"));
6031 then txt;
6032
6033 case ( txt,
6034 Absyn.UMINUS() )
6035 algorithm
6036 105619 txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
6037 then txt;
6038
6039 case ( txt,
6040 Absyn.ADD_EW() )
6041 algorithm
6042 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" .+ "));
6043 then txt;
6044
6045 case ( txt,
6046 Absyn.SUB_EW() )
6047 algorithm
6048 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" .- "));
6049 then txt;
6050
6051 case ( txt,
6052 Absyn.MUL_EW() )
6053 algorithm
6054 12 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".*"));
6055 then txt;
6056
6057 case ( txt,
6058 Absyn.DIV_EW() )
6059 algorithm
6060 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("./"));
6061 then txt;
6062
6063 case ( txt,
6064 Absyn.POW_EW() )
6065 algorithm
6066 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^"));
6067 then txt;
6068
6069 case ( txt,
6070 Absyn.UPLUS_EW() )
6071 algorithm
6072 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" .+ "));
6073 then txt;
6074
6075 case ( txt,
6076 Absyn.UMINUS_EW() )
6077 algorithm
6078 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" .- "));
6079 then txt;
6080
6081 case ( txt,
6082 Absyn.AND() )
6083 algorithm
6084 803 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" and "));
6085 then txt;
6086
6087 case ( txt,
6088 Absyn.OR() )
6089 algorithm
6090 502 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" or "));
6091 then txt;
6092
6093 case ( txt,
6094 Absyn.NOT() )
6095 algorithm
6096 794 txt := Tpl.writeTok(txt, Tpl.ST_STRING("not"));
6097 then txt;
6098
6099 case ( txt,
6100 Absyn.LESS() )
6101 algorithm
6102 678 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" < "));
6103 then txt;
6104
6105 case ( txt,
6106 Absyn.LESSEQ() )
6107 algorithm
6108 344 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" <= "));
6109 then txt;
6110
6111 case ( txt,
6112 Absyn.GREATER() )
6113 algorithm
6114 1073 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" > "));
6115 then txt;
6116
6117 case ( txt,
6118 Absyn.GREATEREQ() )
6119 algorithm
6120 362 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" >= "));
6121 then txt;
6122
6123 case ( txt,
6124 Absyn.EQUAL() )
6125 algorithm
6126 1669 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" == "));
6127 then txt;
6128
6129 case ( txt,
6130 Absyn.NEQUAL() )
6131 algorithm
6132 136 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" <> "));
6133 then txt;
6134
6135 case ( txt,
6136 _ )
6137 then txt;
6138 end match;
6139 end dumpOperator;
6140
6141 protected function fun_186
6142 input Tpl.Text in_txt;
6143 input Boolean in_mArg;
6144
6145 output Tpl.Text out_txt;
6146 algorithm
6147 out_txt :=
6148 match(in_txt, in_mArg)
6149 local
6150 Tpl.Text txt;
6151
6152 case ( txt,
6153 false )
6154 then txt;
6155
6156 case ( txt,
6157 _ )
6158 algorithm
6159 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
6160 then txt;
6161 end match;
6162 end fun_186;
6163
6164 public function dumpCref
6165 input Tpl.Text in_txt;
6166 input Absyn.ComponentRef in_a_cref;
6167
6168 output Tpl.Text out_txt;
6169 algorithm
6170 out_txt :=
6171 match(in_txt, in_a_cref)
6172 local
6173 Tpl.Text txt;
6174 Absyn.ComponentRef i_componentRef;
6175 list<Absyn.Subscript> i_subscripts;
6176 Absyn.Ident i_name;
6177 Boolean ret_0;
6178
6179 case ( txt,
6180 Absyn.CREF_QUAL(name = i_name, subscripts = i_subscripts, componentRef = i_componentRef) )
6181 algorithm
6182 61984 txt := Tpl.writeStr(txt, i_name);
6183 61984 txt := dumpSubscripts(txt, i_subscripts);
6184 61984 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
6185 61984 txt := dumpCref(txt, i_componentRef);
6186 then txt;
6187
6188 case ( txt,
6189 Absyn.CREF_IDENT(name = i_name, subscripts = i_subscripts) )
6190 algorithm
6191 148260 txt := Tpl.writeStr(txt, i_name);
6192 148260 txt := dumpSubscripts(txt, i_subscripts);
6193 then txt;
6194
6195 case ( txt,
6196 Absyn.CREF_FULLYQUALIFIED(componentRef = i_componentRef) )
6197 algorithm
6198 64 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
6199 64 txt := dumpCref(txt, i_componentRef);
6200 then txt;
6201
6202 case ( txt,
6203 Absyn.WILD() )
6204 algorithm
6205 4 ret_0 := Config.acceptMetaModelicaGrammar();
6206 4 txt := fun_186(txt, ret_0);
6207 then txt;
6208
6209 case ( txt,
6210 Absyn.ALLWILD() )
6211 algorithm
6212 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("__"));
6213 then txt;
6214
6215 case ( txt,
6216 _ )
6217 then txt;
6218 end match;
6219 end dumpCref;
6220
6221 protected function lm_188
6222 input output Tpl.Text txt;
6223 input list<Absyn.Exp> items;
6224 algorithm
6225
2/2
✓ Branch 0 taken 24812 times.
✓ Branch 1 taken 26050 times.
50862 for lstElt_188 in items loop
6226 txt := match lstElt_188
6227 local
6228 Absyn.Exp i_arg;
6229
6230 case i_arg
6231 algorithm
6232 24812 txt := dumpExp(txt, i_arg);
6233 24812 txt := Tpl.nextIter(txt);
6234 then txt;
6235 end match;
6236 end for;
6237 end lm_188;
6238
6239 protected function lm_189
6240 input output Tpl.Text txt;
6241 input list<Absyn.NamedArg> items;
6242 algorithm
6243
2/2
✓ Branch 0 taken 32595 times.
✓ Branch 1 taken 26050 times.
58645 for lstElt_189 in items loop
6244 txt := match lstElt_189
6245 local
6246 Absyn.NamedArg i_narg;
6247
6248 case i_narg
6249 algorithm
6250 32595 txt := dumpNamedArg(txt, i_narg);
6251 32595 txt := Tpl.nextIter(txt);
6252 then txt;
6253 end match;
6254 end for;
6255 end lm_189;
6256
6257 protected function fun_190
6258 input Tpl.Text in_txt;
6259 input list<Absyn.NamedArg> in_a_argNames;
6260
6261 output Tpl.Text out_txt;
6262 algorithm
6263 out_txt :=
6264 match(in_txt, in_a_argNames)
6265 local
6266 Tpl.Text txt;
6267
6268 case ( txt,
6269 {} )
6270 then txt;
6271
6272 case ( txt,
6273 _ )
6274 algorithm
6275 124 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
6276 then txt;
6277 end match;
6278 end fun_190;
6279
6280 protected function fun_191
6281 input Tpl.Text in_txt;
6282 input Boolean in_mArg;
6283 input list<Absyn.NamedArg> in_a_argNames;
6284
6285 output Tpl.Text out_txt;
6286 algorithm
6287 out_txt :=
6288 match(in_txt, in_mArg, in_a_argNames)
6289 local
6290 Tpl.Text txt;
6291 list<Absyn.NamedArg> a_argNames;
6292
6293 case ( txt,
6294 true,
6295 _ )
6296 then txt;
6297
6298 case ( txt,
6299 _,
6300 a_argNames )
6301 algorithm
6302 14312 txt := fun_190(txt, a_argNames);
6303 then txt;
6304 end match;
6305 end fun_191;
6306
6307 protected function lm_192
6308 input output Tpl.Text txt;
6309 input Absyn.ForIterators items;
6310 algorithm
6311
2/2
✓ Branch 0 taken 208 times.
✓ Branch 1 taken 207 times.
415 for lstElt_192 in items loop
6312 txt := match lstElt_192
6313 local
6314 Absyn.ForIterator i_i;
6315
6316 case i_i
6317 algorithm
6318 208 txt := dumpForIterator(txt, i_i);
6319 208 txt := Tpl.nextIter(txt);
6320 then txt;
6321 end match;
6322 end for;
6323 end lm_192;
6324
6325 protected function fun_193
6326 input Tpl.Text in_txt;
6327 input Absyn.ReductionIterType in_a_iterType;
6328
6329 output Tpl.Text out_txt;
6330 algorithm
6331 out_txt :=
6332 match(in_txt, in_a_iterType)
6333 local
6334 Tpl.Text txt;
6335
6336 case ( txt,
6337 Absyn.THREAD() )
6338 algorithm
6339 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("threaded "));
6340 then txt;
6341
6342 case ( txt,
6343 _ )
6344 then txt;
6345 end match;
6346 end fun_193;
6347
6348 public function dumpFunctionArgs
6349 input Tpl.Text in_txt;
6350 input Absyn.FunctionArgs in_a_args;
6351
6352 output Tpl.Text out_txt;
6353 algorithm
6354 out_txt :=
6355 match(in_txt, in_a_args)
6356 local
6357 Tpl.Text txt;
6358 Absyn.ReductionIterType i_iterType;
6359 Absyn.ForIterators i_iterators;
6360 Absyn.Exp i_exp;
6361 list<Absyn.NamedArg> i_argNames;
6362 list<Absyn.Exp> i_args;
6363 Tpl.Text l_iter__str;
6364 Tpl.Text l_exp__str;
6365 Boolean ret_3;
6366 Tpl.Text l_separator;
6367 Tpl.Text l_namedargs__str;
6368 Tpl.Text l_args__str;
6369
6370 case ( txt,
6371 Absyn.FUNCTIONARGS(args = i_args, argNames = i_argNames) )
6372 algorithm
6373 26050 l_args__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6374 26050 l_args__str := lm_188(l_args__str, i_args);
6375 26050 l_args__str := Tpl.popIter(l_args__str);
6376 26050 l_namedargs__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6377 26050 l_namedargs__str := lm_189(l_namedargs__str, i_argNames);
6378 26050 l_namedargs__str := Tpl.popIter(l_namedargs__str);
6379 26050 ret_3 := Tpl.isEmpty(l_args__str);
6380 26050 l_separator := fun_191(Tpl.emptyTxt, ret_3, i_argNames);
6381 26050 txt := Tpl.writeText(txt, l_args__str);
6382 26050 txt := Tpl.writeText(txt, l_separator);
6383 26050 txt := Tpl.writeText(txt, l_namedargs__str);
6384 then txt;
6385
6386 case ( txt,
6387 Absyn.FOR_ITER_FARG(exp = i_exp, iterators = i_iterators, iterType = i_iterType) )
6388 algorithm
6389 207 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp);
6390 207 l_iter__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6391 207 l_iter__str := lm_192(l_iter__str, i_iterators);
6392 207 l_iter__str := Tpl.popIter(l_iter__str);
6393 207 txt := Tpl.writeText(txt, l_exp__str);
6394 207 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
6395 207 txt := fun_193(txt, i_iterType);
6396 207 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
6397 207 txt := Tpl.writeText(txt, l_iter__str);
6398 then txt;
6399
6400 case ( txt,
6401 _ )
6402 then txt;
6403 end match;
6404 end dumpFunctionArgs;
6405
6406 public function dumpNamedArg
6407 input Tpl.Text in_txt;
6408 input Absyn.NamedArg in_a_narg;
6409
6410 output Tpl.Text out_txt;
6411 algorithm
6412 out_txt :=
6413 match(in_txt, in_a_narg)
6414 local
6415 Tpl.Text txt;
6416 Absyn.Exp i_argValue;
6417 Absyn.Ident i_argName;
6418
6419 case ( txt,
6420 Absyn.NAMEDARG(argName = i_argName, argValue = i_argValue) )
6421 algorithm
6422 32595 txt := Tpl.writeStr(txt, i_argName);
6423 32595 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
6424 32595 txt := dumpExp(txt, i_argValue);
6425 then txt;
6426
6427 case ( txt,
6428 _ )
6429 then txt;
6430 end match;
6431 end dumpNamedArg;
6432
6433 protected function lm_196
6434 input output Tpl.Text txt;
6435 input Absyn.ForIterators items;
6436 algorithm
6437
2/2
✓ Branch 0 taken 427 times.
✓ Branch 1 taken 427 times.
854 for lstElt_196 in items loop
6438 txt := match lstElt_196
6439 local
6440 Absyn.ForIterator i_i;
6441
6442 case i_i
6443 algorithm
6444 427 txt := dumpForIterator(txt, i_i);
6445 427 txt := Tpl.nextIter(txt);
6446 then txt;
6447 end match;
6448 end for;
6449 end lm_196;
6450
6451 public function dumpForIterators
6452 input Tpl.Text txt;
6453 input Absyn.ForIterators a_iters;
6454
6455 output Tpl.Text out_txt;
6456 algorithm
6457 427 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6458 427 out_txt := lm_196(out_txt, a_iters);
6459 427 out_txt := Tpl.popIter(out_txt);
6460 end dumpForIterators;
6461
6462 protected function fun_198
6463 input Tpl.Text in_txt;
6464 input Option<Absyn.Exp> in_a_range;
6465
6466 output Tpl.Text out_txt;
6467 algorithm
6468 out_txt :=
6469 match(in_txt, in_a_range)
6470 local
6471 Tpl.Text txt;
6472 Absyn.Exp i_r;
6473
6474 case ( txt,
6475 SOME(i_r) )
6476 algorithm
6477 635 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
6478 635 txt := Tpl.writeTok(txt, Tpl.ST_STRING("in "));
6479 635 txt := dumpExp(txt, i_r);
6480 635 txt := Tpl.popBlock(txt);
6481 then txt;
6482
6483 case ( txt,
6484 _ )
6485 then txt;
6486 end match;
6487 end fun_198;
6488
6489 protected function fun_199
6490 input Tpl.Text in_txt;
6491 input Option<Absyn.Exp> in_a_guardExp;
6492
6493 output Tpl.Text out_txt;
6494 algorithm
6495 out_txt :=
6496 match(in_txt, in_a_guardExp)
6497 local
6498 Tpl.Text txt;
6499 Absyn.Exp i_g;
6500
6501 case ( txt,
6502 SOME(i_g) )
6503 algorithm
6504 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
6505 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("guard "));
6506 ✗ txt := dumpExp(txt, i_g);
6507 ✗ txt := Tpl.popBlock(txt);
6508 then txt;
6509
6510 case ( txt,
6511 _ )
6512 then txt;
6513 end match;
6514 end fun_199;
6515
6516 public function dumpForIterator
6517 input Tpl.Text in_txt;
6518 input Absyn.ForIterator in_a_iterator;
6519
6520 output Tpl.Text out_txt;
6521 algorithm
6522 out_txt :=
6523 match(in_txt, in_a_iterator)
6524 local
6525 Tpl.Text txt;
6526 String i_name;
6527 Option<Absyn.Exp> i_guardExp;
6528 Option<Absyn.Exp> i_range;
6529 Tpl.Text l_guard__str;
6530 Tpl.Text l_range__str;
6531
6532 case ( txt,
6533 Absyn.ITERATOR(range = i_range, guardExp = i_guardExp, name = i_name) )
6534 algorithm
6535 635 l_range__str := fun_198(Tpl.emptyTxt, i_range);
6536 635 l_guard__str := fun_199(Tpl.emptyTxt, i_guardExp);
6537 635 txt := Tpl.writeStr(txt, i_name);
6538 635 txt := Tpl.writeText(txt, l_guard__str);
6539 635 txt := Tpl.writeText(txt, l_range__str);
6540 then txt;
6541
6542 case ( txt,
6543 _ )
6544 then txt;
6545 end match;
6546 end dumpForIterator;
6547
6548 public function errorMsg
6549 input Tpl.Text txt;
6550 input String a_errMessage;
6551
6552 output Tpl.Text out_txt;
6553 algorithm
6554 ✗ Tpl.addTemplateError(a_errMessage);
6555 ✗ out_txt := Tpl.writeStr(txt, a_errMessage);
6556 end errorMsg;
6557
6558 annotation(__OpenModelica_Interface="frontend_dump");
6559 end AbsynDumpTpl;
6560