Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 49.8% 426 / 0 / 856
Functions: -% 0 / 1 / 1
Branches: 47.1% 16 / 0 / 34

build_cmake/OMCompiler/Compiler/generated-mo/Template/ExpressionDumpTpl.mo
Line Branch Exec Source
1 encapsulated package ExpressionDumpTpl
2 "
3 file: ExpressionDumpTpl.mo
4 package: ExpressionDumpTpl
5 description: Generated by Susan.
6 "
7
8 public import Tpl;
9
10 protected import Absyn;
11 public import ClassInfUtil;
12 public import ClassInf;
13 public import DAE;
14 protected import Dump;
15 public import ExpressionBasics;
16 public import System;
17 public import Config;
18 public import TypesDump;
19 public import Flags;
20 protected import AbsynDumpTpl;
21 protected import DAEDumpTpl;
22
23 protected function fun_13
24 input Tpl.Text in_txt;
25 input Boolean in_mArg;
26 input Integer in_a_index;
27
28 output Tpl.Text out_txt;
29 algorithm
30 out_txt :=
31 match(in_txt, in_mArg, in_a_index)
32 local
33 Tpl.Text txt;
34 Integer a_index;
35
36 case ( txt,
37 false,
38 _ )
39 then txt;
40
41 case ( txt,
42 _,
43 a_index )
44 algorithm
45 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* "));
46 ✗ txt := Tpl.writeStr(txt, intString(a_index));
47 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */"));
48 then txt;
49 end match;
50 end fun_13;
51
52 protected function fun_14
53 input Tpl.Text in_txt;
54 input Boolean in_mArg;
55 input DAE.Type in_a_ty;
56
57 output Tpl.Text out_txt;
58 algorithm
59 out_txt :=
60 match(in_txt, in_mArg, in_a_ty)
61 local
62 Tpl.Text txt;
63 DAE.Type a_ty;
64 String ret_0;
65
66 case ( txt,
67 false,
68 _ )
69 then txt;
70
71 case ( txt,
72 _,
73 a_ty )
74 algorithm
75 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*"));
76 4 ret_0 := TypesDump.unparseType(a_ty);
77 4 txt := Tpl.writeStr(txt, ret_0);
78 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/ "));
79 then txt;
80 end match;
81 end fun_14;
82
83 protected function fun_15
84 input Tpl.Text in_txt;
85 input Boolean in_mArg;
86 input DAE.Type in_a_attr_ty;
87
88 output Tpl.Text out_txt;
89 algorithm
90 out_txt :=
91 match(in_txt, in_mArg, in_a_attr_ty)
92 local
93 Tpl.Text txt;
94 DAE.Type a_attr_ty;
95 String ret_0;
96
97 case ( txt,
98 false,
99 _ )
100 then txt;
101
102 case ( txt,
103 _,
104 a_attr_ty )
105 algorithm
106 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*"));
107 2 ret_0 := TypesDump.unparseType(a_attr_ty);
108 2 txt := Tpl.writeStr(txt, ret_0);
109 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/ "));
110 then txt;
111 end match;
112 end fun_15;
113
114 protected function fun_16
115 input Tpl.Text in_txt;
116 input Boolean in_a_scalar;
117 input DAE.Type in_a_ty;
118
119 output Tpl.Text out_txt;
120 algorithm
121 out_txt :=
122 match(in_txt, in_a_scalar, in_a_ty)
123 local
124 Tpl.Text txt;
125 DAE.Type a_ty;
126 String ret_1;
127 String ret_0;
128
129 case ( txt,
130 false,
131 a_ty )
132 algorithm
133 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* non-scalar "));
134 ✗ ret_0 := TypesDump.unparseType(a_ty);
135 ✗ txt := Tpl.writeStr(txt, ret_0);
136 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */ "));
137 then txt;
138
139 case ( txt,
140 _,
141 a_ty )
142 algorithm
143 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* scalar "));
144 ✗ ret_1 := TypesDump.unparseType(a_ty);
145 ✗ txt := Tpl.writeStr(txt, ret_1);
146 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/"));
147 then txt;
148 end match;
149 end fun_16;
150
151 protected function fun_17
152 input Tpl.Text in_txt;
153 input Boolean in_mArg;
154 input DAE.Type in_a_ty;
155 input Boolean in_a_scalar;
156
157 output Tpl.Text out_txt;
158 algorithm
159 out_txt :=
160 match(in_txt, in_mArg, in_a_ty, in_a_scalar)
161 local
162 Tpl.Text txt;
163 DAE.Type a_ty;
164 Boolean a_scalar;
165
166 case ( txt,
167 false,
168 _,
169 _ )
170 then txt;
171
172 case ( txt,
173 _,
174 a_ty,
175 a_scalar )
176 algorithm
177 ✗ txt := fun_16(txt, a_scalar, a_ty);
178 then txt;
179 end match;
180 end fun_17;
181
182 protected function fun_18
183 input Tpl.Text in_txt;
184 input Boolean in_mArg;
185 input DAE.Type in_a_ty;
186 input Boolean in_a_scalar;
187 input String in_a_stringDelimiter;
188 input list<DAE.Exp> in_a_array;
189
190 output Tpl.Text out_txt;
191 algorithm
192 out_txt :=
193 match(in_txt, in_mArg, in_a_ty, in_a_scalar, in_a_stringDelimiter, in_a_array)
194 local
195 Tpl.Text txt;
196 DAE.Type a_ty;
197 Boolean a_scalar;
198 String a_stringDelimiter;
199 list<DAE.Exp> a_array;
200 Boolean ret_1;
201 Tpl.Text l_expl;
202
203 case ( txt,
204 false,
205 a_ty,
206 a_scalar,
207 a_stringDelimiter,
208 a_array )
209 algorithm
210 1434 l_expl := dumpExpList(Tpl.emptyTxt, a_array, a_stringDelimiter, ", ");
211 1434 ret_1 := Config.typeinfo();
212 1434 txt := fun_17(txt, ret_1, a_ty, a_scalar);
213 1434 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
214 1434 txt := Tpl.writeText(txt, l_expl);
215 1434 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
216 then txt;
217
218 case ( txt,
219 _,
220 _,
221 _,
222 _,
223 _ )
224 algorithm
225 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fill(0,0)"));
226 then txt;
227 end match;
228 end fun_18;
229
230 protected function fun_19
231 input Tpl.Text in_txt;
232 input Boolean in_a_scalar;
233 input DAE.Type in_a_ty;
234
235 output Tpl.Text out_txt;
236 algorithm
237 out_txt :=
238 match(in_txt, in_a_scalar, in_a_ty)
239 local
240 Tpl.Text txt;
241 DAE.Type a_ty;
242 String ret_1;
243 String ret_0;
244
245 case ( txt,
246 false,
247 a_ty )
248 algorithm
249 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* non-scalar "));
250 ✗ ret_0 := TypesDump.unparseType(a_ty);
251 ✗ txt := Tpl.writeStr(txt, ret_0);
252 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */ "));
253 then txt;
254
255 case ( txt,
256 _,
257 a_ty )
258 algorithm
259 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* scalar "));
260 ✗ ret_1 := TypesDump.unparseType(a_ty);
261 ✗ txt := Tpl.writeStr(txt, ret_1);
262 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/"));
263 then txt;
264 end match;
265 end fun_19;
266
267 protected function fun_20
268 input Tpl.Text in_txt;
269 input Boolean in_mArg;
270 input DAE.Type in_a_ty;
271 input Boolean in_a_scalar;
272
273 output Tpl.Text out_txt;
274 algorithm
275 out_txt :=
276 match(in_txt, in_mArg, in_a_ty, in_a_scalar)
277 local
278 Tpl.Text txt;
279 DAE.Type a_ty;
280 Boolean a_scalar;
281
282 case ( txt,
283 false,
284 _,
285 _ )
286 then txt;
287
288 case ( txt,
289 _,
290 a_ty,
291 a_scalar )
292 algorithm
293 ✗ txt := fun_19(txt, a_scalar, a_ty);
294 then txt;
295 end match;
296 end fun_20;
297
298 protected function lm_21
299 input output Tpl.Text txt;
300 input list<list<DAE.Exp>> items;
301 input String a_stringDelimiter;
302 algorithm
303
2/2
✓ Branch 0 taken 437 times.
✓ Branch 1 taken 179 times.
616 for lstElt_21 in items loop
304 txt := match lstElt_21
305 local
306 list<DAE.Exp> i_row;
307
308 case i_row
309 algorithm
310 437 txt := dumpExpList(txt, i_row, a_stringDelimiter, ", ");
311 437 txt := Tpl.nextIter(txt);
312 then txt;
313 end match;
314 end for;
315 end lm_21;
316
317 protected function fun_22
318 input Tpl.Text in_txt;
319 input Boolean in_mArg;
320 input DAE.Type in_a_ty;
321
322 output Tpl.Text out_txt;
323 algorithm
324 out_txt :=
325 match(in_txt, in_mArg, in_a_ty)
326 local
327 Tpl.Text txt;
328 DAE.Type a_ty;
329 String ret_0;
330
331 case ( txt,
332 false,
333 _ )
334 then txt;
335
336 case ( txt,
337 _,
338 a_ty )
339 algorithm
340 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* matrix "));
341 ✗ ret_0 := TypesDump.unparseType(a_ty);
342 ✗ txt := Tpl.writeStr(txt, ret_0);
343 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */ "));
344 then txt;
345 end match;
346 end fun_22;
347
348 protected function fun_23
349 input Tpl.Text in_txt;
350 input Option<DAE.Exp> in_a_step;
351 input DAE.Exp in_a_e;
352
353 output Tpl.Text out_txt;
354 algorithm
355 out_txt :=
356 match(in_txt, in_a_step, in_a_e)
357 local
358 Tpl.Text txt;
359 DAE.Exp a_e;
360 DAE.Exp i_step;
361
362 case ( txt,
363 SOME(i_step),
364 a_e )
365 algorithm
366 19 txt := dumpOperand(txt, i_step, a_e, false);
367 19 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
368 then txt;
369
370 case ( txt,
371 _,
372 _ )
373 then txt;
374 end match;
375 end fun_23;
376
377 protected function fun_24
378 input Tpl.Text in_txt;
379 input Boolean in_mArg;
380
381 output Tpl.Text out_txt;
382 algorithm
383 out_txt :=
384 match(in_txt, in_mArg)
385 local
386 Tpl.Text txt;
387
388 case ( txt,
389 true )
390 then txt;
391
392 case ( txt,
393 _ )
394 algorithm
395 700 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
396 then txt;
397 end match;
398 end fun_24;
399
400 protected function fun_25
401 input Tpl.Text in_txt;
402 input Boolean in_mArg;
403
404 output Tpl.Text out_txt;
405 algorithm
406 out_txt :=
407 match(in_txt, in_mArg)
408 local
409 Tpl.Text txt;
410
411 case ( txt,
412 true )
413 then txt;
414
415 case ( txt,
416 _ )
417 algorithm
418 700 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
419 then txt;
420 end match;
421 end fun_25;
422
423 protected function fun_26
424 input Tpl.Text in_txt;
425 input Boolean in_mArg;
426
427 output Tpl.Text out_txt;
428 algorithm
429 out_txt :=
430 match(in_txt, in_mArg)
431 local
432 Tpl.Text txt;
433
434 case ( txt,
435 false )
436 then txt;
437
438 case ( txt,
439 _ )
440 algorithm
441 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*ASUB*/"));
442 then txt;
443 end match;
444 end fun_26;
445
446 protected function fun_27
447 input Tpl.Text in_txt;
448 input Boolean in_mArg;
449
450 output Tpl.Text out_txt;
451 algorithm
452 out_txt :=
453 match(in_txt, in_mArg)
454 local
455 Tpl.Text txt;
456
457 case ( txt,
458 true )
459 then txt;
460
461 case ( txt,
462 _ )
463 algorithm
464 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
465 then txt;
466 end match;
467 end fun_27;
468
469 protected function fun_28
470 input Tpl.Text in_txt;
471 input Boolean in_mArg;
472
473 output Tpl.Text out_txt;
474 algorithm
475 out_txt :=
476 match(in_txt, in_mArg)
477 local
478 Tpl.Text txt;
479
480 case ( txt,
481 true )
482 then txt;
483
484 case ( txt,
485 _ )
486 algorithm
487 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
488 then txt;
489 end match;
490 end fun_28;
491
492 protected function fun_29
493 input Tpl.Text in_txt;
494 input Boolean in_mArg;
495
496 output Tpl.Text out_txt;
497 algorithm
498 out_txt :=
499 match(in_txt, in_mArg)
500 local
501 Tpl.Text txt;
502
503 case ( txt,
504 true )
505 then txt;
506
507 case ( txt,
508 _ )
509 algorithm
510 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
511 then txt;
512 end match;
513 end fun_29;
514
515 protected function fun_30
516 input Tpl.Text in_txt;
517 input Boolean in_mArg;
518
519 output Tpl.Text out_txt;
520 algorithm
521 out_txt :=
522 match(in_txt, in_mArg)
523 local
524 Tpl.Text txt;
525
526 case ( txt,
527 true )
528 then txt;
529
530 case ( txt,
531 _ )
532 algorithm
533 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
534 then txt;
535 end match;
536 end fun_30;
537
538 protected function fun_31
539 input Tpl.Text in_txt;
540 input Boolean in_mArg;
541 input DAE.Type in_a_ty;
542
543 output Tpl.Text out_txt;
544 algorithm
545 out_txt :=
546 match(in_txt, in_mArg, in_a_ty)
547 local
548 Tpl.Text txt;
549 DAE.Type a_ty;
550 String ret_0;
551
552 case ( txt,
553 false,
554 _ )
555 then txt;
556
557 case ( txt,
558 _,
559 a_ty )
560 algorithm
561 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*RSUB: "));
562 ✗ ret_0 := TypesDump.unparseType(a_ty);
563 ✗ txt := Tpl.writeStr(txt, ret_0);
564 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/"));
565 then txt;
566 end match;
567 end fun_31;
568
569 protected function fun_32
570 input Tpl.Text in_txt;
571 input Option<DAE.Exp> in_a_sz;
572 input String in_a_stringDelimiter;
573
574 output Tpl.Text out_txt;
575 algorithm
576 out_txt :=
577 match(in_txt, in_a_sz, in_a_stringDelimiter)
578 local
579 Tpl.Text txt;
580 String a_stringDelimiter;
581 DAE.Exp i_dim;
582
583 case ( txt,
584 SOME(i_dim),
585 a_stringDelimiter )
586 algorithm
587 171 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
588 171 txt := dumpExp(txt, i_dim, a_stringDelimiter);
589 then txt;
590
591 case ( txt,
592 _,
593 _ )
594 then txt;
595 end match;
596 end fun_32;
597
598 protected function lm_33
599 input output Tpl.Text txt;
600 input DAE.ReductionIterators items;
601 input String a_stringDelimiter;
602 algorithm
603
2/2
✓ Branch 0 taken 185 times.
✓ Branch 1 taken 185 times.
370 for lstElt_33 in items loop
604 txt := match lstElt_33
605 local
606 DAE.ReductionIterator i_it;
607
608 case i_it
609 algorithm
610 185 txt := dumpReductionIterator(txt, i_it, a_stringDelimiter);
611 185 txt := Tpl.nextIter(txt);
612 then txt;
613 end match;
614 end for;
615 end lm_33;
616
617 protected function fun_34
618 input Tpl.Text in_txt;
619 input Absyn.ReductionIterType in_a_ri_iterType;
620
621 output Tpl.Text out_txt;
622 algorithm
623 out_txt :=
624 match(in_txt, in_a_ri_iterType)
625 local
626 Tpl.Text txt;
627
628 case ( txt,
629 Absyn.THREAD() )
630 algorithm
631 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("threaded "));
632 then txt;
633
634 case ( txt,
635 _ )
636 then txt;
637 end match;
638 end fun_34;
639
640 protected function lm_35
641 input output Tpl.Text txt;
642 input list<DAE.MatchCase> items;
643 algorithm
644
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 2 times.
5 for lstElt_35 in items loop
645 txt := match lstElt_35
646 local
647 DAE.MatchCase i_c;
648
649 case i_c
650 algorithm
651 3 txt := dumpMatchCase(txt, i_c);
652 3 txt := Tpl.nextIter(txt);
653 then txt;
654 end match;
655 end for;
656 end lm_35;
657
658 protected function fun_36
659 input Tpl.Text in_txt;
660 input Boolean in_mArg;
661 input Integer in_a_index;
662 input String in_a_stringDelimiter;
663 input DAE.Exp in_a_exp;
664
665 output Tpl.Text out_txt;
666 algorithm
667 out_txt :=
668 match(in_txt, in_mArg, in_a_index, in_a_stringDelimiter, in_a_exp)
669 local
670 Tpl.Text txt;
671 Integer a_index;
672 String a_stringDelimiter;
673 DAE.Exp a_exp;
674
675 case ( txt,
676 false,
677 _,
678 a_stringDelimiter,
679 a_exp )
680 algorithm
681 159597 txt := dumpExp(txt, a_exp, a_stringDelimiter);
682 then txt;
683
684 case ( txt,
685 _,
686 a_index,
687 a_stringDelimiter,
688 a_exp )
689 algorithm
690 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* Shared literal "));
691 ✗ txt := Tpl.writeStr(txt, intString(a_index));
692 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */ "));
693 ✗ txt := dumpExp(txt, a_exp, a_stringDelimiter);
694 then txt;
695 end match;
696 end fun_36;
697
698 protected function fun_37
699 input Tpl.Text in_txt;
700 input Boolean in_mArg;
701
702 output Tpl.Text out_txt;
703 algorithm
704 out_txt :=
705 match(in_txt, in_mArg)
706 local
707 Tpl.Text txt;
708
709 case ( txt,
710 false )
711 then txt;
712
713 case ( txt,
714 _ )
715 algorithm
716 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*pattern*/"));
717 then txt;
718 end match;
719 end fun_37;
720
721 public function dumpExp
722 input Tpl.Text in_txt;
723 input DAE.Exp in_a_exp;
724 input String in_a_stringDelimiter;
725
726 output Tpl.Text out_txt;
727 algorithm
728 out_txt :=
729 match(in_txt, in_a_exp, in_a_stringDelimiter)
730 local
731 Tpl.Text txt;
732 String a_stringDelimiter;
733 DAE.Pattern i_pattern;
734 list<DAE.MatchCase> i_cases;
735 list<DAE.Exp> i_inputs;
736 DAE.MatchType i_matchType;
737 list<DAE.Exp> i_args;
738 list<DAE.Exp> i_listExp;
739 DAE.Exp i_cdr;
740 DAE.Exp i_car;
741 list<DAE.Exp> i_valList;
742 Absyn.ReductionIterType i_ri_iterType;
743 DAE.ReductionIterators i_iterators;
744 DAE.Exp i_expr;
745 Absyn.Path i_ri_path;
746 String i_tyStr;
747 String i_scope;
748 DAE.ComponentRef i_name_1;
749 Absyn.CodeNode i_code;
750 Option<DAE.Exp> i_sz;
751 String i_fieldName;
752 Integer i_ix;
753 list<DAE.Subscript> i_sub;
754 list<DAE.Exp> i_PR;
755 DAE.Exp i_stop;
756 Option<DAE.Exp> i_step;
757 DAE.Exp i_start;
758 list<list<DAE.Exp>> i_matrix;
759 Boolean i_scalar;
760 list<DAE.Exp> i_array;
761 list<DAE.Exp> i_expList;
762 list<DAE.Exp> i_exps;
763 DAE.Type i_attr_ty;
764 list<DAE.Exp> i_expLst;
765 Absyn.Path i_path;
766 DAE.Exp i_expElse;
767 DAE.Exp i_expThen;
768 DAE.Exp i_expCond;
769 DAE.Exp i_exp;
770 DAE.Operator i_operator;
771 DAE.Exp i_exp2;
772 DAE.Exp i_e;
773 DAE.Exp i_exp1;
774 DAE.ComponentRef i_componentRef;
775 DAE.Type i_ty;
776 Absyn.Path i_name;
777 Integer i_index;
778 DAE.ClockKind i_clk;
779 Boolean i_bool;
780 String i_string;
781 Real i_real;
782 Integer i_integer;
783 Boolean ret_49;
784 Boolean ret_48;
785 Tpl.Text l_case__str;
786 Tpl.Text l_inputs__str;
787 Tpl.Text l_match__ty;
788 Tpl.Text l_args__str;
789 Tpl.Text l_cdr__str;
790 Tpl.Text l_car__str;
791 Tpl.Text l_expl__str;
792 Tpl.Text l_iter__str;
793 Tpl.Text l_name__str;
794 String ret_38;
795 Tpl.Text l_code__str;
796 Tpl.Text l_dim__str;
797 Boolean ret_35;
798 Boolean ret_34;
799 Boolean ret_33;
800 Boolean ret_32;
801 Boolean ret_31;
802 Boolean ret_30;
803 Tpl.Text l_sub__str;
804 Boolean ret_28;
805 Tpl.Text l_rparen;
806 Boolean ret_26;
807 Tpl.Text l_lparen;
808 Tpl.Text l_needs__paren;
809 Tpl.Text l_ty__str;
810 Tpl.Text l_tuple__str;
811 Tpl.Text l_stop__str;
812 Tpl.Text l_step__str;
813 Tpl.Text l_start__str;
814 Boolean ret_18;
815 Tpl.Text l_mat__str;
816 Boolean ret_16;
817 Tpl.Text l_expl;
818 Boolean ret_14;
819 Boolean ret_13;
820 Tpl.Text l_argl;
821 Tpl.Text l_func__str;
822 Tpl.Text l_else__str;
823 Tpl.Text l_then__str;
824 Tpl.Text l_cond__str;
825 Tpl.Text l_exp__str;
826 Tpl.Text l_op__str;
827 Tpl.Text l_rhs__str;
828 Tpl.Text l_lhs__str;
829 Boolean ret_3;
830 Boolean ret_2;
831 String ret_1;
832 Tpl.Text l_str;
833
834 case ( txt,
835 DAE.ICONST(integer = i_integer),
836 _ )
837 algorithm
838 1828640 txt := Tpl.writeStr(txt, intString(i_integer));
839 then txt;
840
841 case ( txt,
842 DAE.RCONST(real = i_real),
843 _ )
844 algorithm
845 750686 txt := Tpl.writeStr(txt, realString(i_real));
846 then txt;
847
848 case ( txt,
849 DAE.SCONST(string = i_string),
850 a_stringDelimiter )
851 algorithm
852 242063 ret_1 := System.escapedString(i_string, false);
853 242063 l_str := Tpl.writeStr(Tpl.emptyTxt, ret_1);
854 242063 txt := Tpl.writeStr(txt, a_stringDelimiter);
855 242063 txt := Tpl.writeText(txt, l_str);
856 242063 txt := Tpl.writeStr(txt, a_stringDelimiter);
857 then txt;
858
859 case ( txt,
860 DAE.BCONST(bool = i_bool),
861 _ )
862 algorithm
863 31711 txt := Tpl.writeStr(txt, Tpl.booleanString(i_bool));
864 then txt;
865
866 case ( txt,
867 DAE.CLKCONST(clk = i_clk),
868 a_stringDelimiter )
869 algorithm
870 30 txt := dumpClockKind(txt, i_clk, a_stringDelimiter);
871 then txt;
872
873 case ( txt,
874 DAE.ENUM_LITERAL(index = i_index, name = i_name),
875 _ )
876 algorithm
877 62231 ret_2 := Config.typeinfo();
878 62231 txt := fun_13(txt, ret_2, i_index);
879 62231 txt := AbsynDumpTpl.dumpPath(txt, i_name);
880 then txt;
881
882 case ( txt,
883 DAE.CREF(ty = i_ty, componentRef = i_componentRef),
884 _ )
885 algorithm
886 1556423 ret_3 := Config.typeinfo();
887 1556423 txt := fun_14(txt, ret_3, i_ty);
888 1556423 txt := dumpCref(txt, i_componentRef);
889 then txt;
890
891 case ( txt,
892 (i_e as DAE.BINARY(exp1 = i_exp1, exp2 = i_exp2, operator = i_operator)),
893 _ )
894 algorithm
895 1068749 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
896 1068749 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
897 1068749 l_op__str := dumpBinOp(Tpl.emptyTxt, i_operator);
898 1068749 txt := Tpl.writeText(txt, l_lhs__str);
899 1068749 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
900 1068749 txt := Tpl.writeText(txt, l_op__str);
901 1068749 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
902 1068749 txt := Tpl.writeText(txt, l_rhs__str);
903 then txt;
904
905 case ( txt,
906 (i_e as DAE.UNARY(exp = i_exp, operator = i_operator)),
907 _ )
908 algorithm
909 54488 l_exp__str := dumpOperand(Tpl.emptyTxt, i_exp, i_e, false);
910 54488 l_op__str := dumpUnaryOp(Tpl.emptyTxt, i_operator);
911 54488 txt := Tpl.writeText(txt, l_op__str);
912 54488 txt := Tpl.writeText(txt, l_exp__str);
913 then txt;
914
915 case ( txt,
916 (i_e as DAE.LBINARY(exp1 = i_exp1, exp2 = i_exp2, operator = i_operator)),
917 _ )
918 algorithm
919 55756 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
920 55756 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
921 55756 l_op__str := dumpLogicalBinOp(Tpl.emptyTxt, i_operator);
922 55756 txt := Tpl.writeText(txt, l_lhs__str);
923 55756 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
924 55756 txt := Tpl.writeText(txt, l_op__str);
925 55756 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
926 55756 txt := Tpl.writeText(txt, l_rhs__str);
927 then txt;
928
929 case ( txt,
930 (i_e as DAE.LUNARY(exp = i_exp, operator = i_operator)),
931 _ )
932 algorithm
933 2749 l_exp__str := dumpOperand(Tpl.emptyTxt, i_exp, i_e, false);
934 2749 l_op__str := dumpLogicalUnaryOp(Tpl.emptyTxt, i_operator);
935 2749 txt := Tpl.writeText(txt, l_op__str);
936 2749 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
937 2749 txt := Tpl.writeText(txt, l_exp__str);
938 then txt;
939
940 case ( txt,
941 (i_e as DAE.RELATION(exp1 = i_exp1, exp2 = i_exp2, operator = i_operator)),
942 _ )
943 algorithm
944 178846 l_lhs__str := dumpOperand(Tpl.emptyTxt, i_exp1, i_e, true);
945 178846 l_rhs__str := dumpOperand(Tpl.emptyTxt, i_exp2, i_e, false);
946 178846 l_op__str := dumpRelationOp(Tpl.emptyTxt, i_operator);
947 178846 txt := Tpl.writeText(txt, l_lhs__str);
948 178846 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
949 178846 txt := Tpl.writeText(txt, l_op__str);
950 178846 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
951 178846 txt := Tpl.writeText(txt, l_rhs__str);
952 then txt;
953
954 case ( txt,
955 DAE.IFEXP(expCond = i_expCond, expThen = i_expThen, expElse = i_expElse),
956 a_stringDelimiter )
957 algorithm
958 23829 l_cond__str := dumpExp(Tpl.emptyTxt, i_expCond, a_stringDelimiter);
959 23829 l_then__str := dumpExp(Tpl.emptyTxt, i_expThen, a_stringDelimiter);
960 23829 l_else__str := dumpExp(Tpl.emptyTxt, i_expElse, a_stringDelimiter);
961 23829 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if "));
962 23829 txt := Tpl.writeText(txt, l_cond__str);
963 23829 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" then "));
964 23829 txt := Tpl.writeText(txt, l_then__str);
965 23829 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" else "));
966 23829 txt := Tpl.writeText(txt, l_else__str);
967 then txt;
968
969 case ( txt,
970 DAE.CALL(attr = DAE.CALL_ATTR(builtin = true, ty = i_attr_ty), path = i_path, expLst = i_expLst),
971 a_stringDelimiter )
972 algorithm
973 152379 l_func__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
974 152379 l_argl := dumpExpList(Tpl.emptyTxt, i_expLst, a_stringDelimiter, ", ");
975 152379 ret_13 := Config.typeinfo();
976 152379 txt := fun_15(txt, ret_13, i_attr_ty);
977 152379 txt := Tpl.writeText(txt, l_func__str);
978 152379 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
979 152379 txt := Tpl.writeText(txt, l_argl);
980 152379 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
981 then txt;
982
983 case ( txt,
984 DAE.CALL(path = i_path, expLst = i_expLst),
985 a_stringDelimiter )
986 algorithm
987 48981 l_func__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
988 48981 l_argl := dumpExpList(Tpl.emptyTxt, i_expLst, a_stringDelimiter, ", ");
989 48981 txt := Tpl.writeText(txt, l_func__str);
990 48981 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
991 48981 txt := Tpl.writeText(txt, l_argl);
992 48981 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
993 then txt;
994
995 case ( txt,
996 DAE.RECORD(path = i_path, exps = i_exps),
997 a_stringDelimiter )
998 algorithm
999 6964 l_func__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
1000 6964 l_argl := dumpExpList(Tpl.emptyTxt, i_exps, a_stringDelimiter, ", ");
1001 6964 txt := Tpl.writeText(txt, l_func__str);
1002 6964 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1003 6964 txt := Tpl.writeText(txt, l_argl);
1004 6964 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1005 then txt;
1006
1007 case ( txt,
1008 DAE.PARTEVALFUNCTION(path = i_path, expList = i_expList),
1009 a_stringDelimiter )
1010 algorithm
1011 291 l_func__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
1012 291 l_argl := dumpExpList(Tpl.emptyTxt, i_expList, a_stringDelimiter, ", ");
1013 291 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
1014 291 txt := Tpl.writeText(txt, l_func__str);
1015 291 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1016 291 txt := Tpl.writeText(txt, l_argl);
1017 291 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1018 then txt;
1019
1020 case ( txt,
1021 DAE.ARRAY(array = (i_array as {}), scalar = i_scalar, ty = i_ty),
1022 a_stringDelimiter )
1023 algorithm
1024 1434 ret_14 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
1025 1434 txt := fun_18(txt, ret_14, i_ty, i_scalar, a_stringDelimiter, i_array);
1026 then txt;
1027
1028 case ( txt,
1029 DAE.ARRAY(array = i_array, scalar = i_scalar, ty = i_ty),
1030 a_stringDelimiter )
1031 algorithm
1032 14462 l_expl := dumpExpList(Tpl.emptyTxt, i_array, a_stringDelimiter, ", ");
1033 14462 ret_16 := Config.typeinfo();
1034 14462 txt := fun_20(txt, ret_16, i_ty, i_scalar);
1035 14462 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
1036 14462 txt := Tpl.writeText(txt, l_expl);
1037 14462 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
1038 then txt;
1039
1040 case ( txt,
1041 DAE.MATRIX(matrix = i_matrix, ty = i_ty),
1042 a_stringDelimiter )
1043 algorithm
1044 179 l_mat__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()));
1045 179 l_mat__str := lm_21(l_mat__str, i_matrix, a_stringDelimiter);
1046 179 l_mat__str := Tpl.popIter(l_mat__str);
1047 179 ret_18 := Config.typeinfo();
1048 179 txt := fun_22(txt, ret_18, i_ty);
1049 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("{{"));
1050 179 txt := Tpl.writeText(txt, l_mat__str);
1051 179 txt := Tpl.writeTok(txt, Tpl.ST_STRING("}}"));
1052 then txt;
1053
1054 case ( txt,
1055 (i_e as DAE.RANGE(start = i_start, step = i_step, stop = i_stop)),
1056 _ )
1057 algorithm
1058 852 l_start__str := dumpOperand(Tpl.emptyTxt, i_start, i_e, false);
1059 852 l_step__str := fun_23(Tpl.emptyTxt, i_step, i_e);
1060 852 l_stop__str := dumpOperand(Tpl.emptyTxt, i_stop, i_e, false);
1061 852 txt := Tpl.writeText(txt, l_start__str);
1062 852 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
1063 852 txt := Tpl.writeText(txt, l_step__str);
1064 852 txt := Tpl.writeText(txt, l_stop__str);
1065 then txt;
1066
1067 case ( txt,
1068 DAE.TUPLE(PR = i_PR),
1069 a_stringDelimiter )
1070 algorithm
1071 356 l_tuple__str := dumpExpList(Tpl.emptyTxt, i_PR, a_stringDelimiter, ", ");
1072 356 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1073 356 txt := Tpl.writeText(txt, l_tuple__str);
1074 356 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1075 then txt;
1076
1077 case ( txt,
1078 DAE.CAST(exp = i_exp, ty = i_ty),
1079 a_stringDelimiter )
1080 algorithm
1081 6230 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1082 6230 l_ty__str := dumpType(Tpl.emptyTxt, i_ty);
1083 6230 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/*"));
1084 6230 txt := Tpl.writeText(txt, l_ty__str);
1085 6230 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*/("));
1086 6230 txt := Tpl.writeText(txt, l_exp__str);
1087 6230 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1088 then txt;
1089
1090 case ( txt,
1091 DAE.ASUB(exp = i_exp, sub = i_sub),
1092 a_stringDelimiter )
1093 algorithm
1094 970 l_needs__paren := parenthesizeSubExp(Tpl.emptyTxt, i_exp);
1095 970 ret_26 := Tpl.isEmpty(l_needs__paren);
1096 970 l_lparen := fun_24(Tpl.emptyTxt, ret_26);
1097 970 ret_28 := Tpl.isEmpty(l_needs__paren);
1098 970 l_rparen := fun_25(Tpl.emptyTxt, ret_28);
1099 970 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1100 970 l_sub__str := dumpSubscripts(Tpl.emptyTxt, i_sub);
1101 970 txt := Tpl.writeText(txt, l_lparen);
1102 970 txt := Tpl.writeText(txt, l_exp__str);
1103 970 txt := Tpl.writeText(txt, l_rparen);
1104 970 ret_30 := Config.typeinfo();
1105 970 txt := fun_26(txt, ret_30);
1106 970 txt := Tpl.writeText(txt, l_sub__str);
1107 then txt;
1108
1109 case ( txt,
1110 DAE.TSUB(exp = i_exp, ix = i_ix),
1111 a_stringDelimiter )
1112 algorithm
1113 47 l_needs__paren := parenthesizeSubExp(Tpl.emptyTxt, i_exp);
1114 47 ret_31 := Tpl.isEmpty(l_needs__paren);
1115 47 l_lparen := fun_27(Tpl.emptyTxt, ret_31);
1116 47 ret_32 := Tpl.isEmpty(l_needs__paren);
1117 47 l_rparen := fun_28(Tpl.emptyTxt, ret_32);
1118 47 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1119 47 txt := Tpl.writeText(txt, l_lparen);
1120 47 txt := Tpl.writeText(txt, l_exp__str);
1121 47 txt := Tpl.writeText(txt, l_rparen);
1122 47 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
1123 47 txt := Tpl.writeStr(txt, intString(i_ix));
1124 47 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
1125 then txt;
1126
1127 case ( txt,
1128 DAE.RSUB(exp = i_exp, ty = i_ty, fieldName = i_fieldName),
1129 a_stringDelimiter )
1130 algorithm
1131 27105 l_needs__paren := parenthesizeSubExp(Tpl.emptyTxt, i_exp);
1132 27105 ret_33 := Tpl.isEmpty(l_needs__paren);
1133 27105 l_lparen := fun_29(Tpl.emptyTxt, ret_33);
1134 27105 ret_34 := Tpl.isEmpty(l_needs__paren);
1135 27105 l_rparen := fun_30(Tpl.emptyTxt, ret_34);
1136 27105 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1137 27105 ret_35 := Config.typeinfo();
1138 27105 txt := fun_31(txt, ret_35, i_ty);
1139 27105 txt := Tpl.writeText(txt, l_lparen);
1140 27105 txt := Tpl.writeText(txt, l_exp__str);
1141 27105 txt := Tpl.writeText(txt, l_rparen);
1142 27105 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
1143 27105 txt := Tpl.writeStr(txt, i_fieldName);
1144 then txt;
1145
1146 case ( txt,
1147 DAE.SIZE(exp = i_exp, sz = i_sz),
1148 a_stringDelimiter )
1149 algorithm
1150 171 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1151 171 l_dim__str := fun_32(Tpl.emptyTxt, i_sz, a_stringDelimiter);
1152 171 txt := Tpl.writeTok(txt, Tpl.ST_STRING("size("));
1153 171 txt := Tpl.writeText(txt, l_exp__str);
1154 171 txt := Tpl.writeText(txt, l_dim__str);
1155 171 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1156 then txt;
1157
1158 case ( txt,
1159 DAE.CODE(code = i_code),
1160 _ )
1161 algorithm
1162 ✗ ret_38 := Dump.printCodeStr(i_code);
1163 ✗ l_code__str := Tpl.writeStr(Tpl.emptyTxt, ret_38);
1164 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("$Code("));
1165 ✗ txt := Tpl.writeText(txt, l_code__str);
1166 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1167 then txt;
1168
1169 case ( txt,
1170 DAE.EMPTY(name = i_name_1, scope = i_scope, tyStr = i_tyStr),
1171 _ )
1172 algorithm
1173 ✗ l_name__str := dumpCref(Tpl.emptyTxt, i_name_1);
1174 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("<EMPTY(scope: "));
1175 ✗ txt := Tpl.writeStr(txt, i_scope);
1176 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", name: "));
1177 ✗ txt := Tpl.writeText(txt, l_name__str);
1178 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", ty: "));
1179 ✗ txt := Tpl.writeStr(txt, i_tyStr);
1180 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")>"));
1181 then txt;
1182
1183 case ( txt,
1184 DAE.REDUCTION(reductionInfo = DAE.REDUCTIONINFO(path = i_ri_path, iterType = i_ri_iterType), expr = i_expr, iterators = i_iterators),
1185 a_stringDelimiter )
1186 algorithm
1187 185 l_name__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_ri_path);
1188 185 l_exp__str := dumpExp(Tpl.emptyTxt, i_expr, a_stringDelimiter);
1189 185 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()));
1190 185 l_iter__str := lm_33(l_iter__str, i_iterators, a_stringDelimiter);
1191 185 l_iter__str := Tpl.popIter(l_iter__str);
1192 185 txt := Tpl.writeText(txt, l_name__str);
1193 185 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1194 185 txt := Tpl.writeText(txt, l_exp__str);
1195 185 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" for "));
1196 185 txt := fun_34(txt, i_ri_iterType);
1197 185 txt := Tpl.writeText(txt, l_iter__str);
1198 185 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1199 then txt;
1200
1201 case ( txt,
1202 DAE.LIST(valList = i_valList),
1203 a_stringDelimiter )
1204 algorithm
1205 6483 l_expl__str := dumpExpList(Tpl.emptyTxt, i_valList, a_stringDelimiter, ", ");
1206 6483 txt := Tpl.writeTok(txt, Tpl.ST_STRING("List("));
1207 6483 txt := Tpl.writeText(txt, l_expl__str);
1208 6483 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1209 then txt;
1210
1211 case ( txt,
1212 DAE.CONS(car = i_car, cdr = i_cdr),
1213 a_stringDelimiter )
1214 algorithm
1215 16241 l_car__str := dumpExp(Tpl.emptyTxt, i_car, a_stringDelimiter);
1216 16241 l_cdr__str := dumpExp(Tpl.emptyTxt, i_cdr, a_stringDelimiter);
1217 16241 txt := Tpl.writeTok(txt, Tpl.ST_STRING("listCons("));
1218 16241 txt := Tpl.writeText(txt, l_car__str);
1219 16241 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
1220 16241 txt := Tpl.writeText(txt, l_cdr__str);
1221 16241 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1222 then txt;
1223
1224 case ( txt,
1225 DAE.META_TUPLE(listExp = i_listExp),
1226 a_stringDelimiter )
1227 algorithm
1228 13700 l_tuple__str := dumpExpList(Tpl.emptyTxt, i_listExp, a_stringDelimiter, ", ");
1229 13700 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Tuple("));
1230 13700 txt := Tpl.writeText(txt, l_tuple__str);
1231 13700 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1232 then txt;
1233
1234 case ( txt,
1235 DAE.META_OPTION(exp = SOME(i_exp)),
1236 a_stringDelimiter )
1237 algorithm
1238 1278 txt := Tpl.writeTok(txt, Tpl.ST_STRING("SOME("));
1239 1278 txt := dumpExp(txt, i_exp, a_stringDelimiter);
1240 1278 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1241 then txt;
1242
1243 case ( txt,
1244 DAE.META_OPTION(exp = _),
1245 _ )
1246 algorithm
1247 3717 txt := Tpl.writeTok(txt, Tpl.ST_STRING("NONE()"));
1248 then txt;
1249
1250 case ( txt,
1251 DAE.METARECORDCALL(path = i_path, args = i_args),
1252 a_stringDelimiter )
1253 algorithm
1254 17973 l_name__str := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_path);
1255 17973 l_args__str := dumpExpList(Tpl.emptyTxt, i_args, a_stringDelimiter, ", ");
1256 17973 txt := Tpl.writeText(txt, l_name__str);
1257 17973 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1258 17973 txt := Tpl.writeText(txt, l_args__str);
1259 17973 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1260 then txt;
1261
1262 case ( txt,
1263 DAE.MATCHEXPRESSION(matchType = i_matchType, inputs = i_inputs, cases = i_cases),
1264 a_stringDelimiter )
1265 algorithm
1266 2 l_match__ty := dumpMatchType(Tpl.emptyTxt, i_matchType);
1267 2 l_inputs__str := dumpExpList(Tpl.emptyTxt, i_inputs, a_stringDelimiter, ", ");
1268 2 l_case__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()));
1269 2 l_case__str := lm_35(l_case__str, i_cases);
1270 2 l_case__str := Tpl.popIter(l_case__str);
1271 2 txt := Tpl.writeText(txt, l_match__ty);
1272 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" ("));
1273 2 txt := Tpl.writeText(txt, l_inputs__str);
1274 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(")\n"));
1275 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
1276 2 txt := Tpl.writeText(txt, l_case__str);
1277 2 txt := Tpl.softNewLine(txt);
1278 2 txt := Tpl.popBlock(txt);
1279 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1280 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
1281 2 txt := Tpl.writeText(txt, l_match__ty);
1282 2 txt := Tpl.popBlock(txt);
1283 then txt;
1284
1285 case ( txt,
1286 DAE.BOX(exp = i_exp),
1287 a_stringDelimiter )
1288 algorithm
1289 16581 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#("));
1290 16581 txt := dumpExp(txt, i_exp, a_stringDelimiter);
1291 16581 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1292 then txt;
1293
1294 case ( txt,
1295 DAE.UNBOX(exp = i_exp),
1296 a_stringDelimiter )
1297 algorithm
1298 35 txt := Tpl.writeTok(txt, Tpl.ST_STRING("unbox("));
1299 35 txt := dumpExp(txt, i_exp, a_stringDelimiter);
1300 35 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1301 then txt;
1302
1303 case ( txt,
1304 DAE.SHARED_LITERAL(exp = i_exp, index = i_index),
1305 a_stringDelimiter )
1306 algorithm
1307 159597 ret_48 := Config.typeinfo();
1308 159597 txt := fun_36(txt, ret_48, i_index, a_stringDelimiter, i_exp);
1309 then txt;
1310
1311 case ( txt,
1312 DAE.PATTERN(pattern = i_pattern),
1313 _ )
1314 algorithm
1315 1 ret_49 := Config.typeinfo();
1316 1 txt := fun_37(txt, ret_49);
1317 1 txt := dumpPattern(txt, i_pattern);
1318 then txt;
1319
1320 case ( txt,
1321 _,
1322 _ )
1323 algorithm
1324 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpExp: Unknown expression.");
1325 then txt;
1326 end match;
1327 end dumpExp;
1328
1329 public function parenthesizeSubExp
1330 input Tpl.Text in_txt;
1331 input DAE.Exp in_a_exp;
1332
1333 output Tpl.Text out_txt;
1334 algorithm
1335 out_txt :=
1336 match(in_txt, in_a_exp)
1337 local
1338 Tpl.Text txt;
1339
1340 case ( txt,
1341 DAE.ICONST(integer = _) )
1342 then txt;
1343
1344 case ( txt,
1345 DAE.RCONST(real = _) )
1346 then txt;
1347
1348 case ( txt,
1349 DAE.SCONST(string = _) )
1350 then txt;
1351
1352 case ( txt,
1353 DAE.BCONST(bool = _) )
1354 then txt;
1355
1356 case ( txt,
1357 DAE.ENUM_LITERAL(name = _) )
1358 then txt;
1359
1360 case ( txt,
1361 DAE.CREF(componentRef = _) )
1362 then txt;
1363
1364 case ( txt,
1365 DAE.CALL(path = _) )
1366 then txt;
1367
1368 case ( txt,
1369 DAE.ARRAY(ty = _) )
1370 then txt;
1371
1372 case ( txt,
1373 DAE.MATRIX(ty = _) )
1374 then txt;
1375
1376 case ( txt,
1377 DAE.TUPLE(PR = _) )
1378 then txt;
1379
1380 case ( txt,
1381 DAE.CAST(ty = _) )
1382 then txt;
1383
1384 case ( txt,
1385 DAE.SIZE(exp = _) )
1386 then txt;
1387
1388 case ( txt,
1389 DAE.REDUCTION(reductionInfo = _) )
1390 then txt;
1391
1392 case ( txt,
1393 _ )
1394 algorithm
1395 700 txt := Tpl.writeTok(txt, Tpl.ST_STRING("y"));
1396 then txt;
1397 end match;
1398 end parenthesizeSubExp;
1399
1400 protected function lm_40
1401 input output Tpl.Text txt;
1402 input list<DAE.Exp> items;
1403 input String a_stringDelimiter;
1404 algorithm
1405
2/2
✓ Branch 0 taken 637634 times.
✓ Branch 1 taken 263462 times.
901096 for lstElt_40 in items loop
1406 txt := match lstElt_40
1407 local
1408 DAE.Exp i_exp;
1409
1410 case i_exp
1411 algorithm
1412 637634 txt := dumpExp(txt, i_exp, a_stringDelimiter);
1413 637634 txt := Tpl.nextIter(txt);
1414 then txt;
1415 end match;
1416 end for;
1417 end lm_40;
1418
1419 public function dumpExpList
1420 input Tpl.Text txt;
1421 input list<DAE.Exp> a_expl;
1422 input String a_stringDelimiter;
1423 input String a_expDelimiter;
1424
1425 output Tpl.Text out_txt;
1426 algorithm
1427 526924 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(a_expDelimiter)), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1428 263462 out_txt := lm_40(out_txt, a_expl, a_stringDelimiter);
1429 263462 out_txt := Tpl.popIter(out_txt);
1430 end dumpExpList;
1431
1432 protected function lm_42
1433 input output Tpl.Text txt;
1434 input list<DAE.Exp> items;
1435 input String a_stringDelimiter;
1436 algorithm
1437 ✗ for lstElt_42 in items loop
1438 txt := match lstElt_42
1439 local
1440 DAE.Exp i_exp;
1441
1442 case i_exp
1443 algorithm
1444 ✗ txt := dumpExpCrefs(txt, i_exp, a_stringDelimiter);
1445 ✗ txt := Tpl.nextIter(txt);
1446 then txt;
1447 end match;
1448 end for;
1449 end lm_42;
1450
1451 public function dumpExpListCrefs
1452 input Tpl.Text txt;
1453 input list<DAE.Exp> a_expl;
1454 input String a_stringDelimiter;
1455 input String a_expDelimiter;
1456
1457 output Tpl.Text out_txt;
1458 algorithm
1459 ✗ out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(a_expDelimiter)), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1460 ✗ out_txt := lm_42(out_txt, a_expl, a_stringDelimiter);
1461 ✗ out_txt := Tpl.popIter(out_txt);
1462 end dumpExpListCrefs;
1463
1464 public function dumpClockKind
1465 input Tpl.Text in_txt;
1466 input DAE.ClockKind in_a_clk;
1467 input String in_a_stringDelimiter;
1468
1469 output Tpl.Text out_txt;
1470 algorithm
1471 out_txt :=
1472 match(in_txt, in_a_clk, in_a_stringDelimiter)
1473 local
1474 Tpl.Text txt;
1475 String a_stringDelimiter;
1476 DAE.Exp i_solverMethod;
1477 DAE.Exp i_c;
1478 DAE.Exp i_startInterval;
1479 DAE.Exp i_condition;
1480 DAE.Exp i_interval;
1481 DAE.Exp i_resolution;
1482 DAE.Exp i_intervalCounter;
1483 Tpl.Text l_sm__str;
1484 Tpl.Text l_clk__str;
1485 Tpl.Text l_si__str;
1486 Tpl.Text l_condition__str;
1487 Tpl.Text l_interval__str;
1488 Tpl.Text l_re__str;
1489 Tpl.Text l_ic__str;
1490
1491 case ( txt,
1492 DAE.INFERRED_CLOCK(),
1493 _ )
1494 algorithm
1495 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock()"));
1496 then txt;
1497
1498 case ( txt,
1499 DAE.RATIONAL_CLOCK(intervalCounter = i_intervalCounter, resolution = i_resolution),
1500 a_stringDelimiter )
1501 algorithm
1502 9 l_ic__str := dumpExp(Tpl.emptyTxt, i_intervalCounter, a_stringDelimiter);
1503 9 l_re__str := dumpExp(Tpl.emptyTxt, i_resolution, a_stringDelimiter);
1504 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock("));
1505 9 txt := Tpl.writeText(txt, l_ic__str);
1506 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
1507 9 txt := Tpl.writeText(txt, l_re__str);
1508 9 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1509 then txt;
1510
1511 case ( txt,
1512 DAE.REAL_CLOCK(interval = i_interval),
1513 a_stringDelimiter )
1514 algorithm
1515 16 l_interval__str := dumpExp(Tpl.emptyTxt, i_interval, a_stringDelimiter);
1516 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock("));
1517 16 txt := Tpl.writeText(txt, l_interval__str);
1518 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1519 then txt;
1520
1521 case ( txt,
1522 DAE.EVENT_CLOCK(condition = i_condition, startInterval = i_startInterval),
1523 a_stringDelimiter )
1524 algorithm
1525 3 l_condition__str := dumpExp(Tpl.emptyTxt, i_condition, a_stringDelimiter);
1526 3 l_si__str := dumpExp(Tpl.emptyTxt, i_startInterval, a_stringDelimiter);
1527 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock("));
1528 3 txt := Tpl.writeText(txt, l_condition__str);
1529 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
1530 3 txt := Tpl.writeText(txt, l_si__str);
1531 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1532 then txt;
1533
1534 case ( txt,
1535 DAE.SOLVER_CLOCK(c = i_c, solverMethod = i_solverMethod),
1536 a_stringDelimiter )
1537 algorithm
1538 2 l_clk__str := dumpExp(Tpl.emptyTxt, i_c, a_stringDelimiter);
1539 2 l_sm__str := dumpExp(Tpl.emptyTxt, i_solverMethod, a_stringDelimiter);
1540 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock("));
1541 2 txt := Tpl.writeText(txt, l_clk__str);
1542 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
1543 2 txt := Tpl.writeText(txt, l_sm__str);
1544 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1545 then txt;
1546
1547 case ( txt,
1548 _,
1549 _ )
1550 then txt;
1551 end match;
1552 end dumpClockKind;
1553
1554 protected function fun_45
1555 input Tpl.Text in_txt;
1556 input Boolean in_mArg;
1557 input Tpl.Text in_a_cref__str;
1558 input Tpl.Text in_a_sub__str;
1559 input DAE.Ident in_a_ident;
1560
1561 output Tpl.Text out_txt;
1562 algorithm
1563 out_txt :=
1564 match(in_txt, in_mArg, in_a_cref__str, in_a_sub__str, in_a_ident)
1565 local
1566 Tpl.Text txt;
1567 Tpl.Text a_cref__str;
1568 Tpl.Text a_sub__str;
1569 DAE.Ident a_ident;
1570
1571 case ( txt,
1572 false,
1573 a_cref__str,
1574 a_sub__str,
1575 a_ident )
1576 algorithm
1577 3167961 txt := Tpl.writeStr(txt, a_ident);
1578 3167961 txt := Tpl.writeText(txt, a_sub__str);
1579 3167961 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
1580 3167961 txt := Tpl.writeText(txt, a_cref__str);
1581 then txt;
1582
1583 case ( txt,
1584 _,
1585 a_cref__str,
1586 a_sub__str,
1587 a_ident )
1588 algorithm
1589 ✗ txt := Tpl.writeStr(txt, a_ident);
1590 ✗ txt := Tpl.writeText(txt, a_sub__str);
1591 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("__"));
1592 ✗ txt := Tpl.writeText(txt, a_cref__str);
1593 then txt;
1594 end match;
1595 end fun_45;
1596
1597 public function dumpCref
1598 input Tpl.Text in_txt;
1599 input DAE.ComponentRef in_a_cref;
1600
1601 output Tpl.Text out_txt;
1602 algorithm
1603 out_txt :=
1604 match(in_txt, in_a_cref)
1605 local
1606 Tpl.Text txt;
1607 String i_instant;
1608 DAE.ComponentRef i_componentRef;
1609 DAE.Ident i_ident;
1610 list<DAE.Subscript> i_subscriptLst;
1611 Boolean ret_2;
1612 Tpl.Text l_cref__str;
1613 Tpl.Text l_sub__str;
1614
1615 case ( txt,
1616 DAE.CREF_IDENT(subscriptLst = i_subscriptLst, ident = i_ident) )
1617 algorithm
1618 1760112 l_sub__str := dumpSubscripts(Tpl.emptyTxt, i_subscriptLst);
1619 1760112 txt := Tpl.writeStr(txt, i_ident);
1620 1760112 txt := Tpl.writeText(txt, l_sub__str);
1621 then txt;
1622
1623 case ( txt,
1624 DAE.CREF_QUAL(subscriptLst = i_subscriptLst, componentRef = i_componentRef, ident = i_ident) )
1625 algorithm
1626 3167961 l_sub__str := dumpSubscripts(Tpl.emptyTxt, i_subscriptLst);
1627 3167961 l_cref__str := dumpCref(Tpl.emptyTxt, i_componentRef);
1628 3167961 ret_2 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
1629 3167961 txt := fun_45(txt, ret_2, l_cref__str, l_sub__str, i_ident);
1630 then txt;
1631
1632 case ( txt,
1633 DAE.WILD() )
1634 algorithm
1635 93 txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
1636 then txt;
1637
1638 case ( txt,
1639 DAE.OPTIMICA_ATTR_INST_CREF(componentRef = i_componentRef, instant = i_instant) )
1640 algorithm
1641 ✗ txt := dumpCref(txt, i_componentRef);
1642 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1643 ✗ txt := Tpl.writeStr(txt, i_instant);
1644 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1645 then txt;
1646
1647 case ( txt,
1648 _ )
1649 algorithm
1650 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpCref: unknown cref");
1651 then txt;
1652 end match;
1653 end dumpCref;
1654
1655 protected function lm_47
1656 input output Tpl.Text txt;
1657 input list<DAE.Subscript> items;
1658 algorithm
1659
2/2
✓ Branch 0 taken 1068363 times.
✓ Branch 1 taken 946951 times.
2015314 for lstElt_47 in items loop
1660 txt := match lstElt_47
1661 local
1662 DAE.Subscript i_sub;
1663
1664 case i_sub
1665 algorithm
1666 1068363 txt := dumpSubscript(txt, i_sub);
1667 1068363 txt := Tpl.nextIter(txt);
1668 then txt;
1669 end match;
1670 end for;
1671 end lm_47;
1672
1673 protected function lm_48
1674 input output Tpl.Text txt;
1675 input list<DAE.Subscript> items;
1676 algorithm
1677 ✗ for lstElt_48 in items loop
1678 txt := match lstElt_48
1679 local
1680 DAE.Subscript i_sub;
1681
1682 case i_sub
1683 algorithm
1684 ✗ txt := dumpSubscript(txt, i_sub);
1685 ✗ txt := Tpl.nextIter(txt);
1686 then txt;
1687 end match;
1688 end for;
1689 end lm_48;
1690
1691 protected function fun_49
1692 input Tpl.Text in_txt;
1693 input Boolean in_mArg;
1694 input list<DAE.Subscript> in_a_subscripts;
1695
1696 output Tpl.Text out_txt;
1697 algorithm
1698 out_txt :=
1699 match(in_txt, in_mArg, in_a_subscripts)
1700 local
1701 Tpl.Text txt;
1702 list<DAE.Subscript> a_subscripts;
1703 Tpl.Text l_sub__str;
1704
1705 case ( txt,
1706 false,
1707 a_subscripts )
1708 algorithm
1709 946951 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()));
1710 946951 l_sub__str := lm_47(l_sub__str, a_subscripts);
1711 946951 l_sub__str := Tpl.popIter(l_sub__str);
1712 946951 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
1713 946951 txt := Tpl.writeText(txt, l_sub__str);
1714 946951 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
1715 then txt;
1716
1717 case ( txt,
1718 _,
1719 a_subscripts )
1720 algorithm
1721 ✗ 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()));
1722 ✗ l_sub__str := lm_48(l_sub__str, a_subscripts);
1723 ✗ l_sub__str := Tpl.popIter(l_sub__str);
1724 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
1725 ✗ txt := Tpl.writeText(txt, l_sub__str);
1726 then txt;
1727 end match;
1728 end fun_49;
1729
1730 public function dumpSubscripts
1731 input Tpl.Text in_txt;
1732 input list<DAE.Subscript> in_a_subscripts;
1733
1734 output Tpl.Text out_txt;
1735 algorithm
1736 out_txt :=
1737 match(in_txt, in_a_subscripts)
1738 local
1739 Tpl.Text txt;
1740 list<DAE.Subscript> i_subscripts;
1741 Boolean ret_0;
1742
1743 case ( txt,
1744 {} )
1745 then txt;
1746
1747 case ( txt,
1748 i_subscripts )
1749 algorithm
1750 946951 ret_0 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
1751 946951 txt := fun_49(txt, ret_0, i_subscripts);
1752 then txt;
1753 end match;
1754 end dumpSubscripts;
1755
1756 public function dumpSubscript
1757 input Tpl.Text in_txt;
1758 input DAE.Subscript in_a_subscript;
1759
1760 output Tpl.Text out_txt;
1761 algorithm
1762 out_txt :=
1763 match(in_txt, in_a_subscript)
1764 local
1765 Tpl.Text txt;
1766 DAE.Exp i_exp;
1767
1768 case ( txt,
1769 DAE.WHOLEDIM() )
1770 algorithm
1771 410 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
1772 then txt;
1773
1774 case ( txt,
1775 DAE.SLICE(exp = i_exp) )
1776 algorithm
1777 99 txt := dumpExp(txt, i_exp, "\"");
1778 then txt;
1779
1780 case ( txt,
1781 DAE.INDEX(exp = i_exp) )
1782 algorithm
1783 1067854 txt := dumpExp(txt, i_exp, "\"");
1784 then txt;
1785
1786 case ( txt,
1787 DAE.WHOLE_NONEXP(exp = i_exp) )
1788 algorithm
1789 ✗ txt := dumpExp(txt, i_exp, "\"");
1790 then txt;
1791
1792 case ( txt,
1793 _ )
1794 then txt;
1795 end match;
1796 end dumpSubscript;
1797
1798 public function dumpReductionIterator
1799 input Tpl.Text in_txt;
1800 input DAE.ReductionIterator in_a_iterator;
1801 input String in_a_stringDelimiter;
1802
1803 output Tpl.Text out_txt;
1804 algorithm
1805 out_txt :=
1806 match(in_txt, in_a_iterator, in_a_stringDelimiter)
1807 local
1808 Tpl.Text txt;
1809 String a_stringDelimiter;
1810 DAE.Exp i_gexp;
1811 String i_id;
1812 DAE.Exp i_exp;
1813 Tpl.Text l_guard__str;
1814 Tpl.Text l_exp__str;
1815
1816 case ( txt,
1817 DAE.REDUCTIONITER(guardExp = NONE(), exp = i_exp, id = i_id),
1818 a_stringDelimiter )
1819 algorithm
1820 167 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1821 167 txt := Tpl.writeStr(txt, i_id);
1822 167 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
1823 167 txt := Tpl.writeText(txt, l_exp__str);
1824 then txt;
1825
1826 case ( txt,
1827 DAE.REDUCTIONITER(guardExp = SOME(i_gexp), exp = i_exp, id = i_id),
1828 a_stringDelimiter )
1829 algorithm
1830 18 l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
1831 18 l_guard__str := dumpExp(Tpl.emptyTxt, i_gexp, a_stringDelimiter);
1832 18 txt := Tpl.writeStr(txt, i_id);
1833 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" guard "));
1834 18 txt := Tpl.writeText(txt, l_guard__str);
1835 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
1836 18 txt := Tpl.writeText(txt, l_exp__str);
1837 then txt;
1838
1839 case ( txt,
1840 _,
1841 _ )
1842 then txt;
1843 end match;
1844 end dumpReductionIterator;
1845
1846 protected function fun_53
1847 input Tpl.Text in_txt;
1848 input Boolean in_mArg;
1849 input Tpl.Text in_a_op__str;
1850
1851 output Tpl.Text out_txt;
1852 algorithm
1853 out_txt :=
1854 match(in_txt, in_mArg, in_a_op__str)
1855 local
1856 Tpl.Text txt;
1857 Tpl.Text a_op__str;
1858
1859 case ( txt,
1860 false,
1861 a_op__str )
1862 algorithm
1863 2401650 txt := Tpl.writeText(txt, a_op__str);
1864 then txt;
1865
1866 case ( txt,
1867 _,
1868 a_op__str )
1869 algorithm
1870 264012 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
1871 264012 txt := Tpl.writeText(txt, a_op__str);
1872 264012 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1873 then txt;
1874 end match;
1875 end fun_53;
1876
1877 public function dumpOperand
1878 input Tpl.Text txt;
1879 input DAE.Exp a_operand;
1880 input DAE.Exp a_operation;
1881 input Boolean a_lhs;
1882
1883 output Tpl.Text out_txt;
1884 protected
1885 Boolean ret_1;
1886 Tpl.Text l_op__str;
1887 algorithm
1888 2665662 l_op__str := dumpExp(Tpl.emptyTxt, a_operand, "\"");
1889 2665662 ret_1 := ExpressionBasics.shouldParenthesize(a_operand, a_operation, a_lhs);
1890 2665662 out_txt := fun_53(txt, ret_1, l_op__str);
1891 end dumpOperand;
1892
1893 protected function fun_55
1894 input Tpl.Text in_txt;
1895 input DAE.Operator in_a_op;
1896
1897 output Tpl.Text out_txt;
1898 algorithm
1899 out_txt :=
1900 match(in_txt, in_a_op)
1901 local
1902 Tpl.Text txt;
1903
1904 case ( txt,
1905 DAE.ADD(ty = _) )
1906 algorithm
1907 294615 txt := Tpl.writeTok(txt, Tpl.ST_STRING("+"));
1908 then txt;
1909
1910 case ( txt,
1911 DAE.SUB(ty = _) )
1912 algorithm
1913 170606 txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
1914 then txt;
1915
1916 case ( txt,
1917 DAE.MUL(ty = _) )
1918 algorithm
1919 476690 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
1920 then txt;
1921
1922 case ( txt,
1923 DAE.DIV(ty = _) )
1924 algorithm
1925 76310 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/"));
1926 then txt;
1927
1928 case ( txt,
1929 DAE.POW(ty = _) )
1930 algorithm
1931 49708 txt := Tpl.writeTok(txt, Tpl.ST_STRING("^"));
1932 then txt;
1933
1934 case ( txt,
1935 DAE.ADD_ARR(ty = _) )
1936 algorithm
1937 85 txt := Tpl.writeTok(txt, Tpl.ST_STRING("+"));
1938 then txt;
1939
1940 case ( txt,
1941 DAE.SUB_ARR(ty = _) )
1942 algorithm
1943 144 txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
1944 then txt;
1945
1946 case ( txt,
1947 DAE.MUL_ARR(ty = _) )
1948 algorithm
1949 21 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".*"));
1950 then txt;
1951
1952 case ( txt,
1953 DAE.DIV_ARR(ty = _) )
1954 algorithm
1955 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("./"));
1956 then txt;
1957
1958 case ( txt,
1959 DAE.POW_ARR(ty = _) )
1960 algorithm
1961 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("^"));
1962 then txt;
1963
1964 case ( txt,
1965 DAE.POW_ARR2(ty = _) )
1966 algorithm
1967 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^"));
1968 then txt;
1969
1970 case ( txt,
1971 DAE.MUL_ARRAY_SCALAR(ty = _) )
1972 algorithm
1973 146 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
1974 then txt;
1975
1976 case ( txt,
1977 DAE.ADD_ARRAY_SCALAR(ty = _) )
1978 algorithm
1979 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".+"));
1980 then txt;
1981
1982 case ( txt,
1983 DAE.SUB_SCALAR_ARRAY(ty = _) )
1984 algorithm
1985 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".-"));
1986 then txt;
1987
1988 case ( txt,
1989 DAE.POW_SCALAR_ARRAY(ty = _) )
1990 algorithm
1991 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^"));
1992 then txt;
1993
1994 case ( txt,
1995 DAE.POW_ARRAY_SCALAR(ty = _) )
1996 algorithm
1997 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^"));
1998 then txt;
1999
2000 case ( txt,
2001 DAE.MUL_SCALAR_PRODUCT(ty = _) )
2002 algorithm
2003 222 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
2004 then txt;
2005
2006 case ( txt,
2007 DAE.MUL_MATRIX_PRODUCT(ty = _) )
2008 algorithm
2009 140 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
2010 then txt;
2011
2012 case ( txt,
2013 DAE.DIV_SCALAR_ARRAY(ty = _) )
2014 algorithm
2015 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("./"));
2016 then txt;
2017
2018 case ( txt,
2019 DAE.DIV_ARRAY_SCALAR(ty = _) )
2020 algorithm
2021 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING("/"));
2022 then txt;
2023
2024 case ( txt,
2025 _ )
2026 algorithm
2027 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpBinOp: Unknown operator.");
2028 then txt;
2029 end match;
2030 end fun_55;
2031
2032 protected function fun_56
2033 input Tpl.Text in_txt;
2034 input DAE.Operator in_a_op;
2035
2036 output Tpl.Text out_txt;
2037 algorithm
2038 out_txt :=
2039 match(in_txt, in_a_op)
2040 local
2041 Tpl.Text txt;
2042
2043 case ( txt,
2044 DAE.ADD(ty = _) )
2045 algorithm
2046 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("+"));
2047 then txt;
2048
2049 case ( txt,
2050 DAE.SUB(ty = _) )
2051 algorithm
2052 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
2053 then txt;
2054
2055 case ( txt,
2056 DAE.MUL(ty = _) )
2057 algorithm
2058 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("*"));
2059 then txt;
2060
2061 case ( txt,
2062 DAE.DIV(ty = _) )
2063 algorithm
2064 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/"));
2065 then txt;
2066
2067 case ( txt,
2068 DAE.POW(ty = _) )
2069 algorithm
2070 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("^"));
2071 then txt;
2072
2073 case ( txt,
2074 DAE.ADD_ARR(ty = _) )
2075 algorithm
2076 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("+ /* ADD_ARR */"));
2077 then txt;
2078
2079 case ( txt,
2080 DAE.SUB_ARR(ty = _) )
2081 algorithm
2082 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("- /* SUB_ARR */"));
2083 then txt;
2084
2085 case ( txt,
2086 DAE.MUL_ARR(ty = _) )
2087 algorithm
2088 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".* /* MUL_ARR */"));
2089 then txt;
2090
2091 case ( txt,
2092 DAE.DIV_ARR(ty = _) )
2093 algorithm
2094 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("./ /* DIV_ARR */"));
2095 then txt;
2096
2097 case ( txt,
2098 DAE.POW_ARR(ty = _) )
2099 algorithm
2100 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("^ /* POW_ARR */"));
2101 then txt;
2102
2103 case ( txt,
2104 DAE.POW_ARR2(ty = _) )
2105 algorithm
2106 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^ /* POW_ARR2 */"));
2107 then txt;
2108
2109 case ( txt,
2110 DAE.MUL_ARRAY_SCALAR(ty = _) )
2111 algorithm
2112 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("* /* MUL_ARR_SCA */"));
2113 then txt;
2114
2115 case ( txt,
2116 DAE.ADD_ARRAY_SCALAR(ty = _) )
2117 algorithm
2118 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".+ /* ADD_ARR_SCA */"));
2119 then txt;
2120
2121 case ( txt,
2122 DAE.SUB_SCALAR_ARRAY(ty = _) )
2123 algorithm
2124 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".- /* SUB_SCA_ARR */"));
2125 then txt;
2126
2127 case ( txt,
2128 DAE.POW_SCALAR_ARRAY(ty = _) )
2129 algorithm
2130 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^ /* POW_SCA_ARR */"));
2131 then txt;
2132
2133 case ( txt,
2134 DAE.POW_ARRAY_SCALAR(ty = _) )
2135 algorithm
2136 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(".^ /* POW_ARR_SCA */"));
2137 then txt;
2138
2139 case ( txt,
2140 DAE.MUL_SCALAR_PRODUCT(ty = _) )
2141 algorithm
2142 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("* /* MUL_SCA_PRO */"));
2143 then txt;
2144
2145 case ( txt,
2146 DAE.MUL_MATRIX_PRODUCT(ty = _) )
2147 algorithm
2148 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("* /* MUL_MAT_PRO */"));
2149 then txt;
2150
2151 case ( txt,
2152 DAE.DIV_SCALAR_ARRAY(ty = _) )
2153 algorithm
2154 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/ /* DIV_SCA_ARR */"));
2155 then txt;
2156
2157 case ( txt,
2158 DAE.DIV_ARRAY_SCALAR(ty = _) )
2159 algorithm
2160 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/ /* DIV_ARR_SCA */"));
2161 then txt;
2162
2163 case ( txt,
2164 _ )
2165 algorithm
2166 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpBinOp: Unknown operator.");
2167 then txt;
2168 end match;
2169 end fun_56;
2170
2171 protected function fun_57
2172 input Tpl.Text in_txt;
2173 input Boolean in_mArg;
2174 input DAE.Operator in_a_op;
2175
2176 output Tpl.Text out_txt;
2177 algorithm
2178 out_txt :=
2179 match(in_txt, in_mArg, in_a_op)
2180 local
2181 Tpl.Text txt;
2182 DAE.Operator a_op;
2183
2184 case ( txt,
2185 false,
2186 a_op )
2187 algorithm
2188 1068747 txt := fun_55(txt, a_op);
2189 then txt;
2190
2191 case ( txt,
2192 _,
2193 a_op )
2194 algorithm
2195 2 txt := fun_56(txt, a_op);
2196 then txt;
2197 end match;
2198 end fun_57;
2199
2200 public function dumpBinOp
2201 input Tpl.Text txt;
2202 input DAE.Operator a_op;
2203
2204 output Tpl.Text out_txt;
2205 protected
2206 Boolean ret_0;
2207 algorithm
2208 1068749 ret_0 := Config.typeinfo();
2209 1068749 out_txt := fun_57(txt, ret_0, a_op);
2210 end dumpBinOp;
2211
2212 public function dumpUnaryOp
2213 input Tpl.Text in_txt;
2214 input DAE.Operator in_a_op;
2215
2216 output Tpl.Text out_txt;
2217 algorithm
2218 out_txt :=
2219 match(in_txt, in_a_op)
2220 local
2221 Tpl.Text txt;
2222
2223 case ( txt,
2224 DAE.UMINUS(ty = _) )
2225 algorithm
2226 54437 txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
2227 then txt;
2228
2229 case ( txt,
2230 DAE.UMINUS_ARR(ty = _) )
2231 algorithm
2232 51 txt := Tpl.writeTok(txt, Tpl.ST_STRING("-"));
2233 then txt;
2234
2235 case ( txt,
2236 DAE.ADD(ty = _) )
2237 algorithm
2238 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("+"));
2239 then txt;
2240
2241 case ( txt,
2242 _ )
2243 algorithm
2244 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpUnaryOp: Unknown operator.");
2245 then txt;
2246 end match;
2247 end dumpUnaryOp;
2248
2249 public function dumpLogicalBinOp
2250 input Tpl.Text in_txt;
2251 input DAE.Operator in_a_op;
2252
2253 output Tpl.Text out_txt;
2254 algorithm
2255 out_txt :=
2256 match(in_txt, in_a_op)
2257 local
2258 Tpl.Text txt;
2259
2260 case ( txt,
2261 DAE.AND(ty = _) )
2262 algorithm
2263 50618 txt := Tpl.writeTok(txt, Tpl.ST_STRING("and"));
2264 then txt;
2265
2266 case ( txt,
2267 DAE.OR(ty = _) )
2268 algorithm
2269 5138 txt := Tpl.writeTok(txt, Tpl.ST_STRING("or"));
2270 then txt;
2271
2272 case ( txt,
2273 _ )
2274 algorithm
2275 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpLogicalBinOp: Unknown operator.");
2276 then txt;
2277 end match;
2278 end dumpLogicalBinOp;
2279
2280 public function dumpLogicalUnaryOp
2281 input Tpl.Text in_txt;
2282 input DAE.Operator in_a_op;
2283
2284 output Tpl.Text out_txt;
2285 algorithm
2286 out_txt :=
2287 match(in_txt, in_a_op)
2288 local
2289 Tpl.Text txt;
2290
2291 case ( txt,
2292 DAE.NOT(ty = _) )
2293 algorithm
2294 2749 txt := Tpl.writeTok(txt, Tpl.ST_STRING("not"));
2295 then txt;
2296
2297 case ( txt,
2298 _ )
2299 algorithm
2300 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpLogicalUnaryOp: Unknown operator.");
2301 then txt;
2302 end match;
2303 end dumpLogicalUnaryOp;
2304
2305 public function dumpRelationOp
2306 input Tpl.Text in_txt;
2307 input DAE.Operator in_a_op;
2308
2309 output Tpl.Text out_txt;
2310 algorithm
2311 out_txt :=
2312 match(in_txt, in_a_op)
2313 local
2314 Tpl.Text txt;
2315
2316 case ( txt,
2317 DAE.LESS(ty = _) )
2318 algorithm
2319 12436 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<"));
2320 then txt;
2321
2322 case ( txt,
2323 DAE.LESSEQ(ty = _) )
2324 algorithm
2325 46207 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<="));
2326 then txt;
2327
2328 case ( txt,
2329 DAE.GREATER(ty = _) )
2330 algorithm
2331 11935 txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2332 then txt;
2333
2334 case ( txt,
2335 DAE.GREATEREQ(ty = _) )
2336 algorithm
2337 100933 txt := Tpl.writeTok(txt, Tpl.ST_STRING(">="));
2338 then txt;
2339
2340 case ( txt,
2341 DAE.EQUAL(ty = _) )
2342 algorithm
2343 5245 txt := Tpl.writeTok(txt, Tpl.ST_STRING("=="));
2344 then txt;
2345
2346 case ( txt,
2347 DAE.NEQUAL(ty = _) )
2348 algorithm
2349 2090 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<>"));
2350 then txt;
2351
2352 case ( txt,
2353 DAE.USERDEFINED(fqName = _) )
2354 algorithm
2355 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("USERDEFINED"));
2356 then txt;
2357
2358 case ( txt,
2359 _ )
2360 algorithm
2361 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpRelationOp: Unknown operator.");
2362 then txt;
2363 end match;
2364 end dumpRelationOp;
2365
2366 protected function lm_63
2367 input output Tpl.Text txt;
2368 input list<DAE.FuncArg> items;
2369 algorithm
2370 ✗ for lstElt_63 in items loop
2371 txt := match lstElt_63
2372 local
2373 DAE.FuncArg i_arg;
2374
2375 case i_arg
2376 algorithm
2377 ✗ txt := dumpFuncArg(txt, i_arg);
2378 ✗ txt := Tpl.nextIter(txt);
2379 then txt;
2380 end match;
2381 end for;
2382 end lm_63;
2383
2384 protected function lm_64
2385 input output Tpl.Text txt;
2386 input list<DAE.Type> items;
2387 algorithm
2388 ✗ for lstElt_64 in items loop
2389 txt := match lstElt_64
2390 local
2391 DAE.Type i_ty;
2392
2393 case i_ty
2394 algorithm
2395 ✗ txt := dumpType(txt, i_ty);
2396 ✗ txt := Tpl.nextIter(txt);
2397 then txt;
2398 end match;
2399 end for;
2400 end lm_64;
2401
2402 protected function lm_65
2403 input output Tpl.Text txt;
2404 input list<DAE.Type> items;
2405 algorithm
2406 ✗ for lstElt_65 in items loop
2407 txt := match lstElt_65
2408 local
2409 DAE.Type i_ty;
2410
2411 case i_ty
2412 algorithm
2413 ✗ txt := dumpType(txt, i_ty);
2414 ✗ txt := Tpl.nextIter(txt);
2415 then txt;
2416 end match;
2417 end for;
2418 end lm_65;
2419
2420 public function dumpType
2421 input Tpl.Text in_txt;
2422 input DAE.Type in_a_ty;
2423
2424 output Tpl.Text out_txt;
2425 algorithm
2426 out_txt :=
2427 match(in_txt, in_a_ty)
2428 local
2429 Tpl.Text txt;
2430 String i_name;
2431 list<DAE.Type> i_types;
2432 DAE.Type i_functionType;
2433 DAE.Type i_funcResultType;
2434 list<DAE.FuncArg> i_funcArg;
2435 ClassInf.State i_complexClassType;
2436 DAE.Type i_ty;
2437 DAE.Dimensions i_dims;
2438 Absyn.Path i_path;
2439 Tpl.Text l_ret__str;
2440 Tpl.Text l_arg__str;
2441 Tpl.Text l_ty__str;
2442 Tpl.Text l_dim__str;
2443
2444 case ( txt,
2445 DAE.T_INTEGER(varLst = _) )
2446 algorithm
2447 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer"));
2448 then txt;
2449
2450 case ( txt,
2451 DAE.T_REAL(varLst = _) )
2452 algorithm
2453 6222 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real"));
2454 then txt;
2455
2456 case ( txt,
2457 DAE.T_BOOL(varLst = _) )
2458 algorithm
2459 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Bool"));
2460 then txt;
2461
2462 case ( txt,
2463 DAE.T_STRING(varLst = _) )
2464 algorithm
2465 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("String"));
2466 then txt;
2467
2468 case ( txt,
2469 DAE.T_ENUMERATION(path = i_path) )
2470 algorithm
2471 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_path);
2472 then txt;
2473
2474 case ( txt,
2475 DAE.T_ARRAY(dims = i_dims, ty = i_ty) )
2476 algorithm
2477 22 l_dim__str := dumpDimensions(Tpl.emptyTxt, i_dims);
2478 22 l_ty__str := dumpType(Tpl.emptyTxt, i_ty);
2479 22 txt := Tpl.writeText(txt, l_ty__str);
2480 22 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
2481 22 txt := Tpl.writeText(txt, l_dim__str);
2482 22 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
2483 then txt;
2484
2485 case ( txt,
2486 DAE.T_COMPLEX(complexClassType = i_complexClassType) )
2487 algorithm
2488 8 txt := dumpClassState(txt, i_complexClassType);
2489 then txt;
2490
2491 case ( txt,
2492 DAE.T_SUBTYPE_BASIC(complexClassType = i_complexClassType) )
2493 algorithm
2494 ✗ txt := dumpClassState(txt, i_complexClassType);
2495 then txt;
2496
2497 case ( txt,
2498 DAE.T_FUNCTION(funcArg = i_funcArg, funcResultType = i_funcResultType) )
2499 algorithm
2500 ✗ l_arg__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()));
2501 ✗ l_arg__str := lm_63(l_arg__str, i_funcArg);
2502 ✗ l_arg__str := Tpl.popIter(l_arg__str);
2503 ✗ l_ret__str := dumpType(Tpl.emptyTxt, i_funcResultType);
2504 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("<function>("));
2505 ✗ txt := Tpl.writeText(txt, l_arg__str);
2506 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(") => "));
2507 ✗ txt := Tpl.writeText(txt, l_ret__str);
2508 then txt;
2509
2510 case ( txt,
2511 DAE.T_FUNCTION_REFERENCE_VAR(functionType = i_functionType) )
2512 algorithm
2513 ✗ txt := dumpType(txt, i_functionType);
2514 then txt;
2515
2516 case ( txt,
2517 DAE.T_FUNCTION_REFERENCE_FUNC(functionType = i_functionType) )
2518 algorithm
2519 ✗ txt := dumpType(txt, i_functionType);
2520 then txt;
2521
2522 case ( txt,
2523 DAE.T_TUPLE(types = i_types) )
2524 algorithm
2525 ✗ 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()));
2526 ✗ l_ty__str := lm_64(l_ty__str, i_types);
2527 ✗ l_ty__str := Tpl.popIter(l_ty__str);
2528 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2529 ✗ txt := Tpl.writeText(txt, l_ty__str);
2530 then txt;
2531
2532 case ( txt,
2533 DAE.T_CODE(ty = _) )
2534 algorithm
2535 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_CODE#"));
2536 then txt;
2537
2538 case ( txt,
2539 DAE.T_METALIST(ty = i_ty) )
2540 algorithm
2541 ✗ l_ty__str := dumpType(Tpl.emptyTxt, i_ty);
2542 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("list<"));
2543 ✗ txt := Tpl.writeText(txt, l_ty__str);
2544 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2545 then txt;
2546
2547 case ( txt,
2548 DAE.T_METATUPLE(types = i_types) )
2549 algorithm
2550 ✗ 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()));
2551 ✗ l_ty__str := lm_65(l_ty__str, i_types);
2552 ✗ l_ty__str := Tpl.popIter(l_ty__str);
2553 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("tuple<"));
2554 ✗ txt := Tpl.writeText(txt, l_ty__str);
2555 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2556 then txt;
2557
2558 case ( txt,
2559 DAE.T_METAOPTION(ty = i_ty) )
2560 algorithm
2561 ✗ l_ty__str := dumpType(Tpl.emptyTxt, i_ty);
2562 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Option<"));
2563 ✗ txt := Tpl.writeText(txt, l_ty__str);
2564 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2565 then txt;
2566
2567 case ( txt,
2568 DAE.T_METAUNIONTYPE(path = i_path) )
2569 algorithm
2570 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_path);
2571 then txt;
2572
2573 case ( txt,
2574 DAE.T_METARECORD(path = i_path) )
2575 algorithm
2576 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_path);
2577 then txt;
2578
2579 case ( txt,
2580 DAE.T_METAARRAY(ty = i_ty) )
2581 algorithm
2582 ✗ l_ty__str := dumpType(Tpl.emptyTxt, i_ty);
2583 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("array<"));
2584 ✗ txt := Tpl.writeText(txt, l_ty__str);
2585 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2586 then txt;
2587
2588 case ( txt,
2589 DAE.T_METABOXED(ty = i_ty) )
2590 algorithm
2591 ✗ txt := dumpType(txt, i_ty);
2592 then txt;
2593
2594 case ( txt,
2595 DAE.T_METAPOLYMORPHIC(name = i_name) )
2596 algorithm
2597 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("polymorphic<"));
2598 ✗ txt := Tpl.writeStr(txt, i_name);
2599 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
2600 then txt;
2601
2602 case ( txt,
2603 DAE.T_METATYPE(ty = i_ty) )
2604 algorithm
2605 ✗ txt := dumpType(txt, i_ty);
2606 then txt;
2607
2608 case ( txt,
2609 DAE.T_UNKNOWN() )
2610 algorithm
2611 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_UNKNOWN#"));
2612 then txt;
2613
2614 case ( txt,
2615 DAE.T_ANYTYPE(anyClassType = _) )
2616 algorithm
2617 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Any"));
2618 then txt;
2619
2620 case ( txt,
2621 DAE.T_NORETCALL() )
2622 algorithm
2623 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_NORETCALL#"));
2624 then txt;
2625
2626 case ( txt,
2627 _ )
2628 then txt;
2629 end match;
2630 end dumpType;
2631
2632 public function dumpFuncArg
2633 input Tpl.Text in_txt;
2634 input DAE.FuncArg in_a_arg;
2635
2636 output Tpl.Text out_txt;
2637 algorithm
2638 out_txt :=
2639 match(in_txt, in_a_arg)
2640 local
2641 Tpl.Text txt;
2642 String i_arg_name;
2643
2644 case ( txt,
2645 DAE.FUNCARG(name = i_arg_name) )
2646 algorithm
2647 ✗ txt := Tpl.writeStr(txt, i_arg_name);
2648 then txt;
2649
2650 case ( txt,
2651 _ )
2652 then txt;
2653 end match;
2654 end dumpFuncArg;
2655
2656 protected function lm_68
2657 input output Tpl.Text txt;
2658 input DAE.Dimensions items;
2659 algorithm
2660
2/2
✓ Branch 0 taken 22 times.
✓ Branch 1 taken 22 times.
44 for lstElt_68 in items loop
2661 txt := match lstElt_68
2662 local
2663 DAE.Dimension i_dim;
2664
2665 case i_dim
2666 algorithm
2667 22 txt := dumpDimension(txt, i_dim);
2668 22 txt := Tpl.nextIter(txt);
2669 then txt;
2670 end match;
2671 end for;
2672 end lm_68;
2673
2674 public function dumpDimensions
2675 input Tpl.Text txt;
2676 input DAE.Dimensions a_dims;
2677
2678 output Tpl.Text out_txt;
2679 algorithm
2680 22 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()));
2681 22 out_txt := lm_68(out_txt, a_dims);
2682 22 out_txt := Tpl.popIter(out_txt);
2683 end dumpDimensions;
2684
2685 public function dumpDimension
2686 input Tpl.Text in_txt;
2687 input DAE.Dimension in_a_dim;
2688
2689 output Tpl.Text out_txt;
2690 algorithm
2691 out_txt :=
2692 match(in_txt, in_a_dim)
2693 local
2694 Tpl.Text txt;
2695 DAE.Exp i_exp;
2696 Absyn.Path i_enumTypeName;
2697 Integer i_integer;
2698
2699 case ( txt,
2700 DAE.DIM_INTEGER(integer = i_integer) )
2701 algorithm
2702 20 txt := Tpl.writeStr(txt, intString(i_integer));
2703 then txt;
2704
2705 case ( txt,
2706 DAE.DIM_ENUM(enumTypeName = i_enumTypeName) )
2707 algorithm
2708 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_enumTypeName);
2709 then txt;
2710
2711 case ( txt,
2712 DAE.DIM_EXP(exp = i_exp) )
2713 algorithm
2714 ✗ txt := dumpExp(txt, i_exp, "\"");
2715 then txt;
2716
2717 case ( txt,
2718 DAE.DIM_UNKNOWN() )
2719 algorithm
2720 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
2721 then txt;
2722
2723 case ( txt,
2724 _ )
2725 then txt;
2726 end match;
2727 end dumpDimension;
2728
2729 public function dumpClassState
2730 input Tpl.Text txt;
2731 input ClassInf.State a_state;
2732
2733 output Tpl.Text out_txt;
2734 protected
2735 Absyn.Path ret_0;
2736 algorithm
2737 8 ret_0 := ClassInfUtil.getStateName(a_state);
2738 8 out_txt := AbsynDumpTpl.dumpPath(txt, ret_0);
2739 end dumpClassState;
2740
2741 public function dumpMatchType
2742 input Tpl.Text in_txt;
2743 input DAE.MatchType in_a_ty;
2744
2745 output Tpl.Text out_txt;
2746 algorithm
2747 out_txt :=
2748 match(in_txt, in_a_ty)
2749 local
2750 Tpl.Text txt;
2751
2752 case ( txt,
2753 DAE.MATCHCONTINUE() )
2754 algorithm
2755 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("matchcontinue"));
2756 then txt;
2757
2758 case ( txt,
2759 DAE.MATCH(switch = NONE()) )
2760 algorithm
2761 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("match"));
2762 then txt;
2763
2764 case ( txt,
2765 DAE.MATCH(switch = SOME(_)) )
2766 algorithm
2767 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("match /* switch */"));
2768 then txt;
2769
2770 case ( txt,
2771 _ )
2772 then txt;
2773 end match;
2774 end dumpMatchType;
2775
2776 public function dumpMatchCase
2777 input Tpl.Text in_txt;
2778 input DAE.MatchCase in_a_mcase;
2779
2780 output Tpl.Text out_txt;
2781 algorithm
2782 out_txt :=
2783 match(in_txt, in_a_mcase)
2784 local
2785 Tpl.Text txt;
2786 list<DAE.Statement> i_body;
2787 DAE.Exp i_result;
2788 list<DAE.Pattern> i_patterns;
2789 Tpl.Text l_body__str;
2790 Tpl.Text l_res__str;
2791 Tpl.Text l_pat__str;
2792
2793 case ( txt,
2794 DAE.CASE(body = {}, result = SOME(i_result), patterns = i_patterns) )
2795 algorithm
2796 1 l_pat__str := dumpPatterns(Tpl.emptyTxt, i_patterns);
2797 1 l_res__str := dumpExp(Tpl.emptyTxt, i_result, "\"");
2798 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case ("));
2799 1 txt := Tpl.writeText(txt, l_pat__str);
2800 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(") then "));
2801 1 txt := Tpl.writeText(txt, l_res__str);
2802 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
2803 then txt;
2804
2805 case ( txt,
2806 DAE.CASE(body = {}, result = NONE(), patterns = i_patterns) )
2807 algorithm
2808 ✗ l_pat__str := dumpPatterns(Tpl.emptyTxt, i_patterns);
2809 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case ("));
2810 ✗ txt := Tpl.writeText(txt, l_pat__str);
2811 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(") then fail();"));
2812 then txt;
2813
2814 case ( txt,
2815 DAE.CASE(result = SOME(i_result), patterns = i_patterns, body = i_body) )
2816 algorithm
2817 2 l_pat__str := dumpPatterns(Tpl.emptyTxt, i_patterns);
2818 2 l_res__str := dumpExp(Tpl.emptyTxt, i_result, "\"");
2819 2 l_body__str := DAEDumpTpl.dumpStatements(Tpl.emptyTxt, i_body);
2820 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("case ("));
2821 2 txt := Tpl.writeText(txt, l_pat__str);
2822 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2823 ")\n",
2824 " algorithm\n"
2825 }, true));
2826 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
2827 2 txt := Tpl.writeText(txt, l_body__str);
2828 2 txt := Tpl.softNewLine(txt);
2829 2 txt := Tpl.popBlock(txt);
2830 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
2831 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
2832 2 txt := Tpl.writeText(txt, l_res__str);
2833 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
2834 2 txt := Tpl.popBlock(txt);
2835 then txt;
2836
2837 case ( txt,
2838 DAE.CASE(patterns = i_patterns, body = i_body) )
2839 algorithm
2840 ✗ l_pat__str := dumpPatterns(Tpl.emptyTxt, i_patterns);
2841 ✗ l_body__str := DAEDumpTpl.dumpStatements(Tpl.emptyTxt, i_body);
2842 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("case ("));
2843 ✗ txt := Tpl.writeText(txt, l_pat__str);
2844 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2845 ")\n",
2846 " algorithm\n"
2847 }, true));
2848 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
2849 ✗ txt := Tpl.writeText(txt, l_body__str);
2850 ✗ txt := Tpl.softNewLine(txt);
2851 ✗ txt := Tpl.popBlock(txt);
2852 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
2853 " then\n",
2854 " fail();"
2855 }, false));
2856 then txt;
2857
2858 case ( txt,
2859 _ )
2860 then txt;
2861 end match;
2862 end dumpMatchCase;
2863
2864 protected function lm_74
2865 input output Tpl.Text txt;
2866 input list<DAE.Pattern> items;
2867 algorithm
2868
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 3 times.
4 for lstElt_74 in items loop
2869 txt := match lstElt_74
2870 local
2871 DAE.Pattern i_pat;
2872
2873 case i_pat
2874 algorithm
2875 1 txt := dumpPattern(txt, i_pat);
2876 1 txt := Tpl.nextIter(txt);
2877 then txt;
2878 end match;
2879 end for;
2880 end lm_74;
2881
2882 public function dumpPatterns
2883 input Tpl.Text txt;
2884 input list<DAE.Pattern> a_patterns;
2885
2886 output Tpl.Text out_txt;
2887 algorithm
2888 3 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()));
2889 3 out_txt := lm_74(out_txt, a_patterns);
2890 3 out_txt := Tpl.popIter(out_txt);
2891 end dumpPatterns;
2892
2893 protected function lm_76
2894 input output Tpl.Text txt;
2895 input list<tuple<DAE.Pattern, String, DAE.Type>> items;
2896 algorithm
2897 ✗ for lstElt_76 in items loop
2898 txt := match lstElt_76
2899 local
2900 tuple<DAE.Pattern, String, DAE.Type> i_pat;
2901
2902 case i_pat
2903 algorithm
2904 ✗ txt := dumpNamedPattern(txt, i_pat);
2905 ✗ txt := Tpl.nextIter(txt);
2906 then txt;
2907 end match;
2908 end for;
2909 end lm_76;
2910
2911 public function dumpPattern
2912 input Tpl.Text in_txt;
2913 input DAE.Pattern in_a_pattern;
2914
2915 output Tpl.Text out_txt;
2916 algorithm
2917 out_txt :=
2918 match(in_txt, in_a_pattern)
2919 local
2920 Tpl.Text txt;
2921 DAE.Exp i_exp;
2922 DAE.Pattern i_tail;
2923 DAE.Pattern i_head;
2924 list<tuple<DAE.Pattern, String, DAE.Type>> i_patterns_1;
2925 Absyn.Path i_name;
2926 list<DAE.Pattern> i_patterns;
2927 DAE.Pattern i_pat;
2928 String i_id;
2929 Tpl.Text l_pat__str;
2930 Tpl.Text l_name__str;
2931
2932 case ( txt,
2933 DAE.PAT_WILD() )
2934 algorithm
2935 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
2936 then txt;
2937
2938 case ( txt,
2939 DAE.PAT_AS(pat = DAE.PAT_WILD(), id = i_id) )
2940 algorithm
2941 ✗ txt := Tpl.writeStr(txt, i_id);
2942 then txt;
2943
2944 case ( txt,
2945 DAE.PAT_AS_FUNC_PTR(pat = DAE.PAT_WILD(), id = i_id) )
2946 algorithm
2947 ✗ txt := Tpl.writeStr(txt, i_id);
2948 then txt;
2949
2950 case ( txt,
2951 DAE.PAT_SOME(pat = i_pat) )
2952 algorithm
2953 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("SOME("));
2954 ✗ txt := dumpPattern(txt, i_pat);
2955 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2956 then txt;
2957
2958 case ( txt,
2959 DAE.PAT_META_TUPLE(patterns = i_patterns) )
2960 algorithm
2961 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2962 ✗ txt := dumpPatterns(txt, i_patterns);
2963 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2964 then txt;
2965
2966 case ( txt,
2967 DAE.PAT_CALL_TUPLE(patterns = i_patterns) )
2968 algorithm
2969 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2970 ✗ txt := dumpPatterns(txt, i_patterns);
2971 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2972 then txt;
2973
2974 case ( txt,
2975 DAE.PAT_CALL(name = i_name, patterns = i_patterns) )
2976 algorithm
2977 ✗ l_name__str := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_name);
2978 ✗ l_pat__str := dumpPatterns(Tpl.emptyTxt, i_patterns);
2979 ✗ txt := Tpl.writeText(txt, l_name__str);
2980 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2981 ✗ txt := Tpl.writeText(txt, l_pat__str);
2982 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2983 then txt;
2984
2985 case ( txt,
2986 DAE.PAT_CALL_NAMED(name = i_name, patterns = i_patterns_1) )
2987 algorithm
2988 ✗ l_name__str := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_name);
2989 ✗ l_pat__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()));
2990 ✗ l_pat__str := lm_76(l_pat__str, i_patterns_1);
2991 ✗ l_pat__str := Tpl.popIter(l_pat__str);
2992 ✗ txt := Tpl.writeText(txt, l_name__str);
2993 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2994 ✗ txt := Tpl.writeText(txt, l_pat__str);
2995 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2996 then txt;
2997
2998 case ( txt,
2999 DAE.PAT_CONS(head = i_head, tail = i_tail) )
3000 algorithm
3001 ✗ txt := dumpPattern(txt, i_head);
3002 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("::"));
3003 ✗ txt := dumpPattern(txt, i_tail);
3004 then txt;
3005
3006 case ( txt,
3007 DAE.PAT_CONSTANT(exp = i_exp) )
3008 algorithm
3009 2 txt := dumpExp(txt, i_exp, "\"");
3010 then txt;
3011
3012 case ( txt,
3013 DAE.PAT_AS(id = i_id, pat = i_pat) )
3014 algorithm
3015 ✗ txt := Tpl.writeStr(txt, i_id);
3016 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" as "));
3017 ✗ txt := dumpPattern(txt, i_pat);
3018 then txt;
3019
3020 case ( txt,
3021 DAE.PAT_AS_FUNC_PTR(id = i_id, pat = i_pat) )
3022 algorithm
3023 ✗ txt := Tpl.writeStr(txt, i_id);
3024 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" as "));
3025 ✗ txt := dumpPattern(txt, i_pat);
3026 then txt;
3027
3028 case ( txt,
3029 _ )
3030 algorithm
3031 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("*PATTERN*"));
3032 then txt;
3033 end match;
3034 end dumpPattern;
3035
3036 public function dumpNamedPattern
3037 input Tpl.Text in_txt;
3038 input tuple<DAE.Pattern, String, DAE.Type> in_a_pattern;
3039
3040 output Tpl.Text out_txt;
3041 algorithm
3042 out_txt :=
3043 match(in_txt, in_a_pattern)
3044 local
3045 Tpl.Text txt;
3046 DAE.Pattern i_pat;
3047 String i_id;
3048
3049 case ( txt,
3050 (i_pat, i_id, _) )
3051 algorithm
3052 ✗ txt := Tpl.writeStr(txt, i_id);
3053 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3054 ✗ txt := dumpPattern(txt, i_pat);
3055 then txt;
3056 end match;
3057 end dumpNamedPattern;
3058
3059 protected function fun_79
3060 input Tpl.Text in_txt;
3061 input Boolean in_a_scalar;
3062
3063 output Tpl.Text out_txt;
3064 algorithm
3065 out_txt :=
3066 match(in_txt, in_a_scalar)
3067 local
3068 Tpl.Text txt;
3069
3070 case ( txt,
3071 false )
3072 algorithm
3073 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* non-scalar */ "));
3074 then txt;
3075
3076 case ( txt,
3077 _ )
3078 algorithm
3079 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* scalar */ "));
3080 then txt;
3081 end match;
3082 end fun_79;
3083
3084 protected function fun_80
3085 input Tpl.Text in_txt;
3086 input Boolean in_mArg;
3087 input Boolean in_a_scalar;
3088
3089 output Tpl.Text out_txt;
3090 algorithm
3091 out_txt :=
3092 match(in_txt, in_mArg, in_a_scalar)
3093 local
3094 Tpl.Text txt;
3095 Boolean a_scalar;
3096
3097 case ( txt,
3098 false,
3099 _ )
3100 then txt;
3101
3102 case ( txt,
3103 _,
3104 a_scalar )
3105 algorithm
3106 ✗ txt := fun_79(txt, a_scalar);
3107 then txt;
3108 end match;
3109 end fun_80;
3110
3111 protected function lm_81
3112 input output Tpl.Text txt;
3113 input list<list<DAE.Exp>> items;
3114 input String a_stringDelimiter;
3115 algorithm
3116 ✗ for lstElt_81 in items loop
3117 txt := match lstElt_81
3118 local
3119 list<DAE.Exp> i_row;
3120
3121 case i_row
3122 algorithm
3123 ✗ txt := dumpExpList(txt, i_row, a_stringDelimiter, ", ");
3124 ✗ txt := Tpl.nextIter(txt);
3125 then txt;
3126 end match;
3127 end for;
3128 end lm_81;
3129
3130 protected function fun_82
3131 input Tpl.Text in_txt;
3132 input Boolean in_mArg;
3133 input DAE.Type in_a_ty;
3134
3135 output Tpl.Text out_txt;
3136 algorithm
3137 out_txt :=
3138 match(in_txt, in_mArg, in_a_ty)
3139 local
3140 Tpl.Text txt;
3141 DAE.Type a_ty;
3142 String ret_0;
3143
3144 case ( txt,
3145 false,
3146 _ )
3147 then txt;
3148
3149 case ( txt,
3150 _,
3151 a_ty )
3152 algorithm
3153 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("/* matrix "));
3154 ✗ ret_0 := TypesDump.unparseType(a_ty);
3155 ✗ txt := Tpl.writeStr(txt, ret_0);
3156 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" */ "));
3157 then txt;
3158 end match;
3159 end fun_82;
3160
3161 protected function fun_83
3162 input Tpl.Text in_txt;
3163 input Option<DAE.Exp> in_a_step;
3164 input DAE.Exp in_a_e;
3165
3166 output Tpl.Text out_txt;
3167 algorithm
3168 out_txt :=
3169 match(in_txt, in_a_step, in_a_e)
3170 local
3171 Tpl.Text txt;
3172 DAE.Exp a_e;
3173 DAE.Exp i_step;
3174
3175 case ( txt,
3176 SOME(i_step),
3177 a_e )
3178 algorithm
3179 ✗ txt := dumpOperand(txt, i_step, a_e, false);
3180 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
3181 then txt;
3182
3183 case ( txt,
3184 _,
3185 _ )
3186 then txt;
3187 end match;
3188 end fun_83;
3189
3190 protected function fun_84
3191 input Tpl.Text in_txt;
3192 input Boolean in_mArg;
3193
3194 output Tpl.Text out_txt;
3195 algorithm
3196 out_txt :=
3197 match(in_txt, in_mArg)
3198 local
3199 Tpl.Text txt;
3200
3201 case ( txt,
3202 true )
3203 then txt;
3204
3205 case ( txt,
3206 _ )
3207 algorithm
3208 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3209 then txt;
3210 end match;
3211 end fun_84;
3212
3213 protected function fun_85
3214 input Tpl.Text in_txt;
3215 input Boolean in_mArg;
3216
3217 output Tpl.Text out_txt;
3218 algorithm
3219 out_txt :=
3220 match(in_txt, in_mArg)
3221 local
3222 Tpl.Text txt;
3223
3224 case ( txt,
3225 true )
3226 then txt;
3227
3228 case ( txt,
3229 _ )
3230 algorithm
3231 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3232 then txt;
3233 end match;
3234 end fun_85;
3235
3236 protected function fun_86
3237 input Tpl.Text in_txt;
3238 input Boolean in_mArg;
3239
3240 output Tpl.Text out_txt;
3241 algorithm
3242 out_txt :=
3243 match(in_txt, in_mArg)
3244 local
3245 Tpl.Text txt;
3246
3247 case ( txt,
3248 true )
3249 then txt;
3250
3251 case ( txt,
3252 _ )
3253 algorithm
3254 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3255 then txt;
3256 end match;
3257 end fun_86;
3258
3259 protected function fun_87
3260 input Tpl.Text in_txt;
3261 input Boolean in_mArg;
3262
3263 output Tpl.Text out_txt;
3264 algorithm
3265 out_txt :=
3266 match(in_txt, in_mArg)
3267 local
3268 Tpl.Text txt;
3269
3270 case ( txt,
3271 true )
3272 then txt;
3273
3274 case ( txt,
3275 _ )
3276 algorithm
3277 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3278 then txt;
3279 end match;
3280 end fun_87;
3281
3282 protected function fun_88
3283 input Tpl.Text in_txt;
3284 input Option<DAE.Exp> in_a_sz;
3285 input String in_a_stringDelimiter;
3286
3287 output Tpl.Text out_txt;
3288 algorithm
3289 out_txt :=
3290 match(in_txt, in_a_sz, in_a_stringDelimiter)
3291 local
3292 Tpl.Text txt;
3293 String a_stringDelimiter;
3294 DAE.Exp i_dim;
3295
3296 case ( txt,
3297 SOME(i_dim),
3298 a_stringDelimiter )
3299 algorithm
3300 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
3301 ✗ txt := dumpExp(txt, i_dim, a_stringDelimiter);
3302 then txt;
3303
3304 case ( txt,
3305 _,
3306 _ )
3307 then txt;
3308 end match;
3309 end fun_88;
3310
3311 protected function lm_89
3312 input output Tpl.Text txt;
3313 input DAE.ReductionIterators items;
3314 input String a_stringDelimiter;
3315 algorithm
3316 ✗ for lstElt_89 in items loop
3317 txt := match lstElt_89
3318 local
3319 DAE.ReductionIterator i_it;
3320
3321 case i_it
3322 algorithm
3323 ✗ txt := dumpReductionIterator(txt, i_it, a_stringDelimiter);
3324 ✗ txt := Tpl.nextIter(txt);
3325 then txt;
3326 end match;
3327 end for;
3328 end lm_89;
3329
3330 protected function fun_90
3331 input Tpl.Text in_txt;
3332 input Absyn.ReductionIterType in_a_ri_iterType;
3333
3334 output Tpl.Text out_txt;
3335 algorithm
3336 out_txt :=
3337 match(in_txt, in_a_ri_iterType)
3338 local
3339 Tpl.Text txt;
3340
3341 case ( txt,
3342 Absyn.THREAD() )
3343 algorithm
3344 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("threaded "));
3345 then txt;
3346
3347 case ( txt,
3348 _ )
3349 then txt;
3350 end match;
3351 end fun_90;
3352
3353 protected function lm_91
3354 input output Tpl.Text txt;
3355 input list<DAE.MatchCase> items;
3356 algorithm
3357 ✗ for lstElt_91 in items loop
3358 txt := match lstElt_91
3359 local
3360 DAE.MatchCase i_c;
3361
3362 case i_c
3363 algorithm
3364 ✗ txt := dumpMatchCase(txt, i_c);
3365 ✗ txt := Tpl.nextIter(txt);
3366 then txt;
3367 end match;
3368 end for;
3369 end lm_91;
3370
3371 public function dumpExpCrefs
3372 input Tpl.Text in_txt;
3373 input DAE.Exp in_a_exp;
3374 input String in_a_stringDelimiter;
3375
3376 output Tpl.Text out_txt;
3377 algorithm
3378 out_txt :=
3379 match(in_txt, in_a_exp, in_a_stringDelimiter)
3380 local
3381 Tpl.Text txt;
3382 String a_stringDelimiter;
3383 DAE.Pattern i_pattern;
3384 list<DAE.MatchCase> i_cases;
3385 list<DAE.Exp> i_inputs;
3386 DAE.MatchType i_matchType;
3387 list<DAE.Exp> i_args;
3388 list<DAE.Exp> i_listExp;
3389 DAE.Exp i_cdr;
3390 DAE.Exp i_car;
3391 list<DAE.Exp> i_valList;
3392 Absyn.ReductionIterType i_ri_iterType;
3393 DAE.ReductionIterators i_iterators;
3394 DAE.Exp i_expr;
3395 String i_tyStr;
3396 String i_scope;
3397 DAE.ComponentRef i_name_1;
3398 Absyn.CodeNode i_code;
3399 Option<DAE.Exp> i_sz;
3400 Integer i_ix;
3401 list<DAE.Subscript> i_sub;
3402 list<DAE.Exp> i_PR;
3403 DAE.Exp i_stop;
3404 Option<DAE.Exp> i_step;
3405 DAE.Exp i_start;
3406 DAE.Type i_ty;
3407 list<list<DAE.Exp>> i_matrix;
3408 Boolean i_scalar;
3409 list<DAE.Exp> i_array;
3410 list<DAE.Exp> i_expList;
3411 Absyn.Path i_path;
3412 list<DAE.Exp> i_expLst;
3413 DAE.Exp i_expElse;
3414 DAE.Exp i_expThen;
3415 DAE.Exp i_expCond;
3416 DAE.Operator i_operator;
3417 DAE.Exp i_e;
3418 DAE.Exp i_exp;
3419 DAE.Exp i_exp2;
3420 DAE.Exp i_exp1;
3421 DAE.ComponentRef i_componentRef;
3422 Absyn.Path i_name;
3423 Tpl.Text l_case__str;
3424 Tpl.Text l_inputs__str;
3425 Tpl.Text l_match__ty;
3426 Tpl.Text l_args__str;
3427 Tpl.Text l_cdr__str;
3428 Tpl.Text l_car__str;
3429 Tpl.Text l_expl__str;
3430 Tpl.Text l_iter__str;
3431 Tpl.Text l_name__str;
3432 String ret_27;
3433 Tpl.Text l_code__str;
3434 Tpl.Text l_dim__str;
3435 Boolean ret_24;
3436 Boolean ret_23;
3437 Tpl.Text l_sub__str;
3438 Boolean ret_21;
3439 Tpl.Text l_rparen;
3440 Boolean ret_19;
3441 Tpl.Text l_lparen;
3442 Tpl.Text l_needs__paren;
3443 Tpl.Text l_tuple__str;
3444 Tpl.Text l_stop__str;
3445 Tpl.Text l_step__str;
3446 Tpl.Text l_start__str;
3447 Boolean ret_12;
3448 Tpl.Text l_mat__str;
3449 Boolean ret_10;
3450 Tpl.Text l_expl;
3451 Tpl.Text l_func__str;
3452 Tpl.Text l_argl;
3453 Tpl.Text l_else__str;
3454 Tpl.Text l_then__str;
3455 Tpl.Text l_cond__str;
3456 Tpl.Text l_op__str;
3457 Tpl.Text l_exp__str;
3458 Tpl.Text l_rhs__str;
3459 Tpl.Text l_lhs__str;
3460
3461 case ( txt,
3462 DAE.ICONST(integer = _),
3463 _ )
3464 then txt;
3465
3466 case ( txt,
3467 DAE.RCONST(real = _),
3468 _ )
3469 then txt;
3470
3471 case ( txt,
3472 DAE.SCONST(string = _),
3473 _ )
3474 then txt;
3475
3476 case ( txt,
3477 DAE.BCONST(bool = _),
3478 _ )
3479 then txt;
3480
3481 case ( txt,
3482 DAE.ENUM_LITERAL(name = i_name),
3483 _ )
3484 algorithm
3485 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_name);
3486 then txt;
3487
3488 case ( txt,
3489 DAE.CREF(componentRef = i_componentRef),
3490 _ )
3491 algorithm
3492 ✗ txt := dumpCref(txt, i_componentRef);
3493 then txt;
3494
3495 case ( txt,
3496 DAE.BINARY(exp1 = i_exp1, exp2 = i_exp2),
3497 a_stringDelimiter )
3498 algorithm
3499 ✗ l_lhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp1, a_stringDelimiter);
3500 ✗ l_rhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp2, a_stringDelimiter);
3501 ✗ txt := Tpl.writeText(txt, l_lhs__str);
3502 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3503 ✗ txt := Tpl.writeText(txt, l_rhs__str);
3504 then txt;
3505
3506 case ( txt,
3507 (i_e as DAE.UNARY(exp = i_exp, operator = i_operator)),
3508 _ )
3509 algorithm
3510 ✗ l_exp__str := dumpOperand(Tpl.emptyTxt, i_exp, i_e, false);
3511 ✗ l_op__str := dumpUnaryOp(Tpl.emptyTxt, i_operator);
3512 ✗ txt := Tpl.writeText(txt, l_op__str);
3513 ✗ txt := Tpl.writeText(txt, l_exp__str);
3514 then txt;
3515
3516 case ( txt,
3517 DAE.LBINARY(exp1 = i_exp1, exp2 = i_exp2),
3518 a_stringDelimiter )
3519 algorithm
3520 ✗ l_lhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp1, a_stringDelimiter);
3521 ✗ l_rhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp2, a_stringDelimiter);
3522 ✗ txt := Tpl.writeText(txt, l_lhs__str);
3523 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3524 ✗ txt := Tpl.writeText(txt, l_rhs__str);
3525 then txt;
3526
3527 case ( txt,
3528 DAE.LUNARY(exp = i_exp),
3529 a_stringDelimiter )
3530 algorithm
3531 ✗ l_lhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp, a_stringDelimiter);
3532 ✗ txt := Tpl.writeText(txt, l_lhs__str);
3533 then txt;
3534
3535 case ( txt,
3536 DAE.RELATION(exp1 = i_exp1, exp2 = i_exp2),
3537 a_stringDelimiter )
3538 algorithm
3539 ✗ l_lhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp1, a_stringDelimiter);
3540 ✗ l_rhs__str := dumpExpCrefs(Tpl.emptyTxt, i_exp2, a_stringDelimiter);
3541 ✗ txt := Tpl.writeText(txt, l_lhs__str);
3542 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3543 ✗ txt := Tpl.writeText(txt, l_rhs__str);
3544 then txt;
3545
3546 case ( txt,
3547 DAE.IFEXP(expCond = i_expCond, expThen = i_expThen, expElse = i_expElse),
3548 a_stringDelimiter )
3549 algorithm
3550 ✗ l_cond__str := dumpExpCrefs(Tpl.emptyTxt, i_expCond, a_stringDelimiter);
3551 ✗ l_then__str := dumpExpCrefs(Tpl.emptyTxt, i_expThen, a_stringDelimiter);
3552 ✗ l_else__str := dumpExpCrefs(Tpl.emptyTxt, i_expElse, a_stringDelimiter);
3553 ✗ txt := Tpl.writeText(txt, l_cond__str);
3554 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3555 ✗ txt := Tpl.writeText(txt, l_then__str);
3556 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
3557 ✗ txt := Tpl.writeText(txt, l_else__str);
3558 then txt;
3559
3560 case ( txt,
3561 DAE.CALL(attr = DAE.CALL_ATTR(builtin = true), expLst = i_expLst),
3562 a_stringDelimiter )
3563 algorithm
3564 ✗ l_argl := dumpExpListCrefs(Tpl.emptyTxt, i_expLst, a_stringDelimiter, " ");
3565 ✗ txt := Tpl.writeText(txt, l_argl);
3566 then txt;
3567
3568 case ( txt,
3569 DAE.CALL(expLst = i_expLst),
3570 a_stringDelimiter )
3571 algorithm
3572 ✗ l_argl := dumpExpListCrefs(Tpl.emptyTxt, i_expLst, a_stringDelimiter, " ");
3573 ✗ txt := Tpl.writeText(txt, l_argl);
3574 then txt;
3575
3576 case ( txt,
3577 DAE.PARTEVALFUNCTION(path = i_path, expList = i_expList),
3578 a_stringDelimiter )
3579 algorithm
3580 ✗ l_func__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
3581 ✗ l_argl := dumpExpList(Tpl.emptyTxt, i_expList, a_stringDelimiter, ", ");
3582 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
3583 ✗ txt := Tpl.writeText(txt, l_func__str);
3584 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3585 ✗ txt := Tpl.writeText(txt, l_argl);
3586 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3587 then txt;
3588
3589 case ( txt,
3590 DAE.ARRAY(array = i_array, scalar = i_scalar),
3591 a_stringDelimiter )
3592 algorithm
3593 ✗ l_expl := dumpExpList(Tpl.emptyTxt, i_array, a_stringDelimiter, ", ");
3594 ✗ ret_10 := Config.typeinfo();
3595 ✗ txt := fun_80(txt, ret_10, i_scalar);
3596 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{"));
3597 ✗ txt := Tpl.writeText(txt, l_expl);
3598 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}"));
3599 then txt;
3600
3601 case ( txt,
3602 DAE.MATRIX(matrix = i_matrix, ty = i_ty),
3603 a_stringDelimiter )
3604 algorithm
3605 ✗ l_mat__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()));
3606 ✗ l_mat__str := lm_81(l_mat__str, i_matrix, a_stringDelimiter);
3607 ✗ l_mat__str := Tpl.popIter(l_mat__str);
3608 ✗ ret_12 := Config.typeinfo();
3609 ✗ txt := fun_82(txt, ret_12, i_ty);
3610 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("{{"));
3611 ✗ txt := Tpl.writeText(txt, l_mat__str);
3612 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("}}"));
3613 then txt;
3614
3615 case ( txt,
3616 (i_e as DAE.RANGE(start = i_start, step = i_step, stop = i_stop)),
3617 _ )
3618 algorithm
3619 ✗ l_start__str := dumpOperand(Tpl.emptyTxt, i_start, i_e, false);
3620 ✗ l_step__str := fun_83(Tpl.emptyTxt, i_step, i_e);
3621 ✗ l_stop__str := dumpOperand(Tpl.emptyTxt, i_stop, i_e, false);
3622 ✗ txt := Tpl.writeText(txt, l_start__str);
3623 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
3624 ✗ txt := Tpl.writeText(txt, l_step__str);
3625 ✗ txt := Tpl.writeText(txt, l_stop__str);
3626 then txt;
3627
3628 case ( txt,
3629 DAE.TUPLE(PR = {}),
3630 _ )
3631 then txt;
3632
3633 case ( txt,
3634 DAE.TUPLE(PR = i_PR),
3635 a_stringDelimiter )
3636 algorithm
3637 ✗ l_tuple__str := dumpExpList(Tpl.emptyTxt, i_PR, a_stringDelimiter, ", ");
3638 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3639 ✗ txt := Tpl.writeText(txt, l_tuple__str);
3640 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3641 then txt;
3642
3643 case ( txt,
3644 DAE.CAST(exp = i_exp),
3645 a_stringDelimiter )
3646 algorithm
3647 ✗ l_exp__str := dumpExpCrefs(Tpl.emptyTxt, i_exp, a_stringDelimiter);
3648 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3649 ✗ txt := Tpl.writeText(txt, l_exp__str);
3650 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3651 then txt;
3652
3653 case ( txt,
3654 DAE.ASUB(exp = i_exp, sub = i_sub),
3655 a_stringDelimiter )
3656 algorithm
3657 ✗ l_needs__paren := parenthesizeSubExp(Tpl.emptyTxt, i_exp);
3658 ✗ ret_19 := Tpl.isEmpty(l_needs__paren);
3659 ✗ l_lparen := fun_84(Tpl.emptyTxt, ret_19);
3660 ✗ ret_21 := Tpl.isEmpty(l_needs__paren);
3661 ✗ l_rparen := fun_85(Tpl.emptyTxt, ret_21);
3662 ✗ l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
3663 ✗ l_sub__str := dumpSubscripts(Tpl.emptyTxt, i_sub);
3664 ✗ txt := Tpl.writeText(txt, l_lparen);
3665 ✗ txt := Tpl.writeText(txt, l_exp__str);
3666 ✗ txt := Tpl.writeText(txt, l_rparen);
3667 ✗ txt := Tpl.writeText(txt, l_sub__str);
3668 then txt;
3669
3670 case ( txt,
3671 DAE.TSUB(exp = i_exp, ix = i_ix),
3672 a_stringDelimiter )
3673 algorithm
3674 ✗ l_needs__paren := parenthesizeSubExp(Tpl.emptyTxt, i_exp);
3675 ✗ ret_23 := Tpl.isEmpty(l_needs__paren);
3676 ✗ l_lparen := fun_86(Tpl.emptyTxt, ret_23);
3677 ✗ ret_24 := Tpl.isEmpty(l_needs__paren);
3678 ✗ l_rparen := fun_87(Tpl.emptyTxt, ret_24);
3679 ✗ l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
3680 ✗ txt := Tpl.writeText(txt, l_lparen);
3681 ✗ txt := Tpl.writeText(txt, l_exp__str);
3682 ✗ txt := Tpl.writeText(txt, l_rparen);
3683 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
3684 ✗ txt := Tpl.writeStr(txt, intString(i_ix));
3685 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
3686 then txt;
3687
3688 case ( txt,
3689 DAE.SIZE(exp = i_exp, sz = i_sz),
3690 a_stringDelimiter )
3691 algorithm
3692 ✗ l_exp__str := dumpExp(Tpl.emptyTxt, i_exp, a_stringDelimiter);
3693 ✗ l_dim__str := fun_88(Tpl.emptyTxt, i_sz, a_stringDelimiter);
3694 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("size("));
3695 ✗ txt := Tpl.writeText(txt, l_exp__str);
3696 ✗ txt := Tpl.writeText(txt, l_dim__str);
3697 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3698 then txt;
3699
3700 case ( txt,
3701 DAE.CODE(code = i_code),
3702 _ )
3703 algorithm
3704 ✗ ret_27 := Dump.printCodeStr(i_code);
3705 ✗ l_code__str := Tpl.writeStr(Tpl.emptyTxt, ret_27);
3706 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("$Code("));
3707 ✗ txt := Tpl.writeText(txt, l_code__str);
3708 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3709 then txt;
3710
3711 case ( txt,
3712 DAE.EMPTY(name = i_name_1, scope = i_scope, tyStr = i_tyStr),
3713 _ )
3714 algorithm
3715 ✗ l_name__str := dumpCref(Tpl.emptyTxt, i_name_1);
3716 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("<EMPTY(scope: "));
3717 ✗ txt := Tpl.writeStr(txt, i_scope);
3718 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", name: "));
3719 ✗ txt := Tpl.writeText(txt, l_name__str);
3720 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", ty: "));
3721 ✗ txt := Tpl.writeStr(txt, i_tyStr);
3722 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")>"));
3723 then txt;
3724
3725 case ( txt,
3726 DAE.REDUCTION(reductionInfo = DAE.REDUCTIONINFO(path = i_name, iterType = i_ri_iterType), expr = i_expr, iterators = i_iterators),
3727 a_stringDelimiter )
3728 algorithm
3729 ✗ l_name__str := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_name);
3730 ✗ l_exp__str := dumpExp(Tpl.emptyTxt, i_expr, a_stringDelimiter);
3731 ✗ 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()));
3732 ✗ l_iter__str := lm_89(l_iter__str, i_iterators, a_stringDelimiter);
3733 ✗ l_iter__str := Tpl.popIter(l_iter__str);
3734 ✗ txt := Tpl.writeText(txt, l_name__str);
3735 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3736 ✗ txt := Tpl.writeText(txt, l_exp__str);
3737 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" for "));
3738 ✗ txt := fun_90(txt, i_ri_iterType);
3739 ✗ txt := Tpl.writeText(txt, l_iter__str);
3740 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3741 then txt;
3742
3743 case ( txt,
3744 DAE.LIST(valList = i_valList),
3745 a_stringDelimiter )
3746 algorithm
3747 ✗ l_expl__str := dumpExpList(Tpl.emptyTxt, i_valList, a_stringDelimiter, ", ");
3748 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("List("));
3749 ✗ txt := Tpl.writeText(txt, l_expl__str);
3750 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3751 then txt;
3752
3753 case ( txt,
3754 DAE.CONS(car = i_car, cdr = i_cdr),
3755 a_stringDelimiter )
3756 algorithm
3757 ✗ l_car__str := dumpExp(Tpl.emptyTxt, i_car, a_stringDelimiter);
3758 ✗ l_cdr__str := dumpExp(Tpl.emptyTxt, i_cdr, a_stringDelimiter);
3759 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("listCons("));
3760 ✗ txt := Tpl.writeText(txt, l_car__str);
3761 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
3762 ✗ txt := Tpl.writeText(txt, l_cdr__str);
3763 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3764 then txt;
3765
3766 case ( txt,
3767 DAE.META_TUPLE(listExp = i_listExp),
3768 a_stringDelimiter )
3769 algorithm
3770 ✗ l_tuple__str := dumpExpList(Tpl.emptyTxt, i_listExp, a_stringDelimiter, ", ");
3771 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Tuple("));
3772 ✗ txt := Tpl.writeText(txt, l_tuple__str);
3773 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3774 then txt;
3775
3776 case ( txt,
3777 DAE.META_OPTION(exp = SOME(i_exp)),
3778 a_stringDelimiter )
3779 algorithm
3780 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("SOME("));
3781 ✗ txt := dumpExp(txt, i_exp, a_stringDelimiter);
3782 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3783 then txt;
3784
3785 case ( txt,
3786 DAE.META_OPTION(exp = _),
3787 _ )
3788 algorithm
3789 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("NONE()"));
3790 then txt;
3791
3792 case ( txt,
3793 DAE.METARECORDCALL(path = i_path, args = i_args),
3794 a_stringDelimiter )
3795 algorithm
3796 ✗ l_name__str := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_path);
3797 ✗ l_args__str := dumpExpList(Tpl.emptyTxt, i_args, a_stringDelimiter, ", ");
3798 ✗ txt := Tpl.writeText(txt, l_name__str);
3799 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3800 ✗ txt := Tpl.writeText(txt, l_args__str);
3801 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3802 then txt;
3803
3804 case ( txt,
3805 DAE.MATCHEXPRESSION(matchType = i_matchType, inputs = i_inputs, cases = i_cases),
3806 a_stringDelimiter )
3807 algorithm
3808 ✗ l_match__ty := dumpMatchType(Tpl.emptyTxt, i_matchType);
3809 ✗ l_inputs__str := dumpExpList(Tpl.emptyTxt, i_inputs, a_stringDelimiter, ", ");
3810 ✗ l_case__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()));
3811 ✗ l_case__str := lm_91(l_case__str, i_cases);
3812 ✗ l_case__str := Tpl.popIter(l_case__str);
3813 ✗ txt := Tpl.writeText(txt, l_match__ty);
3814 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" ("));
3815 ✗ txt := Tpl.writeText(txt, l_inputs__str);
3816 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE(")\n"));
3817 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(4));
3818 ✗ txt := Tpl.writeText(txt, l_case__str);
3819 ✗ txt := Tpl.softNewLine(txt);
3820 ✗ txt := Tpl.popBlock(txt);
3821 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
3822 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
3823 ✗ txt := Tpl.writeText(txt, l_match__ty);
3824 ✗ txt := Tpl.popBlock(txt);
3825 then txt;
3826
3827 case ( txt,
3828 DAE.BOX(exp = i_exp),
3829 a_stringDelimiter )
3830 algorithm
3831 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#("));
3832 ✗ txt := dumpExp(txt, i_exp, a_stringDelimiter);
3833 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3834 then txt;
3835
3836 case ( txt,
3837 DAE.UNBOX(exp = i_exp),
3838 a_stringDelimiter )
3839 algorithm
3840 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("unbox("));
3841 ✗ txt := dumpExp(txt, i_exp, a_stringDelimiter);
3842 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3843 then txt;
3844
3845 case ( txt,
3846 DAE.SHARED_LITERAL(exp = i_exp),
3847 a_stringDelimiter )
3848 algorithm
3849 ✗ txt := dumpExpCrefs(txt, i_exp, a_stringDelimiter);
3850 then txt;
3851
3852 case ( txt,
3853 DAE.PATTERN(pattern = i_pattern),
3854 _ )
3855 algorithm
3856 ✗ txt := dumpPattern(txt, i_pattern);
3857 then txt;
3858
3859 case ( txt,
3860 _,
3861 _ )
3862 algorithm
3863 ✗ txt := errorMsg(txt, "ExpressionDumpTpl.dumpExp: Unknown expression.");
3864 then txt;
3865 end match;
3866 end dumpExpCrefs;
3867
3868 public function errorMsg
3869 input Tpl.Text txt;
3870 input String a_errMessage;
3871
3872 output Tpl.Text out_txt;
3873 algorithm
3874 ✗ Tpl.addTemplateError(a_errMessage);
3875 ✗ out_txt := Tpl.writeStr(txt, a_errMessage);
3876 end errorMsg;
3877
3878 protected function fun_94
3879 input Tpl.Text in_txt;
3880 input DAE.Constraint in_a_con;
3881
3882 output Tpl.Text out_txt;
3883 algorithm
3884 out_txt :=
3885 match(in_txt, in_a_con)
3886 local
3887 Tpl.Text txt;
3888 DAE.Exp i_c;
3889
3890 case ( txt,
3891 DAE.CONSTRAINT_DT(constraint = i_c, localCon = true) )
3892 algorithm
3893 3 txt := dumpExp(txt, i_c, "\"");
3894 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" (local)"));
3895 then txt;
3896
3897 case ( txt,
3898 DAE.CONSTRAINT_DT(constraint = i_c, localCon = false) )
3899 algorithm
3900 1 txt := dumpExp(txt, i_c, "\"");
3901 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" (global)"));
3902 then txt;
3903
3904 case ( txt,
3905 _ )
3906 then txt;
3907 end match;
3908 end fun_94;
3909
3910 protected function lm_95
3911 input output Tpl.Text txt;
3912 input list<DAE.Constraint> items;
3913 algorithm
3914
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 4 times.
8 for lstElt_95 in items loop
3915 txt := match lstElt_95
3916 local
3917 DAE.Constraint i_con;
3918
3919 case i_con
3920 algorithm
3921 4 txt := fun_94(txt, i_con);
3922 4 txt := Tpl.nextIter(txt);
3923 then txt;
3924 end match;
3925 end for;
3926 end lm_95;
3927
3928 public function dumpConstraints
3929 input Tpl.Text txt;
3930 input list<DAE.Constraint> a_cons;
3931
3932 output Tpl.Text out_txt;
3933 algorithm
3934 4 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()));
3935 4 out_txt := lm_95(out_txt, a_cons);
3936 4 out_txt := Tpl.popIter(out_txt);
3937 end dumpConstraints;
3938
3939 annotation(__OpenModelica_Interface="frontend_dump");
3940 end ExpressionDumpTpl;
3941