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