diff --git a/Compiler/SimCodeC.mo b/Compiler/SimCodeC.mo index eaf642a4ceb..83f65903f55 100644 --- a/Compiler/SimCodeC.mo +++ b/Compiler/SimCodeC.mo @@ -17764,7 +17764,85 @@ algorithm end matchcontinue; end functionArg; -protected function lm_426 +protected function fun_426 + input Tpl.Text in_txt; + input Boolean in_it; + input Integer in_i_ix; + input String in_i_dest; + input Tpl.Text in_i_varAssign; + input DAE.ComponentRef in_i_var_name; + input Tpl.Text in_i_varCopy; + input Tpl.Text in_i_varDecls; + + output Tpl.Text out_txt; + output Tpl.Text out_i_varAssign; + output Tpl.Text out_i_varCopy; + output Tpl.Text out_i_varDecls; +algorithm + (out_txt, out_i_varAssign, out_i_varCopy, out_i_varDecls) := + matchcontinue(in_txt, in_it, in_i_ix, in_i_dest, in_i_varAssign, in_i_var_name, in_i_varCopy, in_i_varDecls) + local + Tpl.Text txt; + Integer i_ix; + String i_dest; + Tpl.Text i_varAssign; + DAE.ComponentRef i_var_name; + Tpl.Text i_varCopy; + Tpl.Text i_varDecls; + + case ( txt, + false, + i_ix, + i_dest, + i_varAssign, + i_var_name, + i_varCopy, + i_varDecls ) + local + Tpl.Text i_strVar; + equation + (i_strVar, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_string", i_varDecls); + i_varCopy = Tpl.writeText(i_varCopy, i_strVar); + i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_STRING(" = strdup(")); + i_varCopy = contextCref(i_varCopy, i_var_name, SimCode.contextFunction); + i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_STRING(");")); + i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_NEW_LINE()); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING("init_modelica_string(&")); + i_varAssign = Tpl.writeStr(i_varAssign, i_dest); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(".targ")); + i_varAssign = Tpl.writeStr(i_varAssign, intString(i_ix)); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(",")); + i_varAssign = Tpl.writeText(i_varAssign, i_strVar); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING_LIST({ + ");\n", + "free(" + }, false)); + i_varAssign = Tpl.writeText(i_varAssign, i_strVar); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(");")); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_NEW_LINE()); + then (txt, i_varAssign, i_varCopy, i_varDecls); + + case ( txt, + _, + i_ix, + i_dest, + i_varAssign, + i_var_name, + i_varCopy, + i_varDecls ) + equation + i_varAssign = Tpl.writeStr(i_varAssign, i_dest); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(".targ")); + i_varAssign = Tpl.writeStr(i_varAssign, intString(i_ix)); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(" = ")); + i_varAssign = contextCref(i_varAssign, i_var_name, SimCode.contextFunction); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(";")); + i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_NEW_LINE()); + then (txt, i_varAssign, i_varCopy, i_varDecls); + end matchcontinue; +end fun_426; + +protected function lm_427 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -17797,7 +17875,7 @@ algorithm equation (txt, i_varInits, i_varDecls) = daeExp(txt, i_exp, SimCode.contextFunction, i_varInits, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_varInits) = lm_426(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_427(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -17807,12 +17885,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_varInits) = lm_426(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_427(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); end matchcontinue; -end lm_426; +end lm_427; -protected function fun_427 +protected function fun_428 input Tpl.Text in_txt; input list in_i_instDims; input Tpl.Text in_i_instDimsInit; @@ -17901,7 +17979,7 @@ algorithm i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_NEW_LINE()); then (txt, i_varAssign, i_varInits); end matchcontinue; -end fun_427; +end fun_428; public function varOutput input Tpl.Text in_txt; @@ -17941,27 +18019,10 @@ algorithm local DAE.ComponentRef i_var_name; SimCode.Variable i_var; - Tpl.Text i_strVar; + Boolean ret_0; equation - (i_strVar, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_string", i_varDecls); - i_varCopy = Tpl.writeText(i_varCopy, i_strVar); - i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_STRING(" = strdup(")); - i_varCopy = contextCref(i_varCopy, i_var_name, SimCode.contextFunction); - i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_STRING(");")); - i_varCopy = Tpl.writeTok(i_varCopy, Tpl.ST_NEW_LINE()); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING("init_modelica_string(&")); - i_varAssign = Tpl.writeStr(i_varAssign, i_dest); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(".targ")); - i_varAssign = Tpl.writeStr(i_varAssign, intString(i_ix)); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(",")); - i_varAssign = Tpl.writeText(i_varAssign, i_strVar); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING_LIST({ - ");\n", - "free(" - }, false)); - i_varAssign = Tpl.writeText(i_varAssign, i_strVar); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_STRING(");")); - i_varAssign = Tpl.writeTok(i_varAssign, Tpl.ST_NEW_LINE()); + ret_0 = RTOpts.acceptMetaModelicaGrammar(); + (txt, i_varAssign, i_varCopy, i_varDecls) = fun_426(txt, ret_0, i_ix, i_dest, i_varAssign, i_var_name, i_varCopy, i_varDecls); then (txt, i_varDecls, i_varInits, i_varCopy, i_varAssign); case ( txt, @@ -17980,9 +18041,9 @@ algorithm Tpl.Text i_instDimsInit; equation i_instDimsInit = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_instDimsInit, i_varDecls, i_varInits) = lm_426(i_instDimsInit, i_instDims, i_varDecls, i_varInits); + (i_instDimsInit, i_varDecls, i_varInits) = lm_427(i_instDimsInit, i_instDims, i_varDecls, i_varInits); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_varAssign, i_varInits) = fun_427(txt, i_instDims, i_instDimsInit, i_var_ty, i_var_name, i_ix, i_dest, i_varAssign, i_var, i_varInits); + (txt, i_varAssign, i_varInits) = fun_428(txt, i_instDims, i_instDimsInit, i_var_ty, i_var_name, i_ix, i_dest, i_varAssign, i_var, i_varInits); then (txt, i_varDecls, i_varInits, i_varCopy, i_varAssign); case ( txt, @@ -17997,7 +18058,7 @@ algorithm end matchcontinue; end varOutput; -protected function lm_429 +protected function lm_430 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varName; @@ -18025,7 +18086,7 @@ algorithm equation (txt, i_varName) = recordMemberInit(txt, i_v, i_varName); txt = Tpl.nextIter(txt); - (txt, i_varName) = lm_429(txt, rest, i_varName); + (txt, i_varName) = lm_430(txt, rest, i_varName); then (txt, i_varName); case ( txt, @@ -18034,10 +18095,10 @@ algorithm local list rest; equation - (txt, i_varName) = lm_429(txt, rest, i_varName); + (txt, i_varName) = lm_430(txt, rest, i_varName); then (txt, i_varName); end matchcontinue; -end lm_429; +end lm_430; public function initRecordMembers input Tpl.Text in_txt; @@ -18060,7 +18121,7 @@ algorithm equation i_varName = contextCref(Tpl.emptyTxt, i_name, SimCode.contextFunction); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varName) = lm_429(txt, i_ty_varLst, i_varName); + (txt, i_varName) = lm_430(txt, i_ty_varLst, i_varName); txt = Tpl.popIter(txt); then txt; @@ -18070,7 +18131,7 @@ algorithm end matchcontinue; end initRecordMembers; -protected function lm_431 +protected function lm_432 input Tpl.Text in_txt; input list in_items; @@ -18093,7 +18154,7 @@ algorithm equation txt = dimension(txt, i_dim); txt = Tpl.nextIter(txt); - txt = lm_431(txt, rest); + txt = lm_432(txt, rest); then txt; case ( txt, @@ -18101,12 +18162,12 @@ algorithm local list rest; equation - txt = lm_431(txt, rest); + txt = lm_432(txt, rest); then txt; end matchcontinue; -end lm_431; +end lm_432; -protected function fun_432 +protected function fun_433 input Tpl.Text in_txt; input DAE.ExpVar in_i_v; input Tpl.Text in_i_varName; @@ -18132,7 +18193,7 @@ algorithm equation i_arrayType = expType(Tpl.emptyTxt, i_tp, true); i_dims = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_dims = lm_431(i_dims, i_tp_arrayDimensions); + i_dims = lm_432(i_dims, i_tp_arrayDimensions); i_dims = Tpl.popIter(i_dims); txt = Tpl.writeTok(txt, Tpl.ST_STRING("alloc_")); txt = Tpl.writeText(txt, i_arrayType); @@ -18153,7 +18214,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_432; +end fun_433; public function recordMemberInit input Tpl.Text txt; @@ -18163,7 +18224,7 @@ public function recordMemberInit output Tpl.Text out_txt; output Tpl.Text out_i_varName; algorithm - out_txt := fun_432(txt, i_v, i_varName); + out_txt := fun_433(txt, i_v, i_varName); out_i_varName := i_varName; end recordMemberInit; @@ -18177,7 +18238,7 @@ algorithm out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("_ext")); end extVarName; -protected function fun_435 +protected function fun_436 input Tpl.Text in_txt; input String in_i_language; input Tpl.Text in_i_varDecls; @@ -18221,7 +18282,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_435; +end fun_436; public function extFunCall input Tpl.Text in_txt; @@ -18248,7 +18309,7 @@ algorithm String i_language; SimCode.Function i_fun; equation - (txt, i_varDecls, i_preExp) = fun_435(txt, i_language, i_varDecls, i_preExp, i_fun); + (txt, i_varDecls, i_preExp) = fun_436(txt, i_language, i_varDecls, i_preExp, i_fun); then (txt, i_preExp, i_varDecls); case ( txt, @@ -18259,7 +18320,7 @@ algorithm end matchcontinue; end extFunCall; -protected function lm_437 +protected function lm_438 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -18292,7 +18353,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = extArg(txt, i_arg, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_437(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_438(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -18302,12 +18363,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_437(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_438(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_437; +end lm_438; -protected function fun_438 +protected function fun_439 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -18331,9 +18392,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_438; +end fun_439; -protected function lm_439 +protected function lm_440 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -18361,7 +18422,7 @@ algorithm equation (txt, i_varDecls) = extFunCallVardecl(txt, i_arg, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_439(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_440(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -18370,12 +18431,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_439(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_440(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_439; +end lm_440; -protected function fun_440 +protected function fun_441 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; input Tpl.Text in_i_varDecls; @@ -18403,9 +18464,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_440; +end fun_441; -protected function lm_441 +protected function lm_442 input Tpl.Text in_txt; input list in_items; @@ -18428,7 +18489,7 @@ algorithm equation txt = extFunCallVarcopy(txt, i_arg); txt = Tpl.nextIter(txt); - txt = lm_441(txt, rest); + txt = lm_442(txt, rest); then txt; case ( txt, @@ -18436,12 +18497,12 @@ algorithm local list rest; equation - txt = lm_441(txt, rest); + txt = lm_442(txt, rest); then txt; end matchcontinue; -end lm_441; +end lm_442; -protected function fun_442 +protected function fun_443 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -18464,7 +18525,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_442; +end fun_443; public function extFunCallC input Tpl.Text in_txt; @@ -18495,14 +18556,14 @@ algorithm Tpl.Text i_args; equation i_args = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_args, i_varDecls, i_preExp) = lm_437(i_args, i_extArgs, i_varDecls, i_preExp); + (i_args, i_varDecls, i_preExp) = lm_438(i_args, i_extArgs, i_varDecls, i_preExp); i_args = Tpl.popIter(i_args); - i_returnAssign = fun_438(Tpl.emptyTxt, i_extReturn); + i_returnAssign = fun_439(Tpl.emptyTxt, i_extReturn); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_439(txt, i_extArgs, i_varDecls); + (txt, i_varDecls) = lm_440(txt, i_extArgs, i_varDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - (txt, i_varDecls) = fun_440(txt, i_extReturn, i_varDecls); + (txt, i_varDecls) = fun_441(txt, i_extReturn, i_varDecls); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_returnAssign); txt = Tpl.writeStr(txt, i_extName); @@ -18510,10 +18571,10 @@ algorithm txt = Tpl.writeText(txt, i_args); txt = Tpl.writeTok(txt, Tpl.ST_LINE(");\n")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt = lm_441(txt, i_extArgs); + txt = lm_442(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - txt = fun_442(txt, i_extReturn); + txt = fun_443(txt, i_extReturn); then (txt, i_preExp, i_varDecls); case ( txt, @@ -18524,7 +18585,7 @@ algorithm end matchcontinue; end extFunCallC; -protected function lm_444 +protected function lm_445 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -18557,7 +18618,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = extArgF77(txt, i_arg, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_444(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_445(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -18567,12 +18628,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_444(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_445(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_444; +end lm_445; -protected function fun_445 +protected function fun_446 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -18596,9 +18657,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_445; +end fun_446; -protected function lm_446 +protected function lm_447 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -18626,7 +18687,7 @@ algorithm equation (txt, i_varDecls) = extFunCallVardeclF77(txt, i_arg, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_446(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_447(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -18635,12 +18696,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_446(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_447(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_446; +end lm_447; -protected function fun_447 +protected function fun_448 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; input Tpl.Text in_i_varDecls; @@ -18668,9 +18729,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_447; +end fun_448; -protected function lm_448 +protected function lm_449 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -18703,7 +18764,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = extFunCallBiVarF77(txt, i_arg, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_448(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_449(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -18713,12 +18774,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_448(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_449(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_448; +end lm_449; -protected function lm_449 +protected function lm_450 input Tpl.Text in_txt; input list in_items; @@ -18741,7 +18802,7 @@ algorithm equation txt = extFunCallVarcopyF77(txt, i_arg); txt = Tpl.nextIter(txt); - txt = lm_449(txt, rest); + txt = lm_450(txt, rest); then txt; case ( txt, @@ -18749,12 +18810,12 @@ algorithm local list rest; equation - txt = lm_449(txt, rest); + txt = lm_450(txt, rest); then txt; end matchcontinue; -end lm_449; +end lm_450; -protected function fun_450 +protected function fun_451 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -18777,7 +18838,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_450; +end fun_451; public function extFunCallF77 input Tpl.Text in_txt; @@ -18809,17 +18870,17 @@ algorithm Tpl.Text i_args; equation i_args = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_args, i_varDecls, i_preExp) = lm_444(i_args, i_extArgs, i_varDecls, i_preExp); + (i_args, i_varDecls, i_preExp) = lm_445(i_args, i_extArgs, i_varDecls, i_preExp); i_args = Tpl.popIter(i_args); - i_returnAssign = fun_445(Tpl.emptyTxt, i_extReturn); + i_returnAssign = fun_446(Tpl.emptyTxt, i_extReturn); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_446(txt, i_extArgs, i_varDecls); + (txt, i_varDecls) = lm_447(txt, i_extArgs, i_varDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - (txt, i_varDecls) = fun_447(txt, i_extReturn, i_varDecls); + (txt, i_varDecls) = fun_448(txt, i_extReturn, i_varDecls); txt = Tpl.softNewLine(txt); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls, i_preExp) = lm_448(txt, i_biVars, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_449(txt, i_biVars, i_varDecls, i_preExp); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_returnAssign); @@ -18828,10 +18889,10 @@ algorithm txt = Tpl.writeText(txt, i_args); txt = Tpl.writeTok(txt, Tpl.ST_LINE(");\n")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt = lm_449(txt, i_extArgs); + txt = lm_450(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - txt = fun_450(txt, i_extReturn); + txt = fun_451(txt, i_extReturn); then (txt, i_preExp, i_varDecls); case ( txt, @@ -18842,7 +18903,7 @@ algorithm end matchcontinue; end extFunCallF77; -protected function fun_452 +protected function fun_453 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input DAE.ComponentRef in_i_c; @@ -18884,9 +18945,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then (txt, i_varDecls); end matchcontinue; -end fun_452; +end fun_453; -protected function fun_453 +protected function fun_454 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -18924,7 +18985,7 @@ algorithm i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_NEW_LINE()); then (txt, i_varDecls); end matchcontinue; -end fun_453; +end fun_454; public function extFunCallVardecl input Tpl.Text in_txt; @@ -18947,7 +19008,7 @@ algorithm DAE.ComponentRef i_c; DAE.ExpType i_ty; equation - (txt, i_varDecls) = fun_452(txt, i_ty, i_c, i_varDecls); + (txt, i_varDecls) = fun_453(txt, i_ty, i_c, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -18958,7 +19019,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - (txt, i_varDecls) = fun_453(txt, i_oi, i_c, i_ty, i_varDecls); + (txt, i_varDecls) = fun_454(txt, i_oi, i_c, i_ty, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -18968,7 +19029,7 @@ algorithm end matchcontinue; end extFunCallVardecl; -protected function fun_455 +protected function fun_456 input Tpl.Text in_txt; input Boolean in_i_ia; input DAE.ComponentRef in_i_c; @@ -19007,9 +19068,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_455; +end fun_456; -protected function fun_456 +protected function fun_457 input Tpl.Text in_txt; input Integer in_i_oi; input Boolean in_i_ia; @@ -19051,10 +19112,10 @@ algorithm i_varDecls = extVarName(i_varDecls, i_c); i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_STRING(";")); i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_NEW_LINE()); - txt = fun_455(txt, i_ia, i_c, i_oi, i_ty); + txt = fun_456(txt, i_ia, i_c, i_oi, i_ty); then (txt, i_varDecls); end matchcontinue; -end fun_456; +end fun_457; public function extFunCallVardeclF77 input Tpl.Text in_txt; @@ -19100,7 +19161,7 @@ algorithm Boolean i_ia; Integer i_oi; equation - (txt, i_varDecls) = fun_456(txt, i_oi, i_ia, i_c, i_ty, i_varDecls); + (txt, i_varDecls) = fun_457(txt, i_oi, i_ia, i_c, i_ty, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -19124,7 +19185,7 @@ algorithm end matchcontinue; end extFunCallVardeclF77; -protected function fun_458 +protected function fun_459 input Tpl.Text in_txt; input Option in_i_value; input Tpl.Text in_i_varDecls; @@ -19165,9 +19226,9 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_458; +end fun_459; -protected function lm_459 +protected function lm_460 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -19200,7 +19261,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, SimCode.contextFunction, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_459(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_460(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -19210,12 +19271,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_459(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_460(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_459; +end lm_460; -protected function fun_460 +protected function fun_461 input Tpl.Text in_txt; input list in_i_instDims; input DAE.ComponentRef in_i_name; @@ -19280,7 +19341,7 @@ algorithm i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_NEW_LINE()); then (txt, i_preExp); end matchcontinue; -end fun_460; +end fun_461; public function extFunCallBiVarF77 input Tpl.Text in_txt; @@ -19324,12 +19385,12 @@ algorithm i_varDecls = extVarName(i_varDecls, i_name); i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_STRING(";")); i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_NEW_LINE()); - (i_defaultValue, i_varDecls, i_preExp) = fun_458(Tpl.emptyTxt, i_value, i_varDecls, i_preExp, i_var__name); + (i_defaultValue, i_varDecls, i_preExp) = fun_459(Tpl.emptyTxt, i_value, i_varDecls, i_preExp, i_var__name); i_preExp = Tpl.writeText(i_preExp, i_defaultValue); i_instDimsInit = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_instDimsInit, i_varDecls, i_preExp) = lm_459(i_instDimsInit, i_instDims, i_varDecls, i_preExp); + (i_instDimsInit, i_varDecls, i_preExp) = lm_460(i_instDimsInit, i_instDims, i_varDecls, i_preExp); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_preExp) = fun_460(txt, i_instDims, i_name, i_instDimsInit, i_var__name, i_preExp, i_var_ty); + (txt, i_preExp) = fun_461(txt, i_instDims, i_name, i_instDimsInit, i_var__name, i_preExp, i_var_ty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -19340,7 +19401,7 @@ algorithm end matchcontinue; end extFunCallBiVarF77; -protected function fun_462 +protected function fun_463 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -19377,7 +19438,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext;")); then txt; end matchcontinue; -end fun_462; +end fun_463; public function extFunCallVarcopy input Tpl.Text in_txt; @@ -19397,7 +19458,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - txt = fun_462(txt, i_oi, i_c, i_ty); + txt = fun_463(txt, i_oi, i_c, i_ty); then txt; case ( txt, @@ -19406,7 +19467,7 @@ algorithm end matchcontinue; end extFunCallVarcopy; -protected function fun_464 +protected function fun_465 input Tpl.Text in_txt; input Boolean in_i_ai; input Tpl.Text in_i_ext__name; @@ -19460,9 +19521,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_464; +end fun_465; -protected function fun_465 +protected function fun_466 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ExpType in_i_ty; @@ -19500,10 +19561,10 @@ algorithm i_outarg = Tpl.writeStr(i_outarg, intString(i_oi)); i_ext__name = contextCref(Tpl.emptyTxt, i_c, SimCode.contextFunction); i_ext__name = Tpl.writeTok(i_ext__name, Tpl.ST_STRING("_ext")); - txt = fun_464(txt, i_ai, i_ext__name, i_ty, i_outarg); + txt = fun_465(txt, i_ai, i_ext__name, i_ty, i_outarg); then txt; end matchcontinue; -end fun_465; +end fun_466; public function extFunCallVarcopyF77 input Tpl.Text in_txt; @@ -19524,7 +19585,7 @@ algorithm Boolean i_ai; Integer i_oi; equation - txt = fun_465(txt, i_oi, i_ty, i_ai, i_c); + txt = fun_466(txt, i_oi, i_ty, i_ai, i_c); then txt; case ( txt, @@ -19533,7 +19594,7 @@ algorithm end matchcontinue; end extFunCallVarcopyF77; -protected function fun_467 +protected function fun_468 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -19563,9 +19624,9 @@ algorithm txt = Tpl.writeStr(txt, intString(i_oi)); then txt; end matchcontinue; -end fun_467; +end fun_468; -protected function fun_468 +protected function fun_469 input Tpl.Text in_txt; input Integer in_i_oi; @@ -19586,9 +19647,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_468; +end fun_469; -protected function fun_469 +protected function fun_470 input Tpl.Text in_txt; input DAE.ExpType in_i_t; @@ -19609,9 +19670,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_469; +end fun_470; -protected function fun_470 +protected function fun_471 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ExpType in_i_t; @@ -19628,7 +19689,7 @@ algorithm 0, i_t ) equation - txt = fun_469(txt, i_t); + txt = fun_470(txt, i_t); then txt; case ( txt, @@ -19638,9 +19699,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_470; +end fun_471; -protected function fun_471 +protected function fun_472 input Tpl.Text in_txt; input Integer in_i_outputIndex; input DAE.ComponentRef in_i_c; @@ -19670,7 +19731,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_outputIndex)); then txt; end matchcontinue; -end fun_471; +end fun_472; public function extArg input Tpl.Text in_txt; @@ -19700,7 +19761,7 @@ algorithm Tpl.Text i_shortTypeStr; Tpl.Text i_name; equation - i_name = fun_467(Tpl.emptyTxt, i_oi, i_c); + i_name = fun_468(Tpl.emptyTxt, i_oi, i_c); i_shortTypeStr = expTypeShort(Tpl.emptyTxt, i_t); txt = Tpl.writeTok(txt, Tpl.ST_STRING("data_of_")); txt = Tpl.writeText(txt, i_shortTypeStr); @@ -19721,8 +19782,8 @@ algorithm Tpl.Text i_suffix; Tpl.Text i_prefix; equation - i_prefix = fun_468(Tpl.emptyTxt, i_oi); - i_suffix = fun_470(Tpl.emptyTxt, i_oi, i_t); + i_prefix = fun_469(Tpl.emptyTxt, i_oi); + i_suffix = fun_471(Tpl.emptyTxt, i_oi, i_t); txt = Tpl.writeText(txt, i_prefix); txt = contextCref(txt, i_c, SimCode.contextFunction); txt = Tpl.writeText(txt, i_suffix); @@ -19752,7 +19813,7 @@ algorithm Tpl.Text i_typeStr; equation i_typeStr = expTypeShort(Tpl.emptyTxt, i_type__); - i_name = fun_471(Tpl.emptyTxt, i_outputIndex, i_c); + i_name = fun_472(Tpl.emptyTxt, i_outputIndex, i_c); (i_dim, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp, SimCode.contextFunction, i_preExp, i_varDecls); txt = Tpl.writeTok(txt, Tpl.ST_STRING("size_of_dimension_")); txt = Tpl.writeText(txt, i_typeStr); @@ -19771,7 +19832,7 @@ algorithm end matchcontinue; end extArg; -protected function fun_473 +protected function fun_474 input Tpl.Text in_txt; input Boolean in_i_ia; @@ -19792,9 +19853,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_473; +end fun_474; -protected function fun_474 +protected function fun_475 input Tpl.Text in_txt; input Integer in_i_oi; input Boolean in_i_ia; @@ -19811,7 +19872,7 @@ algorithm 0, i_ia ) equation - txt = fun_473(txt, i_ia); + txt = fun_474(txt, i_ia); then txt; case ( txt, @@ -19821,7 +19882,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_474; +end fun_475; public function extArgF77 input Tpl.Text in_txt; @@ -19866,7 +19927,7 @@ algorithm DAE.ComponentRef i_c; Tpl.Text i_suffix; equation - i_suffix = fun_474(Tpl.emptyTxt, i_oi, i_ia); + i_suffix = fun_475(Tpl.emptyTxt, i_oi, i_ia); txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); txt = contextCref(txt, i_c, SimCode.contextFunction); txt = Tpl.writeText(txt, i_suffix); @@ -19922,7 +19983,7 @@ algorithm end matchcontinue; end extArgF77; -protected function fun_476 +protected function fun_477 input Tpl.Text in_txt; input DAE.Exp in_i_indices; input DAE.ComponentRef in_i_c; @@ -19953,7 +20014,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("tempSizeVarName:UNHANDLED_EXPRESSION")); then txt; end matchcontinue; -end fun_476; +end fun_477; public function tempSizeVarName input Tpl.Text txt; @@ -19962,10 +20023,10 @@ public function tempSizeVarName output Tpl.Text out_txt; algorithm - out_txt := fun_476(txt, i_indices, i_c); + out_txt := fun_477(txt, i_indices, i_c); end tempSizeVarName; -protected function lm_478 +protected function lm_479 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -19993,7 +20054,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, SimCode.contextFunction, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_478(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_479(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -20002,10 +20063,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_478(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_479(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_478; +end lm_479; public function funStatement input Tpl.Text in_txt; @@ -20028,7 +20089,7 @@ algorithm list i_statementLst; equation txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_478(txt, i_statementLst, i_varDecls); + (txt, i_varDecls) = lm_479(txt, i_statementLst, i_varDecls); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -20240,7 +20301,7 @@ algorithm end matchcontinue; end algStatement; -protected function fun_481 +protected function fun_482 input Tpl.Text in_txt; input DAE.Exp in_i_exp; input DAE.Exp in_i_val; @@ -20293,9 +20354,9 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_481; +end fun_482; -protected function fun_482 +protected function fun_483 input Tpl.Text in_txt; input String in_it; input DAE.Exp in_i_exp1; @@ -20325,7 +20386,7 @@ algorithm i_context, i_exp ) equation - (txt, i_varDecls) = fun_481(txt, i_exp, i_val, i_varDecls, i_context); + (txt, i_varDecls) = fun_482(txt, i_exp, i_val, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -20351,7 +20412,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then (txt, i_varDecls); end matchcontinue; -end fun_482; +end fun_483; public function algStmtAssign input Tpl.Text in_txt; @@ -20462,7 +20523,7 @@ algorithm equation txt_0 = expTypeFromExpShort(Tpl.emptyTxt, i_exp); str_1 = Tpl.textString(txt_0); - (txt, i_varDecls) = fun_482(txt, str_1, i_exp1, i_val, i_varDecls, i_context, i_exp); + (txt, i_varDecls) = fun_483(txt, str_1, i_exp1, i_val, i_varDecls, i_context, i_exp); then (txt, i_varDecls); case ( txt, @@ -20495,7 +20556,7 @@ algorithm end matchcontinue; end algStmtAssign; -protected function fun_484 +protected function fun_485 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_varDecls; @@ -20551,7 +20612,7 @@ algorithm (txt, i_varDecls) = indexedAssign(txt, i_t, Tpl.textString(i_expPart), i_cr, Tpl.textString(i_ispec), i_context, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end fun_484; +end fun_485; public function algStmtAssignArr input Tpl.Text in_txt; @@ -20586,7 +20647,7 @@ algorithm (i_expPart, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_e, i_context, i_preExp, i_varDecls); (i_ispec, i_preExp, i_varDecls) = indexSpecFromCref(Tpl.emptyTxt, i_cr, i_context, i_preExp, i_varDecls); str_3 = Tpl.textString(i_ispec); - (txt, i_varDecls) = fun_484(txt, str_3, i_varDecls, i_ispec, i_context, i_cr, i_expPart, i_t, i_preExp); + (txt, i_varDecls) = fun_485(txt, str_3, i_varDecls, i_ispec, i_context, i_cr, i_expPart, i_t, i_preExp); then (txt, i_varDecls); case ( txt, @@ -20597,7 +20658,7 @@ algorithm end matchcontinue; end algStmtAssignArr; -protected function fun_486 +protected function fun_487 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -20669,7 +20730,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then (txt, i_varDecls); end matchcontinue; -end fun_486; +end fun_487; public function indexedAssign input Tpl.Text txt; @@ -20688,10 +20749,10 @@ protected algorithm i_type := expTypeArray(Tpl.emptyTxt, i_ty); i_cref := contextArrayCref(Tpl.emptyTxt, i_cr, i_context); - (out_txt, out_i_varDecls) := fun_486(txt, i_context, i_varDecls, i_ispec, i_cref, i_exp, i_type); + (out_txt, out_i_varDecls) := fun_487(txt, i_context, i_varDecls, i_ispec, i_cref, i_exp, i_type); end indexedAssign; -protected function fun_488 +protected function fun_489 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_cref; @@ -20738,7 +20799,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_488; +end fun_489; public function copyArrayData input Tpl.Text txt; @@ -20754,10 +20815,10 @@ protected algorithm i_type := expTypeArray(Tpl.emptyTxt, i_ty); i_cref := contextArrayCref(Tpl.emptyTxt, i_cr, i_context); - out_txt := fun_488(txt, i_context, i_cref, i_exp, i_type); + out_txt := fun_489(txt, i_context, i_cref, i_exp, i_type); end copyArrayData; -protected function lm_490 +protected function lm_491 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -20804,7 +20865,7 @@ algorithm i_rhsStr = Tpl.writeStr(i_rhsStr, intString(i_i1)); (txt, i_preExp, i_varDecls) = writeLhsCref(txt, i_cr, Tpl.textString(i_rhsStr), i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_490(txt, rest, i_varDecls, i_preExp, i_context, i_retStruct); + (txt, i_varDecls, i_preExp) = lm_491(txt, rest, i_varDecls, i_preExp, i_context, i_retStruct); then (txt, i_varDecls, i_preExp); case ( txt, @@ -20816,10 +20877,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_490(txt, rest, i_varDecls, i_preExp, i_context, i_retStruct); + (txt, i_varDecls, i_preExp) = lm_491(txt, rest, i_varDecls, i_preExp, i_context, i_retStruct); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_490; +end lm_491; public function algStmtTupleAssign input Tpl.Text in_txt; @@ -20852,7 +20913,7 @@ algorithm txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls, i_preExp) = lm_490(txt, i_expExpLst, i_varDecls, i_preExp, i_context, i_retStruct); + (txt, i_varDecls, i_preExp) = lm_491(txt, i_expExpLst, i_varDecls, i_preExp, i_context, i_retStruct); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -20864,7 +20925,7 @@ algorithm end matchcontinue; end algStmtTupleAssign; -protected function fun_492 +protected function fun_493 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_lhsStr; @@ -20908,9 +20969,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then txt; end matchcontinue; -end fun_492; +end fun_493; -protected function fun_493 +protected function fun_494 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_lhsStr; @@ -20962,7 +21023,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then txt; end matchcontinue; -end fun_493; +end fun_494; public function writeLhsCref input Tpl.Text in_txt; @@ -20997,7 +21058,7 @@ algorithm Tpl.Text i_lhsStr; equation (i_lhsStr, i_preExp, i_varDecls) = scalarLhsCref(Tpl.emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_492(txt, i_context, i_lhsStr, i_rhsStr, i_t); + txt = fun_493(txt, i_context, i_lhsStr, i_rhsStr, i_t); then (txt, i_preExp, i_varDecls); case ( txt, @@ -21012,7 +21073,7 @@ algorithm Tpl.Text i_lhsStr; equation (i_lhsStr, i_preExp, i_varDecls) = scalarLhsCref(Tpl.emptyTxt, i_e, i_context, i_preExp, i_varDecls); - txt = fun_493(txt, i_context, i_lhsStr, i_rhsStr, i_t); + txt = fun_494(txt, i_context, i_lhsStr, i_rhsStr, i_t); then (txt, i_preExp, i_varDecls); case ( txt, @@ -21059,7 +21120,7 @@ algorithm end matchcontinue; end writeLhsCref; -protected function lm_495 +protected function lm_496 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -21091,7 +21152,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_495(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_496(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -21101,10 +21162,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_495(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_496(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_495; +end lm_496; public function algStmtIf input Tpl.Text in_txt; @@ -21142,7 +21203,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_495(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_496(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -21203,7 +21264,7 @@ algorithm end matchcontinue; end algStmtFor; -protected function lm_498 +protected function lm_499 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -21235,7 +21296,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_498(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_499(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -21245,10 +21306,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_498(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_499(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_498; +end lm_499; public function algStmtForRange input Tpl.Text in_txt; @@ -21283,7 +21344,7 @@ algorithm i_identType = expType(Tpl.emptyTxt, i_type__, i_iterIsArray); i_identTypeShort = expTypeShort(Tpl.emptyTxt, i_type__); i_stmtStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_stmtStr, i_varDecls) = lm_498(i_stmtStr, i_statementLst, i_varDecls, i_context); + (i_stmtStr, i_varDecls) = lm_499(i_stmtStr, i_statementLst, i_varDecls, i_context); i_stmtStr = Tpl.popIter(i_stmtStr); (txt, i_stmtStr, i_varDecls) = algStmtForRange_impl(txt, i_rng, i_iter, Tpl.textString(i_identType), Tpl.textString(i_identTypeShort), i_stmtStr, i_context, i_varDecls); then (txt, i_varDecls); @@ -21296,7 +21357,7 @@ algorithm end matchcontinue; end algStmtForRange; -protected function fun_500 +protected function fun_501 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_varDecls; @@ -21322,9 +21383,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_500; +end fun_501; -protected function fun_501 +protected function fun_502 input Tpl.Text in_txt; input Option in_i_expOption; input Tpl.Text in_i_varDecls; @@ -21363,9 +21424,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_501; +end fun_502; -protected function fun_502 +protected function fun_503 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_stateVar; @@ -21391,9 +21452,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_502; +end fun_503; -protected function fun_503 +protected function fun_504 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_stateVar; @@ -21420,9 +21481,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_503; +end fun_504; -protected function fun_504 +protected function fun_505 input Tpl.Text in_txt; input DAE.Exp in_i_range; input Absyn.Ident in_i_iterator; @@ -21473,13 +21534,13 @@ algorithm equation i_iterName = contextIteratorName(Tpl.emptyTxt, i_iterator, i_context); ret_2 = RTOpts.acceptMetaModelicaGrammar(); - (i_stateVar, i_varDecls) = fun_500(Tpl.emptyTxt, ret_2, i_varDecls); + (i_stateVar, i_varDecls) = fun_501(Tpl.emptyTxt, ret_2, i_varDecls); (i_startVar, i_varDecls) = tempDecl(Tpl.emptyTxt, i_type, i_varDecls); (i_stepVar, i_varDecls) = tempDecl(Tpl.emptyTxt, i_type, i_varDecls); (i_stopVar, i_varDecls) = tempDecl(Tpl.emptyTxt, i_type, i_varDecls); i_preExp = Tpl.emptyTxt; (i_startValue, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - (i_stepValue, i_varDecls, i_preExp) = fun_501(Tpl.emptyTxt, i_expOption, i_varDecls, i_preExp, i_context); + (i_stepValue, i_varDecls, i_preExp) = fun_502(Tpl.emptyTxt, i_expOption, i_varDecls, i_preExp, i_context); (i_stopValue, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_range, i_context, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); @@ -21520,12 +21581,12 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); ret_10 = RTOpts.acceptMetaModelicaGrammar(); - txt = fun_502(txt, ret_10, i_stateVar); + txt = fun_503(txt, ret_10, i_stateVar); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_body); txt = Tpl.softNewLine(txt); ret_11 = RTOpts.acceptMetaModelicaGrammar(); - txt = fun_503(txt, ret_11, i_stateVar); + txt = fun_504(txt, ret_11, i_stateVar); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("}\n")); @@ -21543,7 +21604,7 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_504; +end fun_505; public function algStmtForRange_impl input Tpl.Text txt; @@ -21559,11 +21620,11 @@ public function algStmtForRange_impl output Tpl.Text out_i_body; output Tpl.Text out_i_varDecls; algorithm - (out_txt, out_i_varDecls) := fun_504(txt, i_range, i_iterator, i_type, i_shortType, i_body, i_context, i_varDecls); + (out_txt, out_i_varDecls) := fun_505(txt, i_range, i_iterator, i_type, i_shortType, i_body, i_context, i_varDecls); out_i_body := i_body; end algStmtForRange_impl; -protected function lm_506 +protected function lm_507 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -21595,7 +21656,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_506(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_507(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -21605,10 +21666,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_506(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_507(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_506; +end lm_507; public function algStmtForGeneric input Tpl.Text in_txt; @@ -21643,7 +21704,7 @@ algorithm i_iterType = expType(Tpl.emptyTxt, i_type__, i_iterIsArray); i_arrayType = expTypeArray(Tpl.emptyTxt, i_type__); i_stmtStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_stmtStr, i_varDecls) = lm_506(i_stmtStr, i_statementLst, i_varDecls, i_context); + (i_stmtStr, i_varDecls) = lm_507(i_stmtStr, i_statementLst, i_varDecls, i_context); i_stmtStr = Tpl.popIter(i_stmtStr); (txt, i_stmtStr, i_varDecls) = algStmtForGeneric_impl(txt, i_range, i_iter, Tpl.textString(i_iterType), Tpl.textString(i_arrayType), i_iterIsArray, i_stmtStr, i_context, i_varDecls); then (txt, i_varDecls); @@ -21656,7 +21717,7 @@ algorithm end matchcontinue; end algStmtForGeneric; -protected function fun_508 +protected function fun_509 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_varDecls; @@ -21682,9 +21743,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_508; +end fun_509; -protected function fun_509 +protected function fun_510 input Tpl.Text in_txt; input Boolean in_i_iterIsArray; input Tpl.Text in_i_ivar; @@ -21746,9 +21807,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_509; +end fun_510; -protected function fun_510 +protected function fun_511 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_stateVar; @@ -21774,9 +21835,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_510; +end fun_511; -protected function fun_511 +protected function fun_512 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_stateVar; @@ -21803,7 +21864,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_511; +end fun_512; public function algStmtForGeneric_impl input Tpl.Text txt; @@ -21833,12 +21894,12 @@ protected algorithm i_iterName := contextIteratorName(Tpl.emptyTxt, i_iterator, i_context); ret_2 := RTOpts.acceptMetaModelicaGrammar(); - (i_stateVar, out_i_varDecls) := fun_508(Tpl.emptyTxt, ret_2, i_varDecls); + (i_stateVar, out_i_varDecls) := fun_509(Tpl.emptyTxt, ret_2, i_varDecls); (i_tvar, out_i_varDecls) := tempDecl(Tpl.emptyTxt, "int", out_i_varDecls); (i_ivar, out_i_varDecls) := tempDecl(Tpl.emptyTxt, i_type, out_i_varDecls); i_preExp := Tpl.emptyTxt; (i_evar, i_preExp, out_i_varDecls) := daeExp(Tpl.emptyTxt, i_exp, i_context, i_preExp, out_i_varDecls); - i_stmtStuff := fun_509(Tpl.emptyTxt, i_iterIsArray, i_ivar, i_type, i_tvar, i_evar, i_arrayType, i_iterName); + i_stmtStuff := fun_510(Tpl.emptyTxt, i_iterIsArray, i_ivar, i_type, i_tvar, i_evar, i_arrayType, i_iterName); out_txt := Tpl.writeText(txt, i_preExp); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_LINE("{\n")); @@ -21863,14 +21924,14 @@ algorithm out_txt := Tpl.writeTok(out_txt, Tpl.ST_LINE(") {\n")); out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2)); ret_8 := RTOpts.acceptMetaModelicaGrammar(); - out_txt := fun_510(out_txt, ret_8, i_stateVar); + out_txt := fun_511(out_txt, ret_8, i_stateVar); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeText(out_txt, i_stmtStuff); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeText(out_txt, i_body); out_txt := Tpl.softNewLine(out_txt); ret_9 := RTOpts.acceptMetaModelicaGrammar(); - out_txt := fun_511(out_txt, ret_9, i_stateVar); + out_txt := fun_512(out_txt, ret_9, i_stateVar); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.popBlock(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_LINE("}\n")); @@ -21879,7 +21940,7 @@ algorithm out_i_body := i_body; end algStmtForGeneric_impl; -protected function lm_513 +protected function lm_514 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -21911,7 +21972,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_513(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_514(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -21921,10 +21982,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_513(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_514(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_513; +end lm_514; public function algStmtWhile input Tpl.Text in_txt; @@ -21962,7 +22023,7 @@ algorithm txt = Tpl.writeText(txt, i_var); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") break;\n")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_513(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_514(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -22054,7 +22115,7 @@ algorithm end matchcontinue; end algStmtTerminate; -protected function lm_517 +protected function lm_518 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varAssign; @@ -22110,7 +22171,7 @@ algorithm txt = Tpl.writeText(txt, i_decl); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - (txt, i_varAssign, i_preExp, i_varDecls) = lm_517(txt, rest, i_varAssign, i_preExp, i_context, i_varDecls); + (txt, i_varAssign, i_preExp, i_varDecls) = lm_518(txt, rest, i_varAssign, i_preExp, i_context, i_varDecls); then (txt, i_varAssign, i_preExp, i_varDecls); case ( txt, @@ -22122,10 +22183,10 @@ algorithm local list rest; equation - (txt, i_varAssign, i_preExp, i_varDecls) = lm_517(txt, rest, i_varAssign, i_preExp, i_context, i_varDecls); + (txt, i_varAssign, i_preExp, i_varDecls) = lm_518(txt, rest, i_varAssign, i_preExp, i_context, i_varDecls); then (txt, i_varAssign, i_preExp, i_varDecls); end matchcontinue; -end lm_517; +end lm_518; public function algStmtMatchcasesVarDeclsAndAssign input Tpl.Text txt; @@ -22141,11 +22202,11 @@ public function algStmtMatchcasesVarDeclsAndAssign output Tpl.Text out_i_preExp; algorithm out_txt := Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (out_txt, out_i_varAssign, out_i_preExp, out_i_varDecls) := lm_517(out_txt, i_expList, i_varAssign, i_preExp, i_context, i_varDecls); + (out_txt, out_i_varAssign, out_i_preExp, out_i_varDecls) := lm_518(out_txt, i_expList, i_varAssign, i_preExp, i_context, i_varDecls); out_txt := Tpl.popIter(out_txt); end algStmtMatchcasesVarDeclsAndAssign; -protected function lm_519 +protected function lm_520 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -22177,7 +22238,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_519(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_520(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -22187,10 +22248,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_519(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_520(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_519; +end lm_520; public function algStmtFailure input Tpl.Text in_txt; @@ -22219,7 +22280,7 @@ algorithm equation (i_tmp, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_boolean", i_varDecls); i_stmtBody = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_stmtBody, i_varDecls) = lm_519(i_stmtBody, i_body, i_varDecls, i_context); + (i_stmtBody, i_varDecls) = lm_520(i_stmtBody, i_body, i_varDecls, i_context); i_stmtBody = Tpl.popIter(i_stmtBody); txt = Tpl.writeText(txt, i_tmp); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ @@ -22248,7 +22309,7 @@ algorithm end matchcontinue; end algStmtFailure; -protected function lm_521 +protected function lm_522 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -22280,7 +22341,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_521(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_522(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -22290,10 +22351,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_521(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_522(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_521; +end lm_522; public function algStmtTry input Tpl.Text in_txt; @@ -22320,7 +22381,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_body, i_varDecls) = lm_521(i_body, i_tryBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_522(i_body, i_tryBody, i_varDecls, i_context); i_body = Tpl.popIter(i_body); txt = Tpl.writeTok(txt, Tpl.ST_LINE("try {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -22338,7 +22399,7 @@ algorithm end matchcontinue; end algStmtTry; -protected function lm_523 +protected function lm_524 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -22370,7 +22431,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_523(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_524(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -22380,10 +22441,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_523(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_524(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_523; +end lm_524; public function algStmtCatch input Tpl.Text in_txt; @@ -22410,7 +22471,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_body, i_varDecls) = lm_523(i_body, i_catchBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_524(i_body, i_catchBody, i_varDecls, i_context); i_body = Tpl.popIter(i_body); txt = Tpl.writeTok(txt, Tpl.ST_LINE("catch (int i) {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -22469,7 +22530,7 @@ algorithm end matchcontinue; end algStmtNoretcall; -protected function lm_526 +protected function lm_527 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -22501,7 +22562,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_526(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_527(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -22511,12 +22572,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_526(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_527(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_526; +end lm_527; -protected function lm_527 +protected function lm_528 input Tpl.Text in_txt; input list in_items; @@ -22541,7 +22602,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_idx)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_527(txt, rest); + txt = lm_528(txt, rest); then txt; case ( txt, @@ -22549,12 +22610,12 @@ algorithm local list rest; equation - txt = lm_527(txt, rest); + txt = lm_528(txt, rest); then txt; end matchcontinue; -end lm_527; +end lm_528; -protected function fun_528 +protected function fun_529 input Tpl.Text in_txt; input DAE.Statement in_i_when; input SimCode.Context in_i_context; @@ -22585,14 +22646,14 @@ algorithm equation (i_preIf, i_varDecls) = algStatementWhenPre(Tpl.emptyTxt, i_when, i_varDecls); i_statements = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_statements, i_varDecls) = lm_526(i_statements, i_statementLst, i_varDecls, i_context); + (i_statements, i_varDecls) = lm_527(i_statements, i_statementLst, i_varDecls, i_context); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(Tpl.emptyTxt, i_elseWhen, i_varDecls); txt = Tpl.writeText(txt, i_preIf); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("if (")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" || ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt = lm_527(txt, i_helpVarIndices); + txt = lm_528(txt, i_helpVarIndices); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -22609,9 +22670,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_528; +end fun_529; -protected function fun_529 +protected function fun_530 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.Statement in_i_when; @@ -22634,7 +22695,7 @@ algorithm local SimCode.Context i_context; equation - (txt, i_varDecls) = fun_528(txt, i_when, i_context, i_varDecls); + (txt, i_varDecls) = fun_529(txt, i_when, i_context, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -22643,7 +22704,7 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_529; +end fun_530; public function algStmtWhen input Tpl.Text txt; @@ -22654,10 +22715,10 @@ public function algStmtWhen output Tpl.Text out_txt; output Tpl.Text out_i_varDecls; algorithm - (out_txt, out_i_varDecls) := fun_529(txt, i_context, i_when, i_varDecls); + (out_txt, out_i_varDecls) := fun_530(txt, i_context, i_when, i_varDecls); end algStmtWhen; -protected function fun_531 +protected function fun_532 input Tpl.Text in_txt; input Option in_i_elseWhen; input Tpl.Text in_i_varDecls; @@ -22685,9 +22746,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_531; +end fun_532; -protected function fun_532 +protected function fun_533 input Tpl.Text in_txt; input Option in_i_when_elseWhen; input Tpl.Text in_i_varDecls; @@ -22715,9 +22776,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_532; +end fun_533; -protected function fun_533 +protected function fun_534 input Tpl.Text in_txt; input list in_i_helpVarIndices; input DAE.Exp in_i_when_exp; @@ -22746,7 +22807,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_532(Tpl.emptyTxt, i_when_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_533(Tpl.emptyTxt, i_when_elseWhen, i_varDecls); i_preExp = Tpl.emptyTxt; (i_res, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_when_exp, SimCode.contextSimulationDiscrete, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -22766,7 +22827,7 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_533; +end fun_534; public function algStatementWhenPre input Tpl.Text in_txt; @@ -22793,7 +22854,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_531(Tpl.emptyTxt, i_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_532(Tpl.emptyTxt, i_elseWhen, i_varDecls); i_preExp = Tpl.emptyTxt; (i_assignments, i_preExp, i_varDecls) = algStatementWhenPreAssigns(Tpl.emptyTxt, i_el, i_helpVarIndices, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -22812,7 +22873,7 @@ algorithm list i_helpVarIndices; DAE.Statement i_when; equation - (txt, i_varDecls) = fun_533(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); + (txt, i_varDecls) = fun_534(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); then (txt, i_varDecls); case ( txt, @@ -22822,7 +22883,7 @@ algorithm end matchcontinue; end algStatementWhenPre; -protected function lm_535 +protected function lm_536 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -22850,7 +22911,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, SimCode.contextSimulationDiscrete, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_535(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_536(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -22859,12 +22920,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_535(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_536(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_535; +end lm_536; -protected function lm_536 +protected function lm_537 input Tpl.Text in_txt; input list in_items; @@ -22889,7 +22950,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_idx)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_536(txt, rest); + txt = lm_537(txt, rest); then txt; case ( txt, @@ -22897,10 +22958,10 @@ algorithm local list rest; equation - txt = lm_536(txt, rest); + txt = lm_537(txt, rest); then txt; end matchcontinue; -end lm_536; +end lm_537; public function algStatementWhenElse input Tpl.Text in_txt; @@ -22929,11 +22990,11 @@ algorithm Tpl.Text i_statements; equation i_statements = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_statements, i_varDecls) = lm_535(i_statements, i_when_statementLst, i_varDecls); + (i_statements, i_varDecls) = lm_536(i_statements, i_when_statementLst, i_varDecls); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(Tpl.emptyTxt, i_when_elseWhen, i_varDecls); i_elseCondStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(" || ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_elseCondStr = lm_536(i_elseCondStr, i_when_helpVarIndices); + i_elseCondStr = lm_537(i_elseCondStr, i_when_helpVarIndices); i_elseCondStr = Tpl.popIter(i_elseCondStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING("else if (")); txt = Tpl.writeText(txt, i_elseCondStr); @@ -22953,7 +23014,7 @@ algorithm end matchcontinue; end algStatementWhenElse; -protected function fun_538 +protected function fun_539 input Tpl.Text in_txt; input list in_i_ints; input DAE.Exp in_i_firstExp; @@ -23004,7 +23065,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_538; +end fun_539; public function algStatementWhenPreAssigns input Tpl.Text in_txt; @@ -23041,7 +23102,7 @@ algorithm list i_restExps; DAE.Exp i_firstExp; equation - (txt, i_varDecls, i_preExp) = fun_538(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); + (txt, i_varDecls, i_preExp) = fun_539(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); then (txt, i_preExp, i_varDecls); case ( txt, @@ -23092,7 +23153,7 @@ algorithm end matchcontinue; end indexSpecFromCref; -protected function lm_541 +protected function lm_542 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -23124,7 +23185,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_541(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_542(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -23134,12 +23195,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_541(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_542(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_541; +end lm_542; -protected function lm_542 +protected function lm_543 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -23171,7 +23232,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_stmt, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_542(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_543(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -23181,10 +23242,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_542(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_543(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_542; +end lm_543; public function elseExpr input Tpl.Text in_txt; @@ -23230,7 +23291,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_541(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_542(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -23251,7 +23312,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE("else {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls) = lm_542(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_543(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -23266,7 +23327,7 @@ algorithm end matchcontinue; end elseExpr; -protected function fun_544 +protected function fun_545 input Tpl.Text in_txt; input Boolean in_it; input DAE.ComponentRef in_i_ecr_componentRef; @@ -23311,7 +23372,7 @@ algorithm txt = contextCref(txt, i_ecr_componentRef, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_544; +end fun_545; public function scalarLhsCref input Tpl.Text in_txt; @@ -23356,7 +23417,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefNoSub(i_ecr_componentRef); - (txt, i_varDecls, i_preExp) = fun_544(txt, ret_0, i_ecr_componentRef, i_varDecls, i_preExp, i_context, i_ecr); + (txt, i_varDecls, i_preExp) = fun_545(txt, ret_0, i_ecr_componentRef, i_varDecls, i_preExp, i_context, i_ecr); then (txt, i_preExp, i_varDecls); case ( txt, @@ -23450,7 +23511,7 @@ algorithm end matchcontinue; end rhsCrefType; -protected function fun_548 +protected function fun_549 input Tpl.Text in_txt; input Boolean in_i_bool; @@ -23473,7 +23534,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then txt; end matchcontinue; -end fun_548; +end fun_549; public function daeExp input Tpl.Text in_txt; @@ -23539,7 +23600,7 @@ algorithm Boolean i_bool; DAE.Exp i_e; equation - txt = fun_548(txt, i_bool); + txt = fun_549(txt, i_bool); then (txt, i_preExp, i_varDecls); case ( txt, @@ -23806,7 +23867,7 @@ algorithm out_i_varDecls := i_varDecls; end daeExpSconst; -protected function fun_551 +protected function fun_552 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.ComponentRef in_i_cr; @@ -23855,7 +23916,7 @@ algorithm (txt, i_preExp, i_varDecls) = daeExpRecordCrefRhs(txt, i_t, i_cr, i_context, i_preExp, i_varDecls); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_551; +end fun_552; public function daeExpCrefRhs input Tpl.Text in_txt; @@ -23886,7 +23947,7 @@ algorithm DAE.ComponentRef i_cr; DAE.Exp i_exp; equation - (txt, i_varDecls, i_preExp) = fun_551(txt, i_context, i_cr, i_t, i_varDecls, i_preExp, i_exp); + (txt, i_varDecls, i_preExp) = fun_552(txt, i_context, i_cr, i_t, i_varDecls, i_preExp, i_exp); then (txt, i_preExp, i_varDecls); case ( txt, @@ -23928,7 +23989,7 @@ algorithm end matchcontinue; end daeExpCrefRhs; -protected function lm_553 +protected function lm_554 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -23965,7 +24026,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_553(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_554(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -23976,12 +24037,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_553(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_554(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_553; +end lm_554; -protected function fun_554 +protected function fun_555 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_dimsLenStr; @@ -24032,9 +24093,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("))")); then txt; end matchcontinue; -end fun_554; +end fun_555; -protected function fun_555 +protected function fun_556 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -24115,15 +24176,15 @@ algorithm i_dimsLenStr = Tpl.writeStr(Tpl.emptyTxt, intString(ret_5)); ret_7 = ComponentReference.crefSubs(i_cr); i_dimsValuesStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_dimsValuesStr, i_varDecls, i_preExp) = lm_553(i_dimsValuesStr, ret_7, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, i_varDecls, i_preExp) = lm_554(i_dimsValuesStr, ret_7, i_varDecls, i_preExp, i_context); i_dimsValuesStr = Tpl.popIter(i_dimsValuesStr); str_8 = Tpl.textString(i_arrayType); - txt = fun_554(txt, str_8, i_dimsLenStr, i_arrayType, i_dimsValuesStr, i_arrName); + txt = fun_555(txt, str_8, i_dimsLenStr, i_arrayType, i_dimsValuesStr, i_arrName); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_555; +end fun_556; -protected function fun_556 +protected function fun_557 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24144,9 +24205,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_556; +end fun_557; -protected function fun_557 +protected function fun_558 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -24180,7 +24241,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefSubIsScalar(i_cr); - (txt, i_preExp, i_varDecls) = fun_555(txt, ret_0, i_preExp, i_varDecls, i_ty, i_context, i_cr); + (txt, i_preExp, i_varDecls) = fun_556(txt, ret_0, i_preExp, i_varDecls, i_ty, i_context, i_cr); then (txt, i_preExp, i_varDecls); case ( txt, @@ -24193,14 +24254,14 @@ algorithm local Tpl.Text i_cast; equation - i_cast = fun_556(Tpl.emptyTxt, i_ty); + i_cast = fun_557(Tpl.emptyTxt, i_ty); txt = Tpl.writeText(txt, i_cast); txt = contextCref(txt, i_cr, i_context); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_557; +end fun_558; -protected function fun_558 +protected function fun_559 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_box; @@ -24237,7 +24298,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefIsScalar(i_cr, i_context); - (txt, i_preExp, i_varDecls) = fun_557(txt, ret_0, i_preExp, i_varDecls, i_ty, i_context, i_cr); + (txt, i_preExp, i_varDecls) = fun_558(txt, ret_0, i_preExp, i_varDecls, i_ty, i_context, i_cr); then (txt, i_preExp, i_varDecls); case ( txt, @@ -24252,7 +24313,7 @@ algorithm txt = Tpl.writeText(txt, i_box); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_558; +end fun_559; public function daeExpCrefRhs2 input Tpl.Text in_txt; @@ -24287,7 +24348,7 @@ algorithm equation (i_box, i_preExp, i_varDecls) = daeExpCrefRhsArrayBox(Tpl.emptyTxt, i_ecr, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(i_box); - (txt, i_preExp, i_varDecls) = fun_558(txt, str_1, i_box, i_preExp, i_varDecls, i_ty, i_context, i_cr); + (txt, i_preExp, i_varDecls) = fun_559(txt, str_1, i_box, i_preExp, i_varDecls, i_ty, i_context, i_cr); then (txt, i_preExp, i_varDecls); case ( txt, @@ -24299,7 +24360,7 @@ algorithm end matchcontinue; end daeExpCrefRhs2; -protected function fun_560 +protected function fun_561 input Tpl.Text in_txt; input DAE.Subscript in_i_sub; input Tpl.Text in_i_varDecls; @@ -24372,9 +24433,9 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_560; +end fun_561; -protected function lm_561 +protected function lm_562 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -24409,9 +24470,9 @@ algorithm list rest; DAE.Subscript i_sub; equation - (txt, i_varDecls, i_preExp) = fun_560(txt, i_sub, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = fun_561(txt, i_sub, i_varDecls, i_preExp, i_context); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_561(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_562(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -24422,10 +24483,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_561(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_562(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_561; +end lm_562; public function daeExpCrefRhsIndexSpec input Tpl.Text txt; @@ -24446,7 +24507,7 @@ algorithm ret_1 := listLength(i_subs); i_nridx__str := Tpl.writeStr(Tpl.emptyTxt, intString(ret_1)); i_idx__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())); - (i_idx__str, out_i_varDecls, out_i_preExp) := lm_561(i_idx__str, i_subs, i_varDecls, i_preExp, i_context); + (i_idx__str, out_i_varDecls, out_i_preExp) := lm_562(i_idx__str, i_subs, i_varDecls, i_preExp, i_context); i_idx__str := Tpl.popIter(i_idx__str); (i_tmp, out_i_varDecls) := tempDecl(Tpl.emptyTxt, "index_spec_t", out_i_varDecls); out_i_preExp := Tpl.writeTok(out_i_preExp, Tpl.ST_STRING("create_index_spec(&")); @@ -24460,7 +24521,7 @@ algorithm out_txt := Tpl.writeText(txt, i_tmp); end daeExpCrefRhsIndexSpec; -protected function lm_563 +protected function lm_564 input Tpl.Text in_txt; input list in_items; @@ -24483,7 +24544,7 @@ algorithm equation txt = dimension(txt, i_dim); txt = Tpl.nextIter(txt); - txt = lm_563(txt, rest); + txt = lm_564(txt, rest); then txt; case ( txt, @@ -24491,12 +24552,12 @@ algorithm local list rest; equation - txt = lm_563(txt, rest); + txt = lm_564(txt, rest); then txt; end matchcontinue; -end lm_563; +end lm_564; -protected function fun_564 +protected function fun_565 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.ComponentRef in_i_ecr_componentRef; @@ -24547,7 +24608,7 @@ algorithm ret_3 = listLength(i_dims); i_dimsLenStr = Tpl.writeStr(Tpl.emptyTxt, intString(ret_3)); i_dimsValuesStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_dimsValuesStr = lm_563(i_dimsValuesStr, i_dims); + i_dimsValuesStr = lm_564(i_dimsValuesStr, i_dims); i_dimsValuesStr = Tpl.popIter(i_dimsValuesStr); i_preExp = expTypeShort(i_preExp, i_aty); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("_array_create(&")); @@ -24563,7 +24624,7 @@ algorithm txt = Tpl.writeText(txt, i_tmpArr); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_564; +end fun_565; public function daeExpCrefRhsArrayBox input Tpl.Text in_txt; @@ -24595,7 +24656,7 @@ algorithm DAE.ExpType i_aty; DAE.Exp i_ecr; equation - (txt, i_preExp, i_varDecls) = fun_564(txt, i_context, i_ecr_componentRef, i_preExp, i_dims, i_varDecls, i_aty); + (txt, i_preExp, i_varDecls) = fun_565(txt, i_context, i_ecr_componentRef, i_preExp, i_dims, i_varDecls, i_aty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -24607,7 +24668,7 @@ algorithm end matchcontinue; end daeExpCrefRhsArrayBox; -protected function lm_566 +protected function lm_567 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -24650,7 +24711,7 @@ algorithm ret_0 = SimCode.makeCrefRecordExp(i_cr, i_v); (txt, i_preExp, i_varDecls) = daeExp(txt, ret_0, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_566(txt, rest, i_varDecls, i_preExp, i_context, i_cr); + (txt, i_varDecls, i_preExp) = lm_567(txt, rest, i_varDecls, i_preExp, i_context, i_cr); then (txt, i_varDecls, i_preExp); case ( txt, @@ -24662,10 +24723,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_566(txt, rest, i_varDecls, i_preExp, i_context, i_cr); + (txt, i_varDecls, i_preExp) = lm_567(txt, rest, i_varDecls, i_preExp, i_context, i_cr); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_566; +end lm_567; public function daeExpRecordCrefRhs input Tpl.Text in_txt; @@ -24703,7 +24764,7 @@ algorithm Tpl.Text i_vars; equation i_vars = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_vars, i_varDecls, i_preExp) = lm_566(i_vars, i_var__lst, i_varDecls, i_preExp, i_context, i_cr); + (i_vars, i_varDecls, i_preExp) = lm_567(i_vars, i_var__lst, i_varDecls, i_preExp, i_context, i_cr); i_vars = Tpl.popIter(i_vars); i_record__type__name = underscorePath(Tpl.emptyTxt, i_record__path); i_ret__type = Tpl.writeText(Tpl.emptyTxt, i_record__type__name); @@ -24732,7 +24793,7 @@ algorithm end matchcontinue; end daeExpRecordCrefRhs; -protected function fun_568 +protected function fun_569 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_e2; @@ -24780,9 +24841,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_NEW_LINE()); then txt; end matchcontinue; -end fun_568; +end fun_569; -protected function fun_569 +protected function fun_570 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24805,9 +24866,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_569; +end fun_570; -protected function fun_570 +protected function fun_571 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24830,9 +24891,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_570; +end fun_571; -protected function fun_571 +protected function fun_572 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24855,9 +24916,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_571; +end fun_572; -protected function fun_572 +protected function fun_573 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24880,9 +24941,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_572; +end fun_573; -protected function fun_573 +protected function fun_574 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24905,9 +24966,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_scalar")); then txt; end matchcontinue; -end fun_573; +end fun_574; -protected function fun_574 +protected function fun_575 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24930,9 +24991,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real")); then txt; end matchcontinue; -end fun_574; +end fun_575; -protected function fun_575 +protected function fun_576 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -24955,9 +25016,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_575; +end fun_576; -protected function fun_576 +protected function fun_577 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input SimCode.Context in_i_context; @@ -24996,7 +25057,7 @@ algorithm equation (i_tmpStr, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_string", i_varDecls); ret_1 = RTOpts.acceptMetaModelicaGrammar(); - i_preExp = fun_568(i_preExp, ret_1, i_e2, i_e1, i_tmpStr); + i_preExp = fun_569(i_preExp, ret_1, i_e2, i_e1, i_tmpStr); txt = Tpl.writeText(txt, i_tmpStr); then (txt, i_preExp, i_varDecls); @@ -25105,7 +25166,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_569(Tpl.emptyTxt, i_ty); + i_type = fun_570(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("add_alloc_")); i_preExp = Tpl.writeText(i_preExp, i_type); @@ -25133,7 +25194,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_570(Tpl.emptyTxt, i_ty); + i_type = fun_571(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("sub_alloc_")); i_preExp = Tpl.writeText(i_preExp, i_type); @@ -25185,7 +25246,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_571(Tpl.emptyTxt, i_ty); + i_type = fun_572(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("mul_alloc_scalar_")); i_preExp = Tpl.writeText(i_preExp, i_type); @@ -25213,7 +25274,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_572(Tpl.emptyTxt, i_ty); + i_type = fun_573(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("mul_alloc_")); i_preExp = Tpl.writeText(i_preExp, i_type); @@ -25288,7 +25349,7 @@ algorithm DAE.ExpType i_ty; Tpl.Text i_type; equation - i_type = fun_573(Tpl.emptyTxt, i_ty); + i_type = fun_574(Tpl.emptyTxt, i_ty); txt = Tpl.writeTok(txt, Tpl.ST_STRING("mul_")); txt = Tpl.writeText(txt, i_type); txt = Tpl.writeTok(txt, Tpl.ST_STRING("_product(&")); @@ -25312,7 +25373,7 @@ algorithm Tpl.Text i_type; Tpl.Text i_typeShort; equation - i_typeShort = fun_574(Tpl.emptyTxt, i_ty); + i_typeShort = fun_575(Tpl.emptyTxt, i_ty); i_type = Tpl.writeText(Tpl.emptyTxt, i_typeShort); i_type = Tpl.writeTok(i_type, Tpl.ST_STRING("_array")); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); @@ -25342,7 +25403,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_575(Tpl.emptyTxt, i_ty); + i_type = fun_576(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("div_alloc_")); i_preExp = Tpl.writeText(i_preExp, i_type); @@ -25429,7 +25490,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpBinary:ERR")); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_576; +end fun_577; public function daeExpBinary input Tpl.Text in_txt; @@ -25465,7 +25526,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_576(txt, i_operator, i_context, i_exp, i_e2, i_e1, i_preExp, i_varDecls); + (txt, i_preExp, i_varDecls) = fun_577(txt, i_operator, i_context, i_exp, i_e2, i_e1, i_preExp, i_varDecls); then (txt, i_preExp, i_varDecls); case ( txt, @@ -25477,7 +25538,7 @@ algorithm end matchcontinue; end daeExpBinary; -protected function fun_578 +protected function fun_579 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_preExp; @@ -25549,7 +25610,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpUnary:ERR")); then (txt, i_preExp); end matchcontinue; -end fun_578; +end fun_579; public function daeExpUnary input Tpl.Text in_txt; @@ -25581,7 +25642,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - (txt, i_preExp) = fun_578(txt, i_operator, i_preExp, i_e); + (txt, i_preExp) = fun_579(txt, i_operator, i_preExp, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -25593,7 +25654,7 @@ algorithm end matchcontinue; end daeExpUnary; -protected function fun_580 +protected function fun_581 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e2; @@ -25640,7 +25701,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpLbinary:ERR")); then txt; end matchcontinue; -end fun_580; +end fun_581; public function daeExpLbinary input Tpl.Text in_txt; @@ -25675,7 +25736,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - txt = fun_580(txt, i_operator, i_e2, i_e1); + txt = fun_581(txt, i_operator, i_e2, i_e1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -25687,7 +25748,7 @@ algorithm end matchcontinue; end daeExpLbinary; -protected function fun_582 +protected function fun_583 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e; @@ -25714,7 +25775,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_582; +end fun_583; public function daeExpLunary input Tpl.Text in_txt; @@ -25746,7 +25807,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_582(txt, i_operator, i_e); + txt = fun_583(txt, i_operator, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -25758,7 +25819,7 @@ algorithm end matchcontinue; end daeExpLunary; -protected function fun_584 +protected function fun_585 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -26073,9 +26134,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpRelation:ERR")); then txt; end matchcontinue; -end fun_584; +end fun_585; -protected function fun_585 +protected function fun_586 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_simRel; @@ -26117,7 +26178,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); - txt = fun_584(txt, i_rel_operator, i_e2, i_e1); + txt = fun_585(txt, i_rel_operator, i_e2, i_e1); then (txt, i_varDecls, i_preExp); case ( txt, @@ -26133,7 +26194,7 @@ algorithm txt = Tpl.writeText(txt, i_simRel); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_585; +end fun_586; public function daeExpRelation input Tpl.Text in_txt; @@ -26169,7 +26230,7 @@ algorithm equation (i_simRel, i_preExp, i_varDecls) = daeExpRelationSim(Tpl.emptyTxt, i_rel, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(i_simRel); - (txt, i_varDecls, i_preExp) = fun_585(txt, str_1, i_simRel, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_586(txt, str_1, i_simRel, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -26181,7 +26242,7 @@ algorithm end matchcontinue; end daeExpRelation; -protected function fun_587 +protected function fun_588 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -26281,9 +26342,9 @@ algorithm i_preExp ) then (txt, i_preExp); end matchcontinue; -end fun_587; +end fun_588; -protected function fun_588 +protected function fun_589 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.Operator in_i_rel_operator; @@ -26322,7 +26383,7 @@ algorithm (i_e1, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); (i_res, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_boolean", i_varDecls); - (txt, i_preExp) = fun_587(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); + (txt, i_preExp) = fun_588(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -26334,7 +26395,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_588; +end fun_589; public function daeExpRelationSim input Tpl.Text in_txt; @@ -26366,7 +26427,7 @@ algorithm DAE.Exp i_rel_exp1; DAE.Exp i_rel; equation - (txt, i_varDecls, i_preExp) = fun_588(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_589(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -26463,7 +26524,7 @@ algorithm end matchcontinue; end daeExpIf; -protected function fun_591 +protected function fun_592 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -26486,9 +26547,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_591; +end fun_592; -protected function fun_592 +protected function fun_593 input Tpl.Text in_txt; input DAE.ExpType in_i_arg_ty; @@ -26509,9 +26570,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_592; +end fun_593; -protected function lm_593 +protected function lm_594 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -26548,7 +26609,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_593(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_594(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -26559,12 +26620,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_593(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_594(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_593; +end lm_594; -protected function lm_594 +protected function lm_595 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -26601,7 +26662,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_594(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_595(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -26612,12 +26673,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_594(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_595(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_594; +end lm_595; -protected function fun_595 +protected function fun_596 input Tpl.Text in_txt; input Boolean in_i_builtin; input Tpl.Text in_i_retType; @@ -26651,9 +26712,9 @@ algorithm txt = Tpl.writeText(txt, i_retVar); then txt; end matchcontinue; -end fun_595; +end fun_596; -protected function lm_596 +protected function lm_597 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -26690,7 +26751,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_596(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_597(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -26701,10 +26762,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_596(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_597(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_596; +end lm_597; public function daeExpCall input Tpl.Text in_txt; @@ -26769,7 +26830,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_591(Tpl.emptyTxt, i_ty); + i_type = fun_592(Tpl.emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_type), i_varDecls); (i_var1, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_e1, i_context, i_preExp, i_varDecls); (i_var2, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_e2, i_context, i_preExp, i_varDecls); @@ -26818,7 +26879,7 @@ algorithm equation i_retType = expTypeArrayIf(Tpl.emptyTxt, i_arg_ty); (i_retVar, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_retType), i_varDecls); - i_cast = fun_592(Tpl.emptyTxt, i_arg_ty); + i_cast = fun_593(Tpl.emptyTxt, i_arg_ty); i_preExp = Tpl.writeText(i_preExp, i_retVar); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING(" = ")); i_preExp = Tpl.writeText(i_preExp, i_cast); @@ -27267,7 +27328,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_argStr, i_varDecls, i_preExp) = lm_593(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_594(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(Tpl.emptyTxt, i_path); i_preExp = daeExpCallBuiltinPrefix(i_preExp, i_builtin); @@ -27294,7 +27355,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_argStr, i_varDecls, i_preExp) = lm_594(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_595(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(Tpl.emptyTxt, i_path); i_retType = Tpl.writeText(Tpl.emptyTxt, i_funName); @@ -27308,7 +27369,7 @@ algorithm i_preExp = Tpl.writeText(i_preExp, i_argStr); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING(");")); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_NEW_LINE()); - txt = fun_595(txt, i_builtin, i_retType, i_retVar); + txt = fun_596(txt, i_builtin, i_retType, i_retVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -27326,7 +27387,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_argStr, i_varDecls, i_preExp) = lm_596(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_597(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(Tpl.emptyTxt, i_path); i_retType = Tpl.writeText(Tpl.emptyTxt, i_funName); @@ -27379,7 +27440,7 @@ algorithm end matchcontinue; end daeExpCallBuiltinPrefix; -protected function fun_599 +protected function fun_600 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -27400,9 +27461,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_599; +end fun_600; -protected function fun_600 +protected function fun_601 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -27423,9 +27484,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_600; +end fun_601; -protected function fun_601 +protected function fun_602 input Tpl.Text in_txt; input Boolean in_i_scalar; input DAE.Exp in_i_e; @@ -27454,9 +27515,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); then txt; end matchcontinue; -end fun_601; +end fun_602; -protected function lm_602 +protected function lm_603 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -27496,11 +27557,11 @@ algorithm DAE.Exp i_e; Tpl.Text i_prefix; equation - i_prefix = fun_601(Tpl.emptyTxt, i_scalar, i_e); + i_prefix = fun_602(Tpl.emptyTxt, i_scalar, i_e); txt = Tpl.writeText(txt, i_prefix); (txt, i_preExp, i_varDecls) = daeExp(txt, i_e, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_602(txt, rest, i_varDecls, i_preExp, i_context, i_scalar); + (txt, i_varDecls, i_preExp) = lm_603(txt, rest, i_varDecls, i_preExp, i_context, i_scalar); then (txt, i_varDecls, i_preExp); case ( txt, @@ -27512,10 +27573,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_602(txt, rest, i_varDecls, i_preExp, i_context, i_scalar); + (txt, i_varDecls, i_preExp) = lm_603(txt, rest, i_varDecls, i_preExp, i_context, i_scalar); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_602; +end lm_603; public function daeExpArray input Tpl.Text in_txt; @@ -27554,10 +27615,10 @@ algorithm equation i_arrayTypeStr = expTypeArray(Tpl.emptyTxt, i_ty); (i_arrayVar, i_varDecls) = tempDecl(Tpl.emptyTxt, Tpl.textString(i_arrayTypeStr), i_varDecls); - i_scalarPrefix = fun_599(Tpl.emptyTxt, i_scalar); - i_scalarRef = fun_600(Tpl.emptyTxt, i_scalar); + i_scalarPrefix = fun_600(Tpl.emptyTxt, i_scalar); + i_scalarRef = fun_601(Tpl.emptyTxt, i_scalar); i_params = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_params, i_varDecls, i_preExp) = lm_602(i_params, i_array, i_varDecls, i_preExp, i_context, i_scalar); + (i_params, i_varDecls, i_preExp) = lm_603(i_params, i_array, i_varDecls, i_preExp, i_context, i_scalar); i_params = Tpl.popIter(i_params); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("array_alloc_")); i_preExp = Tpl.writeText(i_preExp, i_scalarPrefix); @@ -27583,7 +27644,7 @@ algorithm end matchcontinue; end daeExpArray; -protected function lm_604 +protected function lm_605 input Tpl.Text in_txt; input list>> in_items; input Tpl.Text in_i_vars2; @@ -27644,7 +27705,7 @@ algorithm txt = Tpl.writeText(txt, i_vars); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); txt = Tpl.nextIter(txt); - (txt, i_vars2, i_promote, i_varDecls) = lm_604(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_605(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); case ( txt, @@ -27657,10 +27718,10 @@ algorithm local list>> rest; equation - (txt, i_vars2, i_promote, i_varDecls) = lm_604(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_605(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); end matchcontinue; -end lm_604; +end lm_605; public function daeExpMatrix input Tpl.Text in_txt; @@ -27743,7 +27804,7 @@ algorithm i_vars2 = Tpl.emptyTxt; i_promote = Tpl.emptyTxt; i_catAlloc = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_catAlloc, i_vars2, i_promote, i_varDecls) = lm_604(i_catAlloc, i_m_scalar, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (i_catAlloc, i_vars2, i_promote, i_varDecls) = lm_605(i_catAlloc, i_m_scalar, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); i_catAlloc = Tpl.popIter(i_catAlloc); i_preExp = Tpl.writeText(i_preExp, i_promote); i_preExp = Tpl.writeText(i_preExp, i_catAlloc); @@ -27771,7 +27832,7 @@ algorithm end matchcontinue; end daeExpMatrix; -protected function fun_606 +protected function fun_607 input Tpl.Text in_txt; input Boolean in_i_b; @@ -27792,9 +27853,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_606; +end fun_607; -protected function fun_607 +protected function fun_608 input Tpl.Text in_txt; input Boolean in_i_b; @@ -27815,9 +27876,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_607; +end fun_608; -protected function lm_608 +protected function lm_609 input Tpl.Text in_txt; input list> in_items; input Tpl.Text in_i_varLstStr; @@ -27867,8 +27928,8 @@ algorithm Tpl.Text i_scalarRefStr; Tpl.Text i_scalarStr; equation - i_scalarStr = fun_606(Tpl.emptyTxt, i_b); - i_scalarRefStr = fun_607(Tpl.emptyTxt, i_b); + i_scalarStr = fun_607(Tpl.emptyTxt, i_b); + i_scalarRefStr = fun_608(Tpl.emptyTxt, i_b); (i_expVar, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_e, i_context, i_preExp, i_varDecls); (i_tmp, i_varDecls) = tempDecl(Tpl.emptyTxt, i_arrayTypeStr, i_varDecls); i_varLstStr = Tpl.writeTok(i_varLstStr, Tpl.ST_STRING(", &")); @@ -27883,7 +27944,7 @@ algorithm txt = Tpl.writeText(txt, i_tmp); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); txt = Tpl.nextIter(txt); - (txt, i_varLstStr, i_varDecls, i_preExp) = lm_608(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_609(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); case ( txt, @@ -27896,10 +27957,10 @@ algorithm local list> rest; equation - (txt, i_varLstStr, i_varDecls, i_preExp) = lm_608(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_609(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); end matchcontinue; -end lm_608; +end lm_609; public function daeExpMatrixRow input Tpl.Text txt; @@ -27918,14 +27979,14 @@ protected algorithm i_varLstStr := Tpl.emptyTxt; i_preExp2 := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_preExp2, i_varLstStr, out_i_varDecls, out_i_preExp) := lm_608(i_preExp2, i_row, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (i_preExp2, i_varLstStr, out_i_varDecls, out_i_preExp) := lm_609(i_preExp2, i_row, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); i_preExp2 := Tpl.popIter(i_preExp2); i_preExp2 := Tpl.writeTok(i_preExp2, Tpl.ST_NEW_LINE()); out_i_preExp := Tpl.writeText(out_i_preExp, i_preExp2); out_txt := Tpl.writeText(txt, i_varLstStr); end daeExpMatrixRow; -protected function fun_610 +protected function fun_611 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input Tpl.Text in_i_preExp; @@ -28008,7 +28069,7 @@ algorithm _ ) then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_610; +end fun_611; public function daeExpCast input Tpl.Text in_txt; @@ -28040,7 +28101,7 @@ algorithm Tpl.Text i_expVar; equation (i_expVar, i_preExp, i_varDecls) = daeExp(Tpl.emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_610(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); + (txt, i_preExp, i_varDecls) = fun_611(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -28052,7 +28113,7 @@ algorithm end matchcontinue; end daeExpCast; -protected function fun_612 +protected function fun_613 input Tpl.Text in_txt; input DAE.Exp in_i_exp; input Tpl.Text in_i_varDecls; @@ -28098,9 +28159,9 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_612; +end fun_613; -protected function fun_613 +protected function fun_614 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -28147,9 +28208,9 @@ algorithm (txt, i_preExp, i_varDecls) = arrayScalarRhs(txt, i_ecr_ty, i_subs, Tpl.textString(i_arrName), i_context, i_preExp, i_varDecls); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_613; +end fun_614; -protected function fun_614 +protected function fun_615 input Tpl.Text in_txt; input DAE.Exp in_i_exp; input Tpl.Text in_i_varDecls; @@ -28316,7 +28377,7 @@ algorithm equation ret_1 = SimCode.buildCrefExpFromAsub(i_ecr, i_subs); (i_arrName, i_preExp, i_varDecls) = daeExpCrefRhs(Tpl.emptyTxt, ret_1, i_context, i_preExp, i_varDecls); - (txt, i_varDecls, i_preExp) = fun_613(txt, i_context, i_varDecls, i_preExp, i_subs, i_ecr_ty, i_arrName); + (txt, i_varDecls, i_preExp) = fun_614(txt, i_context, i_varDecls, i_preExp, i_subs, i_ecr_ty, i_arrName); then (txt, i_varDecls, i_preExp); case ( txt, @@ -28328,9 +28389,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("OTHER_ASUB")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_614; +end fun_615; -protected function fun_615 +protected function fun_616 input Tpl.Text in_txt; input String in_it; input DAE.Exp in_i_exp; @@ -28358,7 +28419,7 @@ algorithm i_preExp, i_varDecls ) equation - (txt, i_varDecls, i_preExp) = fun_612(txt, i_exp, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = fun_613(txt, i_exp, i_varDecls, i_preExp, i_context); then (txt, i_preExp, i_varDecls); case ( txt, @@ -28368,10 +28429,10 @@ algorithm i_preExp, i_varDecls ) equation - (txt, i_varDecls, i_preExp) = fun_614(txt, i_exp, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = fun_615(txt, i_exp, i_varDecls, i_preExp, i_context); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_615; +end fun_616; public function daeExpAsub input Tpl.Text txt; @@ -28389,7 +28450,7 @@ protected algorithm txt_0 := expTypeFromExpShort(Tpl.emptyTxt, i_exp); str_1 := Tpl.textString(txt_0); - (out_txt, out_i_preExp, out_i_varDecls) := fun_615(txt, str_1, i_exp, i_context, i_preExp, i_varDecls); + (out_txt, out_i_preExp, out_i_varDecls) := fun_616(txt, str_1, i_exp, i_context, i_preExp, i_varDecls); end daeExpAsub; public function daeExpSize @@ -28452,7 +28513,7 @@ algorithm end matchcontinue; end daeExpSize; -protected function fun_618 +protected function fun_619 input Tpl.Text in_txt; input String in_it; @@ -28479,7 +28540,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_618; +end fun_619; public function daeExpReduction input Tpl.Text in_txt; @@ -28526,7 +28587,7 @@ algorithm i_tmpExpPre = Tpl.emptyTxt; (i_tmpExpVar, i_tmpExpPre, i_varDecls) = daeExp(Tpl.emptyTxt, i_expr, i_context, i_tmpExpPre, i_varDecls); str_7 = Tpl.textString(i_accFun); - i_cast = fun_618(Tpl.emptyTxt, str_7); + i_cast = fun_619(Tpl.emptyTxt, str_7); i_body = Tpl.writeText(Tpl.emptyTxt, i_tmpExpPre); i_body = Tpl.softNewLine(i_body); i_body = Tpl.writeText(i_body, i_res); @@ -28621,7 +28682,7 @@ algorithm end matchcontinue; end daeExpReductionLoop; -protected function fun_621 +protected function fun_622 input Tpl.Text in_txt; input String in_i_type; @@ -28650,9 +28711,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_621; +end fun_622; -protected function fun_622 +protected function fun_623 input Tpl.Text in_txt; input String in_i_type; @@ -28681,7 +28742,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_622; +end fun_623; public function daeExpReductionFnName input Tpl.Text in_txt; @@ -28700,14 +28761,14 @@ algorithm "sum", i_type ) equation - txt = fun_621(txt, i_type); + txt = fun_622(txt, i_type); then txt; case ( txt, "product", i_type ) equation - txt = fun_622(txt, i_type); + txt = fun_623(txt, i_type); then txt; case ( txt, @@ -28721,7 +28782,7 @@ algorithm end matchcontinue; end daeExpReductionFnName; -protected function fun_624 +protected function fun_625 input Tpl.Text in_txt; input String in_i_type; @@ -28750,9 +28811,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_624; +end fun_625; -protected function fun_625 +protected function fun_626 input Tpl.Text in_txt; input String in_i_type; @@ -28781,7 +28842,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_625; +end fun_626; public function daeExpReductionStartValue input Tpl.Text in_txt; @@ -28800,14 +28861,14 @@ algorithm "min", i_type ) equation - txt = fun_624(txt, i_type); + txt = fun_625(txt, i_type); then txt; case ( txt, "max", i_type ) equation - txt = fun_625(txt, i_type); + txt = fun_626(txt, i_type); then txt; case ( txt, @@ -28833,7 +28894,7 @@ algorithm end matchcontinue; end daeExpReductionStartValue; -protected function lm_627 +protected function lm_628 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_preExpInner; @@ -28865,7 +28926,7 @@ algorithm SimCode.Variable i_var; equation (txt, i_varDeclsInner, i_preExpInner) = varInit(txt, i_var, "", 0, i_varDeclsInner, i_preExpInner); - (txt, i_preExpInner, i_varDeclsInner) = lm_627(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_628(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); case ( txt, @@ -28875,12 +28936,12 @@ algorithm local list rest; equation - (txt, i_preExpInner, i_varDeclsInner) = lm_627(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_628(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); end matchcontinue; -end lm_627; +end lm_628; -protected function lm_628 +protected function lm_629 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_preExpInput; @@ -28941,7 +29002,7 @@ algorithm i_expInput = Tpl.writeTok(i_expInput, Tpl.ST_STRING(";")); i_expInput = Tpl.writeTok(i_expInput, Tpl.ST_NEW_LINE()); txt = Tpl.nextIter(txt); - (txt, i_preExpInput, i_expInput, i_varDeclsInput) = lm_628(txt, rest, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); + (txt, i_preExpInput, i_expInput, i_varDeclsInput) = lm_629(txt, rest, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); then (txt, i_preExpInput, i_expInput, i_varDeclsInput); case ( txt, @@ -28954,12 +29015,12 @@ algorithm local list rest; equation - (txt, i_preExpInput, i_expInput, i_varDeclsInput) = lm_628(txt, rest, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); + (txt, i_preExpInput, i_expInput, i_varDeclsInput) = lm_629(txt, rest, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); then (txt, i_preExpInput, i_expInput, i_varDeclsInput); end matchcontinue; -end lm_628; +end lm_629; -protected function fun_629 +protected function fun_630 input Tpl.Text in_txt; input DAE.ExpType in_i_et; input Tpl.Text in_i_varDecls; @@ -28991,9 +29052,9 @@ algorithm (txt, i_varDecls) = tempDecl(txt, Tpl.textString(txt_0), i_varDecls); then (txt, i_varDecls); end matchcontinue; -end fun_629; +end fun_630; -protected function fun_630 +protected function fun_631 input Tpl.Text in_txt; input Absyn.MatchType in_i_exp_matchType; @@ -29020,9 +29081,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_630; +end fun_631; -protected function fun_631 +protected function fun_632 input Tpl.Text in_txt; input Absyn.MatchType in_i_exp_matchType; @@ -29049,9 +29110,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_631; +end fun_632; -protected function fun_632 +protected function fun_633 input Tpl.Text in_txt; input Absyn.MatchType in_i_exp_matchType; @@ -29072,9 +29133,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_632; +end fun_633; -protected function lm_633 +protected function lm_634 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_assignments; @@ -29122,7 +29183,7 @@ algorithm txt_0 = Tpl.writeStr(txt_0, intString(i_i0)); (txt, txt_0, i_onPatternFail, i_varDeclsCaseInner, i_assignments) = patternMatch(txt, i_lhs, txt_0, i_onPatternFail, i_varDeclsCaseInner, i_assignments); txt = Tpl.nextIter(txt); - (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_633(txt, rest, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); + (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_634(txt, rest, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); then (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail); case ( txt, @@ -29134,12 +29195,12 @@ algorithm local list rest; equation - (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_633(txt, rest, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); + (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_634(txt, rest, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); then (txt, i_assignments, i_varDeclsCaseInner, i_onPatternFail); end matchcontinue; -end lm_633; +end lm_634; -protected function lm_634 +protected function lm_635 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDeclsCaseInner; @@ -29171,7 +29232,7 @@ algorithm equation (txt, i_varDeclsCaseInner) = algStatement(txt, i_stmt, i_context, i_varDeclsCaseInner); txt = Tpl.nextIter(txt); - (txt, i_varDeclsCaseInner) = lm_634(txt, rest, i_varDeclsCaseInner, i_context); + (txt, i_varDeclsCaseInner) = lm_635(txt, rest, i_varDeclsCaseInner, i_context); then (txt, i_varDeclsCaseInner); case ( txt, @@ -29181,12 +29242,12 @@ algorithm local list rest; equation - (txt, i_varDeclsCaseInner) = lm_634(txt, rest, i_varDeclsCaseInner, i_context); + (txt, i_varDeclsCaseInner) = lm_635(txt, rest, i_varDeclsCaseInner, i_context); then (txt, i_varDeclsCaseInner); end matchcontinue; -end lm_634; +end lm_635; -protected function fun_635 +protected function fun_636 input Tpl.Text in_txt; input Option in_i_c_result; input Tpl.Text in_i_varDeclsCaseInner; @@ -29223,9 +29284,9 @@ algorithm _ ) then (txt, i_varDeclsCaseInner, i_preRes); end matchcontinue; -end fun_635; +end fun_636; -protected function lm_636 +protected function lm_637 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_preExpCaseInner; @@ -29257,7 +29318,7 @@ algorithm SimCode.Variable i_var; equation (txt, i_varDeclsCaseInner, i_preExpCaseInner) = varInit(txt, i_var, "", 0, i_varDeclsCaseInner, i_preExpCaseInner); - (txt, i_preExpCaseInner, i_varDeclsCaseInner) = lm_636(txt, rest, i_preExpCaseInner, i_varDeclsCaseInner); + (txt, i_preExpCaseInner, i_varDeclsCaseInner) = lm_637(txt, rest, i_preExpCaseInner, i_varDeclsCaseInner); then (txt, i_preExpCaseInner, i_varDeclsCaseInner); case ( txt, @@ -29267,12 +29328,12 @@ algorithm local list rest; equation - (txt, i_preExpCaseInner, i_varDeclsCaseInner) = lm_636(txt, rest, i_preExpCaseInner, i_varDeclsCaseInner); + (txt, i_preExpCaseInner, i_varDeclsCaseInner) = lm_637(txt, rest, i_preExpCaseInner, i_varDeclsCaseInner); then (txt, i_preExpCaseInner, i_varDeclsCaseInner); end matchcontinue; -end lm_636; +end lm_637; -protected function fun_637 +protected function fun_638 input Tpl.Text in_txt; input Option in_i_c_result; input Tpl.Text in_i_caseRes; @@ -29313,9 +29374,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_NEW_LINE()); then txt; end matchcontinue; -end fun_637; +end fun_638; -protected function lm_638 +protected function lm_639 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_done; @@ -29377,14 +29438,14 @@ algorithm i_assignments = Tpl.emptyTxt; i_preRes = Tpl.emptyTxt; i_patternMatching = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_patternMatching, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_633(i_patternMatching, i_c_patterns, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); + (i_patternMatching, i_assignments, i_varDeclsCaseInner, i_onPatternFail) = lm_634(i_patternMatching, i_c_patterns, i_assignments, i_varDeclsCaseInner, i_onPatternFail, i_prefix); i_patternMatching = Tpl.popIter(i_patternMatching); i_stmts = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_stmts, i_varDeclsCaseInner) = lm_634(i_stmts, i_c_body, i_varDeclsCaseInner, i_context); + (i_stmts, i_varDeclsCaseInner) = lm_635(i_stmts, i_c_body, i_varDeclsCaseInner, i_context); i_stmts = Tpl.popIter(i_stmts); - (i_caseRes, i_varDeclsCaseInner, i_preRes) = fun_635(Tpl.emptyTxt, i_c_result, i_varDeclsCaseInner, i_preRes, i_context); + (i_caseRes, i_varDeclsCaseInner, i_preRes) = fun_636(Tpl.emptyTxt, i_c_result, i_varDeclsCaseInner, i_preRes, i_context); ret_8 = SimCode.elementVars(i_c_localDecls); - (i_0__, i_preExpCaseInner, i_varDeclsCaseInner) = lm_636(Tpl.emptyTxt, ret_8, i_preExpCaseInner, i_varDeclsCaseInner); + (i_0__, i_preExpCaseInner, i_varDeclsCaseInner) = lm_637(Tpl.emptyTxt, ret_8, i_preExpCaseInner, i_varDeclsCaseInner); txt = Tpl.writeTok(txt, Tpl.ST_STRING("case ")); txt = Tpl.writeStr(txt, intString(i_i0)); txt = Tpl.writeTok(txt, Tpl.ST_LINE(": {\n")); @@ -29400,7 +29461,7 @@ algorithm txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_stmts); txt = Tpl.softNewLine(txt); - txt = fun_637(txt, i_c_result, i_caseRes, i_res, i_preRes); + txt = fun_638(txt, i_c_result, i_caseRes, i_res, i_preRes); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_done); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ @@ -29411,7 +29472,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("}")); txt = Tpl.writeTok(txt, Tpl.ST_NEW_LINE()); txt = Tpl.nextIter(txt); - (txt, i_onPatternFail) = lm_638(txt, rest, i_done, i_res, i_context, i_onPatternFail, i_prefix); + (txt, i_onPatternFail) = lm_639(txt, rest, i_done, i_res, i_context, i_onPatternFail, i_prefix); then (txt, i_onPatternFail); case ( txt, @@ -29424,12 +29485,12 @@ algorithm local list rest; equation - (txt, i_onPatternFail) = lm_638(txt, rest, i_done, i_res, i_context, i_onPatternFail, i_prefix); + (txt, i_onPatternFail) = lm_639(txt, rest, i_done, i_res, i_context, i_onPatternFail, i_prefix); then (txt, i_onPatternFail); end matchcontinue; -end lm_638; +end lm_639; -protected function fun_639 +protected function fun_640 input Tpl.Text in_txt; input Absyn.MatchType in_i_exp_matchType; @@ -29450,7 +29511,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_639; +end fun_640; public function daeExpMatch input Tpl.Text in_txt; @@ -29507,21 +29568,21 @@ algorithm i_varDeclsInner = Tpl.emptyTxt; i_ignore = Tpl.emptyTxt; ret_6 = SimCode.elementVars(i_localDecls); - (i_ignore2, i_preExpInner, i_varDeclsInner) = lm_627(Tpl.emptyTxt, ret_6, i_preExpInner, i_varDeclsInner); + (i_ignore2, i_preExpInner, i_varDeclsInner) = lm_628(Tpl.emptyTxt, ret_6, i_preExpInner, i_varDeclsInner); i_prefix = Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("tmp")); ret_8 = System.tmpTick(); i_prefix = Tpl.writeStr(i_prefix, intString(ret_8)); i_preExpInput = Tpl.emptyTxt; i_expInput = Tpl.emptyTxt; i_ignore3 = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_ignore3, i_preExpInput, i_expInput, i_varDeclsInput) = lm_628(i_ignore3, i_inputs, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); + (i_ignore3, i_preExpInput, i_expInput, i_varDeclsInput) = lm_629(i_ignore3, i_inputs, i_preExpInput, i_context, i_expInput, i_varDeclsInput, i_prefix); i_ignore3 = Tpl.popIter(i_ignore3); - (i_res, i_varDecls) = fun_629(Tpl.emptyTxt, i_et, i_varDecls); + (i_res, i_varDecls) = fun_630(Tpl.emptyTxt, i_et, i_varDecls); (i_ix, i_varDeclsInner) = tempDecl(Tpl.emptyTxt, "int", i_varDeclsInner); (i_done, i_varDeclsInner) = tempDecl(Tpl.emptyTxt, "int", i_varDeclsInner); - i_onPatternFail = fun_630(Tpl.emptyTxt, i_exp_matchType); + i_onPatternFail = fun_631(Tpl.emptyTxt, i_exp_matchType); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("{ /* ")); - i_preExp = fun_631(i_preExp, i_exp_matchType); + i_preExp = fun_632(i_preExp, i_exp_matchType); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE(" */\n")); i_preExp = Tpl.pushBlock(i_preExp, Tpl.BT_INDENT(2)); i_preExp = Tpl.writeText(i_preExp, i_varDeclsInput); @@ -29550,20 +29611,20 @@ algorithm i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("; ")); i_preExp = Tpl.writeText(i_preExp, i_ix); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("++) ")); - i_preExp = fun_632(i_preExp, i_exp_matchType); + i_preExp = fun_633(i_preExp, i_exp_matchType); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE("{\n")); i_preExp = Tpl.pushBlock(i_preExp, Tpl.BT_INDENT(2)); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("switch (")); i_preExp = Tpl.writeText(i_preExp, i_ix); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE(") {\n")); i_preExp = Tpl.pushIter(i_preExp, Tpl.ITER_OPTIONS(0, NONE(), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_preExp, i_onPatternFail) = lm_638(i_preExp, i_cases, i_done, i_res, i_context, i_onPatternFail, i_prefix); + (i_preExp, i_onPatternFail) = lm_639(i_preExp, i_cases, i_done, i_res, i_context, i_onPatternFail, i_prefix); i_preExp = Tpl.popIter(i_preExp); i_preExp = Tpl.softNewLine(i_preExp); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE("}\n")); i_preExp = Tpl.popBlock(i_preExp); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("}")); - i_preExp = fun_639(i_preExp, i_exp_matchType); + i_preExp = fun_640(i_preExp, i_exp_matchType); i_preExp = Tpl.softNewLine(i_preExp); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("if (!")); i_preExp = Tpl.writeText(i_preExp, i_done); @@ -29584,7 +29645,7 @@ algorithm end matchcontinue; end daeExpMatch; -protected function lm_641 +protected function lm_642 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -29621,7 +29682,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExp(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_641(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_642(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -29632,12 +29693,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_641(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_642(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_641; +end lm_642; -protected function fun_642 +protected function fun_643 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_dimsLenStr; @@ -29688,7 +29749,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("))")); then txt; end matchcontinue; -end fun_642; +end fun_643; public function arrayScalarRhs input Tpl.Text txt; @@ -29713,10 +29774,10 @@ algorithm ret_2 := listLength(i_subs); i_dimsLenStr := Tpl.writeStr(Tpl.emptyTxt, intString(ret_2)); i_dimsValuesStr := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_dimsValuesStr, out_i_varDecls, out_i_preExp) := lm_641(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, out_i_varDecls, out_i_preExp) := lm_642(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); i_dimsValuesStr := Tpl.popIter(i_dimsValuesStr); str_4 := Tpl.textString(i_arrayType); - out_txt := fun_642(txt, str_4, i_dimsLenStr, i_arrayType, i_dimsValuesStr, i_arrName); + out_txt := fun_643(txt, str_4, i_dimsLenStr, i_arrayType, i_dimsValuesStr, i_arrName); end arrayScalarRhs; public function daeExpList @@ -29877,7 +29938,7 @@ algorithm end matchcontinue; end daeExpCons; -protected function lm_647 +protected function lm_648 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -29914,7 +29975,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExpMetaHelperConstant(txt, i_e, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_647(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_648(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -29925,12 +29986,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_647(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_648(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_647; +end lm_648; -protected function fun_648 +protected function fun_649 input Tpl.Text in_txt; input String in_it; @@ -29951,7 +30012,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(", ")); then txt; end matchcontinue; -end fun_648; +end fun_649; public function daeExpMetaTuple input Tpl.Text in_txt; @@ -29988,7 +30049,7 @@ algorithm ret_1 = listLength(i_listExp); i_start = daeExpMetaHelperBoxStart(Tpl.emptyTxt, ret_1); i_args = Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_args, i_varDecls, i_preExp) = lm_647(i_args, i_listExp, i_varDecls, i_preExp, i_context); + (i_args, i_varDecls, i_preExp) = lm_648(i_args, i_listExp, i_varDecls, i_preExp, i_context); i_args = Tpl.popIter(i_args); (i_tmp, i_varDecls) = tempDecl(Tpl.emptyTxt, "modelica_metatype", i_varDecls); i_preExp = Tpl.writeText(i_preExp, i_tmp); @@ -29996,7 +30057,7 @@ algorithm i_preExp = Tpl.writeText(i_preExp, i_start); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING("0")); str_4 = Tpl.textString(i_args); - i_preExp = fun_648(i_preExp, str_4); + i_preExp = fun_649(i_preExp, str_4); i_preExp = Tpl.writeText(i_preExp, i_args); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING(");")); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_NEW_LINE()); @@ -30064,7 +30125,7 @@ algorithm end matchcontinue; end daeExpMetaOption; -protected function lm_651 +protected function lm_652 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -30101,7 +30162,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = daeExpMetaHelperConstant(txt, i_exp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_651(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_652(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -30112,12 +30173,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_651(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_652(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_651; +end lm_652; -protected function fun_652 +protected function fun_653 input Tpl.Text in_txt; input list in_i_args; input Tpl.Text in_i_varDecls; @@ -30153,11 +30214,11 @@ algorithm equation txt = Tpl.writeTok(txt, Tpl.ST_STRING(", ")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls, i_preExp) = lm_651(txt, i_args, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_652(txt, i_args, i_varDecls, i_preExp, i_context); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_652; +end fun_653; public function daeExpMetarecordcall input Tpl.Text in_txt; @@ -30197,7 +30258,7 @@ algorithm equation ret_1 = SimCode.incrementInt(i_index, 3); i_newIndex = Tpl.writeStr(Tpl.emptyTxt, intString(ret_1)); - (i_argsStr, i_varDecls, i_preExp) = fun_652(Tpl.emptyTxt, i_args, i_varDecls, i_preExp, i_context); + (i_argsStr, i_varDecls, i_preExp) = fun_653(Tpl.emptyTxt, i_args, i_varDecls, i_preExp, i_context); i_box = Tpl.writeTok(Tpl.emptyTxt, Tpl.ST_STRING("mmc_mk_box")); ret_4 = listLength(i_args); ret_5 = SimCode.incrementInt(ret_4, 1); @@ -30245,7 +30306,7 @@ algorithm (out_txt, i_expPart, out_i_preExp, out_i_varDecls) := daeExpMetaHelperConstantNameType(txt, i_expPart, ret_1, out_i_preExp, out_i_varDecls); end daeExpMetaHelperConstant; -protected function lm_655 +protected function lm_656 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -30288,7 +30349,7 @@ algorithm i_nameText = Tpl.writeStr(i_nameText, i_cvname); (txt, i_nameText, i_preExp, i_varDecls) = daeExpMetaHelperConstantNameType(txt, i_nameText, i_tp, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_655(txt, rest, i_varDecls, i_preExp, i_varname); + (txt, i_varDecls, i_preExp) = lm_656(txt, rest, i_varDecls, i_preExp, i_varname); then (txt, i_varDecls, i_preExp); case ( txt, @@ -30299,12 +30360,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_655(txt, rest, i_varDecls, i_preExp, i_varname); + (txt, i_varDecls, i_preExp) = lm_656(txt, rest, i_varDecls, i_preExp, i_varname); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_655; +end lm_656; -protected function fun_656 +protected function fun_657 input Tpl.Text in_txt; input list in_i_varLst; input Tpl.Text in_i_varDecls; @@ -30340,13 +30401,13 @@ algorithm equation txt = Tpl.writeTok(txt, Tpl.ST_STRING(", ")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, NONE(), SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_varDecls, i_preExp) = lm_655(txt, i_varLst, i_varDecls, i_preExp, i_varname); + (txt, i_varDecls, i_preExp) = lm_656(txt, i_varLst, i_varDecls, i_preExp, i_varname); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_656; +end fun_657; -protected function fun_657 +protected function fun_658 input Tpl.Text in_txt; input DAE.ExpType in_i_type; input Tpl.Text in_i_varname; @@ -30425,7 +30486,7 @@ algorithm ret_1 = listLength(i_varLst); ret_2 = SimCode.incrementInt(ret_1, 1); i_start = daeExpMetaHelperBoxStart(Tpl.emptyTxt, ret_2); - (i_args, i_varDecls, i_preExp) = fun_656(Tpl.emptyTxt, i_varLst, i_varDecls, i_preExp, i_varname); + (i_args, i_varDecls, i_preExp) = fun_657(Tpl.emptyTxt, i_varLst, i_varDecls, i_preExp, i_varname); txt = Tpl.writeTok(txt, Tpl.ST_STRING("mmc_mk_box")); txt = Tpl.writeText(txt, i_start); txt = Tpl.writeTok(txt, Tpl.ST_STRING("2, &")); @@ -30444,7 +30505,7 @@ algorithm txt = Tpl.writeText(txt, i_varname); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_657; +end fun_658; public function daeExpMetaHelperConstantNameType input Tpl.Text txt; @@ -30458,7 +30519,7 @@ public function daeExpMetaHelperConstantNameType output Tpl.Text out_i_preExp; output Tpl.Text out_i_varDecls; algorithm - (out_txt, out_i_preExp, out_i_varDecls) := fun_657(txt, i_type, i_varname, i_preExp, i_varDecls); + (out_txt, out_i_preExp, out_i_varDecls) := fun_658(txt, i_type, i_varname, i_preExp, i_varDecls); out_i_varname := i_varname; end daeExpMetaHelperConstantNameType; @@ -30641,7 +30702,7 @@ algorithm out_txt := Tpl.writeText(txt, i_newVar); end tempDeclConst; -protected function fun_663 +protected function fun_664 input Tpl.Text in_txt; input list in_i_instDims; input DAE.ExpType in_i_var_ty; @@ -30668,7 +30729,7 @@ algorithm txt = expTypeArray(txt, i_var_ty); then txt; end matchcontinue; -end fun_663; +end fun_664; public function varType input Tpl.Text in_txt; @@ -30688,7 +30749,7 @@ algorithm list i_instDims; SimCode.Variable i_var; equation - txt = fun_663(txt, i_instDims, i_var_ty); + txt = fun_664(txt, i_instDims, i_var_ty); then txt; case ( txt, @@ -31079,7 +31140,7 @@ algorithm end matchcontinue; end mmcExpTypeShort; -protected function fun_670 +protected function fun_671 input Tpl.Text in_txt; input Boolean in_i_array; input DAE.ExpType in_i_ty; @@ -31111,7 +31172,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_670; +end fun_671; public function expType input Tpl.Text txt; @@ -31120,7 +31181,7 @@ public function expType output Tpl.Text out_txt; algorithm - out_txt := fun_670(txt, i_array, i_ty); + out_txt := fun_671(txt, i_array, i_ty); end expType; public function expTypeModelica @@ -31186,7 +31247,7 @@ algorithm out_txt := expTypeFromExpFlag(txt, i_exp, 4); end expTypeFromExpArrayIf; -protected function fun_679 +protected function fun_680 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -31215,9 +31276,9 @@ algorithm txt = expTypeShort(txt, i_ty); then txt; end matchcontinue; -end fun_679; +end fun_680; -protected function fun_680 +protected function fun_681 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -31242,12 +31303,12 @@ algorithm local DAE.ExpType i_ty; equation - txt = fun_679(txt, i_ty); + txt = fun_680(txt, i_ty); then txt; end matchcontinue; -end fun_680; +end fun_681; -protected function fun_681 +protected function fun_682 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -31275,9 +31336,9 @@ algorithm txt = expTypeFlag(txt, i_ty, 2); then txt; end matchcontinue; -end fun_681; +end fun_682; -protected function fun_682 +protected function fun_683 input Tpl.Text in_txt; input Integer in_i_flag; input DAE.ExpType in_i_ty; @@ -31301,7 +31362,7 @@ algorithm 2, i_ty ) equation - txt = fun_680(txt, i_ty); + txt = fun_681(txt, i_ty); then txt; case ( txt, @@ -31316,7 +31377,7 @@ algorithm 4, i_ty ) equation - txt = fun_681(txt, i_ty); + txt = fun_682(txt, i_ty); then txt; case ( txt, @@ -31324,7 +31385,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_682; +end fun_683; public function expTypeFlag input Tpl.Text txt; @@ -31333,10 +31394,10 @@ public function expTypeFlag output Tpl.Text out_txt; algorithm - out_txt := fun_682(txt, i_flag, i_ty); + out_txt := fun_683(txt, i_flag, i_ty); end expTypeFlag; -protected function fun_684 +protected function fun_685 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31359,9 +31420,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_integer")); then txt; end matchcontinue; -end fun_684; +end fun_685; -protected function fun_685 +protected function fun_686 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31384,9 +31445,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_real")); then txt; end matchcontinue; -end fun_685; +end fun_686; -protected function fun_686 +protected function fun_687 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31409,9 +31470,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_string")); then txt; end matchcontinue; -end fun_686; +end fun_687; -protected function fun_687 +protected function fun_688 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31434,9 +31495,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_687; +end fun_688; -protected function fun_688 +protected function fun_689 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31459,7 +31520,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_integer")); then txt; end matchcontinue; -end fun_688; +end fun_689; public function expTypeFromExpFlag input Tpl.Text in_txt; @@ -31478,35 +31539,35 @@ algorithm DAE.ICONST(integer = _), i_flag ) equation - txt = fun_684(txt, i_flag); + txt = fun_685(txt, i_flag); then txt; case ( txt, DAE.RCONST(real = _), i_flag ) equation - txt = fun_685(txt, i_flag); + txt = fun_686(txt, i_flag); then txt; case ( txt, DAE.SCONST(string = _), i_flag ) equation - txt = fun_686(txt, i_flag); + txt = fun_687(txt, i_flag); then txt; case ( txt, DAE.BCONST(bool = _), i_flag ) equation - txt = fun_687(txt, i_flag); + txt = fun_688(txt, i_flag); then txt; case ( txt, DAE.ENUM_LITERAL(name = _), i_flag ) equation - txt = fun_688(txt, i_flag); + txt = fun_689(txt, i_flag); then txt; case ( txt, @@ -31664,7 +31725,7 @@ algorithm end matchcontinue; end expTypeFromExpFlag; -protected function fun_690 +protected function fun_691 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31687,9 +31748,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_690; +end fun_691; -protected function fun_691 +protected function fun_692 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31712,9 +31773,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_691; +end fun_692; -protected function fun_692 +protected function fun_693 input Tpl.Text in_txt; input Integer in_i_flag; @@ -31737,7 +31798,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_692; +end fun_693; public function expTypeFromOpFlag input Tpl.Text in_txt; @@ -32088,7 +32149,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_690(txt, i_flag); + txt = fun_691(txt, i_flag); then txt; case ( txt, @@ -32097,7 +32158,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_691(txt, i_flag); + txt = fun_692(txt, i_flag); then txt; case ( txt, @@ -32106,7 +32167,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_692(txt, i_flag); + txt = fun_693(txt, i_flag); then txt; case ( txt, @@ -32203,7 +32264,7 @@ algorithm end matchcontinue; end algStmtAssignPattern; -protected function fun_696 +protected function fun_697 input Tpl.Text in_txt; input Option in_i_p_ty; input Tpl.Text in_i_varDecls; @@ -32242,9 +32303,9 @@ algorithm txt = Tpl.writeText(txt, i_rhs); then (txt, i_varDecls, i_unboxBuf); end matchcontinue; -end fun_696; +end fun_697; -protected function fun_697 +protected function fun_698 input Tpl.Text in_txt; input DAE.Exp in_i_p_exp; input Tpl.Text in_i_onPatternFail; @@ -32369,9 +32430,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("UNKNOWN_CONSTANT_PATTERN")); then txt; end matchcontinue; -end fun_697; +end fun_698; -protected function lm_698 +protected function lm_699 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_assignments; @@ -32423,7 +32484,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE("));\n")); (txt, i_tvar, i_onPatternFail, i_varDecls, i_assignments) = patternMatch(txt, i_p, i_tvar, i_onPatternFail, i_varDecls, i_assignments); txt = Tpl.nextIter(txt); - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_698(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_699(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); case ( txt, @@ -32435,12 +32496,12 @@ algorithm local list rest; equation - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_698(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_699(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); end matchcontinue; -end lm_698; +end lm_699; -protected function lm_699 +protected function lm_700 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_assignments; @@ -32488,7 +32549,7 @@ algorithm i_nrhs = Tpl.writeStr(i_nrhs, intString(i_i1)); (txt, i_nrhs, i_onPatternFail, i_varDecls, i_assignments) = patternMatch(txt, i_p, i_nrhs, i_onPatternFail, i_varDecls, i_assignments); txt = Tpl.nextIter(txt); - (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_699(txt, rest, i_assignments, i_varDecls, i_onPatternFail, i_rhs); + (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_700(txt, rest, i_assignments, i_varDecls, i_onPatternFail, i_rhs); then (txt, i_assignments, i_varDecls, i_onPatternFail); case ( txt, @@ -32500,12 +32561,12 @@ algorithm local list rest; equation - (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_699(txt, rest, i_assignments, i_varDecls, i_onPatternFail, i_rhs); + (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_700(txt, rest, i_assignments, i_varDecls, i_onPatternFail, i_rhs); then (txt, i_assignments, i_varDecls, i_onPatternFail); end matchcontinue; -end lm_699; +end lm_700; -protected function lm_700 +protected function lm_701 input Tpl.Text in_txt; input list> in_items; input Tpl.Text in_i_assignments; @@ -32558,7 +32619,7 @@ algorithm txt = Tpl.writeStr(txt, i_n); txt = Tpl.writeTok(txt, Tpl.ST_LINE(";\n")); (txt, i_tvar, i_onPatternFail, i_varDecls, i_assignments) = patternMatch(txt, i_p, i_tvar, i_onPatternFail, i_varDecls, i_assignments); - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_700(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); case ( txt, @@ -32570,12 +32631,12 @@ algorithm local list> rest; equation - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_700(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); end matchcontinue; -end lm_700; +end lm_701; -protected function lm_701 +protected function lm_702 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_assignments; @@ -32627,7 +32688,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_LINE("));\n")); (txt, i_tvar, i_onPatternFail, i_varDecls, i_assignments) = patternMatch(txt, i_p, i_tvar, i_onPatternFail, i_varDecls, i_assignments); txt = Tpl.nextIter(txt); - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_702(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); case ( txt, @@ -32639,10 +32700,10 @@ algorithm local list rest; equation - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_702(txt, rest, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_assignments, i_onPatternFail, i_varDecls); end matchcontinue; -end lm_701; +end lm_702; public function patternMatch input Tpl.Text in_txt; @@ -32689,9 +32750,9 @@ algorithm Tpl.Text i_unboxBuf; equation i_unboxBuf = Tpl.emptyTxt; - (i_urhs, i_varDecls, i_unboxBuf) = fun_696(Tpl.emptyTxt, i_p_ty, i_varDecls, i_unboxBuf, i_rhs); + (i_urhs, i_varDecls, i_unboxBuf) = fun_697(Tpl.emptyTxt, i_p_ty, i_varDecls, i_unboxBuf, i_rhs); txt = Tpl.writeText(txt, i_unboxBuf); - txt = fun_697(txt, i_p_exp, i_onPatternFail, i_urhs); + txt = fun_698(txt, i_p_exp, i_onPatternFail, i_urhs); then (txt, i_rhs, i_onPatternFail, i_varDecls, i_assignments); case ( txt, @@ -32759,7 +32820,7 @@ algorithm list i_patterns; equation txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_698(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_699(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); txt = Tpl.popIter(txt); then (txt, i_rhs, i_onPatternFail, i_varDecls, i_assignments); @@ -32773,7 +32834,7 @@ algorithm list i_patterns; equation txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_699(txt, i_patterns, i_assignments, i_varDecls, i_onPatternFail, i_rhs); + (txt, i_assignments, i_varDecls, i_onPatternFail) = lm_700(txt, i_patterns, i_assignments, i_varDecls, i_onPatternFail, i_rhs); txt = Tpl.popIter(txt); then (txt, i_rhs, i_onPatternFail, i_varDecls, i_assignments); @@ -32786,7 +32847,7 @@ algorithm local list> i_patterns; equation - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_700(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); then (txt, i_rhs, i_onPatternFail, i_varDecls, i_assignments); case ( txt, @@ -32811,7 +32872,7 @@ algorithm txt = Tpl.writeText(txt, i_onPatternFail); txt = Tpl.writeTok(txt, Tpl.ST_LINE(";\n")); txt = Tpl.pushIter(txt, Tpl.ITER_OPTIONS(2, SOME(Tpl.ST_STRING("")), NONE(), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_701(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); + (txt, i_assignments, i_onPatternFail, i_varDecls) = lm_702(txt, i_patterns, i_assignments, i_onPatternFail, i_rhs, i_varDecls); txt = Tpl.popIter(txt); then (txt, i_rhs, i_onPatternFail, i_varDecls, i_assignments); diff --git a/Compiler/susan_codegen/SimCode/SimCodeC.tpl b/Compiler/susan_codegen/SimCode/SimCodeC.tpl index 39b999c9cfd..5ca2a5db3f3 100644 --- a/Compiler/susan_codegen/SimCode/SimCodeC.tpl +++ b/Compiler/susan_codegen/SimCode/SimCodeC.tpl @@ -3449,15 +3449,19 @@ match var * before set_memory_state. Strings are not known, so we copy them, etc... */ case var as VARIABLE(ty = ET_STRING(__)) then - // We need to strdup() all strings, then allocate them on the memory pool again, then free the temporary string - let strVar = tempDecl("modelica_string", &varDecls) - let &varCopy += '<%strVar%> = strdup(<%contextCref(var.name,contextFunction)%>);<%\n%>' - let &varAssign += - << - init_modelica_string(&<%dest%>.targ<%ix%>,<%strVar%>); - free(<%strVar%>);<%\n%> - >> - "" + if not acceptMetaModelicaGrammar() then + // We need to strdup() all strings, then allocate them on the memory pool again, then free the temporary string + let strVar = tempDecl("modelica_string", &varDecls) + let &varCopy += '<%strVar%> = strdup(<%contextCref(var.name,contextFunction)%>);<%\n%>' + let &varAssign += + << + init_modelica_string(&<%dest%>.targ<%ix%>,<%strVar%>); + free(<%strVar%>);<%\n%> + >> + "" + else + let &varAssign += '<%dest%>.targ<%ix%> = <%contextCref(var.name,contextFunction)%>;<%\n%>' + "" case var as VARIABLE(__) then let instDimsInit = (instDims |> exp => daeExp(exp, contextFunction, &varInits /*BUFC*/, &varDecls /*BUFC*/) diff --git a/c_runtime/meta_modelica_builtin.cpp b/c_runtime/meta_modelica_builtin.cpp index 64358464480..c6dd5427d6c 100644 --- a/c_runtime/meta_modelica_builtin.cpp +++ b/c_runtime/meta_modelica_builtin.cpp @@ -191,10 +191,8 @@ intString_rettype intString(modelica_integer i) { /* 32-bit integer: 1+log_10(2**31)+1 = 12 digits max */ static char buffer[12]; - modelica_string_t res; sprintf(buffer, "%d", i); - init_modelica_string(&res, buffer); - return res; + return strdup(buffer); } modelica_metatype boxptr_intEq(modelica_metatype i1, modelica_metatype i2) @@ -437,7 +435,6 @@ stringEq_rettype stringEq(modelica_string_t str1, modelica_string_t str2) stringGetStringChar_rettype stringGetStringChar(modelica_string_t str, modelica_integer ix) { - modelica_string_t res; char chr[2] = {'\0','\0'}; if (*str == 0) throw 1; @@ -447,8 +444,7 @@ stringGetStringChar_rettype stringGetStringChar(modelica_string_t str, modelica_ ix--; } chr[0] = *str; - init_modelica_string(&res, chr); - return res; + return strdup(chr); } stringUpdateStringChar_rettype stringUpdateStringChar(modelica_string_t str, modelica_string_t c, modelica_integer ix) @@ -460,7 +456,7 @@ stringUpdateStringChar_rettype stringUpdateStringChar(modelica_string_t str, mod length = strlen(str); if (ix > length) throw 1; - copy_modelica_string(str, &res); + res = strdup(str); res[ix-1] = c[0]; return res; }