Linux GNU 11.4.0 Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 87.7% 1084 / 0 / 1236
Functions: -% 0 / 1 / 1
Branches: 91.0% 71 / 0 / 78

build_cmake/OMCompiler/Compiler/generated-mo/Template/DAEDumpTpl.mo
Line Branch Exec Source
1 encapsulated package DAEDumpTpl
2 "
3 file: DAEDumpTpl.mo
4 package: DAEDumpTpl
5 description: Generated by Susan.
6 "
7
8 public import Tpl;
9
10 public import ExpressionDumpTpl;
11 public import ClassInfUtil;
12 public import ClassInf;
13 public import Config;
14 protected import Absyn;
15 protected import SCode;
16 public import DAEDumpTypes;
17 public import DAE;
18 public import SCodeDump;
19 public import System;
20 public import Flags;
21 protected import AbsynDumpTpl;
22 protected import SCodeDumpTpl;
23
24 protected function lm_14
25 input output Tpl.Text txt;
26 input list<DAEDumpTypes.compWithSplitElements> items;
27 algorithm
28
2/2
✓ Branch 0 taken 1026 times.
✓ Branch 1 taken 1026 times.
2052 for lstElt_14 in items loop
29 txt := match lstElt_14
30 local
31 DAEDumpTypes.compWithSplitElements i_dae;
32
33 case i_dae
34 algorithm
35 1026 txt := dumpComp(txt, i_dae);
36 1026 txt := Tpl.nextIter(txt);
37 then txt;
38 end match;
39 end for;
40 end lm_14;
41
42 protected function fun_15
43 input Tpl.Text in_txt;
44 input DAEDumpTypes.functionList in_a_funLists;
45
46 output Tpl.Text out_txt;
47 algorithm
48 out_txt :=
49 match(in_txt, in_a_funLists)
50 local
51 Tpl.Text txt;
52 list<DAE.Function> i_funcs;
53
54 case ( txt,
55 DAEDumpTypes.FUNCTION_LIST(funcs = i_funcs) )
56 algorithm
57 1026 txt := dumpFunctions(txt, i_funcs);
58 then txt;
59
60 case ( txt,
61 _ )
62 then txt;
63 end match;
64 end fun_15;
65
66 protected function fun_16
67 input Tpl.Text in_txt;
68 input Boolean in_mArg;
69 input Tpl.Text in_a_fun__str;
70 input Tpl.Text in_a_comp__str;
71
72 output Tpl.Text out_txt;
73 algorithm
74 out_txt :=
75 match(in_txt, in_mArg, in_a_fun__str, in_a_comp__str)
76 local
77 Tpl.Text txt;
78 Tpl.Text a_fun__str;
79 Tpl.Text a_comp__str;
80
81 case ( txt,
82 true,
83 _,
84 a_comp__str )
85 algorithm
86 822 txt := Tpl.writeText(txt, a_comp__str);
87 then txt;
88
89 case ( txt,
90 _,
91 a_fun__str,
92 a_comp__str )
93 algorithm
94 204 txt := Tpl.writeText(txt, a_fun__str);
95 204 txt := Tpl.writeTok(txt, Tpl.ST_STRING_LIST({
96 "\n",
97 "\n"
98 }, true));
99 204 txt := Tpl.softNewLine(txt);
100 204 txt := Tpl.writeText(txt, a_comp__str);
101 then txt;
102 end match;
103 end fun_16;
104
105 public function dumpDAE
106 input Tpl.Text txt;
107 input list<DAEDumpTypes.compWithSplitElements> a_fixedDaeList;
108 input DAEDumpTypes.functionList a_funLists;
109
110 output Tpl.Text out_txt;
111 protected
112 Boolean ret_2;
113 Tpl.Text l_fun__str;
114 Tpl.Text l_comp__str;
115 algorithm
116 1026 l_comp__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()));
117 1026 l_comp__str := lm_14(l_comp__str, a_fixedDaeList);
118 1026 l_comp__str := Tpl.popIter(l_comp__str);
119 1026 l_fun__str := fun_15(Tpl.emptyTxt, a_funLists);
120 1026 ret_2 := Tpl.isEmpty(l_fun__str);
121 1026 out_txt := fun_16(txt, ret_2, l_fun__str, l_comp__str);
122 end dumpDAE;
123
124 protected function fun_18
125 input Tpl.Text in_txt;
126 input Boolean in_mArg;
127 input String in_a_name;
128
129 output Tpl.Text out_txt;
130 algorithm
131 out_txt :=
132 match(in_txt, in_mArg, in_a_name)
133 local
134 Tpl.Text txt;
135 String a_name;
136 String ret_0;
137
138 case ( txt,
139 false,
140 a_name )
141 algorithm
142 1026 txt := Tpl.writeStr(txt, a_name);
143 then txt;
144
145 case ( txt,
146 _,
147 a_name )
148 algorithm
149 ✗ ret_0 := System.stringReplace(a_name, ".", "__");
150 ✗ txt := Tpl.writeStr(txt, ret_0);
151 then txt;
152 end match;
153 end fun_18;
154
155 protected function fun_19
156 input Tpl.Text in_txt;
157 input Boolean in_mArg;
158
159 output Tpl.Text out_txt;
160 algorithm
161 out_txt :=
162 match(in_txt, in_mArg)
163 local
164 Tpl.Text txt;
165
166 case ( txt,
167 true )
168 then txt;
169
170 case ( txt,
171 _ )
172 algorithm
173 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
174 then txt;
175 end match;
176 end fun_19;
177
178 public function dumpComp
179 input Tpl.Text in_txt;
180 input DAEDumpTypes.compWithSplitElements in_a_fixedDae;
181
182 output Tpl.Text out_txt;
183 algorithm
184 out_txt :=
185 match(in_txt, in_a_fixedDae)
186 local
187 Tpl.Text txt;
188 DAEDumpTypes.splitElements i_spltElems;
189 String i_name;
190 Option<SCode.Comment> i_comment;
191 Boolean ret_4;
192 Boolean ret_3;
193 Tpl.Text l_name__rep;
194 Tpl.Text l_ann__str;
195 Tpl.Text l_cmt__str;
196
197 case ( txt,
198 DAEDumpTypes.COMP_WITH_SPLIT(comment = i_comment, name = i_name, spltElems = i_spltElems) )
199 algorithm
200 1026 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
201 1026 l_ann__str := dumpClassAnnotation(Tpl.emptyTxt, i_comment);
202 1026 ret_3 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
203 1026 l_name__rep := fun_18(Tpl.emptyTxt, ret_3, i_name);
204 1026 txt := Tpl.writeTok(txt, Tpl.ST_STRING("class "));
205 1026 txt := Tpl.writeText(txt, l_name__rep);
206 1026 txt := Tpl.writeText(txt, l_cmt__str);
207 1026 txt := Tpl.softNewLine(txt);
208 1026 txt := dumpCompStream(txt, i_spltElems);
209 1026 txt := Tpl.softNewLine(txt);
210 1026 ret_4 := Tpl.isEmpty(l_ann__str);
211 1026 txt := fun_19(txt, ret_4);
212 1026 txt := Tpl.writeText(txt, l_ann__str);
213 1026 txt := Tpl.softNewLine(txt);
214 1026 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
215 1026 txt := Tpl.writeText(txt, l_name__rep);
216 1026 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
217 1026 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
218 then txt;
219
220 case ( txt,
221 _ )
222 then txt;
223 end match;
224 end dumpComp;
225
226 protected function lm_21
227 input output Tpl.Text txt;
228 input list<DAEDumpTypes.compWithSplitElements> items;
229 algorithm
230
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1029 times.
1032 for lstElt_21 in items loop
231 txt := match lstElt_21
232 local
233 DAEDumpTypes.compWithSplitElements i_flatSM;
234
235 case i_flatSM
236 algorithm
237 3 txt := dumpStateMachineSection(txt, i_flatSM);
238 3 txt := Tpl.nextIter(txt);
239 then txt;
240 end match;
241 end for;
242 end lm_21;
243
244 public function dumpCompStream
245 input Tpl.Text in_txt;
246 input DAEDumpTypes.splitElements in_a_elems;
247
248 output Tpl.Text out_txt;
249 algorithm
250 out_txt :=
251 match(in_txt, in_a_elems)
252 local
253 Tpl.Text txt;
254 list<DAEDumpTypes.compWithSplitElements> i_sm;
255 list<DAE.Element> i_a;
256 list<DAE.Element> i_e;
257 list<DAE.Element> i_ia;
258 list<DAE.Element> i_ie;
259 list<DAE.Element> i_v;
260 Tpl.Text l_sm__str;
261 Tpl.Text l_al__str;
262 Tpl.Text l_eq__str;
263 Tpl.Text l_ial__str;
264 Tpl.Text l_ieq__str;
265 Tpl.Text l_var__str;
266
267 case ( txt,
268 DAEDumpTypes.SPLIT_ELEMENTS(v = i_v, ie = i_ie, ia = i_ia, e = i_e, a = i_a, sm = i_sm) )
269 algorithm
270 1029 l_var__str := dumpVars(Tpl.emptyTxt, i_v);
271 1029 l_ieq__str := dumpInitialEquationSection(Tpl.emptyTxt, i_ie);
272 1029 l_ial__str := dumpInitialAlgorithmSection(Tpl.emptyTxt, i_ia);
273 1029 l_eq__str := dumpEquationSection(Tpl.emptyTxt, i_e);
274 1029 l_al__str := dumpAlgorithmSection(Tpl.emptyTxt, i_a);
275 1029 l_sm__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()));
276 1029 l_sm__str := lm_21(l_sm__str, i_sm);
277 1029 l_sm__str := Tpl.popIter(l_sm__str);
278 1029 txt := Tpl.writeText(txt, l_var__str);
279 1029 txt := Tpl.softNewLine(txt);
280 1029 txt := Tpl.writeText(txt, l_sm__str);
281 1029 txt := Tpl.softNewLine(txt);
282 1029 txt := Tpl.writeText(txt, l_ieq__str);
283 1029 txt := Tpl.softNewLine(txt);
284 1029 txt := Tpl.writeText(txt, l_ial__str);
285 1029 txt := Tpl.softNewLine(txt);
286 1029 txt := Tpl.writeText(txt, l_eq__str);
287 1029 txt := Tpl.softNewLine(txt);
288 1029 txt := Tpl.writeText(txt, l_al__str);
289 then txt;
290
291 case ( txt,
292 _ )
293 then txt;
294 end match;
295 end dumpCompStream;
296
297 protected function lm_23
298 input output Tpl.Text txt;
299 input list<DAE.Function> items;
300 algorithm
301
2/2
✓ Branch 0 taken 636 times.
✓ Branch 1 taken 1026 times.
1662 for lstElt_23 in items loop
302 txt := match lstElt_23
303 local
304 DAE.Function i_func;
305
306 case i_func
307 algorithm
308 636 txt := dumpFunction(txt, i_func);
309 636 txt := Tpl.nextIter(txt);
310 then txt;
311 end match;
312 end for;
313 end lm_23;
314
315 public function dumpFunctions
316 input Tpl.Text txt;
317 input list<DAE.Function> a_funcs;
318
319 output Tpl.Text out_txt;
320 algorithm
321 1026 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING_LIST({
322 "\n",
323 "\n"
324 }, true)), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
325 1026 out_txt := lm_23(out_txt, a_funcs);
326 1026 out_txt := Tpl.popIter(out_txt);
327 end dumpFunctions;
328
329 protected function fun_25
330 input Tpl.Text in_txt;
331 input Boolean in_a_isImpure;
332
333 output Tpl.Text out_txt;
334 algorithm
335 out_txt :=
336 match(in_txt, in_a_isImpure)
337 local
338 Tpl.Text txt;
339
340 case ( txt,
341 false )
342 then txt;
343
344 case ( txt,
345 _ )
346 algorithm
347 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("impure "));
348 then txt;
349 end match;
350 end fun_25;
351
352 protected function fun_26
353 input Tpl.Text in_txt;
354 input Boolean in_mArg;
355
356 output Tpl.Text out_txt;
357 algorithm
358 out_txt :=
359 match(in_txt, in_mArg)
360 local
361 Tpl.Text txt;
362
363 case ( txt,
364 true )
365 then txt;
366
367 case ( txt,
368 _ )
369 algorithm
370 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
371 then txt;
372 end match;
373 end fun_26;
374
375 protected function fun_27
376 input Tpl.Text in_txt;
377 input Boolean in_a_isImpure;
378
379 output Tpl.Text out_txt;
380 algorithm
381 out_txt :=
382 match(in_txt, in_a_isImpure)
383 local
384 Tpl.Text txt;
385
386 case ( txt,
387 false )
388 then txt;
389
390 case ( txt,
391 _ )
392 algorithm
393 20 txt := Tpl.writeTok(txt, Tpl.ST_STRING("impure "));
394 then txt;
395 end match;
396 end fun_27;
397
398 protected function fun_28
399 input Tpl.Text in_txt;
400 input Boolean in_mArg;
401
402 output Tpl.Text out_txt;
403 algorithm
404 out_txt :=
405 match(in_txt, in_mArg)
406 local
407 Tpl.Text txt;
408
409 case ( txt,
410 true )
411 then txt;
412
413 case ( txt,
414 _ )
415 algorithm
416 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
417 then txt;
418 end match;
419 end fun_28;
420
421 protected function fun_29
422 input Tpl.Text in_txt;
423 input Boolean in_mArg;
424 input DAE.Type in_a_type__;
425 input Absyn.Path in_a_path;
426
427 output Tpl.Text out_txt;
428 algorithm
429 out_txt :=
430 match(in_txt, in_mArg, in_a_type__, in_a_path)
431 local
432 Tpl.Text txt;
433 DAE.Type a_type__;
434 Absyn.Path a_path;
435
436 case ( txt,
437 false,
438 a_type__,
439 a_path )
440 algorithm
441 141 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
442 141 txt := AbsynDumpTpl.dumpPathNoQual(txt, a_path);
443 141 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" \"Automatically generated record constructor for "));
444 141 txt := AbsynDumpTpl.dumpPathNoQual(txt, a_path);
445 141 txt := Tpl.writeTok(txt, Tpl.ST_LINE("\"\n"));
446 141 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
447 141 txt := dumpRecordInputVarStr(txt, a_type__);
448 141 txt := Tpl.softNewLine(txt);
449 141 txt := Tpl.writeTok(txt, Tpl.ST_STRING("output "));
450 141 txt := dumpPathLastIndent(txt, a_path);
451 141 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" res;\n"));
452 141 txt := Tpl.popBlock(txt);
453 141 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
454 141 txt := AbsynDumpTpl.dumpPathNoQual(txt, a_path);
455 141 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
456 then txt;
457
458 case ( txt,
459 _,
460 a_type__,
461 _ )
462 algorithm
463 2 txt := dumpRecordType(txt, a_type__);
464 then txt;
465 end match;
466 end fun_29;
467
468 public function dumpFunction
469 input Tpl.Text in_txt;
470 input DAE.Function in_a_function;
471
472 output Tpl.Text out_txt;
473 algorithm
474 out_txt :=
475 match(in_txt, in_a_function)
476 local
477 Tpl.Text txt;
478 DAE.Type i_type__;
479 list<DAE.FunctionDefinition> i_functions;
480 Boolean i_isImpure;
481 Option<SCode.Comment> i_comment;
482 Absyn.Path i_path;
483 Boolean ret_6;
484 Boolean ret_5;
485 Boolean ret_4;
486 Tpl.Text l_impure__str;
487 Tpl.Text l_ann__str;
488 Tpl.Text l_cmt__str;
489 Tpl.Text l_fn__name;
490
491 case ( txt,
492 DAE.FUNCTION(functions = (i_functions as {DAE.FUNCTION_PARTIAL_DERIVATIVE(derivedFunction = _)}), path = i_path, comment = i_comment, isImpure = i_isImpure) )
493 algorithm
494 1 l_fn__name := AbsynDumpTpl.dumpPathNoQual(Tpl.emptyTxt, i_path);
495 1 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
496 1 l_ann__str := dumpClassAnnotation(Tpl.emptyTxt, i_comment);
497 1 l_impure__str := fun_25(Tpl.emptyTxt, i_isImpure);
498 1 txt := Tpl.writeText(txt, l_impure__str);
499 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
500 1 txt := Tpl.writeText(txt, l_fn__name);
501 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
502 1 txt := dumpFunctionDefinitions(txt, i_functions);
503 1 txt := Tpl.writeText(txt, l_cmt__str);
504 1 ret_4 := Tpl.isEmpty(l_ann__str);
505 1 txt := fun_26(txt, ret_4);
506 1 txt := Tpl.writeText(txt, l_ann__str);
507 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
508 then txt;
509
510 case ( txt,
511 DAE.FUNCTION(comment = i_comment, isImpure = i_isImpure, path = i_path, functions = i_functions) )
512 algorithm
513 492 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
514 492 l_ann__str := dumpClassAnnotation(Tpl.emptyTxt, i_comment);
515 492 l_impure__str := fun_27(Tpl.emptyTxt, i_isImpure);
516 492 txt := Tpl.writeText(txt, l_impure__str);
517 492 txt := Tpl.writeTok(txt, Tpl.ST_STRING("function "));
518 492 txt := AbsynDumpTpl.dumpPathNoQual(txt, i_path);
519 492 txt := Tpl.writeText(txt, l_cmt__str);
520 492 txt := Tpl.softNewLine(txt);
521 492 txt := dumpFunctionDefinitions(txt, i_functions);
522 492 txt := Tpl.softNewLine(txt);
523 492 ret_5 := Tpl.isEmpty(l_ann__str);
524 492 txt := fun_28(txt, ret_5);
525 492 txt := Tpl.writeText(txt, l_ann__str);
526 492 txt := Tpl.softNewLine(txt);
527 492 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
528 492 txt := AbsynDumpTpl.dumpPathNoQual(txt, i_path);
529 492 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
530 then txt;
531
532 case ( txt,
533 DAE.RECORD_CONSTRUCTOR(path = i_path, type_ = i_type__) )
534 algorithm
535 143 ret_6 := Flags.isSet(Flags.PRINT_RECORD_TYPES);
536 143 txt := fun_29(txt, ret_6, i_type__, i_path);
537 then txt;
538
539 case ( txt,
540 _ )
541 then txt;
542 end match;
543 end dumpFunction;
544
545 protected function lm_31
546 input output Tpl.Text txt;
547 input list<DAE.FunctionDefinition> items;
548 algorithm
549
2/2
✓ Branch 0 taken 515 times.
✓ Branch 1 taken 493 times.
1008 for lstElt_31 in items loop
550 txt := match lstElt_31
551 local
552 DAE.FunctionDefinition i_func;
553
554 case i_func
555 algorithm
556 515 txt := dumpFunctionDefinition(txt, i_func);
557 515 txt := Tpl.nextIter(txt);
558 then txt;
559 end match;
560 end for;
561 end lm_31;
562
563 public function dumpFunctionDefinitions
564 input Tpl.Text txt;
565 input list<DAE.FunctionDefinition> a_functions;
566
567 output Tpl.Text out_txt;
568 algorithm
569 493 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
570 493 out_txt := lm_31(out_txt, a_functions);
571 493 out_txt := Tpl.popIter(out_txt);
572 end dumpFunctionDefinitions;
573
574 protected function lm_33
575 input output Tpl.Text txt;
576 input list<String> items;
577 algorithm
578
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
2 for lstElt_33 in items loop
579 txt := match lstElt_33
580 local
581 String i_var;
582
583 case i_var
584 algorithm
585 1 txt := Tpl.writeStr(txt, i_var);
586 1 txt := Tpl.nextIter(txt);
587 then txt;
588 end match;
589 end for;
590 end lm_33;
591
592 public function dumpFunctionDefinition
593 input Tpl.Text in_txt;
594 input DAE.FunctionDefinition in_a_functions;
595
596 output Tpl.Text out_txt;
597 algorithm
598 out_txt :=
599 match(in_txt, in_a_functions)
600 local
601 Tpl.Text txt;
602 Absyn.Path i_derivedFunction;
603 list<String> i_derivedVars;
604 DAE.ExternalDecl i_externalDecl;
605 list<DAE.Element> i_body;
606 Tpl.Text l_vars;
607
608 case ( txt,
609 DAE.FUNCTION_DEF(body = i_body) )
610 algorithm
611 444 txt := dumpFunctionBody(txt, i_body);
612 then txt;
613
614 case ( txt,
615 DAE.FUNCTION_EXT(body = i_body, externalDecl = i_externalDecl) )
616 algorithm
617 48 txt := dumpFunctionBody(txt, i_body);
618 48 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
619 48 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
620 48 txt := dumpExternalDecl(txt, i_externalDecl);
621 then txt;
622
623 case ( txt,
624 DAE.FUNCTION_DER_MAPPER(derivedFunction = _) )
625 then txt;
626
627 case ( txt,
628 DAE.FUNCTION_INVERSE(inputParam = _) )
629 then txt;
630
631 case ( txt,
632 DAE.FUNCTION_PARTIAL_DERIVATIVE(derivedVars = i_derivedVars, derivedFunction = i_derivedFunction) )
633 algorithm
634 1 l_vars := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
635 1 l_vars := lm_33(l_vars, i_derivedVars);
636 1 l_vars := Tpl.popIter(l_vars);
637 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("der("));
638 1 txt := AbsynDumpTpl.dumpPathNoQual(txt, i_derivedFunction);
639 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
640 1 txt := Tpl.writeText(txt, l_vars);
641 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
642 then txt;
643
644 case ( txt,
645 _ )
646 then txt;
647 end match;
648 end dumpFunctionDefinition;
649
650 protected function fun_35
651 input Tpl.Text in_txt;
652 input Boolean in_mArg;
653 input Tpl.Text in_a_func__args__str;
654 input Tpl.Text in_a_func__name__str;
655
656 output Tpl.Text out_txt;
657 algorithm
658 out_txt :=
659 match(in_txt, in_mArg, in_a_func__args__str, in_a_func__name__str)
660 local
661 Tpl.Text txt;
662 Tpl.Text a_func__args__str;
663 Tpl.Text a_func__name__str;
664
665 case ( txt,
666 true,
667 _,
668 _ )
669 then txt;
670
671 case ( txt,
672 _,
673 a_func__args__str,
674 a_func__name__str )
675 algorithm
676 48 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
677 48 txt := Tpl.writeText(txt, a_func__name__str);
678 48 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
679 48 txt := Tpl.writeText(txt, a_func__args__str);
680 48 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
681 48 txt := Tpl.popBlock(txt);
682 then txt;
683 end match;
684 end fun_35;
685
686 protected function fun_36
687 input Tpl.Text in_txt;
688 input Boolean in_mArg;
689 input Tpl.Text in_a_ext__output__str;
690
691 output Tpl.Text out_txt;
692 algorithm
693 out_txt :=
694 match(in_txt, in_mArg, in_a_ext__output__str)
695 local
696 Tpl.Text txt;
697 Tpl.Text a_ext__output__str;
698
699 case ( txt,
700 true,
701 _ )
702 then txt;
703
704 case ( txt,
705 _,
706 a_ext__output__str )
707 algorithm
708 30 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
709 30 txt := Tpl.writeText(txt, a_ext__output__str);
710 30 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" ="));
711 30 txt := Tpl.popBlock(txt);
712 then txt;
713 end match;
714 end fun_36;
715
716 protected function fun_37
717 input Tpl.Text in_txt;
718 input Option<SCode.Annotation> in_a_ann;
719
720 output Tpl.Text out_txt;
721 algorithm
722 out_txt :=
723 match(in_txt, in_a_ann)
724 local
725 Tpl.Text txt;
726 SCode.Annotation i_annotation;
727
728 case ( txt,
729 SOME(i_annotation) )
730 algorithm
731 16 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
732 16 txt := dumpAnnotation(txt, i_annotation);
733 16 txt := Tpl.popBlock(txt);
734 then txt;
735
736 case ( txt,
737 _ )
738 then txt;
739 end match;
740 end fun_37;
741
742 public function dumpExternalDecl
743 input Tpl.Text in_txt;
744 input DAE.ExternalDecl in_a_externalDecl;
745
746 output Tpl.Text out_txt;
747 algorithm
748 out_txt :=
749 match(in_txt, in_a_externalDecl)
750 local
751 Tpl.Text txt;
752 Option<SCode.Annotation> i_ann;
753 String i_language;
754 DAE.ExtArg i_returnArg;
755 list<DAE.ExtArg> i_args;
756 String i_name;
757 Tpl.Text l_ann__str;
758 Tpl.Text l_lang__str;
759 Boolean ret_6;
760 Tpl.Text l_output__str;
761 Tpl.Text l_ext__output__str;
762 Boolean ret_3;
763 Tpl.Text l_func__str;
764 Tpl.Text l_func__args__str;
765 Tpl.Text l_func__name__str;
766
767 case ( txt,
768 DAE.EXTERNALDECL(name = i_name, args = i_args, returnArg = i_returnArg, language = i_language, ann = i_ann) )
769 algorithm
770 48 l_func__name__str := Tpl.writeStr(Tpl.emptyTxt, i_name);
771 48 l_func__args__str := dumpExtArgs(Tpl.emptyTxt, i_args);
772 48 ret_3 := Tpl.isEmpty(l_func__name__str);
773 48 l_func__str := fun_35(Tpl.emptyTxt, ret_3, l_func__args__str, l_func__name__str);
774 48 l_ext__output__str := dumpExtArg(Tpl.emptyTxt, i_returnArg);
775 48 ret_6 := Tpl.isEmpty(l_ext__output__str);
776 48 l_output__str := fun_36(Tpl.emptyTxt, ret_6, l_ext__output__str);
777 48 l_lang__str := Tpl.writeStr(Tpl.emptyTxt, i_language);
778 48 l_ann__str := fun_37(Tpl.emptyTxt, i_ann);
779 48 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
780 48 txt := Tpl.writeTok(txt, Tpl.ST_STRING("external \""));
781 48 txt := Tpl.writeText(txt, l_lang__str);
782 48 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
783 48 txt := Tpl.writeText(txt, l_output__str);
784 48 txt := Tpl.writeText(txt, l_func__str);
785 48 txt := Tpl.writeText(txt, l_ann__str);
786 48 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
787 48 txt := Tpl.popBlock(txt);
788 then txt;
789
790 case ( txt,
791 _ )
792 then txt;
793 end match;
794 end dumpExternalDecl;
795
796 protected function lm_39
797 input output Tpl.Text txt;
798 input list<DAE.ExtArg> items;
799 algorithm
800
2/2
✓ Branch 0 taken 88 times.
✓ Branch 1 taken 48 times.
136 for lstElt_39 in items loop
801 txt := match lstElt_39
802 local
803 DAE.ExtArg i_arg;
804
805 case i_arg
806 algorithm
807 88 txt := dumpExtArg(txt, i_arg);
808 88 txt := Tpl.nextIter(txt);
809 then txt;
810 end match;
811 end for;
812 end lm_39;
813
814 public function dumpExtArgs
815 input Tpl.Text txt;
816 input list<DAE.ExtArg> a_args;
817
818 output Tpl.Text out_txt;
819 algorithm
820 48 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()));
821 48 out_txt := lm_39(out_txt, a_args);
822 48 out_txt := Tpl.popIter(out_txt);
823 end dumpExtArgs;
824
825 public function dumpExtArg
826 input Tpl.Text in_txt;
827 input DAE.ExtArg in_a_arg;
828
829 output Tpl.Text out_txt;
830 algorithm
831 out_txt :=
832 match(in_txt, in_a_arg)
833 local
834 Tpl.Text txt;
835 DAE.Exp i_exp;
836 DAE.ComponentRef i_componentRef;
837
838 case ( txt,
839 DAE.EXTARG(componentRef = i_componentRef) )
840 algorithm
841 99 txt := dumpCref(txt, i_componentRef);
842 then txt;
843
844 case ( txt,
845 DAE.EXTARGEXP(exp = i_exp) )
846 algorithm
847 1 txt := dumpExp(txt, i_exp);
848 then txt;
849
850 case ( txt,
851 DAE.EXTARGSIZE(componentRef = i_componentRef, exp = i_exp) )
852 algorithm
853 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("size("));
854 18 txt := dumpCref(txt, i_componentRef);
855 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
856 18 txt := dumpExp(txt, i_exp);
857 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
858 then txt;
859
860 case ( txt,
861 _ )
862 then txt;
863 end match;
864 end dumpExtArg;
865
866 public function dumpRecordInputVarStr
867 input Tpl.Text in_txt;
868 input DAE.Type in_a_type__;
869
870 output Tpl.Text out_txt;
871 algorithm
872 out_txt :=
873 match(in_txt, in_a_type__)
874 local
875 Tpl.Text txt;
876 DAE.Type i_funcResultType;
877 list<DAE.Var> i_varLst;
878
879 case ( txt,
880 DAE.T_COMPLEX(varLst = i_varLst) )
881 algorithm
882 141 txt := dumpRecordVars(txt, i_varLst);
883 then txt;
884
885 case ( txt,
886 DAE.T_FUNCTION(funcResultType = i_funcResultType) )
887 algorithm
888 141 txt := dumpRecordInputVarStr(txt, i_funcResultType);
889 then txt;
890
891 case ( txt,
892 _ )
893 then txt;
894 end match;
895 end dumpRecordInputVarStr;
896
897 protected function lm_43
898 input output Tpl.Text txt;
899 input list<DAE.Var> items;
900 algorithm
901
2/2
✓ Branch 0 taken 759 times.
✓ Branch 1 taken 143 times.
902 for lstElt_43 in items loop
902 txt := match lstElt_43
903 local
904 DAE.Var i_v;
905
906 case i_v
907 algorithm
908 759 txt := dumpRecordVar(txt, i_v);
909 759 txt := Tpl.nextIter(txt);
910 then txt;
911 end match;
912 end for;
913 end lm_43;
914
915 public function dumpRecordVars
916 input Tpl.Text txt;
917 input list<DAE.Var> a_varLst;
918
919 output Tpl.Text out_txt;
920 algorithm
921 143 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
922 143 out_txt := lm_43(out_txt, a_varLst);
923 143 out_txt := Tpl.popIter(out_txt);
924 end dumpRecordVars;
925
926 public function dumpRecordVar
927 input Tpl.Text in_txt;
928 input DAE.Var in_a_v;
929
930 output Tpl.Text out_txt;
931 algorithm
932 out_txt :=
933 match(in_txt, in_a_v)
934 local
935 Tpl.Text txt;
936 DAE.Ident i_name;
937 DAE.Type i_ty;
938 DAE.Binding i_binding;
939 DAE.Attributes i_attributes;
940 Tpl.Text l_ty__str;
941 Tpl.Text l_attr;
942 Tpl.Text l_binding__str;
943 Tpl.Text l_attr__str;
944
945 case ( txt,
946 DAE.TYPES_VAR(attributes = i_attributes, binding = i_binding, ty = i_ty, name = i_name) )
947 algorithm
948 759 l_attr__str := dumpRecordConstructorInputAttr(Tpl.emptyTxt, i_attributes);
949 759 l_binding__str := dumpRecordConstructorBinding(Tpl.emptyTxt, i_binding);
950 759 l_attr := Tpl.emptyTxt;
951 759 (l_ty__str, l_attr) := dumpType(Tpl.emptyTxt, i_ty, l_attr);
952 759 txt := Tpl.writeText(txt, l_attr__str);
953 759 txt := Tpl.writeText(txt, l_ty__str);
954 759 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
955 759 txt := Tpl.writeStr(txt, i_name);
956 759 txt := Tpl.writeText(txt, l_attr);
957 759 txt := Tpl.writeText(txt, l_binding__str);
958 759 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
959 then txt;
960
961 case ( txt,
962 _ )
963 then txt;
964 end match;
965 end dumpRecordVar;
966
967 public function dumpRecordConstructorInputAttr
968 input Tpl.Text in_txt;
969 input DAE.Attributes in_a_attr;
970
971 output Tpl.Text out_txt;
972 algorithm
973 out_txt :=
974 match(in_txt, in_a_attr)
975 local
976 Tpl.Text txt;
977
978 case ( txt,
979 DAE.ATTR(direction = Absyn.INPUT()) )
980 algorithm
981 715 txt := Tpl.writeTok(txt, Tpl.ST_STRING("input "));
982 then txt;
983
984 case ( txt,
985 DAE.ATTR(visibility = SCode.PROTECTED()) )
986 algorithm
987 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING("protected "));
988 then txt;
989
990 case ( txt,
991 DAE.ATTR(variability = SCode.CONST()) )
992 algorithm
993 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant "));
994 then txt;
995
996 case ( txt,
997 _ )
998 algorithm
999 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("input "));
1000 then txt;
1001 end match;
1002 end dumpRecordConstructorInputAttr;
1003
1004 public function dumpRecordConstructorBinding
1005 input Tpl.Text in_txt;
1006 input DAE.Binding in_a_binding;
1007
1008 output Tpl.Text out_txt;
1009 algorithm
1010 out_txt :=
1011 match(in_txt, in_a_binding)
1012 local
1013 Tpl.Text txt;
1014 DAE.Exp i_exp;
1015
1016 case ( txt,
1017 DAE.UNBOUND() )
1018 then txt;
1019
1020 case ( txt,
1021 DAE.EQBOUND(exp = i_exp) )
1022 algorithm
1023 110 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
1024 110 txt := Tpl.writeTok(txt, Tpl.ST_STRING("= "));
1025 110 txt := dumpExp(txt, i_exp);
1026 110 txt := Tpl.popBlock(txt);
1027 then txt;
1028
1029 case ( txt,
1030 _ )
1031 then txt;
1032 end match;
1033 end dumpRecordConstructorBinding;
1034
1035 public function dumpRecordVarBinding
1036 input Tpl.Text in_txt;
1037 input DAE.Binding in_a_binding;
1038
1039 output Tpl.Text out_txt;
1040 algorithm
1041 out_txt :=
1042 match(in_txt, in_a_binding)
1043 local
1044 Tpl.Text txt;
1045 DAE.Exp i_exp;
1046
1047 case ( txt,
1048 DAE.UNBOUND() )
1049 then txt;
1050
1051 case ( txt,
1052 DAE.EQBOUND(exp = i_exp) )
1053 algorithm
1054 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
1055 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("= "));
1056 ✗ txt := dumpExp(txt, i_exp);
1057 ✗ txt := Tpl.popBlock(txt);
1058 then txt;
1059
1060 case ( txt,
1061 DAE.VALBOUND(valBound = _) )
1062 algorithm
1063 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("value bound***** check what to display"));
1064 then txt;
1065
1066 case ( txt,
1067 _ )
1068 then txt;
1069 end match;
1070 end dumpRecordVarBinding;
1071
1072 protected function lm_49
1073 input output Tpl.Text txt;
1074 input list<DAE.Element> items;
1075 algorithm
1076
2/2
✓ Branch 0 taken 2516 times.
✓ Branch 1 taken 492 times.
3008 for lstElt_49 in items loop
1077 txt := match lstElt_49
1078 local
1079 DAE.Element i_lst;
1080
1081 case i_lst
1082 algorithm
1083 2516 txt := dumpFunctionElement(txt, i_lst);
1084 2516 txt := Tpl.nextIter(txt);
1085 then txt;
1086 end match;
1087 end for;
1088 end lm_49;
1089
1090 protected function lm_50
1091 input output Tpl.Text txt;
1092 input list<DAE.Element> items;
1093 algorithm
1094
2/2
✓ Branch 0 taken 2516 times.
✓ Branch 1 taken 492 times.
3008 for lstElt_50 in items loop
1095 txt := match lstElt_50
1096 local
1097 DAE.Element i_lst;
1098
1099 case i_lst
1100 algorithm
1101 2516 txt := dumpFunctionAnnotation(txt, i_lst);
1102 then txt;
1103 end match;
1104 end for;
1105 end lm_50;
1106
1107 public function dumpFunctionBody
1108 input Tpl.Text txt;
1109 input list<DAE.Element> a_dAElist;
1110
1111 output Tpl.Text out_txt;
1112 algorithm
1113 492 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1114 492 out_txt := lm_49(out_txt, a_dAElist);
1115 492 out_txt := Tpl.popIter(out_txt);
1116 492 out_txt := lm_50(out_txt, a_dAElist);
1117 end dumpFunctionBody;
1118
1119 public function dumpFunctionElement
1120 input Tpl.Text in_txt;
1121 input DAE.Element in_a_lst;
1122
1123 output Tpl.Text out_txt;
1124 algorithm
1125 out_txt :=
1126 match(in_txt, in_a_lst)
1127 local
1128 Tpl.Text txt;
1129 DAE.Algorithm i_algorithm__;
1130 DAE.Element i_lst;
1131
1132 case ( txt,
1133 (i_lst as DAE.VAR(componentRef = _)) )
1134 algorithm
1135 2096 txt := dumpVar(txt, i_lst, true);
1136 then txt;
1137
1138 case ( txt,
1139 DAE.INITIALALGORITHM(algorithm_ = i_algorithm__) )
1140 algorithm
1141 ✗ txt := dumpFunctionAlgorithm(txt, i_algorithm__, "initial algorithm");
1142 then txt;
1143
1144 case ( txt,
1145 DAE.ALGORITHM(algorithm_ = i_algorithm__) )
1146 algorithm
1147 407 txt := dumpFunctionAlgorithm(txt, i_algorithm__, "algorithm");
1148 then txt;
1149
1150 case ( txt,
1151 DAE.COMMENT(cmt = _) )
1152 then txt;
1153
1154 case ( txt,
1155 _ )
1156 algorithm
1157 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Element not found"));
1158 then txt;
1159 end match;
1160 end dumpFunctionElement;
1161
1162 protected function fun_53
1163 input Tpl.Text in_txt;
1164 input Boolean in_mArg;
1165 input Tpl.Text in_a_x;
1166
1167 output Tpl.Text out_txt;
1168 algorithm
1169 out_txt :=
1170 match(in_txt, in_mArg, in_a_x)
1171 local
1172 Tpl.Text txt;
1173 Tpl.Text a_x;
1174
1175 case ( txt,
1176 true,
1177 _ )
1178 then txt;
1179
1180 case ( txt,
1181 _,
1182 a_x )
1183 algorithm
1184 ✗ txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
1185 ✗ txt := Tpl.writeText(txt, a_x);
1186 then txt;
1187 end match;
1188 end fun_53;
1189
1190 public function dumpFunctionAnnotation
1191 input Tpl.Text in_txt;
1192 input DAE.Element in_a_lst;
1193
1194 output Tpl.Text out_txt;
1195 algorithm
1196 out_txt :=
1197 match(in_txt, in_a_lst)
1198 local
1199 Tpl.Text txt;
1200 SCode.Comment i_cmt;
1201 Boolean ret_1;
1202 Tpl.Text l_x;
1203
1204 case ( txt,
1205 DAE.COMMENT(cmt = i_cmt) )
1206 algorithm
1207 13 l_x := dumpCommentAnnotationNoOpt(Tpl.emptyTxt, i_cmt);
1208 13 ret_1 := Tpl.isEmpty(l_x);
1209 13 txt := fun_53(txt, ret_1, l_x);
1210 then txt;
1211
1212 case ( txt,
1213 _ )
1214 then txt;
1215 end match;
1216 end dumpFunctionAnnotation;
1217
1218 public function dumpFunctionAlgorithm
1219 input Tpl.Text in_txt;
1220 input DAE.Algorithm in_a_algorithm__;
1221 input String in_a_label;
1222
1223 output Tpl.Text out_txt;
1224 algorithm
1225 out_txt :=
1226 match(in_txt, in_a_algorithm__, in_a_label)
1227 local
1228 Tpl.Text txt;
1229 String a_label;
1230 list<DAE.Statement> i_statementLst;
1231
1232 case ( txt,
1233 DAE.ALGORITHM_STMTS(statementLst = i_statementLst),
1234 a_label )
1235 algorithm
1236 407 txt := Tpl.writeStr(txt, a_label);
1237 407 txt := Tpl.softNewLine(txt);
1238 407 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
1239 407 txt := dumpStatements(txt, i_statementLst);
1240 407 txt := Tpl.popBlock(txt);
1241 then txt;
1242
1243 case ( txt,
1244 _,
1245 _ )
1246 then txt;
1247 end match;
1248 end dumpFunctionAlgorithm;
1249
1250 protected function lm_56
1251 input output Tpl.Text txt;
1252 input list<DAE.Element> items;
1253 algorithm
1254
2/2
✓ Branch 0 taken 15435 times.
✓ Branch 1 taken 1029 times.
16464 for lstElt_56 in items loop
1255 txt := match lstElt_56
1256 local
1257 DAE.Element i_var;
1258
1259 case i_var
1260 algorithm
1261 15435 txt := dumpVar(txt, i_var, false);
1262 15435 txt := Tpl.nextIter(txt);
1263 then txt;
1264 end match;
1265 end for;
1266 end lm_56;
1267
1268 public function dumpVars
1269 input Tpl.Text txt;
1270 input list<DAE.Element> a_v;
1271
1272 output Tpl.Text out_txt;
1273 algorithm
1274 1029 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
1275 1029 out_txt := lm_56(out_txt, a_v);
1276 1029 out_txt := Tpl.popIter(out_txt);
1277 end dumpVars;
1278
1279 protected function fun_58
1280 input Tpl.Text in_txt;
1281 input Option<DAE.VariableAttributes> in_a_variableAttributesOption;
1282
1283 output Tpl.Text out_txt;
1284 algorithm
1285 out_txt :=
1286 match(in_txt, in_a_variableAttributesOption)
1287 local
1288 Tpl.Text txt;
1289 DAE.VariableAttributes i_VariableAttributes;
1290
1291 case ( txt,
1292 SOME(i_VariableAttributes) )
1293 algorithm
1294 14550 txt := dumpFinalPrefix(txt, i_VariableAttributes);
1295 then txt;
1296
1297 case ( txt,
1298 _ )
1299 then txt;
1300 end match;
1301 end fun_58;
1302
1303 protected function fun_59
1304 input Tpl.Text in_txt;
1305 input Boolean in_a_printTypeDimension;
1306 input DAE.InstDims in_a_dims;
1307
1308 output Tpl.Text out_txt;
1309 algorithm
1310 out_txt :=
1311 match(in_txt, in_a_printTypeDimension, in_a_dims)
1312 local
1313 Tpl.Text txt;
1314 DAE.InstDims a_dims;
1315
1316 case ( txt,
1317 false,
1318 _ )
1319 then txt;
1320
1321 case ( txt,
1322 _,
1323 a_dims )
1324 algorithm
1325 2096 txt := dumpTypeDimensions(txt, a_dims);
1326 then txt;
1327 end match;
1328 end fun_59;
1329
1330 protected function fun_60
1331 input Tpl.Text in_txt;
1332 input Option<DAE.Exp> in_a_binding;
1333
1334 output Tpl.Text out_txt;
1335 algorithm
1336 out_txt :=
1337 match(in_txt, in_a_binding)
1338 local
1339 Tpl.Text txt;
1340 DAE.Exp i_exp;
1341
1342 case ( txt,
1343 SOME(i_exp) )
1344 algorithm
1345 5381 txt := dumpExp(txt, i_exp);
1346 then txt;
1347
1348 case ( txt,
1349 _ )
1350 then txt;
1351 end match;
1352 end fun_60;
1353
1354 protected function fun_61
1355 input Tpl.Text in_txt;
1356 input Option<DAE.VariableAttributes> in_a_variableAttributesOption;
1357
1358 output Tpl.Text out_txt;
1359 algorithm
1360 out_txt :=
1361 match(in_txt, in_a_variableAttributesOption)
1362 local
1363 Tpl.Text txt;
1364 DAE.VariableAttributes i_VariableAttributes;
1365
1366 case ( txt,
1367 SOME(i_VariableAttributes) )
1368 algorithm
1369 14550 txt := dumpVariableAttributes(txt, i_VariableAttributes);
1370 then txt;
1371
1372 case ( txt,
1373 _ )
1374 then txt;
1375 end match;
1376 end fun_61;
1377
1378 protected function fun_62
1379 input Tpl.Text in_txt;
1380 input Boolean in_mArg;
1381 input Tpl.Text in_a_bindingExp;
1382
1383 output Tpl.Text out_txt;
1384 algorithm
1385 out_txt :=
1386 match(in_txt, in_mArg, in_a_bindingExp)
1387 local
1388 Tpl.Text txt;
1389 Tpl.Text a_bindingExp;
1390
1391 case ( txt,
1392 true,
1393 _ )
1394 then txt;
1395
1396 case ( txt,
1397 _,
1398 a_bindingExp )
1399 algorithm
1400 5381 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
1401 5381 txt := Tpl.writeTok(txt, Tpl.ST_STRING("= "));
1402 5381 txt := Tpl.writeText(txt, a_bindingExp);
1403 5381 txt := Tpl.popBlock(txt);
1404 then txt;
1405 end match;
1406 end fun_62;
1407
1408 public function dumpVar
1409 input Tpl.Text in_txt;
1410 input DAE.Element in_a_lst;
1411 input Boolean in_a_printTypeDimension;
1412
1413 output Tpl.Text out_txt;
1414 algorithm
1415 out_txt :=
1416 match(in_txt, in_a_lst, in_a_printTypeDimension)
1417 local
1418 Tpl.Text txt;
1419 Boolean a_printTypeDimension;
1420 Option<SCode.Comment> i_comment;
1421 Option<DAE.Exp> i_binding;
1422 DAE.ComponentRef i_componentRef;
1423 DAE.InstDims i_dims;
1424 DAE.Type i_ty;
1425 DAE.VarDirection i_direction;
1426 DAE.VarKind i_kind;
1427 DAE.VarParallelism i_parallelism;
1428 DAE.VarVisibility i_protection;
1429 Option<DAE.VariableAttributes> i_variableAttributesOption;
1430 Boolean ret_14;
1431 Tpl.Text l_binding__str;
1432 Tpl.Text l_ann__str;
1433 Tpl.Text l_cmt__str;
1434 Tpl.Text l_varAttr;
1435 Tpl.Text l_bindingExp;
1436 Tpl.Text l_varName;
1437 Tpl.Text l_dim__str;
1438 Tpl.Text l_varType;
1439 Tpl.Text l_attr;
1440 Tpl.Text l_varDirection;
1441 Tpl.Text l_varKind;
1442 Tpl.Text l_varParallelism;
1443 Tpl.Text l_varVisibility;
1444 Tpl.Text l_final;
1445
1446 case ( txt,
1447 DAE.VAR(variableAttributesOption = i_variableAttributesOption, protection = i_protection, parallelism = i_parallelism, kind = i_kind, direction = i_direction, ty = i_ty, dims = i_dims, componentRef = i_componentRef, binding = i_binding, comment = i_comment),
1448 a_printTypeDimension )
1449 algorithm
1450 17531 l_final := fun_58(Tpl.emptyTxt, i_variableAttributesOption);
1451 17531 l_varVisibility := dumpVarVisibility(Tpl.emptyTxt, i_protection);
1452 17531 l_varParallelism := dumpVarParallelism(Tpl.emptyTxt, i_parallelism);
1453 17531 l_varKind := dumpVarKind(Tpl.emptyTxt, i_kind);
1454 17531 l_varDirection := dumpVarDirection(Tpl.emptyTxt, i_direction);
1455 17531 l_attr := Tpl.emptyTxt;
1456 17531 (l_varType, l_attr) := dumpType(Tpl.emptyTxt, i_ty, l_attr);
1457 17531 l_dim__str := fun_59(Tpl.emptyTxt, a_printTypeDimension, i_dims);
1458 17531 l_varName := dumpCref(Tpl.emptyTxt, i_componentRef);
1459 17531 l_bindingExp := fun_60(Tpl.emptyTxt, i_binding);
1460 17531 l_varAttr := fun_61(Tpl.emptyTxt, i_variableAttributesOption);
1461 17531 l_cmt__str := dumpCommentOpt(Tpl.emptyTxt, i_comment);
1462 17531 l_ann__str := dumpCompAnnotation(Tpl.emptyTxt, i_comment);
1463 17531 ret_14 := Tpl.isEmpty(l_bindingExp);
1464 17531 l_binding__str := fun_62(Tpl.emptyTxt, ret_14, l_bindingExp);
1465 17531 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
1466 17531 txt := Tpl.writeText(txt, l_varVisibility);
1467 17531 txt := Tpl.writeText(txt, l_final);
1468 17531 txt := Tpl.writeText(txt, l_varParallelism);
1469 17531 txt := Tpl.writeText(txt, l_varKind);
1470 17531 txt := Tpl.writeText(txt, l_varDirection);
1471 17531 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
1472 17531 txt := Tpl.writeText(txt, l_varType);
1473 17531 txt := Tpl.writeText(txt, l_dim__str);
1474 17531 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
1475 17531 txt := Tpl.writeText(txt, l_varName);
1476 17531 txt := Tpl.writeText(txt, l_attr);
1477 17531 txt := Tpl.writeText(txt, l_varAttr);
1478 17531 txt := Tpl.writeText(txt, l_binding__str);
1479 17531 txt := Tpl.writeText(txt, l_cmt__str);
1480 17531 txt := Tpl.writeText(txt, l_ann__str);
1481 17531 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
1482 17531 txt := Tpl.popBlock(txt);
1483 then txt;
1484
1485 case ( txt,
1486 _,
1487 _ )
1488 then txt;
1489 end match;
1490 end dumpVar;
1491
1492 public function dumpFinalPrefix
1493 input Tpl.Text in_txt;
1494 input DAE.VariableAttributes in_a_varAttr;
1495
1496 output Tpl.Text out_txt;
1497 algorithm
1498 out_txt :=
1499 match(in_txt, in_a_varAttr)
1500 local
1501 Tpl.Text txt;
1502
1503 case ( txt,
1504 DAE.VAR_ATTR_REAL(finalPrefix = SOME(true)) )
1505 algorithm
1506 806 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" final"));
1507 then txt;
1508
1509 case ( txt,
1510 DAE.VAR_ATTR_INT(finalPrefix = SOME(true)) )
1511 algorithm
1512 100 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" final"));
1513 then txt;
1514
1515 case ( txt,
1516 DAE.VAR_ATTR_BOOL(finalPrefix = SOME(true)) )
1517 algorithm
1518 178 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" final"));
1519 then txt;
1520
1521 case ( txt,
1522 DAE.VAR_ATTR_STRING(finalPrefix = SOME(true)) )
1523 algorithm
1524 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" final"));
1525 then txt;
1526
1527 case ( txt,
1528 DAE.VAR_ATTR_ENUMERATION(finalPrefix = SOME(true)) )
1529 algorithm
1530 52 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" final"));
1531 then txt;
1532
1533 case ( txt,
1534 _ )
1535 then txt;
1536 end match;
1537 end dumpFinalPrefix;
1538
1539 public function dumpVarVisibility
1540 input Tpl.Text in_txt;
1541 input DAE.VarVisibility in_a_protection;
1542
1543 output Tpl.Text out_txt;
1544 algorithm
1545 out_txt :=
1546 match(in_txt, in_a_protection)
1547 local
1548 Tpl.Text txt;
1549
1550 case ( txt,
1551 DAE.PROTECTED() )
1552 algorithm
1553 1974 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" protected"));
1554 then txt;
1555
1556 case ( txt,
1557 _ )
1558 then txt;
1559 end match;
1560 end dumpVarVisibility;
1561
1562 public function dumpVarParallelism
1563 input Tpl.Text in_txt;
1564 input DAE.VarParallelism in_a_parallelism;
1565
1566 output Tpl.Text out_txt;
1567 algorithm
1568 out_txt :=
1569 match(in_txt, in_a_parallelism)
1570 local
1571 Tpl.Text txt;
1572
1573 case ( txt,
1574 DAE.PARGLOBAL() )
1575 algorithm
1576 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" parglobal"));
1577 then txt;
1578
1579 case ( txt,
1580 DAE.PARLOCAL() )
1581 algorithm
1582 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" parlocal"));
1583 then txt;
1584
1585 case ( txt,
1586 _ )
1587 then txt;
1588 end match;
1589 end dumpVarParallelism;
1590
1591 public function dumpVarKind
1592 input Tpl.Text in_txt;
1593 input DAE.VarKind in_a_kind;
1594
1595 output Tpl.Text out_txt;
1596 algorithm
1597 out_txt :=
1598 match(in_txt, in_a_kind)
1599 local
1600 Tpl.Text txt;
1601
1602 case ( txt,
1603 DAE.CONST() )
1604 algorithm
1605 1268 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" constant"));
1606 then txt;
1607
1608 case ( txt,
1609 DAE.PARAM() )
1610 algorithm
1611 3299 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" parameter"));
1612 then txt;
1613
1614 case ( txt,
1615 DAE.DISCRETE() )
1616 algorithm
1617 76 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" discrete"));
1618 then txt;
1619
1620 case ( txt,
1621 _ )
1622 then txt;
1623 end match;
1624 end dumpVarKind;
1625
1626 public function dumpVarDirection
1627 input Tpl.Text in_txt;
1628 input DAE.VarDirection in_a_direction;
1629
1630 output Tpl.Text out_txt;
1631 algorithm
1632 out_txt :=
1633 match(in_txt, in_a_direction)
1634 local
1635 Tpl.Text txt;
1636
1637 case ( txt,
1638 DAE.INPUT() )
1639 algorithm
1640 1052 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" input"));
1641 then txt;
1642
1643 case ( txt,
1644 DAE.OUTPUT() )
1645 algorithm
1646 600 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" output"));
1647 then txt;
1648
1649 case ( txt,
1650 _ )
1651 then txt;
1652 end match;
1653 end dumpVarDirection;
1654
1655 protected function lm_69
1656 input output Tpl.Text txt;
1657 input list<String> items;
1658 algorithm
1659
2/2
✓ Branch 0 taken 500 times.
✓ Branch 1 taken 143 times.
643 for lstElt_69 in items loop
1660 txt := match lstElt_69
1661 local
1662 String i_it;
1663
1664 case i_it
1665 algorithm
1666 500 txt := Tpl.writeStr(txt, i_it);
1667 500 txt := Tpl.nextIter(txt);
1668 then txt;
1669 end match;
1670 end for;
1671 end lm_69;
1672
1673 public function dumpType
1674 input Tpl.Text in_txt;
1675 input DAE.Type in_a_ty;
1676 input Tpl.Text in_a_attributes;
1677
1678 output Tpl.Text out_txt;
1679 output Tpl.Text out_a_attributes;
1680 algorithm
1681 (out_txt, out_a_attributes) :=
1682 match(in_txt, in_a_ty, in_a_attributes)
1683 local
1684 Tpl.Text txt;
1685 Tpl.Text a_attributes;
1686 Absyn.Path i_path;
1687 String i_name;
1688 list<DAE.Type> i_types;
1689 DAE.Type i_complexType;
1690 ClassInf.State i_complexClassType;
1691 Absyn.Path i_rname;
1692 DAE.Dimensions i_dims;
1693 DAE.Type i_ty;
1694 list<String> i_names;
1695 list<DAE.Var> i_varLst;
1696 Absyn.Path ret_2;
1697 Tpl.Text txt_1;
1698 Tpl.Text l_lit__str;
1699
1700 case ( txt,
1701 DAE.T_INTEGER(varLst = i_varLst),
1702 a_attributes )
1703 algorithm
1704 1192 a_attributes := dumpVarAttributes(a_attributes, i_varLst);
1705 1192 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Integer"));
1706 1192 then (txt, a_attributes);
1707
1708 case ( txt,
1709 DAE.T_REAL(varLst = i_varLst),
1710 a_attributes )
1711 algorithm
1712 15710 a_attributes := dumpVarAttributes(a_attributes, i_varLst);
1713 15710 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Real"));
1714 15710 then (txt, a_attributes);
1715
1716 case ( txt,
1717 DAE.T_STRING(varLst = i_varLst),
1718 a_attributes )
1719 algorithm
1720 356 a_attributes := dumpVarAttributes(a_attributes, i_varLst);
1721 356 txt := Tpl.writeTok(txt, Tpl.ST_STRING("String"));
1722 356 then (txt, a_attributes);
1723
1724 case ( txt,
1725 DAE.T_BOOL(varLst = i_varLst),
1726 a_attributes )
1727 algorithm
1728 625 a_attributes := dumpVarAttributes(a_attributes, i_varLst);
1729 625 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Boolean"));
1730 625 then (txt, a_attributes);
1731
1732 case ( txt,
1733 DAE.T_CLOCK(varLst = i_varLst),
1734 a_attributes )
1735 algorithm
1736 18 a_attributes := dumpVarAttributes(a_attributes, i_varLst);
1737 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("Clock"));
1738 18 then (txt, a_attributes);
1739
1740 case ( txt,
1741 DAE.T_ENUMERATION(names = i_names),
1742 a_attributes )
1743 algorithm
1744 143 l_lit__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()));
1745 143 l_lit__str := lm_69(l_lit__str, i_names);
1746 143 l_lit__str := Tpl.popIter(l_lit__str);
1747 143 txt := Tpl.writeTok(txt, Tpl.ST_STRING("enumeration("));
1748 143 txt := Tpl.writeText(txt, l_lit__str);
1749 143 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
1750 143 then (txt, a_attributes);
1751
1752 case ( txt,
1753 DAE.T_ARRAY(ty = i_ty, dims = i_dims),
1754 a_attributes )
1755 algorithm
1756 94 txt_1 := dumpDimensions(Tpl.emptyTxt, i_dims);
1757 94 (txt, a_attributes) := dumpArrayType(txt, i_ty, Tpl.textString(txt_1), a_attributes);
1758 then (txt, a_attributes);
1759
1760 case ( txt,
1761 DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(path = i_rname)),
1762 a_attributes )
1763 algorithm
1764 223 txt := AbsynDumpTpl.dumpPathNoQual(txt, i_rname);
1765 223 then (txt, a_attributes);
1766
1767 case ( txt,
1768 DAE.T_COMPLEX(complexClassType = i_complexClassType),
1769 a_attributes )
1770 algorithm
1771 28 ret_2 := ClassInfUtil.getStateName(i_complexClassType);
1772 28 txt := AbsynDumpTpl.dumpPath(txt, ret_2);
1773 28 then (txt, a_attributes);
1774
1775 case ( txt,
1776 DAE.T_SUBTYPE_BASIC(complexType = i_complexType),
1777 a_attributes )
1778 algorithm
1779 17 (txt, a_attributes) := dumpType(txt, i_complexType, a_attributes);
1780 then (txt, a_attributes);
1781
1782 case ( txt,
1783 (i_ty as DAE.T_FUNCTION(funcArg = _)),
1784 a_attributes )
1785 algorithm
1786 6 txt := dumpFunctionType(txt, i_ty);
1787 6 then (txt, a_attributes);
1788
1789 case ( txt,
1790 DAE.T_TUPLE(types = i_types),
1791 a_attributes )
1792 algorithm
1793 ✗ txt := dumpTupleType(txt, i_types, "(", ")");
1794 ✗ then (txt, a_attributes);
1795
1796 case ( txt,
1797 DAE.T_METATUPLE(types = i_types),
1798 a_attributes )
1799 algorithm
1800 ✗ txt := dumpTupleType(txt, i_types, "tuple<", ">");
1801 ✗ then (txt, a_attributes);
1802
1803 case ( txt,
1804 DAE.T_METALIST(ty = i_ty),
1805 a_attributes )
1806 algorithm
1807 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("list<"));
1808 6 (txt, a_attributes) := dumpType(txt, i_ty, a_attributes);
1809 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
1810 6 then (txt, a_attributes);
1811
1812 case ( txt,
1813 DAE.T_METAARRAY(ty = i_ty),
1814 a_attributes )
1815 algorithm
1816 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("array<"));
1817 ✗ (txt, a_attributes) := dumpType(txt, i_ty, a_attributes);
1818 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
1819 ✗ then (txt, a_attributes);
1820
1821 case ( txt,
1822 DAE.T_METAPOLYMORPHIC(name = i_name),
1823 a_attributes )
1824 algorithm
1825 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("polymorphic<"));
1826 ✗ txt := Tpl.writeStr(txt, i_name);
1827 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
1828 ✗ then (txt, a_attributes);
1829
1830 case ( txt,
1831 DAE.T_METAUNIONTYPE(path = i_path),
1832 a_attributes )
1833 algorithm
1834 2 txt := AbsynDumpTpl.dumpPathNoQual(txt, i_path);
1835 2 then (txt, a_attributes);
1836
1837 case ( txt,
1838 DAE.T_METARECORD(path = i_path),
1839 a_attributes )
1840 algorithm
1841 ✗ txt := AbsynDumpTpl.dumpPathNoQual(txt, i_path);
1842 ✗ then (txt, a_attributes);
1843
1844 case ( txt,
1845 DAE.T_METABOXED(ty = i_ty),
1846 a_attributes )
1847 algorithm
1848 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("#"));
1849 17 (txt, a_attributes) := dumpType(txt, i_ty, a_attributes);
1850 then (txt, a_attributes);
1851
1852 case ( txt,
1853 DAE.T_METAOPTION(ty = DAE.T_UNKNOWN()),
1854 a_attributes )
1855 algorithm
1856 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Option<Any>"));
1857 ✗ then (txt, a_attributes);
1858
1859 case ( txt,
1860 DAE.T_METAOPTION(ty = i_ty),
1861 a_attributes )
1862 algorithm
1863 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Option<"));
1864 ✗ (txt, a_attributes) := dumpType(txt, i_ty, a_attributes);
1865 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(">"));
1866 ✗ then (txt, a_attributes);
1867
1868 case ( txt,
1869 DAE.T_METATYPE(ty = i_ty),
1870 a_attributes )
1871 algorithm
1872 ✗ (txt, a_attributes) := dumpType(txt, i_ty, a_attributes);
1873 then (txt, a_attributes);
1874
1875 case ( txt,
1876 DAE.T_NORETCALL(),
1877 a_attributes )
1878 algorithm
1879 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_NORETCALL#"));
1880 ✗ then (txt, a_attributes);
1881
1882 case ( txt,
1883 DAE.T_UNKNOWN(),
1884 a_attributes )
1885 algorithm
1886 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_UNKNOWN#"));
1887 ✗ then (txt, a_attributes);
1888
1889 case ( txt,
1890 DAE.T_ANYTYPE(anyClassType = _),
1891 a_attributes )
1892 algorithm
1893 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("#T_ANYTYPE#"));
1894 ✗ then (txt, a_attributes);
1895
1896 case ( txt,
1897 _,
1898 a_attributes )
1899 algorithm
1900 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("DAEDumpTpl.dumpType: Not yet implemented"));
1901 ✗ then (txt, a_attributes);
1902 end match;
1903 end dumpType;
1904
1905 protected function fun_71
1906 input Tpl.Text in_txt;
1907 input String in_a_dims__accum;
1908 input Tpl.Text in_a_dims__str;
1909
1910 output Tpl.Text out_txt;
1911 algorithm
1912 out_txt :=
1913 match(in_txt, in_a_dims__accum, in_a_dims__str)
1914 local
1915 Tpl.Text txt;
1916 Tpl.Text a_dims__str;
1917 String i_dims__accum;
1918
1919 case ( txt,
1920 "",
1921 a_dims__str )
1922 algorithm
1923 ✗ txt := Tpl.writeText(txt, a_dims__str);
1924 then txt;
1925
1926 case ( txt,
1927 i_dims__accum,
1928 a_dims__str )
1929 algorithm
1930 2 txt := Tpl.writeStr(txt, i_dims__accum);
1931 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
1932 2 txt := Tpl.writeText(txt, a_dims__str);
1933 then txt;
1934 end match;
1935 end fun_71;
1936
1937 protected function fun_72
1938 input Tpl.Text in_txt;
1939 input String in_a_dims__accum;
1940
1941 output Tpl.Text out_txt;
1942 algorithm
1943 out_txt :=
1944 match(in_txt, in_a_dims__accum)
1945 local
1946 Tpl.Text txt;
1947 String i_dims__accum;
1948
1949 case ( txt,
1950 "" )
1951 then txt;
1952
1953 case ( txt,
1954 i_dims__accum )
1955 algorithm
1956 94 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
1957 94 txt := Tpl.writeStr(txt, i_dims__accum);
1958 94 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
1959 then txt;
1960 end match;
1961 end fun_72;
1962
1963 public function dumpArrayType
1964 input Tpl.Text in_txt;
1965 input DAE.Type in_a_ty;
1966 input String in_a_dims__accum;
1967 input Tpl.Text in_a_attributes;
1968
1969 output Tpl.Text out_txt;
1970 output Tpl.Text out_a_attributes;
1971 algorithm
1972 (out_txt, out_a_attributes) :=
1973 match(in_txt, in_a_ty, in_a_dims__accum, in_a_attributes)
1974 local
1975 Tpl.Text txt;
1976 String a_dims__accum;
1977 Tpl.Text a_attributes;
1978 DAE.Type i_ty;
1979 DAE.Dimensions i_dims;
1980 Tpl.Text l_ty__str;
1981 Tpl.Text l_dims__accum__str;
1982 Tpl.Text l_dims__str;
1983
1984 case ( txt,
1985 DAE.T_ARRAY(dims = i_dims, ty = i_ty),
1986 a_dims__accum,
1987 a_attributes )
1988 algorithm
1989 2 l_dims__str := dumpDimensions(Tpl.emptyTxt, i_dims);
1990 2 l_dims__accum__str := fun_71(Tpl.emptyTxt, a_dims__accum, l_dims__str);
1991 2 (txt, a_attributes) := dumpArrayType(txt, i_ty, Tpl.textString(l_dims__accum__str), a_attributes);
1992 then (txt, a_attributes);
1993
1994 case ( txt,
1995 i_ty,
1996 a_dims__accum,
1997 a_attributes )
1998 algorithm
1999 94 (l_ty__str, a_attributes) := dumpType(Tpl.emptyTxt, i_ty, a_attributes);
2000 94 l_dims__str := fun_72(Tpl.emptyTxt, a_dims__accum);
2001 94 txt := Tpl.writeText(txt, l_ty__str);
2002 94 txt := Tpl.writeText(txt, l_dims__str);
2003
1/2
✓ Branch 0 taken 94 times.
✗ Branch 1 not taken.
94 then (txt, a_attributes);
2004 end match;
2005 end dumpArrayType;
2006
2007 protected function lm_74
2008 input output Tpl.Text txt;
2009 input list<DAE.Type> items;
2010 input output Tpl.Text a_attr;
2011 algorithm
2012 ✗ for lstElt_74 in items loop
2013 (txt, a_attr) := match lstElt_74
2014 local
2015 DAE.Type i_ty;
2016
2017 case i_ty
2018 algorithm
2019 ✗ (txt, a_attr) := dumpType(txt, i_ty, a_attr);
2020 ✗ txt := Tpl.nextIter(txt);
2021 then (txt, a_attr);
2022 end match;
2023 end for;
2024 end lm_74;
2025
2026 public function dumpTupleType
2027 input Tpl.Text txt;
2028 input list<DAE.Type> a_tys;
2029 input String a_ty__begin;
2030 input String a_ty__end;
2031
2032 output Tpl.Text out_txt;
2033 protected
2034 Tpl.Text l_attr;
2035 algorithm
2036 ✗ l_attr := Tpl.emptyTxt;
2037 ✗ out_txt := Tpl.writeStr(txt, a_ty__begin);
2038 ✗ out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2039 ✗ (out_txt, l_attr) := lm_74(out_txt, a_tys, l_attr);
2040 ✗ out_txt := Tpl.popIter(out_txt);
2041 ✗ out_txt := Tpl.writeStr(out_txt, a_ty__end);
2042 end dumpTupleType;
2043
2044 protected function lm_76
2045 input output Tpl.Text txt;
2046 input list<DAE.FuncArg> items;
2047 algorithm
2048
2/2
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 6 times.
13 for lstElt_76 in items loop
2049 txt := match lstElt_76
2050 local
2051 DAE.FuncArg i_arg;
2052
2053 case i_arg
2054 algorithm
2055 7 txt := dumpFuncArg(txt, i_arg);
2056 7 txt := Tpl.nextIter(txt);
2057 then txt;
2058 end match;
2059 end for;
2060 end lm_76;
2061
2062 public function dumpFunctionType
2063 input Tpl.Text in_txt;
2064 input DAE.Type in_a_ty;
2065
2066 output Tpl.Text out_txt;
2067 algorithm
2068 out_txt :=
2069 match(in_txt, in_a_ty)
2070 local
2071 Tpl.Text txt;
2072 DAE.Type i_funcResultType;
2073 Absyn.Path i_path;
2074 list<DAE.FuncArg> i_funcArg;
2075 Tpl.Text l_res__str;
2076 Tpl.Text l_attr;
2077 Tpl.Text l_src__str;
2078 Tpl.Text l_args__str;
2079
2080 case ( txt,
2081 DAE.T_FUNCTION(funcArg = i_funcArg, path = i_path, funcResultType = i_funcResultType) )
2082 algorithm
2083 6 l_args__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2084 6 l_args__str := lm_76(l_args__str, i_funcArg);
2085 6 l_args__str := Tpl.popIter(l_args__str);
2086 6 l_src__str := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, i_path);
2087 6 l_attr := Tpl.emptyTxt;
2088 6 (l_res__str, l_attr) := dumpType(Tpl.emptyTxt, i_funcResultType, l_attr);
2089 6 txt := Tpl.writeText(txt, l_src__str);
2090 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING("<function>("));
2091 6 txt := Tpl.writeText(txt, l_args__str);
2092 6 txt := Tpl.writeTok(txt, Tpl.ST_STRING(") => "));
2093 6 txt := Tpl.writeText(txt, l_res__str);
2094 then txt;
2095
2096 case ( txt,
2097 _ )
2098 then txt;
2099 end match;
2100 end dumpFunctionType;
2101
2102 protected function fun_78
2103 input Tpl.Text in_txt;
2104 input Option<DAE.Exp> in_a_defaultBinding;
2105
2106 output Tpl.Text out_txt;
2107 algorithm
2108 out_txt :=
2109 match(in_txt, in_a_defaultBinding)
2110 local
2111 Tpl.Text txt;
2112 DAE.Exp i_bexp;
2113
2114 case ( txt,
2115 SOME(i_bexp) )
2116 algorithm
2117 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1));
2118 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(":= "));
2119 ✗ txt := dumpExp(txt, i_bexp);
2120 ✗ txt := Tpl.popBlock(txt);
2121 then txt;
2122
2123 case ( txt,
2124 _ )
2125 then txt;
2126 end match;
2127 end fun_78;
2128
2129 public function dumpFuncArg
2130 input Tpl.Text in_txt;
2131 input DAE.FuncArg in_a_arg;
2132
2133 output Tpl.Text out_txt;
2134 algorithm
2135 out_txt :=
2136 match(in_txt, in_a_arg)
2137 local
2138 Tpl.Text txt;
2139 String i_name;
2140 Option<DAE.Exp> i_defaultBinding;
2141 DAE.VarParallelism i_par;
2142 DAE.Const i_const;
2143 DAE.Type i_ty;
2144 Tpl.Text l_binding__str;
2145 Tpl.Text l_p__str;
2146 Tpl.Text l_c__str;
2147 Tpl.Text l_ty__str;
2148 Tpl.Text l_attr;
2149
2150 case ( txt,
2151 DAE.FUNCARG(ty = i_ty, const = i_const, par = i_par, defaultBinding = i_defaultBinding, name = i_name) )
2152 algorithm
2153 7 l_attr := Tpl.emptyTxt;
2154 7 (l_ty__str, l_attr) := dumpType(Tpl.emptyTxt, i_ty, l_attr);
2155 7 l_c__str := dumpConst(Tpl.emptyTxt, i_const);
2156 7 l_p__str := dumpParallelism(Tpl.emptyTxt, i_par);
2157 7 l_binding__str := fun_78(Tpl.emptyTxt, i_defaultBinding);
2158 7 txt := Tpl.writeText(txt, l_ty__str);
2159 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
2160 7 txt := Tpl.writeText(txt, l_c__str);
2161 7 txt := Tpl.writeText(txt, l_p__str);
2162 7 txt := Tpl.writeStr(txt, i_name);
2163 7 txt := Tpl.writeText(txt, l_binding__str);
2164 then txt;
2165
2166 case ( txt,
2167 _ )
2168 then txt;
2169 end match;
2170 end dumpFuncArg;
2171
2172 public function dumpRecordType
2173 input Tpl.Text in_txt;
2174 input DAE.Type in_a_ty;
2175
2176 output Tpl.Text out_txt;
2177 algorithm
2178 out_txt :=
2179 match(in_txt, in_a_ty)
2180 local
2181 Tpl.Text txt;
2182 DAE.Type i_funcResultType;
2183 list<DAE.Var> i_varLst;
2184 ClassInf.State i_complexClassType;
2185 Tpl.Text l_vars;
2186 Absyn.Path ret_1;
2187 Tpl.Text l_name;
2188
2189 case ( txt,
2190 DAE.T_COMPLEX(complexClassType = i_complexClassType, varLst = i_varLst) )
2191 algorithm
2192 2 ret_1 := ClassInfUtil.getStateName(i_complexClassType);
2193 2 l_name := AbsynDumpTpl.dumpPath(Tpl.emptyTxt, ret_1);
2194 2 l_vars := dumpRecordVars(Tpl.emptyTxt, i_varLst);
2195 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("record "));
2196 2 txt := Tpl.writeText(txt, l_name);
2197 2 txt := Tpl.softNewLine(txt);
2198 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
2199 2 txt := Tpl.writeText(txt, l_vars);
2200 2 txt := Tpl.softNewLine(txt);
2201 2 txt := Tpl.popBlock(txt);
2202 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
2203 2 txt := Tpl.writeText(txt, l_name);
2204 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
2205 then txt;
2206
2207 case ( txt,
2208 DAE.T_FUNCTION(funcResultType = i_funcResultType) )
2209 algorithm
2210 2 txt := dumpRecordType(txt, i_funcResultType);
2211 then txt;
2212
2213 case ( txt,
2214 _ )
2215 then txt;
2216 end match;
2217 end dumpRecordType;
2218
2219 public function dumpConst
2220 input Tpl.Text in_txt;
2221 input DAE.Const in_a_c;
2222
2223 output Tpl.Text out_txt;
2224 algorithm
2225 out_txt :=
2226 match(in_txt, in_a_c)
2227 local
2228 Tpl.Text txt;
2229
2230 case ( txt,
2231 DAE.C_PARAM() )
2232 algorithm
2233 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parameter "));
2234 then txt;
2235
2236 case ( txt,
2237 DAE.C_CONST() )
2238 algorithm
2239 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("constant "));
2240 then txt;
2241
2242 case ( txt,
2243 _ )
2244 then txt;
2245 end match;
2246 end dumpConst;
2247
2248 public function dumpParallelism
2249 input Tpl.Text in_txt;
2250 input DAE.VarParallelism in_a_p;
2251
2252 output Tpl.Text out_txt;
2253 algorithm
2254 out_txt :=
2255 match(in_txt, in_a_p)
2256 local
2257 Tpl.Text txt;
2258
2259 case ( txt,
2260 DAE.PARGLOBAL() )
2261 algorithm
2262 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parglobal "));
2263 then txt;
2264
2265 case ( txt,
2266 DAE.PARLOCAL() )
2267 algorithm
2268 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parlocal "));
2269 then txt;
2270
2271 case ( txt,
2272 _ )
2273 then txt;
2274 end match;
2275 end dumpParallelism;
2276
2277 protected function lm_83
2278 input output Tpl.Text txt;
2279 input list<DAE.Var> items;
2280 algorithm
2281
2/2
✓ Branch 0 taken 1067 times.
✓ Branch 1 taken 338 times.
1405 for lstElt_83 in items loop
2282 txt := match lstElt_83
2283 local
2284 DAE.Var i_var;
2285
2286 case i_var
2287 algorithm
2288 1067 txt := dumpVarAttribute(txt, i_var);
2289 1067 txt := Tpl.nextIter(txt);
2290 then txt;
2291 end match;
2292 end for;
2293 end lm_83;
2294
2295 public function dumpVarAttributes
2296 input Tpl.Text in_txt;
2297 input list<DAE.Var> in_a_literalVarLst;
2298
2299 output Tpl.Text out_txt;
2300 algorithm
2301 out_txt :=
2302 match(in_txt, in_a_literalVarLst)
2303 local
2304 Tpl.Text txt;
2305 list<DAE.Var> i_literalVarLst;
2306
2307 case ( txt,
2308 {} )
2309 then txt;
2310
2311 case ( txt,
2312 i_literalVarLst )
2313 algorithm
2314 338 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2315 338 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2316 338 txt := lm_83(txt, i_literalVarLst);
2317 338 txt := Tpl.popIter(txt);
2318 338 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2319 then txt;
2320 end match;
2321 end dumpVarAttributes;
2322
2323 public function dumpVarAttribute
2324 input Tpl.Text in_txt;
2325 input DAE.Var in_a_var;
2326
2327 output Tpl.Text out_txt;
2328 algorithm
2329 out_txt :=
2330 match(in_txt, in_a_var)
2331 local
2332 Tpl.Text txt;
2333 DAE.Exp i_e;
2334 DAE.Ident i_name;
2335
2336 case ( txt,
2337 DAE.TYPES_VAR(binding = DAE.EQBOUND(exp = i_e), name = i_name) )
2338 algorithm
2339 1067 txt := Tpl.writeStr(txt, i_name);
2340 1067 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
2341 1067 txt := dumpExp(txt, i_e);
2342 then txt;
2343
2344 case ( txt,
2345 _ )
2346 then txt;
2347 end match;
2348 end dumpVarAttribute;
2349
2350 protected function lm_86
2351 input output Tpl.Text txt;
2352 input list<DAE.Dimension> items;
2353 algorithm
2354
2/2
✓ Branch 0 taken 105 times.
✓ Branch 1 taken 96 times.
201 for lstElt_86 in items loop
2355 txt := match lstElt_86
2356 local
2357 DAE.Dimension i_dim;
2358
2359 case i_dim
2360 algorithm
2361 105 txt := dumpDimension(txt, i_dim);
2362 105 txt := Tpl.nextIter(txt);
2363 then txt;
2364 end match;
2365 end for;
2366 end lm_86;
2367
2368 public function dumpDimensions
2369 input Tpl.Text in_txt;
2370 input list<DAE.Dimension> in_a_dims;
2371
2372 output Tpl.Text out_txt;
2373 algorithm
2374 out_txt :=
2375 match(in_txt, in_a_dims)
2376 local
2377 Tpl.Text txt;
2378 list<DAE.Dimension> i_dims;
2379
2380 case ( txt,
2381 {} )
2382 then txt;
2383
2384 case ( txt,
2385 i_dims )
2386 algorithm
2387 96 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
2388 96 txt := lm_86(txt, i_dims);
2389 96 txt := Tpl.popIter(txt);
2390 then txt;
2391 end match;
2392 end dumpDimensions;
2393
2394 public function dumpDimension
2395 input Tpl.Text in_txt;
2396 input DAE.Dimension in_a_dim;
2397
2398 output Tpl.Text out_txt;
2399 algorithm
2400 out_txt :=
2401 match(in_txt, in_a_dim)
2402 local
2403 Tpl.Text txt;
2404 DAE.Exp i_exp;
2405 Absyn.Path i_enumTypeName;
2406 Integer i_integer;
2407
2408 case ( txt,
2409 DAE.DIM_INTEGER(integer = i_integer) )
2410 algorithm
2411 275 txt := Tpl.writeStr(txt, intString(i_integer));
2412 then txt;
2413
2414 case ( txt,
2415 DAE.DIM_ENUM(enumTypeName = i_enumTypeName) )
2416 algorithm
2417 ✗ txt := AbsynDumpTpl.dumpPath(txt, i_enumTypeName);
2418 then txt;
2419
2420 case ( txt,
2421 DAE.DIM_EXP(exp = i_exp) )
2422 algorithm
2423 51 txt := dumpExp(txt, i_exp);
2424 then txt;
2425
2426 case ( txt,
2427 DAE.DIM_UNKNOWN() )
2428 algorithm
2429 116 txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
2430 then txt;
2431
2432 case ( txt,
2433 _ )
2434 then txt;
2435 end match;
2436 end dumpDimension;
2437
2438 protected function smf_89
2439 input Tpl.Text in_txt;
2440 input Tpl.Text in_it;
2441
2442 output Tpl.Text out_txt;
2443 algorithm
2444 out_txt :=
2445 match(in_txt, in_it)
2446 local
2447 Tpl.Text txt;
2448 Tpl.Text i_it;
2449
2450 case ( txt,
2451 i_it )
2452 algorithm
2453 12856 txt := Tpl.writeText(txt, i_it);
2454 12856 txt := Tpl.nextIter(txt);
2455 then txt;
2456 end match;
2457 end smf_89;
2458
2459 protected function smf_90
2460 input Tpl.Text in_txt;
2461 input Tpl.Text in_it;
2462
2463 output Tpl.Text out_txt;
2464 algorithm
2465 out_txt :=
2466 match(in_txt, in_it)
2467 local
2468 Tpl.Text txt;
2469 Tpl.Text i_it;
2470
2471 case ( txt,
2472 i_it )
2473 algorithm
2474 12856 txt := Tpl.writeText(txt, i_it);
2475 12856 txt := Tpl.nextIter(txt);
2476 then txt;
2477 end match;
2478 end smf_90;
2479
2480 protected function smf_91
2481 input Tpl.Text in_txt;
2482 input Tpl.Text in_it;
2483
2484 output Tpl.Text out_txt;
2485 algorithm
2486 out_txt :=
2487 match(in_txt, in_it)
2488 local
2489 Tpl.Text txt;
2490 Tpl.Text i_it;
2491
2492 case ( txt,
2493 i_it )
2494 algorithm
2495 12856 txt := Tpl.writeText(txt, i_it);
2496 12856 txt := Tpl.nextIter(txt);
2497 then txt;
2498 end match;
2499 end smf_91;
2500
2501 protected function smf_92
2502 input Tpl.Text in_txt;
2503 input Tpl.Text in_it;
2504
2505 output Tpl.Text out_txt;
2506 algorithm
2507 out_txt :=
2508 match(in_txt, in_it)
2509 local
2510 Tpl.Text txt;
2511 Tpl.Text i_it;
2512
2513 case ( txt,
2514 i_it )
2515 algorithm
2516 12856 txt := Tpl.writeText(txt, i_it);
2517 12856 txt := Tpl.nextIter(txt);
2518 then txt;
2519 end match;
2520 end smf_92;
2521
2522 protected function smf_93
2523 input Tpl.Text in_txt;
2524 input Tpl.Text in_it;
2525
2526 output Tpl.Text out_txt;
2527 algorithm
2528 out_txt :=
2529 match(in_txt, in_it)
2530 local
2531 Tpl.Text txt;
2532 Tpl.Text i_it;
2533
2534 case ( txt,
2535 i_it )
2536 algorithm
2537 12856 txt := Tpl.writeText(txt, i_it);
2538 12856 txt := Tpl.nextIter(txt);
2539 then txt;
2540 end match;
2541 end smf_93;
2542
2543 protected function smf_94
2544 input Tpl.Text in_txt;
2545 input Tpl.Text in_it;
2546
2547 output Tpl.Text out_txt;
2548 algorithm
2549 out_txt :=
2550 match(in_txt, in_it)
2551 local
2552 Tpl.Text txt;
2553 Tpl.Text i_it;
2554
2555 case ( txt,
2556 i_it )
2557 algorithm
2558 12856 txt := Tpl.writeText(txt, i_it);
2559 12856 txt := Tpl.nextIter(txt);
2560 then txt;
2561 end match;
2562 end smf_94;
2563
2564 protected function smf_95
2565 input Tpl.Text in_txt;
2566 input Tpl.Text in_it;
2567
2568 output Tpl.Text out_txt;
2569 algorithm
2570 out_txt :=
2571 match(in_txt, in_it)
2572 local
2573 Tpl.Text txt;
2574 Tpl.Text i_it;
2575
2576 case ( txt,
2577 i_it )
2578 algorithm
2579 12856 txt := Tpl.writeText(txt, i_it);
2580 12856 txt := Tpl.nextIter(txt);
2581 then txt;
2582 end match;
2583 end smf_95;
2584
2585 protected function smf_96
2586 input Tpl.Text in_txt;
2587 input Tpl.Text in_it;
2588
2589 output Tpl.Text out_txt;
2590 algorithm
2591 out_txt :=
2592 match(in_txt, in_it)
2593 local
2594 Tpl.Text txt;
2595 Tpl.Text i_it;
2596
2597 case ( txt,
2598 i_it )
2599 algorithm
2600 12856 txt := Tpl.writeText(txt, i_it);
2601 12856 txt := Tpl.nextIter(txt);
2602 then txt;
2603 end match;
2604 end smf_96;
2605
2606 protected function smf_97
2607 input Tpl.Text in_txt;
2608 input Tpl.Text in_it;
2609
2610 output Tpl.Text out_txt;
2611 algorithm
2612 out_txt :=
2613 match(in_txt, in_it)
2614 local
2615 Tpl.Text txt;
2616 Tpl.Text i_it;
2617
2618 case ( txt,
2619 i_it )
2620 algorithm
2621 12856 txt := Tpl.writeText(txt, i_it);
2622 12856 txt := Tpl.nextIter(txt);
2623 then txt;
2624 end match;
2625 end smf_97;
2626
2627 protected function smf_98
2628 input Tpl.Text in_txt;
2629 input Tpl.Text in_it;
2630
2631 output Tpl.Text out_txt;
2632 algorithm
2633 out_txt :=
2634 match(in_txt, in_it)
2635 local
2636 Tpl.Text txt;
2637 Tpl.Text i_it;
2638
2639 case ( txt,
2640 i_it )
2641 algorithm
2642 12856 txt := Tpl.writeText(txt, i_it);
2643 12856 txt := Tpl.nextIter(txt);
2644 then txt;
2645 end match;
2646 end smf_98;
2647
2648 protected function smf_99
2649 input Tpl.Text in_txt;
2650 input Tpl.Text in_it;
2651
2652 output Tpl.Text out_txt;
2653 algorithm
2654 out_txt :=
2655 match(in_txt, in_it)
2656 local
2657 Tpl.Text txt;
2658 Tpl.Text i_it;
2659
2660 case ( txt,
2661 i_it )
2662 algorithm
2663 12856 txt := Tpl.writeText(txt, i_it);
2664 12856 txt := Tpl.nextIter(txt);
2665 then txt;
2666 end match;
2667 end smf_99;
2668
2669 protected function smf_100
2670 input Tpl.Text in_txt;
2671 input Tpl.Text in_it;
2672
2673 output Tpl.Text out_txt;
2674 algorithm
2675 out_txt :=
2676 match(in_txt, in_it)
2677 local
2678 Tpl.Text txt;
2679 Tpl.Text i_it;
2680
2681 case ( txt,
2682 i_it )
2683 algorithm
2684 12856 txt := Tpl.writeText(txt, i_it);
2685 12856 txt := Tpl.nextIter(txt);
2686 then txt;
2687 end match;
2688 end smf_100;
2689
2690 protected function fun_101
2691 input Tpl.Text in_txt;
2692 input Boolean in_mArg;
2693 input Tpl.Text in_a_attrs__str;
2694
2695 output Tpl.Text out_txt;
2696 algorithm
2697 out_txt :=
2698 match(in_txt, in_mArg, in_a_attrs__str)
2699 local
2700 Tpl.Text txt;
2701 Tpl.Text a_attrs__str;
2702
2703 case ( txt,
2704 true,
2705 _ )
2706 then txt;
2707
2708 case ( txt,
2709 _,
2710 a_attrs__str )
2711 algorithm
2712 6569 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2713 6569 txt := Tpl.writeText(txt, a_attrs__str);
2714 6569 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2715 then txt;
2716 end match;
2717 end fun_101;
2718
2719 protected function smf_102
2720 input Tpl.Text in_txt;
2721 input Tpl.Text in_it;
2722
2723 output Tpl.Text out_txt;
2724 algorithm
2725 out_txt :=
2726 match(in_txt, in_it)
2727 local
2728 Tpl.Text txt;
2729 Tpl.Text i_it;
2730
2731 case ( txt,
2732 i_it )
2733 algorithm
2734 922 txt := Tpl.writeText(txt, i_it);
2735 922 txt := Tpl.nextIter(txt);
2736 then txt;
2737 end match;
2738 end smf_102;
2739
2740 protected function smf_103
2741 input Tpl.Text in_txt;
2742 input Tpl.Text in_it;
2743
2744 output Tpl.Text out_txt;
2745 algorithm
2746 out_txt :=
2747 match(in_txt, in_it)
2748 local
2749 Tpl.Text txt;
2750 Tpl.Text i_it;
2751
2752 case ( txt,
2753 i_it )
2754 algorithm
2755 922 txt := Tpl.writeText(txt, i_it);
2756 922 txt := Tpl.nextIter(txt);
2757 then txt;
2758 end match;
2759 end smf_103;
2760
2761 protected function smf_104
2762 input Tpl.Text in_txt;
2763 input Tpl.Text in_it;
2764
2765 output Tpl.Text out_txt;
2766 algorithm
2767 out_txt :=
2768 match(in_txt, in_it)
2769 local
2770 Tpl.Text txt;
2771 Tpl.Text i_it;
2772
2773 case ( txt,
2774 i_it )
2775 algorithm
2776 922 txt := Tpl.writeText(txt, i_it);
2777 922 txt := Tpl.nextIter(txt);
2778 then txt;
2779 end match;
2780 end smf_104;
2781
2782 protected function smf_105
2783 input Tpl.Text in_txt;
2784 input Tpl.Text in_it;
2785
2786 output Tpl.Text out_txt;
2787 algorithm
2788 out_txt :=
2789 match(in_txt, in_it)
2790 local
2791 Tpl.Text txt;
2792 Tpl.Text i_it;
2793
2794 case ( txt,
2795 i_it )
2796 algorithm
2797 922 txt := Tpl.writeText(txt, i_it);
2798 922 txt := Tpl.nextIter(txt);
2799 then txt;
2800 end match;
2801 end smf_105;
2802
2803 protected function smf_106
2804 input Tpl.Text in_txt;
2805 input Tpl.Text in_it;
2806
2807 output Tpl.Text out_txt;
2808 algorithm
2809 out_txt :=
2810 match(in_txt, in_it)
2811 local
2812 Tpl.Text txt;
2813 Tpl.Text i_it;
2814
2815 case ( txt,
2816 i_it )
2817 algorithm
2818 922 txt := Tpl.writeText(txt, i_it);
2819 922 txt := Tpl.nextIter(txt);
2820 then txt;
2821 end match;
2822 end smf_106;
2823
2824 protected function smf_107
2825 input Tpl.Text in_txt;
2826 input Tpl.Text in_it;
2827
2828 output Tpl.Text out_txt;
2829 algorithm
2830 out_txt :=
2831 match(in_txt, in_it)
2832 local
2833 Tpl.Text txt;
2834 Tpl.Text i_it;
2835
2836 case ( txt,
2837 i_it )
2838 algorithm
2839 922 txt := Tpl.writeText(txt, i_it);
2840 922 txt := Tpl.nextIter(txt);
2841 then txt;
2842 end match;
2843 end smf_107;
2844
2845 protected function smf_108
2846 input Tpl.Text in_txt;
2847 input Tpl.Text in_it;
2848
2849 output Tpl.Text out_txt;
2850 algorithm
2851 out_txt :=
2852 match(in_txt, in_it)
2853 local
2854 Tpl.Text txt;
2855 Tpl.Text i_it;
2856
2857 case ( txt,
2858 i_it )
2859 algorithm
2860 922 txt := Tpl.writeText(txt, i_it);
2861 922 txt := Tpl.nextIter(txt);
2862 then txt;
2863 end match;
2864 end smf_108;
2865
2866 protected function smf_109
2867 input Tpl.Text in_txt;
2868 input Tpl.Text in_it;
2869
2870 output Tpl.Text out_txt;
2871 algorithm
2872 out_txt :=
2873 match(in_txt, in_it)
2874 local
2875 Tpl.Text txt;
2876 Tpl.Text i_it;
2877
2878 case ( txt,
2879 i_it )
2880 algorithm
2881 922 txt := Tpl.writeText(txt, i_it);
2882 922 txt := Tpl.nextIter(txt);
2883 then txt;
2884 end match;
2885 end smf_109;
2886
2887 protected function fun_110
2888 input Tpl.Text in_txt;
2889 input Boolean in_mArg;
2890 input Tpl.Text in_a_attrs__str;
2891
2892 output Tpl.Text out_txt;
2893 algorithm
2894 out_txt :=
2895 match(in_txt, in_mArg, in_a_attrs__str)
2896 local
2897 Tpl.Text txt;
2898 Tpl.Text a_attrs__str;
2899
2900 case ( txt,
2901 true,
2902 _ )
2903 then txt;
2904
2905 case ( txt,
2906 _,
2907 a_attrs__str )
2908 algorithm
2909 135 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
2910 135 txt := Tpl.writeText(txt, a_attrs__str);
2911 135 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
2912 then txt;
2913 end match;
2914 end fun_110;
2915
2916 protected function smf_111
2917 input Tpl.Text in_txt;
2918 input Tpl.Text in_it;
2919
2920 output Tpl.Text out_txt;
2921 algorithm
2922 out_txt :=
2923 match(in_txt, in_it)
2924 local
2925 Tpl.Text txt;
2926 Tpl.Text i_it;
2927
2928 case ( txt,
2929 i_it )
2930 algorithm
2931 523 txt := Tpl.writeText(txt, i_it);
2932 523 txt := Tpl.nextIter(txt);
2933 then txt;
2934 end match;
2935 end smf_111;
2936
2937 protected function smf_112
2938 input Tpl.Text in_txt;
2939 input Tpl.Text in_it;
2940
2941 output Tpl.Text out_txt;
2942 algorithm
2943 out_txt :=
2944 match(in_txt, in_it)
2945 local
2946 Tpl.Text txt;
2947 Tpl.Text i_it;
2948
2949 case ( txt,
2950 i_it )
2951 algorithm
2952 523 txt := Tpl.writeText(txt, i_it);
2953 523 txt := Tpl.nextIter(txt);
2954 then txt;
2955 end match;
2956 end smf_112;
2957
2958 protected function smf_113
2959 input Tpl.Text in_txt;
2960 input Tpl.Text in_it;
2961
2962 output Tpl.Text out_txt;
2963 algorithm
2964 out_txt :=
2965 match(in_txt, in_it)
2966 local
2967 Tpl.Text txt;
2968 Tpl.Text i_it;
2969
2970 case ( txt,
2971 i_it )
2972 algorithm
2973 523 txt := Tpl.writeText(txt, i_it);
2974 523 txt := Tpl.nextIter(txt);
2975 then txt;
2976 end match;
2977 end smf_113;
2978
2979 protected function smf_114
2980 input Tpl.Text in_txt;
2981 input Tpl.Text in_it;
2982
2983 output Tpl.Text out_txt;
2984 algorithm
2985 out_txt :=
2986 match(in_txt, in_it)
2987 local
2988 Tpl.Text txt;
2989 Tpl.Text i_it;
2990
2991 case ( txt,
2992 i_it )
2993 algorithm
2994 523 txt := Tpl.writeText(txt, i_it);
2995 523 txt := Tpl.nextIter(txt);
2996 then txt;
2997 end match;
2998 end smf_114;
2999
3000 protected function fun_115
3001 input Tpl.Text in_txt;
3002 input Boolean in_mArg;
3003 input Tpl.Text in_a_attrs__str;
3004
3005 output Tpl.Text out_txt;
3006 algorithm
3007 out_txt :=
3008 match(in_txt, in_mArg, in_a_attrs__str)
3009 local
3010 Tpl.Text txt;
3011 Tpl.Text a_attrs__str;
3012
3013 case ( txt,
3014 true,
3015 _ )
3016 then txt;
3017
3018 case ( txt,
3019 _,
3020 a_attrs__str )
3021 algorithm
3022 29 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3023 29 txt := Tpl.writeText(txt, a_attrs__str);
3024 29 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3025 then txt;
3026 end match;
3027 end fun_115;
3028
3029 protected function smf_116
3030 input Tpl.Text in_txt;
3031 input Tpl.Text in_it;
3032
3033 output Tpl.Text out_txt;
3034 algorithm
3035 out_txt :=
3036 match(in_txt, in_it)
3037 local
3038 Tpl.Text txt;
3039 Tpl.Text i_it;
3040
3041 case ( txt,
3042 i_it )
3043 algorithm
3044 141 txt := Tpl.writeText(txt, i_it);
3045 141 txt := Tpl.nextIter(txt);
3046 then txt;
3047 end match;
3048 end smf_116;
3049
3050 protected function smf_117
3051 input Tpl.Text in_txt;
3052 input Tpl.Text in_it;
3053
3054 output Tpl.Text out_txt;
3055 algorithm
3056 out_txt :=
3057 match(in_txt, in_it)
3058 local
3059 Tpl.Text txt;
3060 Tpl.Text i_it;
3061
3062 case ( txt,
3063 i_it )
3064 algorithm
3065 141 txt := Tpl.writeText(txt, i_it);
3066 141 txt := Tpl.nextIter(txt);
3067 then txt;
3068 end match;
3069 end smf_117;
3070
3071 protected function smf_118
3072 input Tpl.Text in_txt;
3073 input Tpl.Text in_it;
3074
3075 output Tpl.Text out_txt;
3076 algorithm
3077 out_txt :=
3078 match(in_txt, in_it)
3079 local
3080 Tpl.Text txt;
3081 Tpl.Text i_it;
3082
3083 case ( txt,
3084 i_it )
3085 algorithm
3086 141 txt := Tpl.writeText(txt, i_it);
3087 141 txt := Tpl.nextIter(txt);
3088 then txt;
3089 end match;
3090 end smf_118;
3091
3092 protected function fun_119
3093 input Tpl.Text in_txt;
3094 input Boolean in_mArg;
3095 input Tpl.Text in_a_attrs__str;
3096
3097 output Tpl.Text out_txt;
3098 algorithm
3099 out_txt :=
3100 match(in_txt, in_mArg, in_a_attrs__str)
3101 local
3102 Tpl.Text txt;
3103 Tpl.Text a_attrs__str;
3104
3105 case ( txt,
3106 true,
3107 _ )
3108 then txt;
3109
3110 case ( txt,
3111 _,
3112 a_attrs__str )
3113 algorithm
3114 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3115 1 txt := Tpl.writeText(txt, a_attrs__str);
3116 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3117 then txt;
3118 end match;
3119 end fun_119;
3120
3121 protected function smf_120
3122 input Tpl.Text in_txt;
3123 input Tpl.Text in_it;
3124
3125 output Tpl.Text out_txt;
3126 algorithm
3127 out_txt :=
3128 match(in_txt, in_it)
3129 local
3130 Tpl.Text txt;
3131 Tpl.Text i_it;
3132
3133 case ( txt,
3134 i_it )
3135 algorithm
3136 105 txt := Tpl.writeText(txt, i_it);
3137 105 txt := Tpl.nextIter(txt);
3138 then txt;
3139 end match;
3140 end smf_120;
3141
3142 protected function smf_121
3143 input Tpl.Text in_txt;
3144 input Tpl.Text in_it;
3145
3146 output Tpl.Text out_txt;
3147 algorithm
3148 out_txt :=
3149 match(in_txt, in_it)
3150 local
3151 Tpl.Text txt;
3152 Tpl.Text i_it;
3153
3154 case ( txt,
3155 i_it )
3156 algorithm
3157 105 txt := Tpl.writeText(txt, i_it);
3158 105 txt := Tpl.nextIter(txt);
3159 then txt;
3160 end match;
3161 end smf_121;
3162
3163 protected function smf_122
3164 input Tpl.Text in_txt;
3165 input Tpl.Text in_it;
3166
3167 output Tpl.Text out_txt;
3168 algorithm
3169 out_txt :=
3170 match(in_txt, in_it)
3171 local
3172 Tpl.Text txt;
3173 Tpl.Text i_it;
3174
3175 case ( txt,
3176 i_it )
3177 algorithm
3178 105 txt := Tpl.writeText(txt, i_it);
3179 105 txt := Tpl.nextIter(txt);
3180 then txt;
3181 end match;
3182 end smf_122;
3183
3184 protected function smf_123
3185 input Tpl.Text in_txt;
3186 input Tpl.Text in_it;
3187
3188 output Tpl.Text out_txt;
3189 algorithm
3190 out_txt :=
3191 match(in_txt, in_it)
3192 local
3193 Tpl.Text txt;
3194 Tpl.Text i_it;
3195
3196 case ( txt,
3197 i_it )
3198 algorithm
3199 105 txt := Tpl.writeText(txt, i_it);
3200 105 txt := Tpl.nextIter(txt);
3201 then txt;
3202 end match;
3203 end smf_123;
3204
3205 protected function smf_124
3206 input Tpl.Text in_txt;
3207 input Tpl.Text in_it;
3208
3209 output Tpl.Text out_txt;
3210 algorithm
3211 out_txt :=
3212 match(in_txt, in_it)
3213 local
3214 Tpl.Text txt;
3215 Tpl.Text i_it;
3216
3217 case ( txt,
3218 i_it )
3219 algorithm
3220 105 txt := Tpl.writeText(txt, i_it);
3221 105 txt := Tpl.nextIter(txt);
3222 then txt;
3223 end match;
3224 end smf_124;
3225
3226 protected function smf_125
3227 input Tpl.Text in_txt;
3228 input Tpl.Text in_it;
3229
3230 output Tpl.Text out_txt;
3231 algorithm
3232 out_txt :=
3233 match(in_txt, in_it)
3234 local
3235 Tpl.Text txt;
3236 Tpl.Text i_it;
3237
3238 case ( txt,
3239 i_it )
3240 algorithm
3241 105 txt := Tpl.writeText(txt, i_it);
3242 105 txt := Tpl.nextIter(txt);
3243 then txt;
3244 end match;
3245 end smf_125;
3246
3247 protected function fun_126
3248 input Tpl.Text in_txt;
3249 input Boolean in_mArg;
3250 input Tpl.Text in_a_attrs__str;
3251
3252 output Tpl.Text out_txt;
3253 algorithm
3254 out_txt :=
3255 match(in_txt, in_mArg, in_a_attrs__str)
3256 local
3257 Tpl.Text txt;
3258 Tpl.Text a_attrs__str;
3259
3260 case ( txt,
3261 true,
3262 _ )
3263 then txt;
3264
3265 case ( txt,
3266 _,
3267 a_attrs__str )
3268 algorithm
3269 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
3270 8 txt := Tpl.writeText(txt, a_attrs__str);
3271 8 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3272 then txt;
3273 end match;
3274 end fun_126;
3275
3276 public function dumpVariableAttributes
3277 input Tpl.Text in_txt;
3278 input DAE.VariableAttributes in_a_variableAttributesOption;
3279
3280 output Tpl.Text out_txt;
3281 algorithm
3282 out_txt :=
3283 match(in_txt, in_a_variableAttributesOption)
3284 local
3285 Tpl.Text txt;
3286 Option<DAE.StartOrigin> i_startOrigin;
3287 Option<DAE.Distribution> i_distributionOption;
3288 Option<DAE.Uncertainty> i_uncertainOption;
3289 Option<DAE.StateSelect> i_stateSelectOption;
3290 Option<DAE.Exp> i_nominal;
3291 Option<DAE.Exp> i_fixed;
3292 Option<DAE.Exp> i_start;
3293 Option<DAE.Exp> i_max;
3294 Option<DAE.Exp> i_min;
3295 Option<DAE.Exp> i_displayUnit;
3296 Option<DAE.Exp> i_unit;
3297 Option<DAE.Exp> i_quantity;
3298 Boolean ret_17;
3299 Boolean ret_16;
3300 Boolean ret_15;
3301 Boolean ret_14;
3302 Boolean ret_13;
3303 Tpl.Text l_attrs__str;
3304 Tpl.Text l_so__str;
3305 Tpl.Text l_dist__str;
3306 Tpl.Text l_uncert__str;
3307 Tpl.Text l_statesel__str;
3308 Tpl.Text l_nominal__str;
3309 Tpl.Text l_fixed__str;
3310 Tpl.Text l_start__str;
3311 Tpl.Text l_max__str;
3312 Tpl.Text l_min__str;
3313 Tpl.Text l_displayunit__str;
3314 Tpl.Text l_unit__str;
3315 Tpl.Text l_quantity__str;
3316
3317 case ( txt,
3318 DAE.VAR_ATTR_REAL(quantity = i_quantity, unit = i_unit, displayUnit = i_displayUnit, min = i_min, max = i_max, start = i_start, fixed = i_fixed, nominal = i_nominal, stateSelectOption = i_stateSelectOption, uncertainOption = i_uncertainOption, distributionOption = i_distributionOption, startOrigin = i_startOrigin) )
3319 algorithm
3320 12856 l_quantity__str := dumpExpAttrOpt(Tpl.emptyTxt, i_quantity, "quantity");
3321 12856 l_unit__str := dumpExpAttrOpt(Tpl.emptyTxt, i_unit, "unit");
3322 12856 l_displayunit__str := dumpExpAttrOpt(Tpl.emptyTxt, i_displayUnit, "displayUnit");
3323 12856 l_min__str := dumpExpAttrOpt(Tpl.emptyTxt, i_min, "min");
3324 12856 l_max__str := dumpExpAttrOpt(Tpl.emptyTxt, i_max, "max");
3325 12856 l_start__str := dumpExpAttrOpt(Tpl.emptyTxt, i_start, "start");
3326 12856 l_fixed__str := dumpExpAttrOpt(Tpl.emptyTxt, i_fixed, "fixed");
3327 12856 l_nominal__str := dumpExpAttrOpt(Tpl.emptyTxt, i_nominal, "nominal");
3328 12856 l_statesel__str := dumpStateSelectAttrOpt(Tpl.emptyTxt, i_stateSelectOption);
3329 12856 l_uncert__str := dumpUncertaintyAttrOpt(Tpl.emptyTxt, i_uncertainOption);
3330 12856 l_dist__str := dumpDistributionAttrOpt(Tpl.emptyTxt, i_distributionOption);
3331 12856 l_so__str := dumpStartOriginAttrOpt(Tpl.emptyTxt, i_startOrigin);
3332 12856 l_attrs__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()));
3333 12856 l_attrs__str := smf_89(l_attrs__str, l_quantity__str);
3334 12856 l_attrs__str := smf_90(l_attrs__str, l_unit__str);
3335 12856 l_attrs__str := smf_91(l_attrs__str, l_displayunit__str);
3336 12856 l_attrs__str := smf_92(l_attrs__str, l_min__str);
3337 12856 l_attrs__str := smf_93(l_attrs__str, l_max__str);
3338 12856 l_attrs__str := smf_94(l_attrs__str, l_start__str);
3339 12856 l_attrs__str := smf_95(l_attrs__str, l_fixed__str);
3340 12856 l_attrs__str := smf_96(l_attrs__str, l_nominal__str);
3341 12856 l_attrs__str := smf_97(l_attrs__str, l_statesel__str);
3342 12856 l_attrs__str := smf_98(l_attrs__str, l_uncert__str);
3343 12856 l_attrs__str := smf_99(l_attrs__str, l_dist__str);
3344 12856 l_attrs__str := smf_100(l_attrs__str, l_so__str);
3345 12856 l_attrs__str := Tpl.popIter(l_attrs__str);
3346 12856 ret_13 := Tpl.isEmpty(l_attrs__str);
3347 12856 txt := fun_101(txt, ret_13, l_attrs__str);
3348 then txt;
3349
3350 case ( txt,
3351 DAE.VAR_ATTR_INT(quantity = i_quantity, min = i_min, max = i_max, start = i_start, fixed = i_fixed, uncertainOption = i_uncertainOption, distributionOption = i_distributionOption, startOrigin = i_startOrigin) )
3352 algorithm
3353 922 l_quantity__str := dumpExpAttrOpt(Tpl.emptyTxt, i_quantity, "quantity");
3354 922 l_min__str := dumpExpAttrOpt(Tpl.emptyTxt, i_min, "min");
3355 922 l_max__str := dumpExpAttrOpt(Tpl.emptyTxt, i_max, "max");
3356 922 l_start__str := dumpExpAttrOpt(Tpl.emptyTxt, i_start, "start");
3357 922 l_fixed__str := dumpExpAttrOpt(Tpl.emptyTxt, i_fixed, "fixed");
3358 922 l_uncert__str := dumpUncertaintyAttrOpt(Tpl.emptyTxt, i_uncertainOption);
3359 922 l_dist__str := dumpDistributionAttrOpt(Tpl.emptyTxt, i_distributionOption);
3360 922 l_so__str := dumpStartOriginAttrOpt(Tpl.emptyTxt, i_startOrigin);
3361 922 l_attrs__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()));
3362 922 l_attrs__str := smf_102(l_attrs__str, l_quantity__str);
3363 922 l_attrs__str := smf_103(l_attrs__str, l_min__str);
3364 922 l_attrs__str := smf_104(l_attrs__str, l_max__str);
3365 922 l_attrs__str := smf_105(l_attrs__str, l_start__str);
3366 922 l_attrs__str := smf_106(l_attrs__str, l_fixed__str);
3367 922 l_attrs__str := smf_107(l_attrs__str, l_uncert__str);
3368 922 l_attrs__str := smf_108(l_attrs__str, l_dist__str);
3369 922 l_attrs__str := smf_109(l_attrs__str, l_so__str);
3370 922 l_attrs__str := Tpl.popIter(l_attrs__str);
3371 922 ret_14 := Tpl.isEmpty(l_attrs__str);
3372 922 txt := fun_110(txt, ret_14, l_attrs__str);
3373 then txt;
3374
3375 case ( txt,
3376 DAE.VAR_ATTR_BOOL(quantity = i_quantity, start = i_start, fixed = i_fixed, startOrigin = i_startOrigin) )
3377 algorithm
3378 523 l_quantity__str := dumpExpAttrOpt(Tpl.emptyTxt, i_quantity, "quantity");
3379 523 l_start__str := dumpExpAttrOpt(Tpl.emptyTxt, i_start, "start");
3380 523 l_fixed__str := dumpExpAttrOpt(Tpl.emptyTxt, i_fixed, "fixed");
3381 523 l_so__str := dumpStartOriginAttrOpt(Tpl.emptyTxt, i_startOrigin);
3382 523 l_attrs__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()));
3383 523 l_attrs__str := smf_111(l_attrs__str, l_quantity__str);
3384 523 l_attrs__str := smf_112(l_attrs__str, l_start__str);
3385 523 l_attrs__str := smf_113(l_attrs__str, l_fixed__str);
3386 523 l_attrs__str := smf_114(l_attrs__str, l_so__str);
3387 523 l_attrs__str := Tpl.popIter(l_attrs__str);
3388 523 ret_15 := Tpl.isEmpty(l_attrs__str);
3389 523 txt := fun_115(txt, ret_15, l_attrs__str);
3390 then txt;
3391
3392 case ( txt,
3393 DAE.VAR_ATTR_STRING(quantity = i_quantity, start = i_start, startOrigin = i_startOrigin) )
3394 algorithm
3395 141 l_quantity__str := dumpExpAttrOpt(Tpl.emptyTxt, i_quantity, "quantity");
3396 141 l_start__str := dumpExpAttrOpt(Tpl.emptyTxt, i_start, "start");
3397 141 l_so__str := dumpStartOriginAttrOpt(Tpl.emptyTxt, i_startOrigin);
3398 141 l_attrs__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()));
3399 141 l_attrs__str := smf_116(l_attrs__str, l_quantity__str);
3400 141 l_attrs__str := smf_117(l_attrs__str, l_start__str);
3401 141 l_attrs__str := smf_118(l_attrs__str, l_so__str);
3402 141 l_attrs__str := Tpl.popIter(l_attrs__str);
3403 141 ret_16 := Tpl.isEmpty(l_attrs__str);
3404 141 txt := fun_119(txt, ret_16, l_attrs__str);
3405 then txt;
3406
3407 case ( txt,
3408 DAE.VAR_ATTR_ENUMERATION(quantity = i_quantity, min = i_min, max = i_max, start = i_start, fixed = i_fixed, startOrigin = i_startOrigin) )
3409 algorithm
3410 105 l_quantity__str := dumpExpAttrOpt(Tpl.emptyTxt, i_quantity, "quantity");
3411 105 l_min__str := dumpExpAttrOpt(Tpl.emptyTxt, i_min, "min");
3412 105 l_max__str := dumpExpAttrOpt(Tpl.emptyTxt, i_max, "max");
3413 105 l_start__str := dumpExpAttrOpt(Tpl.emptyTxt, i_start, "start");
3414 105 l_fixed__str := dumpExpAttrOpt(Tpl.emptyTxt, i_fixed, "fixed");
3415 105 l_so__str := dumpStartOriginAttrOpt(Tpl.emptyTxt, i_startOrigin);
3416 105 l_attrs__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()));
3417 105 l_attrs__str := smf_120(l_attrs__str, l_quantity__str);
3418 105 l_attrs__str := smf_121(l_attrs__str, l_min__str);
3419 105 l_attrs__str := smf_122(l_attrs__str, l_max__str);
3420 105 l_attrs__str := smf_123(l_attrs__str, l_start__str);
3421 105 l_attrs__str := smf_124(l_attrs__str, l_fixed__str);
3422 105 l_attrs__str := smf_125(l_attrs__str, l_so__str);
3423 105 l_attrs__str := Tpl.popIter(l_attrs__str);
3424 105 ret_17 := Tpl.isEmpty(l_attrs__str);
3425 105 txt := fun_126(txt, ret_17, l_attrs__str);
3426 then txt;
3427
3428 case ( txt,
3429 _ )
3430 then txt;
3431 end match;
3432 end dumpVariableAttributes;
3433
3434 public function dumpExpAttrOpt
3435 input Tpl.Text in_txt;
3436 input Option<DAE.Exp> in_a_exp;
3437 input String in_a_attr;
3438
3439 output Tpl.Text out_txt;
3440 algorithm
3441 out_txt :=
3442 match(in_txt, in_a_exp, in_a_attr)
3443 local
3444 Tpl.Text txt;
3445 String a_attr;
3446 DAE.Exp i_e;
3447
3448 case ( txt,
3449 SOME(i_e),
3450 a_attr )
3451 algorithm
3452 21106 txt := Tpl.writeStr(txt, a_attr);
3453 21106 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" = "));
3454 21106 txt := dumpExp(txt, i_e);
3455 then txt;
3456
3457 case ( txt,
3458 _,
3459 _ )
3460 then txt;
3461 end match;
3462 end dumpExpAttrOpt;
3463
3464 public function dumpStateSelectAttrOpt
3465 input Tpl.Text in_txt;
3466 input Option<DAE.StateSelect> in_a_stateSelect;
3467
3468 output Tpl.Text out_txt;
3469 algorithm
3470 out_txt :=
3471 match(in_txt, in_a_stateSelect)
3472 local
3473 Tpl.Text txt;
3474 DAE.StateSelect i_ss;
3475
3476 case ( txt,
3477 SOME(i_ss) )
3478 algorithm
3479 121 txt := dumpStateSelectAttr(txt, i_ss);
3480 then txt;
3481
3482 case ( txt,
3483 _ )
3484 then txt;
3485 end match;
3486 end dumpStateSelectAttrOpt;
3487
3488 public function dumpStateSelectAttr
3489 input Tpl.Text txt;
3490 input DAE.StateSelect a_stateSelect;
3491
3492 output Tpl.Text out_txt;
3493 algorithm
3494 121 out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("stateSelect = "));
3495 121 out_txt := dumpStateSelect(out_txt, a_stateSelect);
3496 end dumpStateSelectAttr;
3497
3498 public function dumpStateSelect
3499 input Tpl.Text in_txt;
3500 input DAE.StateSelect in_a_stateSelect;
3501
3502 output Tpl.Text out_txt;
3503 algorithm
3504 out_txt :=
3505 match(in_txt, in_a_stateSelect)
3506 local
3507 Tpl.Text txt;
3508
3509 case ( txt,
3510 DAE.NEVER() )
3511 algorithm
3512 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("StateSelect.never"));
3513 then txt;
3514
3515 case ( txt,
3516 DAE.AVOID() )
3517 algorithm
3518 20 txt := Tpl.writeTok(txt, Tpl.ST_STRING("StateSelect.avoid"));
3519 then txt;
3520
3521 case ( txt,
3522 DAE.DEFAULT() )
3523 algorithm
3524 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("StateSelect.default"));
3525 then txt;
3526
3527 case ( txt,
3528 DAE.PREFER() )
3529 algorithm
3530 88 txt := Tpl.writeTok(txt, Tpl.ST_STRING("StateSelect.prefer"));
3531 then txt;
3532
3533 case ( txt,
3534 DAE.ALWAYS() )
3535 algorithm
3536 4 txt := Tpl.writeTok(txt, Tpl.ST_STRING("StateSelect.always"));
3537 then txt;
3538
3539 case ( txt,
3540 _ )
3541 then txt;
3542 end match;
3543 end dumpStateSelect;
3544
3545 public function dumpUncertaintyAttrOpt
3546 input Tpl.Text in_txt;
3547 input Option<DAE.Uncertainty> in_a_uncertainty;
3548
3549 output Tpl.Text out_txt;
3550 algorithm
3551 out_txt :=
3552 match(in_txt, in_a_uncertainty)
3553 local
3554 Tpl.Text txt;
3555 DAE.Uncertainty i_u;
3556
3557 case ( txt,
3558 SOME(i_u) )
3559 algorithm
3560 ✗ txt := dumpUncertaintyAttr(txt, i_u);
3561 then txt;
3562
3563 case ( txt,
3564 _ )
3565 then txt;
3566 end match;
3567 end dumpUncertaintyAttrOpt;
3568
3569 public function dumpUncertaintyAttr
3570 input Tpl.Text txt;
3571 input DAE.Uncertainty a_uncertainty;
3572
3573 output Tpl.Text out_txt;
3574 algorithm
3575 ✗ out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("uncertainty = "));
3576 ✗ out_txt := dumpUncertainty(out_txt, a_uncertainty);
3577 end dumpUncertaintyAttr;
3578
3579 public function dumpUncertainty
3580 input Tpl.Text in_txt;
3581 input DAE.Uncertainty in_a_uncertainty;
3582
3583 output Tpl.Text out_txt;
3584 algorithm
3585 out_txt :=
3586 match(in_txt, in_a_uncertainty)
3587 local
3588 Tpl.Text txt;
3589
3590 case ( txt,
3591 DAE.GIVEN() )
3592 algorithm
3593 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Uncertainty.given"));
3594 then txt;
3595
3596 case ( txt,
3597 DAE.SOUGHT() )
3598 algorithm
3599 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Uncertainty.sought"));
3600 then txt;
3601
3602 case ( txt,
3603 DAE.REFINE() )
3604 algorithm
3605 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Uncertainty.refine"));
3606 then txt;
3607
3608 case ( txt,
3609 DAE.PROPAGATE() )
3610 algorithm
3611 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Uncertainty.propagate"));
3612 then txt;
3613
3614 case ( txt,
3615 _ )
3616 then txt;
3617 end match;
3618 end dumpUncertainty;
3619
3620 public function dumpDistributionAttrOpt
3621 input Tpl.Text in_txt;
3622 input Option<DAE.Distribution> in_a_distribution;
3623
3624 output Tpl.Text out_txt;
3625 algorithm
3626 out_txt :=
3627 match(in_txt, in_a_distribution)
3628 local
3629 Tpl.Text txt;
3630 DAE.Distribution i_d;
3631
3632 case ( txt,
3633 SOME(i_d) )
3634 algorithm
3635 ✗ txt := dumpDistributionAttr(txt, i_d);
3636 then txt;
3637
3638 case ( txt,
3639 _ )
3640 then txt;
3641 end match;
3642 end dumpDistributionAttrOpt;
3643
3644 public function dumpDistributionAttr
3645 input Tpl.Text txt;
3646 input DAE.Distribution a_distribution;
3647
3648 output Tpl.Text out_txt;
3649 algorithm
3650 ✗ out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("distribution = "));
3651 ✗ out_txt := dumpDistribution(out_txt, a_distribution);
3652 end dumpDistributionAttr;
3653
3654 public function dumpDistribution
3655 input Tpl.Text in_txt;
3656 input DAE.Distribution in_a_distribution;
3657
3658 output Tpl.Text out_txt;
3659 algorithm
3660 out_txt :=
3661 match(in_txt, in_a_distribution)
3662 local
3663 Tpl.Text txt;
3664 DAE.Exp i_paramNames;
3665 DAE.Exp i_params;
3666 DAE.Exp i_name;
3667 Tpl.Text l_paramnames__str;
3668 Tpl.Text l_params__str;
3669 Tpl.Text l_name__str;
3670
3671 case ( txt,
3672 DAE.DISTRIBUTION(name = i_name, params = i_params, paramNames = i_paramNames) )
3673 algorithm
3674 ✗ l_name__str := dumpExp(Tpl.emptyTxt, i_name);
3675 ✗ l_params__str := dumpExp(Tpl.emptyTxt, i_params);
3676 ✗ l_paramnames__str := dumpExp(Tpl.emptyTxt, i_paramNames);
3677 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("Distribution(name = "));
3678 ✗ txt := Tpl.writeText(txt, l_name__str);
3679 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", params = "));
3680 ✗ txt := Tpl.writeText(txt, l_params__str);
3681 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", paramNames = "));
3682 ✗ txt := Tpl.writeText(txt, l_paramnames__str);
3683 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3684 then txt;
3685
3686 case ( txt,
3687 _ )
3688 then txt;
3689 end match;
3690 end dumpDistribution;
3691
3692 protected function fun_138
3693 input Tpl.Text in_txt;
3694 input Option<DAE.StartOrigin> in_a_startOrigin;
3695
3696 output Tpl.Text out_txt;
3697 algorithm
3698 out_txt :=
3699 match(in_txt, in_a_startOrigin)
3700 local
3701 Tpl.Text txt;
3702 Integer i_level;
3703 Integer i_raw;
3704 Integer i_actual;
3705
3706 case ( txt,
3707 SOME(DAE.UNDEFINED_ORIGIN()) )
3708 algorithm
3709 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("startOrigin = undefined"));
3710 then txt;
3711
3712 case ( txt,
3713 SOME(DAE.TYPE_ORIGIN()) )
3714 algorithm
3715 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("startOrigin = type"));
3716 then txt;
3717
3718 case ( txt,
3719 SOME(DAE.BINDING_ORIGIN()) )
3720 algorithm
3721 7 txt := Tpl.writeTok(txt, Tpl.ST_STRING("startOrigin = binding"));
3722 then txt;
3723
3724 case ( txt,
3725 SOME(DAE.CONFIDENCE(actual = i_actual, raw = i_raw)) )
3726 algorithm
3727 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("startOrigin = confidence("));
3728 ✗ txt := Tpl.writeStr(txt, intString(i_actual));
3729 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
3730 ✗ txt := Tpl.writeStr(txt, intString(i_raw));
3731 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3732 then txt;
3733
3734 case ( txt,
3735 SOME(DAE.TYPE_CONFIDENCE(level = i_level)) )
3736 algorithm
3737 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("startOrigin = typeConfidence("));
3738 ✗ txt := Tpl.writeStr(txt, intString(i_level));
3739 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3740 then txt;
3741
3742 case ( txt,
3743 _ )
3744 then txt;
3745 end match;
3746 end fun_138;
3747
3748 protected function fun_139
3749 input Tpl.Text in_txt;
3750 input Boolean in_mArg;
3751 input Option<DAE.StartOrigin> in_a_startOrigin;
3752
3753 output Tpl.Text out_txt;
3754 algorithm
3755 out_txt :=
3756 match(in_txt, in_mArg, in_a_startOrigin)
3757 local
3758 Tpl.Text txt;
3759 Option<DAE.StartOrigin> a_startOrigin;
3760
3761 case ( txt,
3762 false,
3763 _ )
3764 then txt;
3765
3766 case ( txt,
3767 _,
3768 a_startOrigin )
3769 algorithm
3770 9 txt := fun_138(txt, a_startOrigin);
3771 then txt;
3772 end match;
3773 end fun_139;
3774
3775 public function dumpStartOriginAttrOpt
3776 input Tpl.Text txt;
3777 input Option<DAE.StartOrigin> a_startOrigin;
3778
3779 output Tpl.Text out_txt;
3780 protected
3781 Boolean ret_0;
3782 algorithm
3783 14547 ret_0 := Config.showStartOrigin();
3784 14547 out_txt := fun_139(txt, ret_0, a_startOrigin);
3785 end dumpStartOriginAttrOpt;
3786
3787 protected function fun_141
3788 input Tpl.Text in_txt;
3789 input Boolean in_mArg;
3790 input DAE.ComponentRef in_a_componentRef;
3791 input list<DAE.Subscript> in_a_subscriptLst;
3792 input DAE.Ident in_a_ident;
3793
3794 output Tpl.Text out_txt;
3795 algorithm
3796 out_txt :=
3797 match(in_txt, in_mArg, in_a_componentRef, in_a_subscriptLst, in_a_ident)
3798 local
3799 Tpl.Text txt;
3800 DAE.ComponentRef a_componentRef;
3801 list<DAE.Subscript> a_subscriptLst;
3802 DAE.Ident a_ident;
3803
3804 case ( txt,
3805 false,
3806 a_componentRef,
3807 a_subscriptLst,
3808 a_ident )
3809 algorithm
3810 35951 txt := Tpl.writeStr(txt, a_ident);
3811 35951 txt := dumpSubscripts(txt, a_subscriptLst);
3812 35951 txt := Tpl.writeTok(txt, Tpl.ST_STRING("."));
3813 35951 txt := dumpCref(txt, a_componentRef);
3814 then txt;
3815
3816 case ( txt,
3817 _,
3818 a_componentRef,
3819 a_subscriptLst,
3820 a_ident )
3821 algorithm
3822 ✗ txt := Tpl.writeStr(txt, a_ident);
3823 ✗ txt := dumpSubscripts(txt, a_subscriptLst);
3824 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("__"));
3825 ✗ txt := dumpCref(txt, a_componentRef);
3826 then txt;
3827 end match;
3828 end fun_141;
3829
3830 public function dumpCref
3831 input Tpl.Text in_txt;
3832 input DAE.ComponentRef in_a_c;
3833
3834 output Tpl.Text out_txt;
3835 algorithm
3836 out_txt :=
3837 match(in_txt, in_a_c)
3838 local
3839 Tpl.Text txt;
3840 DAE.ComponentRef i_componentRef;
3841 list<DAE.Subscript> i_subscriptLst;
3842 DAE.Ident i_ident;
3843 Boolean ret_0;
3844
3845 case ( txt,
3846 DAE.CREF_QUAL(ident = i_ident, subscriptLst = i_subscriptLst, componentRef = i_componentRef) )
3847 algorithm
3848 35951 ret_0 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
3849 35951 txt := fun_141(txt, ret_0, i_componentRef, i_subscriptLst, i_ident);
3850 then txt;
3851
3852 case ( txt,
3853 DAE.CREF_IDENT(ident = (i_ident as "$DER"), subscriptLst = i_subscriptLst) )
3854 algorithm
3855 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("der("));
3856 ✗ txt := Tpl.writeStr(txt, i_ident);
3857 ✗ txt := dumpSubscripts(txt, i_subscriptLst);
3858 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
3859 then txt;
3860
3861 case ( txt,
3862 DAE.CREF_IDENT(ident = i_ident, subscriptLst = i_subscriptLst) )
3863 algorithm
3864 22387 txt := Tpl.writeStr(txt, i_ident);
3865 22387 txt := dumpSubscripts(txt, i_subscriptLst);
3866 then txt;
3867
3868 case ( txt,
3869 _ )
3870 then txt;
3871 end match;
3872 end dumpCref;
3873
3874 protected function lm_143
3875 input output Tpl.Text txt;
3876 input list<DAE.Dimension> items;
3877 algorithm
3878
2/2
✓ Branch 0 taken 337 times.
✓ Branch 1 taken 292 times.
629 for lstElt_143 in items loop
3879 txt := match lstElt_143
3880 local
3881 DAE.Dimension i_s;
3882
3883 case i_s
3884 algorithm
3885 337 txt := dumpDimension(txt, i_s);
3886 337 txt := Tpl.nextIter(txt);
3887 then txt;
3888 end match;
3889 end for;
3890 end lm_143;
3891
3892 public function dumpTypeDimensions
3893 input Tpl.Text in_txt;
3894 input list<DAE.Dimension> in_a_dimensionLst;
3895
3896 output Tpl.Text out_txt;
3897 algorithm
3898 out_txt :=
3899 match(in_txt, in_a_dimensionLst)
3900 local
3901 Tpl.Text txt;
3902 list<DAE.Dimension> i_dimensionLst;
3903 Tpl.Text l_sub__str;
3904
3905 case ( txt,
3906 {} )
3907 then txt;
3908
3909 case ( txt,
3910 i_dimensionLst )
3911 algorithm
3912 292 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()));
3913 292 l_sub__str := lm_143(l_sub__str, i_dimensionLst);
3914 292 l_sub__str := Tpl.popIter(l_sub__str);
3915 292 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
3916 292 txt := Tpl.writeText(txt, l_sub__str);
3917 292 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
3918 then txt;
3919 end match;
3920 end dumpTypeDimensions;
3921
3922 protected function lm_145
3923 input output Tpl.Text txt;
3924 input list<DAE.Subscript> items;
3925 algorithm
3926
2/2
✓ Branch 0 taken 16710 times.
✓ Branch 1 taken 11974 times.
28684 for lstElt_145 in items loop
3927 txt := match lstElt_145
3928 local
3929 DAE.Subscript i_s;
3930
3931 case i_s
3932 algorithm
3933 16710 txt := dumpSubscript(txt, i_s);
3934 16710 txt := Tpl.nextIter(txt);
3935 then txt;
3936 end match;
3937 end for;
3938 end lm_145;
3939
3940 protected function lm_146
3941 input output Tpl.Text txt;
3942 input list<DAE.Subscript> items;
3943 algorithm
3944 ✗ for lstElt_146 in items loop
3945 txt := match lstElt_146
3946 local
3947 DAE.Subscript i_s;
3948
3949 case i_s
3950 algorithm
3951 ✗ txt := dumpSubscript(txt, i_s);
3952 ✗ txt := Tpl.nextIter(txt);
3953 then txt;
3954 end match;
3955 end for;
3956 end lm_146;
3957
3958 protected function fun_147
3959 input Tpl.Text in_txt;
3960 input Boolean in_mArg;
3961 input list<DAE.Subscript> in_a_subscriptLst;
3962
3963 output Tpl.Text out_txt;
3964 algorithm
3965 out_txt :=
3966 match(in_txt, in_mArg, in_a_subscriptLst)
3967 local
3968 Tpl.Text txt;
3969 list<DAE.Subscript> a_subscriptLst;
3970 Tpl.Text l_sub__str;
3971
3972 case ( txt,
3973 false,
3974 a_subscriptLst )
3975 algorithm
3976 11974 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()));
3977 11974 l_sub__str := lm_145(l_sub__str, a_subscriptLst);
3978 11974 l_sub__str := Tpl.popIter(l_sub__str);
3979 11974 txt := Tpl.writeTok(txt, Tpl.ST_STRING("["));
3980 11974 txt := Tpl.writeText(txt, l_sub__str);
3981 11974 txt := Tpl.writeTok(txt, Tpl.ST_STRING("]"));
3982 then txt;
3983
3984 case ( txt,
3985 _,
3986 a_subscriptLst )
3987 algorithm
3988 ✗ 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()));
3989 ✗ l_sub__str := lm_146(l_sub__str, a_subscriptLst);
3990 ✗ l_sub__str := Tpl.popIter(l_sub__str);
3991 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("_"));
3992 ✗ txt := Tpl.writeText(txt, l_sub__str);
3993 then txt;
3994 end match;
3995 end fun_147;
3996
3997 public function dumpSubscripts
3998 input Tpl.Text in_txt;
3999 input list<DAE.Subscript> in_a_subscriptLst;
4000
4001 output Tpl.Text out_txt;
4002 algorithm
4003 out_txt :=
4004 match(in_txt, in_a_subscriptLst)
4005 local
4006 Tpl.Text txt;
4007 list<DAE.Subscript> i_subscriptLst;
4008 Boolean ret_0;
4009
4010 case ( txt,
4011 {} )
4012 then txt;
4013
4014 case ( txt,
4015 i_subscriptLst )
4016 algorithm
4017 11974 ret_0 := Flags.getConfigBool(Flags.MODELICA_OUTPUT);
4018 11974 txt := fun_147(txt, ret_0, i_subscriptLst);
4019 then txt;
4020 end match;
4021 end dumpSubscripts;
4022
4023 public function dumpSubscript
4024 input Tpl.Text in_txt;
4025 input DAE.Subscript in_a_subscript;
4026
4027 output Tpl.Text out_txt;
4028 algorithm
4029 out_txt :=
4030 match(in_txt, in_a_subscript)
4031 local
4032 Tpl.Text txt;
4033 DAE.Exp i_exp;
4034
4035 case ( txt,
4036 DAE.WHOLEDIM() )
4037 algorithm
4038 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(":"));
4039 then txt;
4040
4041 case ( txt,
4042 DAE.SLICE(exp = i_exp) )
4043 algorithm
4044 ✗ txt := dumpExp(txt, i_exp);
4045 then txt;
4046
4047 case ( txt,
4048 DAE.INDEX(exp = i_exp) )
4049 algorithm
4050 16710 txt := dumpExp(txt, i_exp);
4051 then txt;
4052
4053 case ( txt,
4054 DAE.WHOLE_NONEXP(exp = i_exp) )
4055 algorithm
4056 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("1:"));
4057 ✗ txt := dumpExp(txt, i_exp);
4058 then txt;
4059
4060 case ( txt,
4061 _ )
4062 then txt;
4063 end match;
4064 end dumpSubscript;
4065
4066 protected function lm_150
4067 input output Tpl.Text txt;
4068 input list<DAE.Element> items;
4069 algorithm
4070
2/2
✓ Branch 0 taken 187 times.
✓ Branch 1 taken 13 times.
200 for lstElt_150 in items loop
4071 txt := match lstElt_150
4072 local
4073 DAE.Element i_ineq;
4074
4075 case i_ineq
4076 algorithm
4077 187 txt := dumpEquationElement(txt, i_ineq);
4078 187 txt := Tpl.nextIter(txt);
4079 then txt;
4080 end match;
4081 end for;
4082 end lm_150;
4083
4084 public function dumpInitialEquationSection
4085 input Tpl.Text in_txt;
4086 input list<DAE.Element> in_a_ie;
4087
4088 output Tpl.Text out_txt;
4089 algorithm
4090 out_txt :=
4091 match(in_txt, in_a_ie)
4092 local
4093 Tpl.Text txt;
4094 list<DAE.Element> i_ie;
4095
4096 case ( txt,
4097 {} )
4098 then txt;
4099
4100 case ( txt,
4101 i_ie )
4102 algorithm
4103 13 txt := Tpl.writeTok(txt, Tpl.ST_LINE("initial equation\n"));
4104 13 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4105 13 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4106 13 txt := lm_150(txt, i_ie);
4107 13 txt := Tpl.popIter(txt);
4108 13 txt := Tpl.popBlock(txt);
4109 then txt;
4110 end match;
4111 end dumpInitialEquationSection;
4112
4113 protected function lm_152
4114 input output Tpl.Text txt;
4115 input list<DAE.Element> items;
4116 algorithm
4117
2/2
✓ Branch 0 taken 7036 times.
✓ Branch 1 taken 527 times.
7563 for lstElt_152 in items loop
4118 txt := match lstElt_152
4119 local
4120 DAE.Element i_eq;
4121
4122 case i_eq
4123 algorithm
4124 7036 txt := dumpEquationElement(txt, i_eq);
4125 7036 txt := Tpl.nextIter(txt);
4126 then txt;
4127 end match;
4128 end for;
4129 end lm_152;
4130
4131 public function dumpEquationSection
4132 input Tpl.Text in_txt;
4133 input list<DAE.Element> in_a_e;
4134
4135 output Tpl.Text out_txt;
4136 algorithm
4137 out_txt :=
4138 match(in_txt, in_a_e)
4139 local
4140 Tpl.Text txt;
4141 list<DAE.Element> i_e;
4142
4143 case ( txt,
4144 {} )
4145 then txt;
4146
4147 case ( txt,
4148 i_e )
4149 algorithm
4150 527 txt := Tpl.writeTok(txt, Tpl.ST_LINE("equation\n"));
4151 527 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4152 527 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4153 527 txt := lm_152(txt, i_e);
4154 527 txt := Tpl.popIter(txt);
4155 527 txt := Tpl.popBlock(txt);
4156 then txt;
4157 end match;
4158 end dumpEquationSection;
4159
4160 public function dumpEquationElement
4161 input Tpl.Text in_txt;
4162 input DAE.Element in_a_lst;
4163
4164 output Tpl.Text out_txt;
4165 algorithm
4166 out_txt :=
4167 match(in_txt, in_a_lst)
4168 local
4169 Tpl.Text txt;
4170 DAE.Exp i_exp2;
4171 DAE.Exp i_exp1;
4172 DAE.Exp i_level;
4173 DAE.Exp i_message;
4174 DAE.Exp i_condition;
4175 list<DAE.Element> i_equations3;
4176 list<list<DAE.Element>> i_equations2;
4177 list<DAE.Exp> i_condition1;
4178 DAE.Element i_lst;
4179 DAE.ComponentRef i_componentRef;
4180 DAE.Exp i_rhs;
4181 DAE.Exp i_lhs;
4182 DAE.Exp i_array;
4183 DAE.ComponentRef i_cr2;
4184 DAE.ComponentRef i_cr1;
4185 DAE.ElementSource i_source;
4186 DAE.Exp i_scalar;
4187 DAE.Exp i_exp;
4188
4189 case ( txt,
4190 DAE.EQUATION(exp = i_exp, scalar = i_scalar, source = i_source) )
4191 algorithm
4192 3949 txt := dumpEquation(txt, i_exp, i_scalar, i_source);
4193 then txt;
4194
4195 case ( txt,
4196 DAE.EQUEQUATION(cr1 = i_cr1, cr2 = i_cr2, source = i_source) )
4197 algorithm
4198 2363 txt := dumpEquEquation(txt, i_cr1, i_cr2, i_source);
4199 then txt;
4200
4201 case ( txt,
4202 DAE.ARRAY_EQUATION(exp = i_exp, array = i_array, source = i_source) )
4203 algorithm
4204 524 txt := dumpEquation(txt, i_exp, i_array, i_source);
4205 then txt;
4206
4207 case ( txt,
4208 DAE.COMPLEX_EQUATION(lhs = i_lhs, rhs = i_rhs, source = i_source) )
4209 algorithm
4210 74 txt := dumpEquation(txt, i_lhs, i_rhs, i_source);
4211 then txt;
4212
4213 case ( txt,
4214 DAE.DEFINE(componentRef = i_componentRef, exp = i_exp, source = i_source) )
4215 algorithm
4216 7 txt := dumpDefine(txt, i_componentRef, i_exp, i_source);
4217 then txt;
4218
4219 case ( txt,
4220 (i_lst as DAE.WHEN_EQUATION(condition = _)) )
4221 algorithm
4222 37 txt := dumpWhenEquation(txt, i_lst);
4223 then txt;
4224
4225 case ( txt,
4226 (i_lst as DAE.FOR_EQUATION(type_ = _)) )
4227 algorithm
4228 17 txt := dumpForEquation(txt, i_lst);
4229 then txt;
4230
4231 case ( txt,
4232 DAE.IF_EQUATION(condition1 = i_condition1, equations2 = i_equations2, equations3 = i_equations3, source = i_source) )
4233 algorithm
4234 16 txt := dumpIfEquation(txt, i_condition1, i_equations2, i_equations3, i_source);
4235 then txt;
4236
4237 case ( txt,
4238 DAE.ASSERT(condition = i_condition, message = i_message, level = i_level, source = i_source) )
4239 algorithm
4240 181 txt := dumpAssert(txt, i_condition, i_message, i_level, i_source);
4241 then txt;
4242
4243 case ( txt,
4244 DAE.INITIAL_ASSERT(condition = i_condition, message = i_message, level = i_level, source = i_source) )
4245 algorithm
4246 8 txt := dumpAssert(txt, i_condition, i_message, i_level, i_source);
4247 then txt;
4248
4249 case ( txt,
4250 DAE.TERMINATE(message = i_message, source = i_source) )
4251 algorithm
4252 1 txt := dumpTerminate(txt, i_message, i_source);
4253 then txt;
4254
4255 case ( txt,
4256 DAE.INITIAL_TERMINATE(message = i_message, source = i_source) )
4257 algorithm
4258 ✗ txt := dumpTerminate(txt, i_message, i_source);
4259 then txt;
4260
4261 case ( txt,
4262 DAE.REINIT(componentRef = i_componentRef, exp = i_exp, source = i_source) )
4263 algorithm
4264 6 txt := dumpReinit(txt, i_componentRef, i_exp, i_source);
4265 then txt;
4266
4267 case ( txt,
4268 DAE.NORETCALL(exp = i_exp, source = i_source) )
4269 algorithm
4270 13 txt := dumpNoRetCall(txt, i_exp, i_source);
4271 then txt;
4272
4273 case ( txt,
4274 DAE.INITIAL_NORETCALL(exp = i_exp, source = i_source) )
4275 algorithm
4276 ✗ txt := dumpNoRetCall(txt, i_exp, i_source);
4277 then txt;
4278
4279 case ( txt,
4280 DAE.INITIALDEFINE(componentRef = i_componentRef, exp = i_exp, source = i_source) )
4281 algorithm
4282 ✗ txt := dumpDefine(txt, i_componentRef, i_exp, i_source);
4283 then txt;
4284
4285 case ( txt,
4286 DAE.INITIAL_ARRAY_EQUATION(exp = i_exp, array = i_array, source = i_source) )
4287 algorithm
4288 ✗ txt := dumpEquation(txt, i_exp, i_array, i_source);
4289 then txt;
4290
4291 case ( txt,
4292 DAE.INITIAL_COMPLEX_EQUATION(lhs = i_lhs, rhs = i_rhs, source = i_source) )
4293 algorithm
4294 1 txt := dumpEquation(txt, i_lhs, i_rhs, i_source);
4295 then txt;
4296
4297 case ( txt,
4298 (i_lst as DAE.INITIAL_FOR_EQUATION(type_ = _)) )
4299 algorithm
4300 2 txt := dumpForEquation(txt, i_lst);
4301 then txt;
4302
4303 case ( txt,
4304 DAE.INITIAL_IF_EQUATION(condition1 = i_condition1, equations2 = i_equations2, equations3 = i_equations3, source = i_source) )
4305 algorithm
4306 ✗ txt := dumpIfEquation(txt, i_condition1, i_equations2, i_equations3, i_source);
4307 then txt;
4308
4309 case ( txt,
4310 DAE.INITIALEQUATION(exp1 = i_exp1, exp2 = i_exp2, source = i_source) )
4311 algorithm
4312 178 txt := dumpEquation(txt, i_exp1, i_exp2, i_source);
4313 then txt;
4314
4315 case ( txt,
4316 _ )
4317 algorithm
4318 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("UNKNOWN EQUATION TYPE"));
4319 then txt;
4320 end match;
4321 end dumpEquationElement;
4322
4323 protected function fun_155
4324 input Tpl.Text in_txt;
4325 input DAE.Exp in_a_lhs;
4326
4327 output Tpl.Text out_txt;
4328 algorithm
4329 out_txt :=
4330 match(in_txt, in_a_lhs)
4331 local
4332 Tpl.Text txt;
4333 DAE.Exp i_lhs;
4334
4335 case ( txt,
4336 (i_lhs as DAE.IFEXP(expCond = _)) )
4337 algorithm
4338 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
4339 1 txt := dumpExp(txt, i_lhs);
4340 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
4341 then txt;
4342
4343 case ( txt,
4344 i_lhs )
4345 algorithm
4346 4725 txt := dumpExp(txt, i_lhs);
4347 then txt;
4348 end match;
4349 end fun_155;
4350
4351 public function dumpEquation
4352 input Tpl.Text txt;
4353 input DAE.Exp a_lhs;
4354 input DAE.Exp a_rhs;
4355 input DAE.ElementSource a_src;
4356
4357 output Tpl.Text out_txt;
4358 protected
4359 Tpl.Text l_src__str;
4360 Tpl.Text l_rhs__str;
4361 Tpl.Text l_lhs__str;
4362 algorithm
4363 4726 l_lhs__str := fun_155(Tpl.emptyTxt, a_lhs);
4364 4726 l_rhs__str := dumpExp(Tpl.emptyTxt, a_rhs);
4365 4726 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4366 4726 out_txt := Tpl.writeText(txt, l_lhs__str);
4367 4726 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" = "));
4368 4726 out_txt := Tpl.writeText(out_txt, l_rhs__str);
4369 4726 out_txt := Tpl.writeText(out_txt, l_src__str);
4370 4726 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4371 end dumpEquation;
4372
4373 public function dumpEquEquation
4374 input Tpl.Text txt;
4375 input DAE.ComponentRef a_lhs;
4376 input DAE.ComponentRef a_rhs;
4377 input DAE.ElementSource a_src;
4378
4379 output Tpl.Text out_txt;
4380 protected
4381 Tpl.Text l_src__str;
4382 Tpl.Text l_rhs__str;
4383 Tpl.Text l_lhs__str;
4384 algorithm
4385 2363 l_lhs__str := dumpCref(Tpl.emptyTxt, a_lhs);
4386 2363 l_rhs__str := dumpCref(Tpl.emptyTxt, a_rhs);
4387 2363 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4388 2363 out_txt := Tpl.writeText(txt, l_lhs__str);
4389 2363 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" = "));
4390 2363 out_txt := Tpl.writeText(out_txt, l_rhs__str);
4391 2363 out_txt := Tpl.writeText(out_txt, l_src__str);
4392 2363 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4393 end dumpEquEquation;
4394
4395 public function dumpDefine
4396 input Tpl.Text txt;
4397 input DAE.ComponentRef a_lhs;
4398 input DAE.Exp a_rhs;
4399 input DAE.ElementSource a_src;
4400
4401 output Tpl.Text out_txt;
4402 protected
4403 Tpl.Text l_src__str;
4404 Tpl.Text l_rhs__str;
4405 Tpl.Text l_lhs__str;
4406 algorithm
4407 7 l_lhs__str := dumpCref(Tpl.emptyTxt, a_lhs);
4408 7 l_rhs__str := dumpExp(Tpl.emptyTxt, a_rhs);
4409 7 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4410 7 out_txt := Tpl.writeText(txt, l_lhs__str);
4411 7 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" = "));
4412 7 out_txt := Tpl.writeText(out_txt, l_rhs__str);
4413 7 out_txt := Tpl.writeText(out_txt, l_src__str);
4414 7 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4415 end dumpDefine;
4416
4417 protected function fun_159
4418 input Tpl.Text in_txt;
4419 input DAE.Exp in_a_lvl;
4420
4421 output Tpl.Text out_txt;
4422 algorithm
4423 out_txt :=
4424 match(in_txt, in_a_lvl)
4425 local
4426 Tpl.Text txt;
4427
4428 case ( txt,
4429 DAE.ENUM_LITERAL(index = 1) )
4430 algorithm
4431 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", AssertionLevel.warning"));
4432 then txt;
4433
4434 case ( txt,
4435 _ )
4436 then txt;
4437 end match;
4438 end fun_159;
4439
4440 public function dumpAssert
4441 input Tpl.Text txt;
4442 input DAE.Exp a_cond;
4443 input DAE.Exp a_msg;
4444 input DAE.Exp a_lvl;
4445 input DAE.ElementSource a_src;
4446
4447 output Tpl.Text out_txt;
4448 protected
4449 Tpl.Text l_src__str;
4450 Tpl.Text l_lvl__str;
4451 Tpl.Text l_msg__str;
4452 Tpl.Text l_cond__str;
4453 algorithm
4454 241 l_cond__str := dumpExp(Tpl.emptyTxt, a_cond);
4455 241 l_msg__str := dumpExp(Tpl.emptyTxt, a_msg);
4456 241 l_lvl__str := fun_159(Tpl.emptyTxt, a_lvl);
4457 241 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4458 241 out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("assert("));
4459 241 out_txt := Tpl.writeText(out_txt, l_cond__str);
4460 241 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(", "));
4461 241 out_txt := Tpl.writeText(out_txt, l_msg__str);
4462 241 out_txt := Tpl.writeText(out_txt, l_lvl__str);
4463 241 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(")"));
4464 241 out_txt := Tpl.writeText(out_txt, l_src__str);
4465 241 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4466 end dumpAssert;
4467
4468 public function dumpTerminate
4469 input Tpl.Text txt;
4470 input DAE.Exp a_msg;
4471 input DAE.ElementSource a_src;
4472
4473 output Tpl.Text out_txt;
4474 protected
4475 Tpl.Text l_src__str;
4476 Tpl.Text l_msg__str;
4477 algorithm
4478 1 l_msg__str := dumpExp(Tpl.emptyTxt, a_msg);
4479 1 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4480 1 out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("terminate("));
4481 1 out_txt := Tpl.writeText(out_txt, l_msg__str);
4482 1 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(")"));
4483 1 out_txt := Tpl.writeText(out_txt, l_src__str);
4484 1 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4485 end dumpTerminate;
4486
4487 public function dumpReinit
4488 input Tpl.Text txt;
4489 input DAE.ComponentRef a_cref;
4490 input DAE.Exp a_exp;
4491 input DAE.ElementSource a_src;
4492
4493 output Tpl.Text out_txt;
4494 protected
4495 Tpl.Text l_src__str;
4496 Tpl.Text l_exp__str;
4497 Tpl.Text l_cref__str;
4498 algorithm
4499 6 l_cref__str := dumpCref(Tpl.emptyTxt, a_cref);
4500 6 l_exp__str := dumpExp(Tpl.emptyTxt, a_exp);
4501 6 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4502 6 out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("reinit("));
4503 6 out_txt := Tpl.writeText(out_txt, l_cref__str);
4504 6 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(", "));
4505 6 out_txt := Tpl.writeText(out_txt, l_exp__str);
4506 6 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(")"));
4507 6 out_txt := Tpl.writeText(out_txt, l_src__str);
4508 6 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4509 end dumpReinit;
4510
4511 protected function fun_163
4512 input Tpl.Text in_txt;
4513 input DAE.Exp in_a_call__exp;
4514
4515 output Tpl.Text out_txt;
4516 algorithm
4517 out_txt :=
4518 match(in_txt, in_a_call__exp)
4519 local
4520 Tpl.Text txt;
4521
4522 case ( txt,
4523 DAE.CALL(attr = DAE.CALL_ATTR(tailCall = DAE.TAIL())) )
4524 algorithm
4525 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("return "));
4526 then txt;
4527
4528 case ( txt,
4529 _ )
4530 then txt;
4531 end match;
4532 end fun_163;
4533
4534 public function dumpNoRetCall
4535 input Tpl.Text txt;
4536 input DAE.Exp a_call__exp;
4537 input DAE.ElementSource a_src;
4538
4539 output Tpl.Text out_txt;
4540 protected
4541 Tpl.Text l_tail__str;
4542 Tpl.Text l_src__str;
4543 Tpl.Text l_call__str;
4544 algorithm
4545 26 l_call__str := dumpExp(Tpl.emptyTxt, a_call__exp);
4546 26 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4547 26 l_tail__str := fun_163(Tpl.emptyTxt, a_call__exp);
4548 26 out_txt := Tpl.writeText(txt, l_tail__str);
4549 26 out_txt := Tpl.writeText(out_txt, l_call__str);
4550 26 out_txt := Tpl.writeText(out_txt, l_src__str);
4551 26 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
4552 end dumpNoRetCall;
4553
4554 protected function lm_165
4555 input output Tpl.Text txt;
4556 input list<DAE.Element> items;
4557 algorithm
4558
2/2
✓ Branch 0 taken 49 times.
✓ Branch 1 taken 38 times.
87 for lstElt_165 in items loop
4559 txt := match lstElt_165
4560 local
4561 DAE.Element i_e;
4562
4563 case i_e
4564 algorithm
4565 49 txt := dumpEquationElement(txt, i_e);
4566 49 txt := Tpl.nextIter(txt);
4567 then txt;
4568 end match;
4569 end for;
4570 end lm_165;
4571
4572 protected function fun_166
4573 input Tpl.Text in_txt;
4574 input Option<DAE.Element> in_a_elsewhen__;
4575
4576 output Tpl.Text out_txt;
4577 algorithm
4578 out_txt :=
4579 match(in_txt, in_a_elsewhen__)
4580 local
4581 Tpl.Text txt;
4582 DAE.Element i_el;
4583
4584 case ( txt,
4585 SOME(i_el) )
4586 algorithm
4587 1 txt := dumpWhenEquation(txt, i_el);
4588 then txt;
4589
4590 case ( txt,
4591 _ )
4592 then txt;
4593 end match;
4594 end fun_166;
4595
4596 protected function fun_167
4597 input Tpl.Text in_txt;
4598 input Boolean in_mArg;
4599 input Tpl.Text in_a_elsewhen__str;
4600 input Tpl.Text in_a_src__str;
4601 input Tpl.Text in_a_body__str;
4602 input Tpl.Text in_a_when__cond__str;
4603
4604 output Tpl.Text out_txt;
4605 algorithm
4606 out_txt :=
4607 match(in_txt, in_mArg, in_a_elsewhen__str, in_a_src__str, in_a_body__str, in_a_when__cond__str)
4608 local
4609 Tpl.Text txt;
4610 Tpl.Text a_elsewhen__str;
4611 Tpl.Text a_src__str;
4612 Tpl.Text a_body__str;
4613 Tpl.Text a_when__cond__str;
4614
4615 case ( txt,
4616 true,
4617 _,
4618 a_src__str,
4619 a_body__str,
4620 a_when__cond__str )
4621 algorithm
4622 37 txt := Tpl.writeTok(txt, Tpl.ST_STRING("when "));
4623 37 txt := Tpl.writeText(txt, a_when__cond__str);
4624 37 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
4625 37 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4626 37 txt := Tpl.writeText(txt, a_body__str);
4627 37 txt := Tpl.softNewLine(txt);
4628 37 txt := Tpl.popBlock(txt);
4629 37 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end when"));
4630 37 txt := Tpl.writeText(txt, a_src__str);
4631 37 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
4632 then txt;
4633
4634 case ( txt,
4635 _,
4636 a_elsewhen__str,
4637 _,
4638 a_body__str,
4639 a_when__cond__str )
4640 algorithm
4641 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("when "));
4642 1 txt := Tpl.writeText(txt, a_when__cond__str);
4643 1 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
4644 1 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4645 1 txt := Tpl.writeText(txt, a_body__str);
4646 1 txt := Tpl.softNewLine(txt);
4647 1 txt := Tpl.popBlock(txt);
4648 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("else"));
4649 1 txt := Tpl.writeText(txt, a_elsewhen__str);
4650 then txt;
4651 end match;
4652 end fun_167;
4653
4654 public function dumpWhenEquation
4655 input Tpl.Text in_txt;
4656 input DAE.Element in_a_lst;
4657
4658 output Tpl.Text out_txt;
4659 algorithm
4660 out_txt :=
4661 match(in_txt, in_a_lst)
4662 local
4663 Tpl.Text txt;
4664 DAE.ElementSource i_source;
4665 Option<DAE.Element> i_elsewhen__;
4666 list<DAE.Element> i_equations;
4667 DAE.Exp i_condition;
4668 Boolean ret_4;
4669 Tpl.Text l_src__str;
4670 Tpl.Text l_elsewhen__str;
4671 Tpl.Text l_body__str;
4672 Tpl.Text l_when__cond__str;
4673
4674 case ( txt,
4675 DAE.WHEN_EQUATION(condition = i_condition, equations = i_equations, elsewhen_ = i_elsewhen__, source = i_source) )
4676 algorithm
4677 38 l_when__cond__str := dumpExp(Tpl.emptyTxt, i_condition);
4678 38 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4679 38 l_body__str := lm_165(l_body__str, i_equations);
4680 38 l_body__str := Tpl.popIter(l_body__str);
4681 38 l_elsewhen__str := fun_166(Tpl.emptyTxt, i_elsewhen__);
4682 38 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
4683 38 ret_4 := Tpl.isEmpty(l_elsewhen__str);
4684 38 txt := fun_167(txt, ret_4, l_elsewhen__str, l_src__str, l_body__str, l_when__cond__str);
4685 then txt;
4686
4687 case ( txt,
4688 _ )
4689 then txt;
4690 end match;
4691 end dumpWhenEquation;
4692
4693 protected function lm_169
4694 input output Tpl.Text txt;
4695 input list<DAE.Element> items;
4696 algorithm
4697
2/2
✓ Branch 0 taken 18 times.
✓ Branch 1 taken 17 times.
35 for lstElt_169 in items loop
4698 txt := match lstElt_169
4699 local
4700 DAE.Element i_e;
4701
4702 case i_e
4703 algorithm
4704 18 txt := dumpEquationElement(txt, i_e);
4705 18 txt := Tpl.nextIter(txt);
4706 then txt;
4707 end match;
4708 end for;
4709 end lm_169;
4710
4711 protected function lm_170
4712 input output Tpl.Text txt;
4713 input list<DAE.Element> items;
4714 algorithm
4715
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 for lstElt_170 in items loop
4716 txt := match lstElt_170
4717 local
4718 DAE.Element i_e;
4719
4720 case i_e
4721 algorithm
4722 2 txt := dumpEquationElement(txt, i_e);
4723 2 txt := Tpl.nextIter(txt);
4724 then txt;
4725 end match;
4726 end for;
4727 end lm_170;
4728
4729 public function dumpForEquation
4730 input Tpl.Text in_txt;
4731 input DAE.Element in_a_lst;
4732
4733 output Tpl.Text out_txt;
4734 algorithm
4735 out_txt :=
4736 match(in_txt, in_a_lst)
4737 local
4738 Tpl.Text txt;
4739 DAE.Ident i_iter;
4740 DAE.ElementSource i_source;
4741 list<DAE.Element> i_equations;
4742 DAE.Exp i_range;
4743 Tpl.Text l_src__str;
4744 Tpl.Text l_body__str;
4745 Tpl.Text l_range__str;
4746
4747 case ( txt,
4748 DAE.FOR_EQUATION(range = i_range, equations = i_equations, source = i_source, iter = i_iter) )
4749 algorithm
4750 17 l_range__str := dumpExp(Tpl.emptyTxt, i_range);
4751 17 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4752 17 l_body__str := lm_169(l_body__str, i_equations);
4753 17 l_body__str := Tpl.popIter(l_body__str);
4754 17 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
4755 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
4756 17 txt := Tpl.writeStr(txt, i_iter);
4757 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
4758 17 txt := Tpl.writeText(txt, l_range__str);
4759 17 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
4760 17 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4761 17 txt := Tpl.writeText(txt, l_body__str);
4762 17 txt := Tpl.softNewLine(txt);
4763 17 txt := Tpl.popBlock(txt);
4764 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
4765 17 txt := Tpl.writeText(txt, l_src__str);
4766 17 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
4767 then txt;
4768
4769 case ( txt,
4770 DAE.INITIAL_FOR_EQUATION(range = i_range, equations = i_equations, source = i_source, iter = i_iter) )
4771 algorithm
4772 2 l_range__str := dumpExp(Tpl.emptyTxt, i_range);
4773 2 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4774 2 l_body__str := lm_170(l_body__str, i_equations);
4775 2 l_body__str := Tpl.popIter(l_body__str);
4776 2 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
4777 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
4778 2 txt := Tpl.writeStr(txt, i_iter);
4779 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
4780 2 txt := Tpl.writeText(txt, l_range__str);
4781 2 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
4782 2 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4783 2 txt := Tpl.writeText(txt, l_body__str);
4784 2 txt := Tpl.softNewLine(txt);
4785 2 txt := Tpl.popBlock(txt);
4786 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
4787 2 txt := Tpl.writeText(txt, l_src__str);
4788 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
4789 then txt;
4790
4791 case ( txt,
4792 _ )
4793 then txt;
4794 end match;
4795 end dumpForEquation;
4796
4797 protected function lm_172
4798 input output Tpl.Text txt;
4799 input list<DAE.Element> items;
4800 algorithm
4801
2/2
✓ Branch 0 taken 36 times.
✓ Branch 1 taken 16 times.
52 for lstElt_172 in items loop
4802 txt := match lstElt_172
4803 local
4804 DAE.Element i_e;
4805
4806 case i_e
4807 algorithm
4808 36 txt := dumpEquationElement(txt, i_e);
4809 36 txt := Tpl.nextIter(txt);
4810 then txt;
4811 end match;
4812 end for;
4813 end lm_172;
4814
4815 protected function lm_173
4816 input output Tpl.Text txt;
4817 input list<DAE.Element> items;
4818 algorithm
4819
2/2
✓ Branch 0 taken 33 times.
✓ Branch 1 taken 16 times.
49 for lstElt_173 in items loop
4820 txt := match lstElt_173
4821 local
4822 DAE.Element i_e;
4823
4824 case i_e
4825 algorithm
4826 33 txt := dumpEquationElement(txt, i_e);
4827 33 txt := Tpl.nextIter(txt);
4828 then txt;
4829 end match;
4830 end for;
4831 end lm_173;
4832
4833 protected function fun_174
4834 input Tpl.Text in_txt;
4835 input list<DAE.Element> in_a_else__branch;
4836
4837 output Tpl.Text out_txt;
4838 algorithm
4839 out_txt :=
4840 match(in_txt, in_a_else__branch)
4841 local
4842 Tpl.Text txt;
4843 list<DAE.Element> i_else__branch;
4844
4845 case ( txt,
4846 {} )
4847 then txt;
4848
4849 case ( txt,
4850 i_else__branch )
4851 algorithm
4852 16 txt := Tpl.writeTok(txt, Tpl.ST_LINE("else\n"));
4853 16 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4854 16 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
4855 16 txt := lm_173(txt, i_else__branch);
4856 16 txt := Tpl.popIter(txt);
4857 16 txt := Tpl.popBlock(txt);
4858 then txt;
4859 end match;
4860 end fun_174;
4861
4862 protected function fun_175
4863 input Tpl.Text in_txt;
4864 input list<list<DAE.Element>> in_a_branches;
4865 input DAE.ElementSource in_a_src;
4866 input list<DAE.Element> in_a_else__branch;
4867 input list<DAE.Exp> in_a_elseif__conds;
4868 input DAE.Exp in_a_if__cond;
4869
4870 output Tpl.Text out_txt;
4871 algorithm
4872 out_txt :=
4873 match(in_txt, in_a_branches, in_a_src, in_a_else__branch, in_a_elseif__conds, in_a_if__cond)
4874 local
4875 Tpl.Text txt;
4876 DAE.ElementSource a_src;
4877 list<DAE.Element> a_else__branch;
4878 list<DAE.Exp> a_elseif__conds;
4879 DAE.Exp a_if__cond;
4880 list<list<DAE.Element>> i_elseif__branches;
4881 list<DAE.Element> i_if__branch;
4882 Tpl.Text l_src__str;
4883 Tpl.Text l_else__str;
4884 Tpl.Text l_elseif__str;
4885 Tpl.Text l_if__branch__str;
4886 Tpl.Text l_if__cond__str;
4887
4888 case ( txt,
4889 i_if__branch :: i_elseif__branches,
4890 a_src,
4891 a_else__branch,
4892 a_elseif__conds,
4893 a_if__cond )
4894 algorithm
4895 16 l_if__cond__str := dumpExp(Tpl.emptyTxt, a_if__cond);
4896 16 l_if__branch__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()));
4897 16 l_if__branch__str := lm_172(l_if__branch__str, i_if__branch);
4898 16 l_if__branch__str := Tpl.popIter(l_if__branch__str);
4899 16 l_elseif__str := dumpElseIfEquation(Tpl.emptyTxt, a_elseif__conds, i_elseif__branches);
4900 16 l_else__str := fun_174(Tpl.emptyTxt, a_else__branch);
4901 16 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
4902 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if "));
4903 16 txt := Tpl.writeText(txt, l_if__cond__str);
4904 16 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
4905 16 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
4906 16 txt := Tpl.writeText(txt, l_if__branch__str);
4907 16 txt := Tpl.softNewLine(txt);
4908 16 txt := Tpl.popBlock(txt);
4909 16 txt := Tpl.writeText(txt, l_elseif__str);
4910 16 txt := Tpl.softNewLine(txt);
4911 16 txt := Tpl.writeText(txt, l_else__str);
4912 16 txt := Tpl.softNewLine(txt);
4913 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end if"));
4914 16 txt := Tpl.writeText(txt, l_src__str);
4915 16 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
4916 then txt;
4917
4918 case ( txt,
4919 _,
4920 _,
4921 _,
4922 _,
4923 _ )
4924 then txt;
4925 end match;
4926 end fun_175;
4927
4928 public function dumpIfEquation
4929 input Tpl.Text in_txt;
4930 input list<DAE.Exp> in_a_conds;
4931 input list<list<DAE.Element>> in_a_branches;
4932 input list<DAE.Element> in_a_else__branch;
4933 input DAE.ElementSource in_a_src;
4934
4935 output Tpl.Text out_txt;
4936 algorithm
4937 out_txt :=
4938 match(in_txt, in_a_conds, in_a_branches, in_a_else__branch, in_a_src)
4939 local
4940 Tpl.Text txt;
4941 list<list<DAE.Element>> a_branches;
4942 list<DAE.Element> a_else__branch;
4943 DAE.ElementSource a_src;
4944 list<DAE.Exp> i_elseif__conds;
4945 DAE.Exp i_if__cond;
4946
4947 case ( txt,
4948 i_if__cond :: i_elseif__conds,
4949 a_branches,
4950 a_else__branch,
4951 a_src )
4952 algorithm
4953 16 txt := fun_175(txt, a_branches, a_src, a_else__branch, i_elseif__conds, i_if__cond);
4954 then txt;
4955
4956 case ( txt,
4957 _,
4958 _,
4959 _,
4960 _ )
4961 then txt;
4962 end match;
4963 end dumpIfEquation;
4964
4965 protected function lm_177
4966 input output Tpl.Text txt;
4967 input list<DAE.Element> items;
4968 algorithm
4969
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 5 times.
21 for lstElt_177 in items loop
4970 txt := match lstElt_177
4971 local
4972 DAE.Element i_e;
4973
4974 case i_e
4975 algorithm
4976 16 txt := dumpEquationElement(txt, i_e);
4977 16 txt := Tpl.nextIter(txt);
4978 then txt;
4979 end match;
4980 end for;
4981 end lm_177;
4982
4983 protected function fun_178
4984 input Tpl.Text in_txt;
4985 input list<list<DAE.Element>> in_a_equations;
4986 input list<DAE.Exp> in_a_rest__conds;
4987 input DAE.Exp in_a_cond;
4988
4989 output Tpl.Text out_txt;
4990 algorithm
4991 out_txt :=
4992 match(in_txt, in_a_equations, in_a_rest__conds, in_a_cond)
4993 local
4994 Tpl.Text txt;
4995 list<DAE.Exp> a_rest__conds;
4996 DAE.Exp a_cond;
4997 list<list<DAE.Element>> i_rest__branches;
4998 list<DAE.Element> i_branch;
4999 Tpl.Text l_rest__str;
5000 Tpl.Text l_branch__str;
5001 Tpl.Text l_cond__str;
5002
5003 case ( txt,
5004 i_branch :: i_rest__branches,
5005 a_rest__conds,
5006 a_cond )
5007 algorithm
5008 5 l_cond__str := dumpExp(Tpl.emptyTxt, a_cond);
5009 5 l_branch__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()));
5010 5 l_branch__str := lm_177(l_branch__str, i_branch);
5011 5 l_branch__str := Tpl.popIter(l_branch__str);
5012 5 l_rest__str := dumpElseIfEquation(Tpl.emptyTxt, a_rest__conds, i_rest__branches);
5013 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING("elseif "));
5014 5 txt := Tpl.writeText(txt, l_cond__str);
5015 5 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
5016 5 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5017 5 txt := Tpl.writeText(txt, l_branch__str);
5018 5 txt := Tpl.softNewLine(txt);
5019 5 txt := Tpl.popBlock(txt);
5020 5 txt := Tpl.writeText(txt, l_rest__str);
5021 then txt;
5022
5023 case ( txt,
5024 _,
5025 _,
5026 _ )
5027 then txt;
5028 end match;
5029 end fun_178;
5030
5031 public function dumpElseIfEquation
5032 input Tpl.Text in_txt;
5033 input list<DAE.Exp> in_a_condition1;
5034 input list<list<DAE.Element>> in_a_equations;
5035
5036 output Tpl.Text out_txt;
5037 algorithm
5038 out_txt :=
5039 match(in_txt, in_a_condition1, in_a_equations)
5040 local
5041 Tpl.Text txt;
5042 list<list<DAE.Element>> a_equations;
5043 list<DAE.Exp> i_rest__conds;
5044 DAE.Exp i_cond;
5045
5046 case ( txt,
5047 i_cond :: i_rest__conds,
5048 a_equations )
5049 algorithm
5050 5 txt := fun_178(txt, a_equations, i_rest__conds, i_cond);
5051 then txt;
5052
5053 case ( txt,
5054 _,
5055 _ )
5056 then txt;
5057 end match;
5058 end dumpElseIfEquation;
5059
5060 protected function lm_180
5061 input output Tpl.Text txt;
5062 input list<DAE.Element> items;
5063 algorithm
5064
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1029 times.
1033 for lstElt_180 in items loop
5065 txt := match lstElt_180
5066 local
5067 DAE.Element i_alg;
5068
5069 case i_alg
5070 algorithm
5071 4 txt := dumpInitialAlgorithm(txt, i_alg);
5072 4 txt := Tpl.nextIter(txt);
5073 then txt;
5074 end match;
5075 end for;
5076 end lm_180;
5077
5078 public function dumpInitialAlgorithmSection
5079 input Tpl.Text txt;
5080 input list<DAE.Element> a_ia;
5081
5082 output Tpl.Text out_txt;
5083 algorithm
5084 1029 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5085 1029 out_txt := lm_180(out_txt, a_ia);
5086 1029 out_txt := Tpl.popIter(out_txt);
5087 end dumpInitialAlgorithmSection;
5088
5089 public function dumpInitialAlgorithm
5090 input Tpl.Text in_txt;
5091 input DAE.Element in_a_alg;
5092
5093 output Tpl.Text out_txt;
5094 algorithm
5095 out_txt :=
5096 match(in_txt, in_a_alg)
5097 local
5098 Tpl.Text txt;
5099 DAE.Algorithm i_algorithm__;
5100
5101 case ( txt,
5102 DAE.INITIALALGORITHM(algorithm_ = i_algorithm__) )
5103 algorithm
5104 4 txt := dumpAlgorithm(txt, i_algorithm__, "initial algorithm");
5105 then txt;
5106
5107 case ( txt,
5108 _ )
5109 then txt;
5110 end match;
5111 end dumpInitialAlgorithm;
5112
5113 protected function lm_183
5114 input output Tpl.Text txt;
5115 input list<DAE.Element> items;
5116 algorithm
5117
2/2
✓ Branch 0 taken 63 times.
✓ Branch 1 taken 1029 times.
1092 for lstElt_183 in items loop
5118 txt := match lstElt_183
5119 local
5120 DAE.Element i_alg;
5121
5122 case i_alg
5123 algorithm
5124 63 txt := dumpAlgorithmElement(txt, i_alg);
5125 63 txt := Tpl.nextIter(txt);
5126 then txt;
5127 end match;
5128 end for;
5129 end lm_183;
5130
5131 public function dumpAlgorithmSection
5132 input Tpl.Text txt;
5133 input list<DAE.Element> a_a;
5134
5135 output Tpl.Text out_txt;
5136 algorithm
5137 1029 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5138 1029 out_txt := lm_183(out_txt, a_a);
5139 1029 out_txt := Tpl.popIter(out_txt);
5140 end dumpAlgorithmSection;
5141
5142 public function dumpAlgorithmElement
5143 input Tpl.Text in_txt;
5144 input DAE.Element in_a_alg;
5145
5146 output Tpl.Text out_txt;
5147 algorithm
5148 out_txt :=
5149 match(in_txt, in_a_alg)
5150 local
5151 Tpl.Text txt;
5152 DAE.Algorithm i_algorithm__;
5153
5154 case ( txt,
5155 DAE.ALGORITHM(algorithm_ = i_algorithm__) )
5156 algorithm
5157 63 txt := dumpAlgorithm(txt, i_algorithm__, "algorithm");
5158 then txt;
5159
5160 case ( txt,
5161 _ )
5162 then txt;
5163 end match;
5164 end dumpAlgorithmElement;
5165
5166 public function dumpAlgorithm
5167 input Tpl.Text in_txt;
5168 input DAE.Algorithm in_a_algorithm__;
5169 input String in_a_header;
5170
5171 output Tpl.Text out_txt;
5172 algorithm
5173 out_txt :=
5174 match(in_txt, in_a_algorithm__, in_a_header)
5175 local
5176 Tpl.Text txt;
5177 String a_header;
5178 list<DAE.Statement> i_statementLst;
5179
5180 case ( txt,
5181 DAE.ALGORITHM_STMTS(statementLst = i_statementLst),
5182 a_header )
5183 algorithm
5184 67 txt := Tpl.writeStr(txt, a_header);
5185 67 txt := Tpl.softNewLine(txt);
5186 67 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5187 67 txt := dumpStatements(txt, i_statementLst);
5188 67 txt := Tpl.popBlock(txt);
5189 then txt;
5190
5191 case ( txt,
5192 _,
5193 _ )
5194 then txt;
5195 end match;
5196 end dumpAlgorithm;
5197
5198 protected function lm_187
5199 input output Tpl.Text txt;
5200 input list<DAE.Statement> items;
5201 algorithm
5202
2/2
✓ Branch 0 taken 1566 times.
✓ Branch 1 taken 476 times.
2042 for lstElt_187 in items loop
5203 txt := match lstElt_187
5204 local
5205 DAE.Statement i_stmt;
5206
5207 case i_stmt
5208 algorithm
5209 1566 txt := dumpStatement(txt, i_stmt);
5210 1566 txt := Tpl.nextIter(txt);
5211 then txt;
5212 end match;
5213 end for;
5214 end lm_187;
5215
5216 public function dumpStatements
5217 input Tpl.Text txt;
5218 input list<DAE.Statement> a_stmts;
5219
5220 output Tpl.Text out_txt;
5221 algorithm
5222 476 out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5223 476 out_txt := lm_187(out_txt, a_stmts);
5224 476 out_txt := Tpl.popIter(out_txt);
5225 end dumpStatements;
5226
5227 public function dumpStatement
5228 input Tpl.Text in_txt;
5229 input DAE.Statement in_a_stmt;
5230
5231 output Tpl.Text out_txt;
5232 algorithm
5233 out_txt :=
5234 match(in_txt, in_a_stmt)
5235 local
5236 Tpl.Text txt;
5237 DAE.Exp i_level;
5238 DAE.Exp i_msg;
5239 DAE.Exp i_cond;
5240 DAE.Statement i_stmt;
5241 DAE.ElementSource i_source;
5242 DAE.Exp i_exp;
5243 DAE.Exp i_exp1;
5244
5245 case ( txt,
5246 DAE.STMT_ASSIGN(exp1 = i_exp1, exp = i_exp, source = i_source) )
5247 algorithm
5248 2014 txt := dumpAssignment(txt, i_exp1, i_exp, i_source);
5249 then txt;
5250
5251 case ( txt,
5252 (i_stmt as DAE.STMT_TUPLE_ASSIGN(expExpLst = _)) )
5253 algorithm
5254 41 txt := dumpTupleAssignStatement(txt, i_stmt);
5255 then txt;
5256
5257 case ( txt,
5258 (i_stmt as DAE.STMT_ASSIGN_ARR(lhs = _)) )
5259 algorithm
5260 81 txt := dumpArrayAssignStatement(txt, i_stmt);
5261 then txt;
5262
5263 case ( txt,
5264 (i_stmt as DAE.STMT_IF(exp = _)) )
5265 algorithm
5266 166 txt := dumpIfStatement(txt, i_stmt);
5267 then txt;
5268
5269 case ( txt,
5270 (i_stmt as DAE.STMT_FOR(iterIsArray = _)) )
5271 algorithm
5272 44 txt := dumpForStatement(txt, i_stmt);
5273 then txt;
5274
5275 case ( txt,
5276 (i_stmt as DAE.STMT_PARFOR(iterIsArray = _)) )
5277 algorithm
5278 ✗ txt := dumpParForStatement(txt, i_stmt);
5279 then txt;
5280
5281 case ( txt,
5282 (i_stmt as DAE.STMT_WHILE(exp = _)) )
5283 algorithm
5284 18 txt := dumpWhileStatement(txt, i_stmt);
5285 then txt;
5286
5287 case ( txt,
5288 (i_stmt as DAE.STMT_WHEN(exp = _)) )
5289 algorithm
5290 51 txt := dumpWhenStatement(txt, i_stmt);
5291 then txt;
5292
5293 case ( txt,
5294 DAE.STMT_ASSERT(cond = i_cond, msg = i_msg, level = i_level, source = i_source) )
5295 algorithm
5296 52 txt := dumpAssert(txt, i_cond, i_msg, i_level, i_source);
5297 then txt;
5298
5299 case ( txt,
5300 DAE.STMT_TERMINATE(msg = i_msg, source = i_source) )
5301 algorithm
5302 ✗ txt := dumpTerminate(txt, i_msg, i_source);
5303 then txt;
5304
5305 case ( txt,
5306 (i_stmt as DAE.STMT_REINIT(var = _)) )
5307 algorithm
5308 2 txt := dumpReinitStatement(txt, i_stmt);
5309 then txt;
5310
5311 case ( txt,
5312 DAE.STMT_NORETCALL(exp = i_exp, source = i_source) )
5313 algorithm
5314 13 txt := dumpNoRetCall(txt, i_exp, i_source);
5315 then txt;
5316
5317 case ( txt,
5318 DAE.STMT_RETURN(source = _) )
5319 algorithm
5320 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("return;"));
5321 then txt;
5322
5323 case ( txt,
5324 DAE.STMT_BREAK(source = _) )
5325 algorithm
5326 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("break;"));
5327 then txt;
5328
5329 case ( txt,
5330 DAE.STMT_CONTINUE(source = _) )
5331 algorithm
5332 1 txt := Tpl.writeTok(txt, Tpl.ST_STRING("continue;"));
5333 then txt;
5334
5335 case ( txt,
5336 DAE.STMT_FAILURE(body = _) )
5337 algorithm
5338 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("fail();"));
5339 then txt;
5340
5341 case ( txt,
5342 _ )
5343 algorithm
5344 ✗ txt := errorMsg(txt, "DAEDumpTypes.dumpStatement: Unknown statement.");
5345 then txt;
5346 end match;
5347 end dumpStatement;
5348
5349 protected function fun_190
5350 input Tpl.Text in_txt;
5351 input DAE.Exp in_a_lhs;
5352
5353 output Tpl.Text out_txt;
5354 algorithm
5355 out_txt :=
5356 match(in_txt, in_a_lhs)
5357 local
5358 Tpl.Text txt;
5359 DAE.Exp i_lhs;
5360
5361 case ( txt,
5362 (i_lhs as DAE.IFEXP(expCond = _)) )
5363 algorithm
5364 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5365 ✗ txt := dumpExp(txt, i_lhs);
5366 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
5367 then txt;
5368
5369 case ( txt,
5370 i_lhs )
5371 algorithm
5372 2014 txt := dumpExp(txt, i_lhs);
5373 then txt;
5374 end match;
5375 end fun_190;
5376
5377 public function dumpAssignment
5378 input Tpl.Text txt;
5379 input DAE.Exp a_lhs;
5380 input DAE.Exp a_rhs;
5381 input DAE.ElementSource a_src;
5382
5383 output Tpl.Text out_txt;
5384 protected
5385 Tpl.Text l_src__str;
5386 Tpl.Text l_rhs__str;
5387 Tpl.Text l_lhs__str;
5388 algorithm
5389 2014 l_lhs__str := fun_190(Tpl.emptyTxt, a_lhs);
5390 2014 l_rhs__str := dumpExp(Tpl.emptyTxt, a_rhs);
5391 2014 l_src__str := dumpSource(Tpl.emptyTxt, a_src);
5392 2014 out_txt := Tpl.writeText(txt, l_lhs__str);
5393 2014 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(" := "));
5394 2014 out_txt := Tpl.writeText(out_txt, l_rhs__str);
5395 2014 out_txt := Tpl.writeText(out_txt, l_src__str);
5396 2014 out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(";"));
5397 end dumpAssignment;
5398
5399 protected function lm_192
5400 input output Tpl.Text txt;
5401 input list<DAE.Exp> items;
5402 algorithm
5403
2/2
✓ Branch 0 taken 87 times.
✓ Branch 1 taken 41 times.
128 for lstElt_192 in items loop
5404 txt := match lstElt_192
5405 local
5406 DAE.Exp i_e;
5407
5408 case i_e
5409 algorithm
5410 87 txt := dumpExp(txt, i_e);
5411 87 txt := Tpl.nextIter(txt);
5412 then txt;
5413 end match;
5414 end for;
5415 end lm_192;
5416
5417 public function dumpTupleAssignStatement
5418 input Tpl.Text in_txt;
5419 input DAE.Statement in_a_stmt;
5420
5421 output Tpl.Text out_txt;
5422 algorithm
5423 out_txt :=
5424 match(in_txt, in_a_stmt)
5425 local
5426 Tpl.Text txt;
5427 DAE.ElementSource i_source;
5428 DAE.Exp i_exp;
5429 list<DAE.Exp> i_expExpLst;
5430 Tpl.Text l_src__str;
5431 Tpl.Text l_rhs__str;
5432 Tpl.Text l_lhs__str;
5433
5434 case ( txt,
5435 DAE.STMT_TUPLE_ASSIGN(expExpLst = i_expExpLst, exp = i_exp, source = i_source) )
5436 algorithm
5437 41 l_lhs__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()));
5438 41 l_lhs__str := lm_192(l_lhs__str, i_expExpLst);
5439 41 l_lhs__str := Tpl.popIter(l_lhs__str);
5440 41 l_rhs__str := dumpExp(Tpl.emptyTxt, i_exp);
5441 41 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5442 41 txt := Tpl.writeTok(txt, Tpl.ST_STRING("("));
5443 41 txt := Tpl.writeText(txt, l_lhs__str);
5444 41 txt := Tpl.writeTok(txt, Tpl.ST_STRING(") := "));
5445 41 txt := Tpl.writeText(txt, l_rhs__str);
5446 41 txt := Tpl.writeText(txt, l_src__str);
5447 41 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5448 then txt;
5449
5450 case ( txt,
5451 _ )
5452 then txt;
5453 end match;
5454 end dumpTupleAssignStatement;
5455
5456 public function dumpArrayAssignStatement
5457 input Tpl.Text in_txt;
5458 input DAE.Statement in_a_stmt;
5459
5460 output Tpl.Text out_txt;
5461 algorithm
5462 out_txt :=
5463 match(in_txt, in_a_stmt)
5464 local
5465 Tpl.Text txt;
5466 DAE.ElementSource i_source;
5467 DAE.Exp i_exp;
5468 DAE.Exp i_lhs;
5469 Tpl.Text l_src__str;
5470 Tpl.Text l_rhs__str;
5471 Tpl.Text l_lhs__str;
5472
5473 case ( txt,
5474 DAE.STMT_ASSIGN_ARR(lhs = i_lhs, exp = i_exp, source = i_source) )
5475 algorithm
5476 81 l_lhs__str := dumpExp(Tpl.emptyTxt, i_lhs);
5477 81 l_rhs__str := dumpExp(Tpl.emptyTxt, i_exp);
5478 81 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5479 81 txt := Tpl.writeText(txt, l_lhs__str);
5480 81 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" := "));
5481 81 txt := Tpl.writeText(txt, l_rhs__str);
5482 81 txt := Tpl.writeText(txt, l_src__str);
5483 81 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5484 then txt;
5485
5486 case ( txt,
5487 _ )
5488 then txt;
5489 end match;
5490 end dumpArrayAssignStatement;
5491
5492 protected function lm_195
5493 input output Tpl.Text txt;
5494 input list<DAE.Statement> items;
5495 algorithm
5496
2/2
✓ Branch 0 taken 325 times.
✓ Branch 1 taken 166 times.
491 for lstElt_195 in items loop
5497 txt := match lstElt_195
5498 local
5499 DAE.Statement i_e;
5500
5501 case i_e
5502 algorithm
5503 325 txt := dumpStatement(txt, i_e);
5504 325 txt := Tpl.nextIter(txt);
5505 then txt;
5506 end match;
5507 end for;
5508 end lm_195;
5509
5510 public function dumpIfStatement
5511 input Tpl.Text in_txt;
5512 input DAE.Statement in_a_stmt;
5513
5514 output Tpl.Text out_txt;
5515 algorithm
5516 out_txt :=
5517 match(in_txt, in_a_stmt)
5518 local
5519 Tpl.Text txt;
5520 DAE.ElementSource i_source;
5521 DAE.Else i_else__;
5522 list<DAE.Statement> i_statementLst;
5523 DAE.Exp i_exp;
5524 Tpl.Text l_src__str;
5525 Tpl.Text l_else__if__str;
5526 Tpl.Text l_true__branch__str;
5527 Tpl.Text l_if__cond__str;
5528
5529 case ( txt,
5530 DAE.STMT_IF(exp = i_exp, statementLst = i_statementLst, else_ = i_else__, source = i_source) )
5531 algorithm
5532 166 l_if__cond__str := dumpExp(Tpl.emptyTxt, i_exp);
5533 166 l_true__branch__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()));
5534 166 l_true__branch__str := lm_195(l_true__branch__str, i_statementLst);
5535 166 l_true__branch__str := Tpl.popIter(l_true__branch__str);
5536 166 l_else__if__str := dumpElseIfStatements(Tpl.emptyTxt, i_else__);
5537 166 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5538 166 txt := Tpl.writeTok(txt, Tpl.ST_STRING("if "));
5539 166 txt := Tpl.writeText(txt, l_if__cond__str);
5540 166 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
5541 166 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5542 166 txt := Tpl.writeText(txt, l_true__branch__str);
5543 166 txt := Tpl.softNewLine(txt);
5544 166 txt := Tpl.popBlock(txt);
5545 166 txt := Tpl.writeText(txt, l_else__if__str);
5546 166 txt := Tpl.softNewLine(txt);
5547 166 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end if"));
5548 166 txt := Tpl.writeText(txt, l_src__str);
5549 166 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5550 then txt;
5551
5552 case ( txt,
5553 _ )
5554 then txt;
5555 end match;
5556 end dumpIfStatement;
5557
5558 protected function lm_197
5559 input output Tpl.Text txt;
5560 input list<DAE.Statement> items;
5561 algorithm
5562
2/2
✓ Branch 0 taken 95 times.
✓ Branch 1 taken 36 times.
131 for lstElt_197 in items loop
5563 txt := match lstElt_197
5564 local
5565 DAE.Statement i_e;
5566
5567 case i_e
5568 algorithm
5569 95 txt := dumpStatement(txt, i_e);
5570 95 txt := Tpl.nextIter(txt);
5571 then txt;
5572 end match;
5573 end for;
5574 end lm_197;
5575
5576 protected function lm_198
5577 input output Tpl.Text txt;
5578 input list<DAE.Statement> items;
5579 algorithm
5580
2/2
✓ Branch 0 taken 246 times.
✓ Branch 1 taken 99 times.
345 for lstElt_198 in items loop
5581 txt := match lstElt_198
5582 local
5583 DAE.Statement i_e;
5584
5585 case i_e
5586 algorithm
5587 246 txt := dumpStatement(txt, i_e);
5588 246 txt := Tpl.nextIter(txt);
5589 then txt;
5590 end match;
5591 end for;
5592 end lm_198;
5593
5594 public function dumpElseIfStatements
5595 input Tpl.Text in_txt;
5596 input DAE.Else in_a_else__;
5597
5598 output Tpl.Text out_txt;
5599 algorithm
5600 out_txt :=
5601 match(in_txt, in_a_else__)
5602 local
5603 Tpl.Text txt;
5604 DAE.Else i_else__;
5605 list<DAE.Statement> i_statementLst;
5606 DAE.Exp i_exp;
5607 Tpl.Text l_else__body__str;
5608 Tpl.Text l_else__str;
5609 Tpl.Text l_elseif__body__str;
5610 Tpl.Text l_elseif__cond__str;
5611
5612 case ( txt,
5613 DAE.ELSEIF(exp = i_exp, statementLst = i_statementLst, else_ = i_else__) )
5614 algorithm
5615 36 l_elseif__cond__str := dumpExp(Tpl.emptyTxt, i_exp);
5616 36 l_elseif__body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5617 36 l_elseif__body__str := lm_197(l_elseif__body__str, i_statementLst);
5618 36 l_elseif__body__str := Tpl.popIter(l_elseif__body__str);
5619 36 l_else__str := dumpElseIfStatements(Tpl.emptyTxt, i_else__);
5620 36 txt := Tpl.writeTok(txt, Tpl.ST_STRING("elseif "));
5621 36 txt := Tpl.writeText(txt, l_elseif__cond__str);
5622 36 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
5623 36 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5624 36 txt := Tpl.writeText(txt, l_elseif__body__str);
5625 36 txt := Tpl.softNewLine(txt);
5626 36 txt := Tpl.popBlock(txt);
5627 36 txt := Tpl.writeText(txt, l_else__str);
5628 then txt;
5629
5630 case ( txt,
5631 DAE.ELSE(statementLst = i_statementLst) )
5632 algorithm
5633 99 l_else__body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5634 99 l_else__body__str := lm_198(l_else__body__str, i_statementLst);
5635 99 l_else__body__str := Tpl.popIter(l_else__body__str);
5636 99 txt := Tpl.writeTok(txt, Tpl.ST_LINE("else\n"));
5637 99 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5638 99 txt := Tpl.writeText(txt, l_else__body__str);
5639 99 txt := Tpl.popBlock(txt);
5640 then txt;
5641
5642 case ( txt,
5643 _ )
5644 then txt;
5645 end match;
5646 end dumpElseIfStatements;
5647
5648 protected function lm_200
5649 input output Tpl.Text txt;
5650 input list<DAE.Statement> items;
5651 algorithm
5652
2/2
✓ Branch 0 taken 55 times.
✓ Branch 1 taken 44 times.
99 for lstElt_200 in items loop
5653 txt := match lstElt_200
5654 local
5655 DAE.Statement i_e;
5656
5657 case i_e
5658 algorithm
5659 55 txt := dumpStatement(txt, i_e);
5660 55 txt := Tpl.nextIter(txt);
5661 then txt;
5662 end match;
5663 end for;
5664 end lm_200;
5665
5666 public function dumpForStatement
5667 input Tpl.Text in_txt;
5668 input DAE.Statement in_a_stmt;
5669
5670 output Tpl.Text out_txt;
5671 algorithm
5672 out_txt :=
5673 match(in_txt, in_a_stmt)
5674 local
5675 Tpl.Text txt;
5676 DAE.Ident i_iter;
5677 DAE.ElementSource i_source;
5678 list<DAE.Statement> i_statementLst;
5679 DAE.Exp i_range;
5680 Tpl.Text l_src__str;
5681 Tpl.Text l_alg__str;
5682 Tpl.Text l_range__str;
5683
5684 case ( txt,
5685 DAE.STMT_FOR(range = i_range, statementLst = i_statementLst, source = i_source, iter = i_iter) )
5686 algorithm
5687 44 l_range__str := dumpExp(Tpl.emptyTxt, i_range);
5688 44 l_alg__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()));
5689 44 l_alg__str := lm_200(l_alg__str, i_statementLst);
5690 44 l_alg__str := Tpl.popIter(l_alg__str);
5691 44 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5692 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING("for "));
5693 44 txt := Tpl.writeStr(txt, i_iter);
5694 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
5695 44 txt := Tpl.writeText(txt, l_range__str);
5696 44 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
5697 44 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5698 44 txt := Tpl.writeText(txt, l_alg__str);
5699 44 txt := Tpl.softNewLine(txt);
5700 44 txt := Tpl.popBlock(txt);
5701 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
5702 44 txt := Tpl.writeText(txt, l_src__str);
5703 44 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5704 then txt;
5705
5706 case ( txt,
5707 _ )
5708 then txt;
5709 end match;
5710 end dumpForStatement;
5711
5712 protected function lm_202
5713 input output Tpl.Text txt;
5714 input list<DAE.Statement> items;
5715 algorithm
5716 ✗ for lstElt_202 in items loop
5717 txt := match lstElt_202
5718 local
5719 DAE.Statement i_e;
5720
5721 case i_e
5722 algorithm
5723 ✗ txt := dumpStatement(txt, i_e);
5724 ✗ txt := Tpl.nextIter(txt);
5725 then txt;
5726 end match;
5727 end for;
5728 end lm_202;
5729
5730 public function dumpParForStatement
5731 input Tpl.Text in_txt;
5732 input DAE.Statement in_a_stmt;
5733
5734 output Tpl.Text out_txt;
5735 algorithm
5736 out_txt :=
5737 match(in_txt, in_a_stmt)
5738 local
5739 Tpl.Text txt;
5740 DAE.Ident i_iter;
5741 DAE.ElementSource i_source;
5742 list<DAE.Statement> i_statementLst;
5743 DAE.Exp i_range;
5744 Tpl.Text l_src__str;
5745 Tpl.Text l_alg__str;
5746 Tpl.Text l_range__str;
5747
5748 case ( txt,
5749 DAE.STMT_PARFOR(range = i_range, statementLst = i_statementLst, source = i_source, iter = i_iter) )
5750 algorithm
5751 ✗ l_range__str := dumpExp(Tpl.emptyTxt, i_range);
5752 ✗ l_alg__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()));
5753 ✗ l_alg__str := lm_202(l_alg__str, i_statementLst);
5754 ✗ l_alg__str := Tpl.popIter(l_alg__str);
5755 ✗ l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5756 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("parfor "));
5757 ✗ txt := Tpl.writeStr(txt, i_iter);
5758 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(" in "));
5759 ✗ txt := Tpl.writeText(txt, l_range__str);
5760 ✗ txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
5761 ✗ txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5762 ✗ txt := Tpl.writeText(txt, l_alg__str);
5763 ✗ txt := Tpl.softNewLine(txt);
5764 ✗ txt := Tpl.popBlock(txt);
5765 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING("end for"));
5766 ✗ txt := Tpl.writeText(txt, l_src__str);
5767 ✗ txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5768 then txt;
5769
5770 case ( txt,
5771 _ )
5772 then txt;
5773 end match;
5774 end dumpParForStatement;
5775
5776 protected function lm_204
5777 input output Tpl.Text txt;
5778 input list<DAE.Statement> items;
5779 algorithm
5780
2/2
✓ Branch 0 taken 63 times.
✓ Branch 1 taken 18 times.
81 for lstElt_204 in items loop
5781 txt := match lstElt_204
5782 local
5783 DAE.Statement i_e;
5784
5785 case i_e
5786 algorithm
5787 63 txt := dumpStatement(txt, i_e);
5788 63 txt := Tpl.nextIter(txt);
5789 then txt;
5790 end match;
5791 end for;
5792 end lm_204;
5793
5794 public function dumpWhileStatement
5795 input Tpl.Text in_txt;
5796 input DAE.Statement in_a_stmt;
5797
5798 output Tpl.Text out_txt;
5799 algorithm
5800 out_txt :=
5801 match(in_txt, in_a_stmt)
5802 local
5803 Tpl.Text txt;
5804 DAE.ElementSource i_source;
5805 list<DAE.Statement> i_statementLst;
5806 DAE.Exp i_exp;
5807 Tpl.Text l_src__str;
5808 Tpl.Text l_body__str;
5809 Tpl.Text l_while__cond;
5810
5811 case ( txt,
5812 DAE.STMT_WHILE(exp = i_exp, statementLst = i_statementLst, source = i_source) )
5813 algorithm
5814 18 l_while__cond := dumpExp(Tpl.emptyTxt, i_exp);
5815 18 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5816 18 l_body__str := lm_204(l_body__str, i_statementLst);
5817 18 l_body__str := Tpl.popIter(l_body__str);
5818 18 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5819 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("while "));
5820 18 txt := Tpl.writeText(txt, l_while__cond);
5821 18 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" loop\n"));
5822 18 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5823 18 txt := Tpl.writeText(txt, l_body__str);
5824 18 txt := Tpl.softNewLine(txt);
5825 18 txt := Tpl.popBlock(txt);
5826 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end while"));
5827 18 txt := Tpl.writeText(txt, l_src__str);
5828 18 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5829 then txt;
5830
5831 case ( txt,
5832 _ )
5833 then txt;
5834 end match;
5835 end dumpWhileStatement;
5836
5837 protected function lm_206
5838 input output Tpl.Text txt;
5839 input list<DAE.Statement> items;
5840 algorithm
5841
2/2
✓ Branch 0 taken 135 times.
✓ Branch 1 taken 56 times.
191 for lstElt_206 in items loop
5842 txt := match lstElt_206
5843 local
5844 DAE.Statement i_e;
5845
5846 case i_e
5847 algorithm
5848 135 txt := dumpStatement(txt, i_e);
5849 135 txt := Tpl.nextIter(txt);
5850 then txt;
5851 end match;
5852 end for;
5853 end lm_206;
5854
5855 protected function fun_207
5856 input Tpl.Text in_txt;
5857 input Option<DAE.Statement> in_a_elseWhen;
5858
5859 output Tpl.Text out_txt;
5860 algorithm
5861 out_txt :=
5862 match(in_txt, in_a_elseWhen)
5863 local
5864 Tpl.Text txt;
5865 DAE.Statement i_ew;
5866
5867 case ( txt,
5868 SOME(i_ew) )
5869 algorithm
5870 5 txt := dumpWhenStatement(txt, i_ew);
5871 then txt;
5872
5873 case ( txt,
5874 _ )
5875 then txt;
5876 end match;
5877 end fun_207;
5878
5879 protected function fun_208
5880 input Tpl.Text in_txt;
5881 input Boolean in_mArg;
5882 input Tpl.Text in_a_elsewhen__str;
5883 input Tpl.Text in_a_src__str;
5884 input Tpl.Text in_a_body__str;
5885 input Tpl.Text in_a_when__cond__str;
5886
5887 output Tpl.Text out_txt;
5888 algorithm
5889 out_txt :=
5890 match(in_txt, in_mArg, in_a_elsewhen__str, in_a_src__str, in_a_body__str, in_a_when__cond__str)
5891 local
5892 Tpl.Text txt;
5893 Tpl.Text a_elsewhen__str;
5894 Tpl.Text a_src__str;
5895 Tpl.Text a_body__str;
5896 Tpl.Text a_when__cond__str;
5897
5898 case ( txt,
5899 true,
5900 _,
5901 a_src__str,
5902 a_body__str,
5903 a_when__cond__str )
5904 algorithm
5905 51 txt := Tpl.writeTok(txt, Tpl.ST_STRING("when "));
5906 51 txt := Tpl.writeText(txt, a_when__cond__str);
5907 51 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
5908 51 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5909 51 txt := Tpl.writeText(txt, a_body__str);
5910 51 txt := Tpl.softNewLine(txt);
5911 51 txt := Tpl.popBlock(txt);
5912 51 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end when"));
5913 51 txt := Tpl.writeText(txt, a_src__str);
5914 51 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
5915 then txt;
5916
5917 case ( txt,
5918 _,
5919 a_elsewhen__str,
5920 _,
5921 a_body__str,
5922 a_when__cond__str )
5923 algorithm
5924 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING("when "));
5925 5 txt := Tpl.writeText(txt, a_when__cond__str);
5926 5 txt := Tpl.writeTok(txt, Tpl.ST_LINE(" then\n"));
5927 5 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
5928 5 txt := Tpl.writeText(txt, a_body__str);
5929 5 txt := Tpl.softNewLine(txt);
5930 5 txt := Tpl.popBlock(txt);
5931 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING("else"));
5932 5 txt := Tpl.writeText(txt, a_elsewhen__str);
5933 then txt;
5934 end match;
5935 end fun_208;
5936
5937 public function dumpWhenStatement
5938 input Tpl.Text in_txt;
5939 input DAE.Statement in_a_stmt;
5940
5941 output Tpl.Text out_txt;
5942 algorithm
5943 out_txt :=
5944 match(in_txt, in_a_stmt)
5945 local
5946 Tpl.Text txt;
5947 DAE.ElementSource i_source;
5948 Option<DAE.Statement> i_elseWhen;
5949 list<DAE.Statement> i_statementLst;
5950 DAE.Exp i_exp;
5951 Boolean ret_4;
5952 Tpl.Text l_src__str;
5953 Tpl.Text l_elsewhen__str;
5954 Tpl.Text l_body__str;
5955 Tpl.Text l_when__cond__str;
5956
5957 case ( txt,
5958 DAE.STMT_WHEN(exp = i_exp, statementLst = i_statementLst, elseWhen = i_elseWhen, source = i_source) )
5959 algorithm
5960 56 l_when__cond__str := dumpExp(Tpl.emptyTxt, i_exp);
5961 56 l_body__str := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
5962 56 l_body__str := lm_206(l_body__str, i_statementLst);
5963 56 l_body__str := Tpl.popIter(l_body__str);
5964 56 l_elsewhen__str := fun_207(Tpl.emptyTxt, i_elseWhen);
5965 56 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5966 56 ret_4 := Tpl.isEmpty(l_elsewhen__str);
5967 56 txt := fun_208(txt, ret_4, l_elsewhen__str, l_src__str, l_body__str, l_when__cond__str);
5968 then txt;
5969
5970 case ( txt,
5971 _ )
5972 then txt;
5973 end match;
5974 end dumpWhenStatement;
5975
5976 public function dumpReinitStatement
5977 input Tpl.Text in_txt;
5978 input DAE.Statement in_a_stmt;
5979
5980 output Tpl.Text out_txt;
5981 algorithm
5982 out_txt :=
5983 match(in_txt, in_a_stmt)
5984 local
5985 Tpl.Text txt;
5986 DAE.ElementSource i_source;
5987 DAE.Exp i_value;
5988 DAE.Exp i_var;
5989 Tpl.Text l_src__str;
5990 Tpl.Text l_new__exp__str;
5991 Tpl.Text l_exp__str;
5992
5993 case ( txt,
5994 DAE.STMT_REINIT(var = i_var, value = i_value, source = i_source) )
5995 algorithm
5996 2 l_exp__str := dumpExp(Tpl.emptyTxt, i_var);
5997 2 l_new__exp__str := dumpExp(Tpl.emptyTxt, i_value);
5998 2 l_src__str := dumpSource(Tpl.emptyTxt, i_source);
5999 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING("reinit("));
6000 2 txt := Tpl.writeText(txt, l_exp__str);
6001 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(", "));
6002 2 txt := Tpl.writeText(txt, l_new__exp__str);
6003 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(")"));
6004 2 txt := Tpl.writeText(txt, l_src__str);
6005 2 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
6006 then txt;
6007
6008 case ( txt,
6009 _ )
6010 then txt;
6011 end match;
6012 end dumpReinitStatement;
6013
6014 protected function fun_211
6015 input Tpl.Text in_txt;
6016 input Option<SCode.Comment> in_a_comment;
6017
6018 output Tpl.Text out_txt;
6019 algorithm
6020 out_txt :=
6021 match(in_txt, in_a_comment)
6022 local
6023 Tpl.Text txt;
6024 SCode.Comment i_co;
6025
6026 case ( txt,
6027 SOME(i_co) )
6028 algorithm
6029 3 txt := dumpStateMachineComment(txt, i_co);
6030 then txt;
6031
6032 case ( txt,
6033 _ )
6034 then txt;
6035 end match;
6036 end fun_211;
6037
6038 public function dumpStateMachineSection
6039 input Tpl.Text in_txt;
6040 input DAEDumpTypes.compWithSplitElements in_a_fixedDae;
6041
6042 output Tpl.Text out_txt;
6043 algorithm
6044 out_txt :=
6045 match(in_txt, in_a_fixedDae)
6046 local
6047 Tpl.Text txt;
6048 DAEDumpTypes.splitElements i_spltElems;
6049 String i_name;
6050 Option<SCode.Comment> i_comment;
6051 Tpl.Text l_kind;
6052
6053 case ( txt,
6054 DAEDumpTypes.COMP_WITH_SPLIT(comment = i_comment, name = i_name, spltElems = i_spltElems) )
6055 algorithm
6056 3 l_kind := fun_211(Tpl.emptyTxt, i_comment);
6057 3 txt := Tpl.writeText(txt, l_kind);
6058 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
6059 3 txt := Tpl.writeStr(txt, i_name);
6060 3 txt := Tpl.softNewLine(txt);
6061 3 txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(2));
6062 3 txt := dumpCompStream(txt, i_spltElems);
6063 3 txt := Tpl.softNewLine(txt);
6064 3 txt := Tpl.popBlock(txt);
6065 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("end "));
6066 3 txt := Tpl.writeStr(txt, i_name);
6067 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
6068 3 txt := Tpl.writeTok(txt, Tpl.ST_NEW_LINE());
6069 then txt;
6070
6071 case ( txt,
6072 _ )
6073 then txt;
6074 end match;
6075 end dumpStateMachineSection;
6076
6077 protected function fun_213
6078 input Tpl.Text in_txt;
6079 input Option<String> in_a_comment;
6080
6081 output Tpl.Text out_txt;
6082 algorithm
6083 out_txt :=
6084 match(in_txt, in_a_comment)
6085 local
6086 Tpl.Text txt;
6087 String i_co;
6088
6089 case ( txt,
6090 SOME(i_co) )
6091 algorithm
6092 3 txt := Tpl.writeStr(txt, i_co);
6093 then txt;
6094
6095 case ( txt,
6096 _ )
6097 then txt;
6098 end match;
6099 end fun_213;
6100
6101 public function dumpStateMachineComment
6102 input Tpl.Text in_txt;
6103 input SCode.Comment in_a_cmt;
6104
6105 output Tpl.Text out_txt;
6106 algorithm
6107 out_txt :=
6108 match(in_txt, in_a_cmt)
6109 local
6110 Tpl.Text txt;
6111 Option<String> i_comment;
6112 Tpl.Text l_kind__str;
6113
6114 case ( txt,
6115 SCode.COMMENT(comment = i_comment) )
6116 algorithm
6117 3 l_kind__str := fun_213(Tpl.emptyTxt, i_comment);
6118 3 txt := Tpl.writeText(txt, l_kind__str);
6119 then txt;
6120
6121 case ( txt,
6122 _ )
6123 then txt;
6124 end match;
6125 end dumpStateMachineComment;
6126
6127 public function dumpExp
6128 input Tpl.Text txt;
6129 input DAE.Exp a_exp;
6130
6131 output Tpl.Text out_txt;
6132 algorithm
6133 59138 out_txt := ExpressionDumpTpl.dumpExp(txt, a_exp, "\"");
6134 end dumpExp;
6135
6136 protected function fun_216
6137 input Tpl.Text in_txt;
6138 input Boolean in_mArg;
6139 input Tpl.Text in_a_cmt__str;
6140
6141 output Tpl.Text out_txt;
6142 algorithm
6143 out_txt :=
6144 match(in_txt, in_mArg, in_a_cmt__str)
6145 local
6146 Tpl.Text txt;
6147 Tpl.Text a_cmt__str;
6148
6149 case ( txt,
6150 true,
6151 _ )
6152 then txt;
6153
6154 case ( txt,
6155 _,
6156 a_cmt__str )
6157 algorithm
6158 5 txt := Tpl.writeText(txt, a_cmt__str);
6159 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING(";"));
6160 then txt;
6161 end match;
6162 end fun_216;
6163
6164 public function dumpClassAnnotation
6165 input Tpl.Text txt;
6166 input Option<SCode.Comment> a_comment;
6167
6168 output Tpl.Text out_txt;
6169 protected
6170 Boolean ret_1;
6171 Tpl.Text l_cmt__str;
6172 algorithm
6173 1519 l_cmt__str := dumpCommentAnnotation(Tpl.emptyTxt, a_comment);
6174 1519 ret_1 := Tpl.isEmpty(l_cmt__str);
6175 1519 out_txt := fun_216(txt, ret_1, l_cmt__str);
6176 end dumpClassAnnotation;
6177
6178 protected function fun_218
6179 input Tpl.Text in_txt;
6180 input Boolean in_mArg;
6181 input Tpl.Text in_a_cmt__str;
6182
6183 output Tpl.Text out_txt;
6184 algorithm
6185 out_txt :=
6186 match(in_txt, in_mArg, in_a_cmt__str)
6187 local
6188 Tpl.Text txt;
6189 Tpl.Text a_cmt__str;
6190
6191 case ( txt,
6192 true,
6193 _ )
6194 then txt;
6195
6196 case ( txt,
6197 _,
6198 a_cmt__str )
6199 algorithm
6200 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
6201 3 txt := Tpl.writeText(txt, a_cmt__str);
6202 then txt;
6203 end match;
6204 end fun_218;
6205
6206 public function dumpCompAnnotation
6207 input Tpl.Text txt;
6208 input Option<SCode.Comment> a_comment;
6209
6210 output Tpl.Text out_txt;
6211 protected
6212 Boolean ret_1;
6213 Tpl.Text l_cmt__str;
6214 algorithm
6215 17531 l_cmt__str := dumpCommentAnnotation(Tpl.emptyTxt, a_comment);
6216 17531 ret_1 := Tpl.isEmpty(l_cmt__str);
6217 17531 out_txt := fun_218(txt, ret_1, l_cmt__str);
6218 end dumpCompAnnotation;
6219
6220 public function dumpCommentAnnotation
6221 input Tpl.Text in_txt;
6222 input Option<SCode.Comment> in_a_comment;
6223
6224 output Tpl.Text out_txt;
6225 algorithm
6226 out_txt :=
6227 match(in_txt, in_a_comment)
6228 local
6229 Tpl.Text txt;
6230 SCode.Comment i_cmt;
6231
6232 case ( txt,
6233 SOME(i_cmt) )
6234 algorithm
6235 19050 txt := dumpCommentAnnotationNoOpt(txt, i_cmt);
6236 then txt;
6237
6238 case ( txt,
6239 _ )
6240 then txt;
6241 end match;
6242 end dumpCommentAnnotation;
6243
6244 public function dumpCommentAnnotationNoOpt
6245 input Tpl.Text in_txt;
6246 input SCode.Comment in_a_comment;
6247
6248 output Tpl.Text out_txt;
6249 algorithm
6250 out_txt :=
6251 match(in_txt, in_a_comment)
6252 local
6253 Tpl.Text txt;
6254 SCode.Annotation i_ann;
6255
6256 case ( txt,
6257 SCode.COMMENT(annotation_ = SOME(i_ann)) )
6258 algorithm
6259 1932 txt := dumpAnnotation(txt, i_ann);
6260 then txt;
6261
6262 case ( txt,
6263 _ )
6264 then txt;
6265 end match;
6266 end dumpCommentAnnotationNoOpt;
6267
6268 public function dumpCommentOpt
6269 input Tpl.Text in_txt;
6270 input Option<SCode.Comment> in_a_comment;
6271
6272 output Tpl.Text out_txt;
6273 algorithm
6274 out_txt :=
6275 match(in_txt, in_a_comment)
6276 local
6277 Tpl.Text txt;
6278 SCode.Comment i_cmt;
6279
6280 case ( txt,
6281 SOME(i_cmt) )
6282 algorithm
6283 19050 txt := dumpComment(txt, i_cmt);
6284 then txt;
6285
6286 case ( txt,
6287 _ )
6288 then txt;
6289 end match;
6290 end dumpCommentOpt;
6291
6292 public function dumpComment
6293 input Tpl.Text in_txt;
6294 input SCode.Comment in_a_comment;
6295
6296 output Tpl.Text out_txt;
6297 algorithm
6298 out_txt :=
6299 match(in_txt, in_a_comment)
6300 local
6301 Tpl.Text txt;
6302 Option<String> i_comment;
6303
6304 case ( txt,
6305 SCode.COMMENT(comment = i_comment) )
6306 algorithm
6307 24613 txt := dumpCommentStr(txt, i_comment);
6308 then txt;
6309
6310 case ( txt,
6311 _ )
6312 then txt;
6313 end match;
6314 end dumpComment;
6315
6316 public function dumpCommentStr
6317 input Tpl.Text in_txt;
6318 input Option<String> in_a_comment;
6319
6320 output Tpl.Text out_txt;
6321 algorithm
6322 out_txt :=
6323 match(in_txt, in_a_comment)
6324 local
6325 Tpl.Text txt;
6326 String i_cmt;
6327 String ret_0;
6328
6329 case ( txt,
6330 SOME(i_cmt) )
6331 algorithm
6332 7433 txt := Tpl.writeTok(txt, Tpl.ST_STRING(" "));
6333 7433 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
6334 7433 ret_0 := System.escapedString(i_cmt, false);
6335 7433 txt := Tpl.writeStr(txt, ret_0);
6336 7433 txt := Tpl.writeTok(txt, Tpl.ST_STRING("\""));
6337 then txt;
6338
6339 case ( txt,
6340 _ )
6341 then txt;
6342 end match;
6343 end dumpCommentStr;
6344
6345 public function dumpAnnotationOpt
6346 input Tpl.Text in_txt;
6347 input Option<SCode.Annotation> in_a_annotation;
6348
6349 output Tpl.Text out_txt;
6350 algorithm
6351 out_txt :=
6352 match(in_txt, in_a_annotation)
6353 local
6354 Tpl.Text txt;
6355 SCode.Annotation i_ann;
6356
6357 case ( txt,
6358 SOME(i_ann) )
6359 algorithm
6360 ✗ txt := dumpAnnotation(txt, i_ann);
6361 then txt;
6362
6363 case ( txt,
6364 _ )
6365 then txt;
6366 end match;
6367 end dumpAnnotationOpt;
6368
6369 protected function fun_226
6370 input Tpl.Text in_txt;
6371 input Boolean in_mArg;
6372 input Tpl.Text in_a_ann__str;
6373
6374 output Tpl.Text out_txt;
6375 algorithm
6376 out_txt :=
6377 match(in_txt, in_mArg, in_a_ann__str)
6378 local
6379 Tpl.Text txt;
6380 Tpl.Text a_ann__str;
6381
6382 case ( txt,
6383 true,
6384 _ )
6385 then txt;
6386
6387 case ( txt,
6388 _,
6389 a_ann__str )
6390 algorithm
6391 3 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation"));
6392 3 txt := Tpl.writeText(txt, a_ann__str);
6393 then txt;
6394 end match;
6395 end fun_226;
6396
6397 protected function fun_227
6398 input Tpl.Text in_txt;
6399 input Boolean in_mArg;
6400 input SCode.Mod in_a_ann__mod;
6401
6402 output Tpl.Text out_txt;
6403 algorithm
6404 out_txt :=
6405 match(in_txt, in_mArg, in_a_ann__mod)
6406 local
6407 Tpl.Text txt;
6408 SCode.Mod a_ann__mod;
6409 Boolean ret_2;
6410 SCode.Mod ret_1;
6411 Tpl.Text l_ann__str;
6412
6413 case ( txt,
6414 false,
6415 _ )
6416 then txt;
6417
6418 case ( txt,
6419 _,
6420 a_ann__mod )
6421 algorithm
6422 4 ret_1 := DAEDumpTypes.filterStructuralMods(a_ann__mod);
6423 4 l_ann__str := SCodeDumpTpl.dumpModifier(Tpl.emptyTxt, ret_1, SCodeDump.defaultOptions);
6424 4 ret_2 := Tpl.isEmpty(l_ann__str);
6425 4 txt := fun_226(txt, ret_2, l_ann__str);
6426 then txt;
6427 end match;
6428 end fun_227;
6429
6430 protected function fun_228
6431 input Tpl.Text in_txt;
6432 input Boolean in_mArg;
6433 input SCode.Mod in_a_ann__mod;
6434
6435 output Tpl.Text out_txt;
6436 algorithm
6437 out_txt :=
6438 match(in_txt, in_mArg, in_a_ann__mod)
6439 local
6440 Tpl.Text txt;
6441 SCode.Mod a_ann__mod;
6442 Boolean ret_0;
6443
6444 case ( txt,
6445 false,
6446 a_ann__mod )
6447 algorithm
6448 1943 ret_0 := Config.showStructuralAnnotations();
6449 1943 txt := fun_227(txt, ret_0, a_ann__mod);
6450 then txt;
6451
6452 case ( txt,
6453 _,
6454 a_ann__mod )
6455 algorithm
6456 5 txt := Tpl.writeTok(txt, Tpl.ST_STRING("annotation"));
6457 5 txt := SCodeDumpTpl.dumpModifier(txt, a_ann__mod, SCodeDump.defaultOptions);
6458 then txt;
6459 end match;
6460 end fun_228;
6461
6462 public function dumpAnnotation
6463 input Tpl.Text in_txt;
6464 input SCode.Annotation in_a_annotation;
6465
6466 output Tpl.Text out_txt;
6467 algorithm
6468 out_txt :=
6469 match(in_txt, in_a_annotation)
6470 local
6471 Tpl.Text txt;
6472 SCode.Mod i_ann__mod;
6473 Boolean ret_0;
6474
6475 case ( txt,
6476 SCode.ANNOTATION(modification = i_ann__mod) )
6477 algorithm
6478 1948 ret_0 := Config.showAnnotations();
6479 1948 txt := fun_228(txt, ret_0, i_ann__mod);
6480 then txt;
6481
6482 case ( txt,
6483 _ )
6484 then txt;
6485 end match;
6486 end dumpAnnotation;
6487
6488 public function dumpPathLastIndent
6489 input Tpl.Text in_txt;
6490 input Absyn.Path in_a_path;
6491
6492 output Tpl.Text out_txt;
6493 algorithm
6494 out_txt :=
6495 match(in_txt, in_a_path)
6496 local
6497 Tpl.Text txt;
6498 Absyn.Ident i_name;
6499 Absyn.Path i_path;
6500
6501 case ( txt,
6502 Absyn.FULLYQUALIFIED(path = i_path) )
6503 algorithm
6504 110 txt := dumpPathLastIndent(txt, i_path);
6505 then txt;
6506
6507 case ( txt,
6508 Absyn.QUALIFIED(path = i_path) )
6509 algorithm
6510 402 txt := dumpPathLastIndent(txt, i_path);
6511 then txt;
6512
6513 case ( txt,
6514 Absyn.IDENT(name = i_name) )
6515 algorithm
6516 141 txt := Tpl.writeStr(txt, i_name);
6517 then txt;
6518
6519 case ( txt,
6520 _ )
6521 algorithm
6522 ✗ txt := errorMsg(txt, "dumpPathLastIndent: Unknown path.");
6523 then txt;
6524 end match;
6525 end dumpPathLastIndent;
6526
6527 protected function lm_231
6528 input output Tpl.Text txt;
6529 input list<SCode.Comment> items;
6530 algorithm
6531
2/2
✓ Branch 0 taken 5563 times.
✓ Branch 1 taken 9865 times.
15428 for lstElt_231 in items loop
6532 txt := match lstElt_231
6533 local
6534 SCode.Comment i_c;
6535
6536 case i_c
6537 algorithm
6538 5563 txt := dumpComment(txt, i_c);
6539 5563 txt := Tpl.nextIter(txt);
6540 then txt;
6541 end match;
6542 end for;
6543 end lm_231;
6544
6545 public function dumpSource
6546 input Tpl.Text in_txt;
6547 input DAE.ElementSource in_a_source;
6548
6549 output Tpl.Text out_txt;
6550 algorithm
6551 out_txt :=
6552 match(in_txt, in_a_source)
6553 local
6554 Tpl.Text txt;
6555 list<SCode.Comment> i_comment;
6556
6557 case ( txt,
6558 DAE.SOURCE(comment = i_comment) )
6559 algorithm
6560 9865 txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" + ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE()));
6561 9865 txt := lm_231(txt, i_comment);
6562 9865 txt := Tpl.popIter(txt);
6563 then txt;
6564
6565 case ( txt,
6566 _ )
6567 then txt;
6568 end match;
6569 end dumpSource;
6570
6571 public function errorMsg
6572 input Tpl.Text txt;
6573 input String a_errMessage;
6574
6575 output Tpl.Text out_txt;
6576 algorithm
6577 ✗ Tpl.addTemplateError(a_errMessage);
6578 ✗ out_txt := Tpl.writeStr(txt, a_errMessage);
6579 end errorMsg;
6580
6581 annotation(__OpenModelica_Interface="frontend_dump");
6582 end DAEDumpTpl;
6583