diff --git a/Compiler/CevalScript.mo b/Compiler/CevalScript.mo index 52d8e784ec6..ee96f484e76 100644 --- a/Compiler/CevalScript.mo +++ b/Compiler/CevalScript.mo @@ -4111,8 +4111,9 @@ algorithm pathstr = generateFunctionName(path); Debug.fprintln("ceval", "/*- CevalScript.cevalGenerateFunction starting " +& pathstr +& " */"); (cache,dae as DAE.DAE(d,_),_) = cevalGenerateFunctionDAEs(cache, path, env, {}); - //uniontypePaths = Codegen.getUniontypePaths(d); - //(cache,metarecordTypes) = Lookup.lookupMetarecordsRecursive(cache, env, uniontypePaths, {}); + + uniontypePaths = Codegen.getUniontypePaths(d); + (cache,metarecordTypes) = Lookup.lookupMetarecordsRecursive(cache, env, uniontypePaths, {}); cfilename = stringAppend(pathstr, ".c"); //Print.clearBuf(); @@ -4137,7 +4138,7 @@ algorithm //" $(LDFLAGS)", //" ",libsstr," -lm \n"}); //System.writeFile(makefilename, str); - SimCode.translateFunctions(pathstr, d); + SimCode.translateFunctions(pathstr, d, metarecordTypes); compileModel(pathstr, {}, "", ""); then (cache, pathstr); diff --git a/Compiler/SimCode.mo b/Compiler/SimCode.mo index b560d4d7a3a..089b9dab0bf 100644 --- a/Compiler/SimCode.mo +++ b/Compiler/SimCode.mo @@ -122,6 +122,7 @@ uniontype FunctionCode String name; list functions; MakefileParams makefileParams; + list extraRecordDecls; end FUNCTIONCODE; end FunctionCode; @@ -524,21 +525,23 @@ public function translateFunctions "One of the entry points." input String name; input list daeElements; + input list metarecordTypes; algorithm _ := - matchcontinue (name, daeElements) + matchcontinue (name, daeElements, metarecordTypes) local list fns; list libs; MakefileParams makefileParams; FunctionCode fnCode; - case (name, daeElements) + list extraRecordDecls; + case (name, daeElements, metarecordTypes) equation // Create FunctionCode - fns = elaborateFunctions(daeElements); + (fns, extraRecordDecls) = elaborateFunctions(daeElements, metarecordTypes); libs = extractLibs(fns); makefileParams = createMakefileParams(libs); - fnCode = FUNCTIONCODE(name, fns, makefileParams); + fnCode = FUNCTIONCODE(name, fns, makefileParams, extraRecordDecls); // Generate code _ = Tpl.tplString(SimCodeC.translateFunctions, fnCode); then @@ -585,7 +588,7 @@ algorithm //libs1 = {}; //usless filter, all are already functions from generateFunctions2 //funcelems := Util.listFilter(funcelems, DAEUtil.isFunction); - fns = elaborateFunctions(funcelems); + (fns, _) = elaborateFunctions(funcelems, {}); // Do we need metarecords here as well? //TODO: libs ? see in Codegen.cPrintFunctionIncludes(cfns) libs2 = extractLibs(fns); then @@ -659,12 +662,16 @@ end generateExternalObjectInclude; protected function elaborateFunctions input list daeElements; + input list metarecordTypes; output list functions; + output list extraRecordDecls; protected list fns; + list outRecordTypes; algorithm - (fns, _) := elaborateFunctions2(daeElements, {},{}); + (fns, outRecordTypes) := elaborateFunctions2(daeElements, {},{}); functions := listReverse(fns); // Is there a reason why we reverse here? + (extraRecordDecls,_) := elaborateRecordDeclarationsFromTypes(metarecordTypes, {}, outRecordTypes); end elaborateFunctions; protected function elaborateFunctions2 @@ -1348,6 +1355,31 @@ algorithm end matchcontinue; end extractLibs; +protected function elaborateRecordDeclarationsFromTypes + input list inTypes; + input list inAccRecordDecls; + input list inReturnTypes; + output list outRecordDecls; + output list outReturnTypes; +algorithm + (outRecordDecls, outReturnTypes) := + matchcontinue (inTypes, inAccRecordDecls, inReturnTypes) + local + list accRecDecls; + DAE.Type firstType; + list restTypes; + case ({}, accRecDecls, inReturnTypes) + then (accRecDecls, inReturnTypes); + case (firstType :: restTypes, accRecDecls, inReturnTypes) + equation + (accRecDecls, inReturnTypes) = + elaborateRecordDeclarationsForRecord(firstType, accRecDecls, inReturnTypes); + (accRecDecls, inReturnTypes) = + elaborateRecordDeclarationsFromTypes(restTypes, accRecDecls, inReturnTypes); + then (accRecDecls, inReturnTypes); + end matchcontinue; +end elaborateRecordDeclarationsFromTypes; + protected function elaborateRecordDeclarations "function elaborateRecordDeclarations Translate all records used by varlist to structs." @@ -1430,6 +1462,19 @@ algorithm then (accRecDecls,rt_2); case ((DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(name), complexVarLst = varlst),_), accRecDecls, rt) then (accRecDecls,rt); + case ((DAE.T_METARECORD(fields = varlst), SOME(path)), accRecDecls, rt) + local String sname; + equation + sname = ModUtil.pathStringReplaceDot(path, "_"); + failure(_ = Util.listGetMember(sname,rt)); + + fieldNames = Util.listMap(varlst, generateVarName); + + accRecDecls = RECORD_DECL_DEF(path, fieldNames) :: accRecDecls; + rt_1 = sname::rt; + + (accRecDecls,rt_2) = elaborateNestedRecordDeclarations(varlst, accRecDecls, rt_1); + then (accRecDecls,rt_2); case ((_,_), accRecDecls, rt) then (accRecDecls,rt); case ((_,_), accRecDecls, rt) then @@ -1437,6 +1482,20 @@ algorithm end matchcontinue; end elaborateRecordDeclarationsForRecord; +protected function generateVarName + input DAE.Var inVar; + output String outName; +algorithm + outName := + matchcontinue (inVar) + local + DAE.Ident name; + case DAE.TYPES_VAR(name = name) + then name; + case (_) + then "NULL"; + end matchcontinue; +end generateVarName; protected function elaborateNestedRecordDeclarations "function elaborateNestedRecordDeclarations @@ -5957,12 +6016,19 @@ algorithm local String lib; list eltarg; + list arr; case (eltarg) equation Absyn.CLASSMOD(_,SOME(Absyn.STRING(lib))) = - Interactive.getModificationValue(eltarg, Absyn.CREF_IDENT("Library",{})) "System.stringReplace(lib,\"\\\"\",\"\"\") => lib\'" ; + Interactive.getModificationValue(eltarg, Absyn.CREF_IDENT("Library",{})); then {lib}; + case (eltarg) + equation + Absyn.CLASSMOD(_,SOME(Absyn.ARRAY(arr))) = + Interactive.getModificationValue(eltarg, Absyn.CREF_IDENT("Library",{})); + then + Util.listMap(arr, Absyn.expString); case (_) then {}; end matchcontinue; end generateExtFunctionIncludesLibstr; diff --git a/Compiler/SimCodeC.mo b/Compiler/SimCodeC.mo index 40d04fc0285..f012fc26ba2 100644 --- a/Compiler/SimCodeC.mo +++ b/Compiler/SimCodeC.mo @@ -69,9 +69,10 @@ algorithm Tpl.Text txt; case ( txt, - (i_functionCode as SimCode.FUNCTIONCODE(functions = i_functions, name = i_name)) ) + (i_functionCode as SimCode.FUNCTIONCODE(functions = i_functions, extraRecordDecls = i_extraRecordDecls, name = i_name)) ) local String i_name; + list i_extraRecordDecls; list i_functions; SimCode.FunctionCode i_functionCode; Tpl.Text txt_3; @@ -79,7 +80,7 @@ algorithm Tpl.Text txt_1; Tpl.Text i_functionsFileContent; equation - i_functionsFileContent = functionsFile2(emptyTxt, i_functions); + i_functionsFileContent = functionsFile2(emptyTxt, i_functions, i_extraRecordDecls); txt_1 = Tpl.writeStr(emptyTxt, i_name); txt_1 = Tpl.writeTok(txt_1, Tpl.ST_STRING(".c")); Tpl.textFile(i_functionsFileContent, Tpl.textString(txt_1)); @@ -5457,9 +5458,46 @@ algorithm end matchcontinue; end equation_; +protected function lm_126 + input Tpl.Text in_txt; + input list in_items; + + output Tpl.Text out_txt; +algorithm + out_txt := + matchcontinue(in_txt, in_items) + local + Tpl.Text txt; + + case ( txt, + {} ) + then txt; + + case ( txt, + i_rd :: rest ) + local + list rest; + SimCode.RecordDeclaration i_rd; + equation + txt = recordDeclaration(txt, i_rd); + txt = Tpl.nextIter(txt); + txt = lm_126(txt, rest); + then txt; + + case ( txt, + _ :: rest ) + local + list rest; + equation + txt = lm_126(txt, rest); + then txt; + end matchcontinue; +end lm_126; + public function functionsFile2 input Tpl.Text txt; input list i_functions; + input list i_extraRecordDecls; output Tpl.Text out_txt; algorithm @@ -5493,6 +5531,10 @@ algorithm out_txt := Tpl.softNewLine(out_txt); out_txt := functionHeaders(out_txt, i_functions); out_txt := Tpl.softNewLine(out_txt); + out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); + out_txt := lm_126(out_txt, i_extraRecordDecls); + out_txt := Tpl.popIter(out_txt); + out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING_LIST({ "/* End Header */\n", "\n", @@ -5542,7 +5584,7 @@ algorithm }, false)); end functionsFile; -protected function lm_128 +protected function lm_129 input Tpl.Text in_txt; input list in_items; @@ -5565,7 +5607,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_128(txt, rest); + txt = lm_129(txt, rest); then txt; case ( txt, @@ -5573,10 +5615,10 @@ algorithm local list rest; equation - txt = lm_128(txt, rest); + txt = lm_129(txt, rest); then txt; end matchcontinue; -end lm_128; +end lm_129; public function makefileFunction input Tpl.Text in_txt; @@ -5605,7 +5647,7 @@ algorithm Tpl.Text i_libsStr; equation i_libsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(" ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_libsStr = lm_128(i_libsStr, i_makefileParams_libs); + i_libsStr = lm_129(i_libsStr, i_makefileParams_libs); i_libsStr = Tpl.popIter(i_libsStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ "# Makefile generated by OpenModelica\n", @@ -5662,7 +5704,7 @@ algorithm end matchcontinue; end makefileFunction; -protected function fun_130 +protected function fun_131 input Tpl.Text in_txt; input String in_i_modelInfo_directory; @@ -5683,9 +5725,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("-L\"\"")); then txt; end matchcontinue; -end fun_130; +end fun_131; -protected function lm_131 +protected function lm_132 input Tpl.Text in_txt; input list in_items; @@ -5708,7 +5750,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_131(txt, rest); + txt = lm_132(txt, rest); then txt; case ( txt, @@ -5716,10 +5758,10 @@ algorithm local list rest; equation - txt = lm_131(txt, rest); + txt = lm_132(txt, rest); then txt; end matchcontinue; -end lm_131; +end lm_132; public function makefile input Tpl.Text in_txt; @@ -5749,9 +5791,9 @@ algorithm Tpl.Text i_libsStr; Tpl.Text i_dirExtra; equation - i_dirExtra = fun_130(emptyTxt, i_modelInfo_directory); + i_dirExtra = fun_131(emptyTxt, i_modelInfo_directory); i_libsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(" ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_libsStr = lm_131(i_libsStr, i_makefileParams_libs); + i_libsStr = lm_132(i_libsStr, i_makefileParams_libs); i_libsStr = Tpl.popIter(i_libsStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ "# Makefile generated by OpenModelica\n", @@ -5876,7 +5918,7 @@ algorithm end matchcontinue; end crefSubscript; -protected function lm_135 +protected function lm_136 input Tpl.Text in_txt; input list in_items; @@ -5899,7 +5941,7 @@ algorithm equation txt = subscriptTpl(txt, i_s); txt = Tpl.nextIter(txt); - txt = lm_135(txt, rest); + txt = lm_136(txt, rest); then txt; case ( txt, @@ -5907,10 +5949,10 @@ algorithm local list rest; equation - txt = lm_135(txt, rest); + txt = lm_136(txt, rest); then txt; end matchcontinue; -end lm_135; +end lm_136; public function subscriptsTpl input Tpl.Text in_txt; @@ -5934,14 +5976,14 @@ 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 = lm_135(txt, i_subscripts); + txt = lm_136(txt, i_subscripts); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("]")); then txt; end matchcontinue; end subscriptsTpl; -protected function fun_137 +protected function fun_138 input Tpl.Text in_txt; input DAE.Exp in_i_exp; @@ -5966,7 +6008,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("SUBSCRIPT_NOT_CONSTANT")); then txt; end matchcontinue; -end fun_137; +end fun_138; public function subscriptTpl input Tpl.Text in_txt; @@ -5984,7 +6026,7 @@ algorithm local DAE.Exp i_exp; equation - txt = fun_137(txt, i_exp); + txt = fun_138(txt, i_exp); then txt; case ( txt, @@ -6087,7 +6129,7 @@ algorithm end matchcontinue; end underscorePath; -protected function lm_141 +protected function lm_142 input Tpl.Text in_txt; input list in_items; @@ -6110,7 +6152,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_141(txt, rest); + txt = lm_142(txt, rest); then txt; case ( txt, @@ -6118,12 +6160,12 @@ algorithm local list rest; equation - txt = lm_141(txt, rest); + txt = lm_142(txt, rest); then txt; end matchcontinue; -end lm_141; +end lm_142; -protected function lm_142 +protected function lm_143 input Tpl.Text in_txt; input list in_items; @@ -6145,10 +6187,10 @@ algorithm list i_includes; 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 = lm_141(txt, i_includes); + txt = lm_142(txt, i_includes); txt = Tpl.popIter(txt); txt = Tpl.nextIter(txt); - txt = lm_142(txt, rest); + txt = lm_143(txt, rest); then txt; case ( txt, @@ -6156,10 +6198,10 @@ algorithm local list rest; equation - txt = lm_142(txt, rest); + txt = lm_143(txt, rest); then txt; end matchcontinue; -end lm_142; +end lm_143; public function externalFunctionIncludes input Tpl.Text txt; @@ -6173,7 +6215,7 @@ algorithm "#endif\n" }, true)); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_142(out_txt, i_functions); + out_txt := lm_143(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING_LIST({ @@ -6183,7 +6225,7 @@ algorithm }, false)); end externalFunctionIncludes; -protected function lm_144 +protected function lm_145 input Tpl.Text in_txt; input list in_items; @@ -6206,7 +6248,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_144(txt, rest); + txt = lm_145(txt, rest); then txt; case ( txt, @@ -6214,12 +6256,12 @@ algorithm local list rest; equation - txt = lm_144(txt, rest); + txt = lm_145(txt, rest); then txt; end matchcontinue; -end lm_144; +end lm_145; -protected function lm_145 +protected function lm_146 input Tpl.Text in_txt; input list in_items; @@ -6242,7 +6284,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_145(txt, rest); + txt = lm_146(txt, rest); then txt; case ( txt, @@ -6250,12 +6292,12 @@ algorithm local list rest; equation - txt = lm_145(txt, rest); + txt = lm_146(txt, rest); then txt; end matchcontinue; -end lm_145; +end lm_146; -protected function lm_146 +protected function lm_147 input Tpl.Text in_txt; input list in_items; @@ -6278,7 +6320,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_146(txt, rest); + txt = lm_147(txt, rest); then txt; case ( txt, @@ -6286,12 +6328,12 @@ algorithm local list rest; equation - txt = lm_146(txt, rest); + txt = lm_147(txt, rest); then txt; end matchcontinue; -end lm_146; +end lm_147; -protected function lm_147 +protected function lm_148 input Tpl.Text in_txt; input list in_items; @@ -6317,7 +6359,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_147(txt, rest); + txt = lm_148(txt, rest); then txt; case ( txt, @@ -6325,12 +6367,12 @@ algorithm local list rest; equation - txt = lm_147(txt, rest); + txt = lm_148(txt, rest); then txt; end matchcontinue; -end lm_147; +end lm_148; -protected function fun_148 +protected function fun_149 input Tpl.Text in_txt; input SimCode.Function in_i_it; @@ -6351,7 +6393,7 @@ algorithm Tpl.Text txt_0; 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 = lm_144(txt, i_recordDecls); + txt = lm_145(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt_0 = underscorePath(emptyTxt, i_name); @@ -6369,7 +6411,7 @@ algorithm Tpl.Text txt_0; 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 = lm_145(txt, i_recordDecls); + txt = lm_146(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt_0 = underscorePath(emptyTxt, i_name); @@ -6389,7 +6431,7 @@ algorithm equation i_fname = underscorePath(emptyTxt, i_name); 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_146(txt, i_recordDecls); + txt = lm_147(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("#define ")); @@ -6417,7 +6459,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_147(txt, i_funArgs); + txt = lm_148(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; @@ -6426,9 +6468,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_148; +end fun_149; -protected function lm_149 +protected function lm_150 input Tpl.Text in_txt; input list in_items; @@ -6449,9 +6491,9 @@ algorithm list rest; SimCode.Function i_it; equation - txt = fun_148(txt, i_it); + txt = fun_149(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_149(txt, rest); + txt = lm_150(txt, rest); then txt; case ( txt, @@ -6459,10 +6501,10 @@ algorithm local list rest; equation - txt = lm_149(txt, rest); + txt = lm_150(txt, rest); then txt; end matchcontinue; -end lm_149; +end lm_150; public function functionHeaders input Tpl.Text txt; @@ -6471,11 +6513,11 @@ public function functionHeaders output Tpl.Text out_txt; 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 := lm_149(out_txt, i_functions); + out_txt := lm_150(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); end functionHeaders; -protected function lm_151 +protected function lm_152 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6502,7 +6544,7 @@ algorithm txt = cref(txt, i_var_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_151(txt, rest); + txt = lm_152(txt, rest); then txt; case ( txt, @@ -6510,12 +6552,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_151(txt, rest); + txt = lm_152(txt, rest); then txt; end matchcontinue; -end lm_151; +end lm_152; -protected function lm_152 +protected function lm_153 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6540,7 +6582,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING("\"")); txt = Tpl.nextIter(txt); - txt = lm_152(txt, rest); + txt = lm_153(txt, rest); then txt; case ( txt, @@ -6548,12 +6590,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_152(txt, rest); + txt = lm_153(txt, rest); then txt; end matchcontinue; -end lm_152; +end lm_153; -protected function lm_153 +protected function lm_154 input Tpl.Text in_txt; input list in_items; @@ -6578,7 +6620,7 @@ algorithm txt = Tpl.writeStr(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING("\"")); txt = Tpl.nextIter(txt); - txt = lm_153(txt, rest); + txt = lm_154(txt, rest); then txt; case ( txt, @@ -6586,10 +6628,10 @@ algorithm local list rest; equation - txt = lm_153(txt, rest); + txt = lm_154(txt, rest); then txt; end matchcontinue; -end lm_153; +end lm_154; public function recordDeclaration input Tpl.Text in_txt; @@ -6617,7 +6659,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 = lm_151(txt, i_variables); + txt = lm_152(txt, i_variables); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -6625,7 +6667,7 @@ algorithm txt_0 = dotPath(emptyTxt, i_defPath); txt_1 = underscorePath(emptyTxt, i_defPath); txt_2 = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt_2 = lm_152(txt_2, i_variables); + txt_2 = lm_153(txt_2, i_variables); txt_2 = Tpl.popIter(txt_2); txt = recordDefinition(txt, Tpl.textString(txt_0), Tpl.textString(txt_1), Tpl.textString(txt_2)); then txt; @@ -6642,7 +6684,7 @@ algorithm txt_0 = dotPath(emptyTxt, i_path); txt_1 = underscorePath(emptyTxt, i_path); txt_2 = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt_2 = lm_153(txt_2, i_fieldNames); + txt_2 = lm_154(txt_2, i_fieldNames); txt_2 = Tpl.popIter(txt_2); txt = recordDefinition(txt, Tpl.textString(txt_0), Tpl.textString(txt_1), Tpl.textString(txt_2)); then txt; @@ -6686,7 +6728,7 @@ algorithm out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("};")); end recordDefinition; -protected function lm_156 +protected function lm_157 input Tpl.Text in_txt; input SimCode.Variables in_items; input String in_i_fname; @@ -6719,7 +6761,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" targ")); txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.nextIter(txt); - txt = lm_156(txt, rest, i_fname); + txt = lm_157(txt, rest, i_fname); then txt; case ( txt, @@ -6728,12 +6770,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_156(txt, rest, i_fname); + txt = lm_157(txt, rest, i_fname); then txt; end matchcontinue; -end lm_156; +end lm_157; -protected function fun_157 +protected function fun_158 input Tpl.Text in_txt; input Option in_i_it; @@ -6758,9 +6800,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(":")); then txt; end matchcontinue; -end fun_157; +end fun_158; -protected function lm_158 +protected function lm_159 input Tpl.Text in_txt; input list> in_items; @@ -6781,9 +6823,9 @@ algorithm list> rest; Option i_it; equation - txt = fun_157(txt, i_it); + txt = fun_158(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_158(txt, rest); + txt = lm_159(txt, rest); then txt; case ( txt, @@ -6791,12 +6833,12 @@ algorithm local list> rest; equation - txt = lm_158(txt, rest); + txt = lm_159(txt, rest); then txt; end matchcontinue; -end lm_158; +end lm_159; -protected function fun_159 +protected function fun_160 input Tpl.Text in_txt; input SimCode.Type in_i_ty; @@ -6814,7 +6856,7 @@ 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 = lm_158(txt, i_arrayDimensions); + txt = lm_159(txt, i_arrayDimensions); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("]")); then txt; @@ -6823,9 +6865,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_159; +end fun_160; -protected function lm_160 +protected function lm_161 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6855,10 +6897,10 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("; /* ")); txt = cref(txt, i_name); - txt = fun_159(txt, i_ty); + txt = fun_160(txt, i_ty); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" */")); txt = Tpl.nextIter(txt); - txt = lm_160(txt, rest); + txt = lm_161(txt, rest); then txt; case ( txt, @@ -6866,12 +6908,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_160(txt, rest); + txt = lm_161(txt, rest); then txt; end matchcontinue; -end lm_160; +end lm_161; -protected function lm_161 +protected function lm_162 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6897,7 +6939,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_161(txt, rest); + txt = lm_162(txt, rest); then txt; case ( txt, @@ -6905,10 +6947,10 @@ algorithm local SimCode.Variables rest; equation - txt = lm_161(txt, rest); + txt = lm_162(txt, rest); then txt; end matchcontinue; -end lm_161; +end lm_162; public function functionHeader input Tpl.Text txt; @@ -6919,7 +6961,7 @@ public function functionHeader output Tpl.Text out_txt; 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 := lm_156(out_txt, i_outVars, i_fname); + out_txt := lm_157(out_txt, i_outVars, i_fname); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("typedef struct ")); @@ -6930,7 +6972,7 @@ algorithm }, true)); out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2)); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_160(out_txt, i_outVars); + out_txt := lm_161(out_txt, i_outVars); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.popBlock(out_txt); @@ -6953,12 +6995,12 @@ algorithm out_txt := Tpl.writeStr(out_txt, i_fname); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("(")); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_161(out_txt, i_fargs); + out_txt := lm_162(out_txt, i_fargs); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(");")); end functionHeader; -protected function lm_163 +protected function lm_164 input Tpl.Text in_txt; input list in_items; @@ -6981,7 +7023,7 @@ algorithm equation txt = extFunDefArg(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_163(txt, rest); + txt = lm_164(txt, rest); then txt; case ( txt, @@ -6989,10 +7031,10 @@ algorithm local list rest; equation - txt = lm_163(txt, rest); + txt = lm_164(txt, rest); then txt; end matchcontinue; -end lm_163; +end lm_164; public function extFunDef input Tpl.Text in_txt; @@ -7018,7 +7060,7 @@ algorithm txt = Tpl.writeStr(txt, i_extName); 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 = lm_163(txt, i_extArgs); + txt = lm_164(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; @@ -7118,6 +7160,50 @@ algorithm txt = underscorePath(txt, i_rname); then txt; + case ( txt, + DAE.ET_METAOPTION(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_LIST(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_METATUPLE(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_UNIONTYPE() ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_POLYMORPHIC() ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + i_ET__META__ARRAY ) + local + SimCode.Type i_ET__META__ARRAY; + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_BOXED(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + case ( txt, _ ) equation @@ -7126,7 +7212,7 @@ algorithm end matchcontinue; end extType; -protected function fun_167 +protected function fun_168 input Tpl.Text in_txt; input String in_it; input DAE.ExpType in_i_t; @@ -7158,9 +7244,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" *")); then txt; end matchcontinue; -end fun_167; +end fun_168; -protected function fun_168 +protected function fun_169 input Tpl.Text in_txt; input Boolean in_i_ia; input DAE.ExpType in_i_t; @@ -7189,12 +7275,12 @@ algorithm equation txt_0 = extType(emptyTxt, i_t); str_1 = Tpl.textString(txt_0); - txt = fun_167(txt, str_1, i_t); + txt = fun_168(txt, str_1, i_t); then txt; end matchcontinue; -end fun_168; +end fun_169; -protected function fun_169 +protected function fun_170 input Tpl.Text in_txt; input Boolean in_i_ii; input Boolean in_i_ia; @@ -7223,10 +7309,10 @@ algorithm i_ia, i_t ) equation - txt = fun_168(txt, i_ia, i_t); + txt = fun_169(txt, i_ia, i_t); then txt; end matchcontinue; -end fun_169; +end fun_170; public function extFunDefArg input Tpl.Text in_txt; @@ -7250,7 +7336,7 @@ algorithm Tpl.Text i_name; equation i_name = cref(emptyTxt, i_c); - i_typeStr = fun_169(emptyTxt, i_ii, i_ia, i_t); + i_typeStr = fun_170(emptyTxt, i_ii, i_ia, i_t); txt = Tpl.writeText(txt, i_typeStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = Tpl.writeText(txt, i_name); @@ -7302,7 +7388,7 @@ algorithm (out_txt, i_preExp, i_varDecls) := daeExp(txt, i_exp, SimCode.contextOther, i_preExp, i_varDecls); end daeExpToString; -protected function lm_172 +protected function lm_173 input Tpl.Text in_txt; input list in_items; @@ -7325,7 +7411,7 @@ algorithm equation txt = functionBody(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_172(txt, rest); + txt = lm_173(txt, rest); then txt; case ( txt, @@ -7333,10 +7419,10 @@ algorithm local list rest; equation - txt = lm_172(txt, rest); + txt = lm_173(txt, rest); then txt; end matchcontinue; -end lm_172; +end lm_173; public function functionBodies input Tpl.Text txt; @@ -7345,11 +7431,11 @@ public function functionBodies output Tpl.Text out_txt; 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 := lm_172(out_txt, i_functions); + out_txt := lm_173(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); end functionBodies; -protected function lm_174 +protected function lm_175 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varInits; @@ -7384,7 +7470,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_varInits) = varInit(txt, i_it, "", i_i1, i_varDecls, i_varInits); txt = Tpl.nextIter(txt); - (txt, i_varInits, i_varDecls) = lm_174(txt, rest, i_varInits, i_varDecls); + (txt, i_varInits, i_varDecls) = lm_175(txt, rest, i_varInits, i_varDecls); then (txt, i_varInits, i_varDecls); case ( txt, @@ -7394,12 +7480,12 @@ algorithm local list rest; equation - (txt, i_varInits, i_varDecls) = lm_174(txt, rest, i_varInits, i_varDecls); + (txt, i_varInits, i_varDecls) = lm_175(txt, rest, i_varInits, i_varDecls); then (txt, i_varInits, i_varDecls); end matchcontinue; -end lm_174; +end lm_175; -protected function lm_175 +protected function lm_176 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -7427,7 +7513,7 @@ algorithm equation (txt, i_varDecls) = funStatement(txt, i_stmt, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_175(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_176(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -7436,12 +7522,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_175(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_176(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_175; +end lm_176; -protected function lm_176 +protected function lm_177 input Tpl.Text in_txt; input SimCode.Variables in_items; input Tpl.Text in_i_varInits; @@ -7480,7 +7566,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_varInits) = varOutput(txt, i_it, Tpl.textString(i_retVar), i_i1, i_varDecls, i_varInits); txt = Tpl.nextIter(txt); - (txt, i_varInits, i_varDecls) = lm_176(txt, rest, i_varInits, i_varDecls, i_retVar); + (txt, i_varInits, i_varDecls) = lm_177(txt, rest, i_varInits, i_varDecls, i_retVar); then (txt, i_varInits, i_varDecls); case ( txt, @@ -7491,12 +7577,12 @@ algorithm local SimCode.Variables rest; equation - (txt, i_varInits, i_varDecls) = lm_176(txt, rest, i_varInits, i_varDecls, i_retVar); + (txt, i_varInits, i_varDecls) = lm_177(txt, rest, i_varInits, i_varDecls, i_retVar); then (txt, i_varInits, i_varDecls); end matchcontinue; -end lm_176; +end lm_177; -protected function lm_177 +protected function lm_178 input Tpl.Text in_txt; input list in_items; @@ -7522,7 +7608,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_177(txt, rest); + txt = lm_178(txt, rest); then txt; case ( txt, @@ -7530,12 +7616,12 @@ algorithm local list rest; equation - txt = lm_177(txt, rest); + txt = lm_178(txt, rest); then txt; end matchcontinue; -end lm_177; +end lm_178; -protected function lm_178 +protected function lm_179 input Tpl.Text in_txt; input list in_items; @@ -7562,7 +7648,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_178(txt, rest); + txt = lm_179(txt, rest); then txt; case ( txt, @@ -7570,12 +7656,12 @@ algorithm local list rest; equation - txt = lm_178(txt, rest); + txt = lm_179(txt, rest); then txt; end matchcontinue; -end lm_178; +end lm_179; -protected function lm_179 +protected function lm_180 input Tpl.Text in_txt; input list in_items; @@ -7598,7 +7684,7 @@ algorithm equation txt = readInVar(txt, it); txt = Tpl.nextIter(txt); - txt = lm_179(txt, rest); + txt = lm_180(txt, rest); then txt; case ( txt, @@ -7606,12 +7692,12 @@ algorithm local list rest; equation - txt = lm_179(txt, rest); + txt = lm_180(txt, rest); then txt; end matchcontinue; -end lm_179; +end lm_180; -protected function lm_180 +protected function lm_181 input Tpl.Text in_txt; input list in_items; @@ -7634,7 +7720,7 @@ algorithm equation txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_180(txt, rest); + txt = lm_181(txt, rest); then txt; case ( txt, @@ -7642,12 +7728,12 @@ algorithm local list rest; equation - txt = lm_180(txt, rest); + txt = lm_181(txt, rest); then txt; end matchcontinue; -end lm_180; +end lm_181; -protected function lm_181 +protected function lm_182 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -7672,7 +7758,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); txt = writeOutVar(txt, it, i_i1); txt = Tpl.nextIter(txt); - txt = lm_181(txt, rest); + txt = lm_182(txt, rest); then txt; case ( txt, @@ -7680,12 +7766,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_181(txt, rest); + txt = lm_182(txt, rest); then txt; end matchcontinue; -end lm_181; +end lm_182; -protected function fun_182 +protected function fun_183 input Tpl.Text in_txt; input SimCode.Variables in_i_outVars; @@ -7708,13 +7794,13 @@ algorithm SimCode.Variables i_outVars; 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 = lm_181(txt, i_outVars); + txt = lm_182(txt, i_outVars); txt = Tpl.popIter(txt); then txt; end matchcontinue; -end fun_182; +end fun_183; -protected function lm_183 +protected function lm_184 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_outputAlloc; @@ -7749,7 +7835,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_outputAlloc) = varInit(txt, i_it, "out", i_i1, i_varDecls, i_outputAlloc); txt = Tpl.nextIter(txt); - (txt, i_outputAlloc, i_varDecls) = lm_183(txt, rest, i_outputAlloc, i_varDecls); + (txt, i_outputAlloc, i_varDecls) = lm_184(txt, rest, i_outputAlloc, i_varDecls); then (txt, i_outputAlloc, i_varDecls); case ( txt, @@ -7759,12 +7845,12 @@ algorithm local list rest; equation - (txt, i_outputAlloc, i_varDecls) = lm_183(txt, rest, i_outputAlloc, i_varDecls); + (txt, i_outputAlloc, i_varDecls) = lm_184(txt, rest, i_outputAlloc, i_varDecls); then (txt, i_outputAlloc, i_varDecls); end matchcontinue; -end lm_183; +end lm_184; -protected function lm_184 +protected function lm_185 input Tpl.Text in_txt; input list in_items; @@ -7791,7 +7877,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_184(txt, rest); + txt = lm_185(txt, rest); then txt; case ( txt, @@ -7799,12 +7885,12 @@ algorithm local list rest; equation - txt = lm_184(txt, rest); + txt = lm_185(txt, rest); then txt; end matchcontinue; -end lm_184; +end lm_185; -protected function lm_185 +protected function lm_186 input Tpl.Text in_txt; input list in_items; @@ -7827,7 +7913,7 @@ algorithm equation txt = readInVar(txt, it); txt = Tpl.nextIter(txt); - txt = lm_185(txt, rest); + txt = lm_186(txt, rest); then txt; case ( txt, @@ -7835,12 +7921,12 @@ algorithm local list rest; equation - txt = lm_185(txt, rest); + txt = lm_186(txt, rest); then txt; end matchcontinue; -end lm_185; +end lm_186; -protected function lm_186 +protected function lm_187 input Tpl.Text in_txt; input list in_items; @@ -7863,7 +7949,7 @@ algorithm equation txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_186(txt, rest); + txt = lm_187(txt, rest); then txt; case ( txt, @@ -7871,12 +7957,12 @@ algorithm local list rest; equation - txt = lm_186(txt, rest); + txt = lm_187(txt, rest); then txt; end matchcontinue; -end lm_186; +end lm_187; -protected function lm_187 +protected function lm_188 input Tpl.Text in_txt; input list in_items; @@ -7901,7 +7987,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); txt = writeOutVar(txt, it, i_i1); txt = Tpl.nextIter(txt); - txt = lm_187(txt, rest); + txt = lm_188(txt, rest); then txt; case ( txt, @@ -7909,12 +7995,12 @@ algorithm local list rest; equation - txt = lm_187(txt, rest); + txt = lm_188(txt, rest); then txt; end matchcontinue; -end lm_187; +end lm_188; -protected function lm_188 +protected function lm_189 input Tpl.Text in_txt; input list in_items; @@ -7940,7 +8026,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_188(txt, rest); + txt = lm_189(txt, rest); then txt; case ( txt, @@ -7948,12 +8034,12 @@ algorithm local list rest; equation - txt = lm_188(txt, rest); + txt = lm_189(txt, rest); then txt; end matchcontinue; -end lm_188; +end lm_189; -protected function lm_189 +protected function lm_190 input Tpl.Text in_txt; input list in_items; @@ -7979,7 +8065,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_189(txt, rest); + txt = lm_190(txt, rest); then txt; case ( txt, @@ -7987,12 +8073,12 @@ algorithm local list rest; equation - txt = lm_189(txt, rest); + txt = lm_190(txt, rest); then txt; end matchcontinue; -end lm_189; +end lm_190; -protected function lm_190 +protected function lm_191 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_structVar; @@ -8024,7 +8110,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_190(txt, rest, i_structVar); + txt = lm_191(txt, rest, i_structVar); then txt; case ( txt, @@ -8033,10 +8119,10 @@ algorithm local list rest; equation - txt = lm_190(txt, rest, i_structVar); + txt = lm_191(txt, rest, i_structVar); then txt; end matchcontinue; -end lm_190; +end lm_191; public function functionBody input Tpl.Text in_txt; @@ -8076,20 +8162,20 @@ algorithm (i_retVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_retType), i_varDecls); (i_stateVar, i_varDecls) = tempDecl(emptyTxt, "state", i_varDecls); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_varInits, i_varDecls) = lm_174(i_0__, i_variableDeclarations, i_varInits, i_varDecls); + (i_0__, i_varInits, i_varDecls) = lm_175(i_0__, i_variableDeclarations, i_varInits, i_varDecls); i_0__ = Tpl.popIter(i_0__); i_bodyPart = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_bodyPart, i_varDecls) = lm_175(i_bodyPart, i_body, i_varDecls); + (i_bodyPart, i_varDecls) = lm_176(i_bodyPart, i_body, i_varDecls); i_bodyPart = Tpl.popIter(i_bodyPart); i_outVarsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_outVarsStr, i_varInits, i_varDecls) = lm_176(i_outVarsStr, i_outVars, i_varInits, i_varDecls, i_retVar); + (i_outVarsStr, i_varInits, i_varDecls) = lm_177(i_outVarsStr, i_outVars, i_varInits, i_varDecls, i_retVar); i_outVarsStr = Tpl.popIter(i_outVarsStr); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_177(txt, i_functionArguments); + txt = lm_178(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8135,23 +8221,23 @@ algorithm }, true)); 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 = lm_178(txt, i_functionArguments); + txt = lm_179(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" out;\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_179(txt, i_functionArguments); + txt = lm_180(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("out = _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_180(txt, i_functionArguments); + txt = lm_181(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(");\n")); - txt = fun_182(txt, i_outVars); + txt = fun_183(txt, i_outVars); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("return 0;\n")); txt = Tpl.popBlock(txt); @@ -8182,7 +8268,7 @@ algorithm i_outputAlloc = emptyTxt; (i_callPart, i_preExp, i_varDecls) = extFunCall(emptyTxt, i_fn, i_preExp, i_varDecls); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_outputAlloc, i_varDecls) = lm_183(i_0__, i_outVars, i_outputAlloc, i_varDecls); + (i_0__, i_outputAlloc, i_varDecls) = lm_184(i_0__, i_outVars, i_outputAlloc, i_varDecls); i_0__ = Tpl.popIter(i_0__); txt = Tpl.writeTok(txt, Tpl.ST_STRING("int in_")); txt = Tpl.writeText(txt, i_fname); @@ -8192,24 +8278,24 @@ algorithm }, true)); 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 = lm_184(txt, i_funArgs); + txt = lm_185(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" out;\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_185(txt, i_funArgs); + txt = lm_186(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("out = _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_186(txt, i_funArgs); + txt = lm_187(txt, i_funArgs); txt = Tpl.popIter(txt); 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_187(txt, i_outVars); + txt = lm_188(txt, i_outVars); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("return 0;\n")); @@ -8223,7 +8309,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_188(txt, i_funArgs); + txt = lm_189(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8271,7 +8357,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_189(txt, i_funArgs); + txt = lm_190(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8281,7 +8367,7 @@ algorithm txt = Tpl.writeText(txt, 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 = lm_190(txt, i_funArgs, i_structVar); + txt = lm_191(txt, i_funArgs, i_structVar); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retVar); @@ -8346,7 +8432,7 @@ algorithm end matchcontinue; end readInVar; -protected function fun_193 +protected function fun_194 input Tpl.Text in_txt; input DAE.ExpType in_i_tp; input String in_i_subvar_name; @@ -8387,9 +8473,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); then txt; end matchcontinue; -end fun_193; +end fun_194; -protected function lm_194 +protected function lm_195 input Tpl.Text in_txt; input list in_items; input String in_i_prefix; @@ -8416,9 +8502,9 @@ algorithm DAE.ExpType i_tp; DAE.ExpVar i_subvar; equation - txt = fun_193(txt, i_tp, i_subvar_name, i_prefix); + txt = fun_194(txt, i_tp, i_subvar_name, i_prefix); txt = Tpl.nextIter(txt); - txt = lm_194(txt, rest, i_prefix); + txt = lm_195(txt, rest, i_prefix); then txt; case ( txt, @@ -8427,10 +8513,10 @@ algorithm local list rest; equation - txt = lm_194(txt, rest, i_prefix); + txt = lm_195(txt, rest, i_prefix); then txt; end matchcontinue; -end lm_194; +end lm_195; public function readInVarRecordMembers input Tpl.Text in_txt; @@ -8452,7 +8538,7 @@ algorithm list i_vl; equation 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_194(txt, i_vl, i_prefix); + txt = lm_195(txt, i_vl, i_prefix); txt = Tpl.popIter(txt); then txt; @@ -8507,7 +8593,7 @@ algorithm end matchcontinue; end writeOutVar; -protected function fun_197 +protected function fun_198 input Tpl.Text in_txt; input DAE.ExpType in_i_tp; input Integer in_i_index; @@ -8558,9 +8644,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); then txt; end matchcontinue; -end fun_197; +end fun_198; -protected function lm_198 +protected function lm_199 input Tpl.Text in_txt; input list in_items; input Integer in_i_index; @@ -8591,9 +8677,9 @@ algorithm DAE.ExpType i_tp; DAE.ExpVar i_subvar; equation - txt = fun_197(txt, i_tp, i_index, i_subvar_name, i_prefix); + txt = fun_198(txt, i_tp, i_index, i_subvar_name, i_prefix); txt = Tpl.nextIter(txt); - txt = lm_198(txt, rest, i_index, i_prefix); + txt = lm_199(txt, rest, i_index, i_prefix); then txt; case ( txt, @@ -8603,12 +8689,12 @@ algorithm local list rest; equation - txt = lm_198(txt, rest, i_index, i_prefix); + txt = lm_199(txt, rest, i_index, i_prefix); then txt; end matchcontinue; -end lm_198; +end lm_199; -protected function fun_199 +protected function fun_200 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_args; @@ -8634,7 +8720,7 @@ algorithm txt = Tpl.writeText(txt, i_args); then txt; end matchcontinue; -end fun_199; +end fun_200; public function writeOutVarRecordMembers input Tpl.Text in_txt; @@ -8664,13 +8750,13 @@ algorithm equation i_basename = underscorePath(emptyTxt, i_n); i_args = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_args = lm_198(i_args, i_vl, i_index, i_prefix); + i_args = lm_199(i_args, i_vl, i_index, i_prefix); i_args = Tpl.popIter(i_args); txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); txt = Tpl.writeText(txt, i_basename); txt = Tpl.writeTok(txt, Tpl.ST_STRING("__desc")); str_2 = Tpl.textString(i_args); - txt = fun_199(txt, str_2, i_args); + txt = fun_200(txt, str_2, i_args); txt = Tpl.writeTok(txt, Tpl.ST_STRING(", TYPE_DESC_NONE")); then txt; @@ -8682,7 +8768,7 @@ algorithm end matchcontinue; end writeOutVarRecordMembers; -protected function fun_201 +protected function fun_202 input Tpl.Text in_txt; input String in_i_outStruct; input DAE.ComponentRef in_i_var_name; @@ -8715,9 +8801,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_201; +end fun_202; -protected function fun_202 +protected function fun_203 input Tpl.Text in_txt; input String in_i_outStruct; input Integer in_i_i; @@ -8752,9 +8838,9 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i)); then txt; end matchcontinue; -end fun_202; +end fun_203; -protected function lm_203 +protected function lm_204 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -8787,7 +8873,7 @@ algorithm equation (txt, i_varInits, i_varDecls) = daeExp(txt, i_exp, SimCode.contextOther, i_varInits, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_varInits) = lm_203(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_204(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8797,12 +8883,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_varInits) = lm_203(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_204(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); end matchcontinue; -end lm_203; +end lm_204; -protected function fun_204 +protected function fun_205 input Tpl.Text in_txt; input list in_i_instDims; input Tpl.Text in_i_instDimsInit; @@ -8853,7 +8939,7 @@ algorithm i_varInits = Tpl.writeTok(i_varInits, Tpl.ST_NEW_LINE()); then (txt, i_varInits); end matchcontinue; -end fun_204; +end fun_205; public function varInit input Tpl.Text in_txt; @@ -8890,12 +8976,12 @@ algorithm Tpl.Text i_instDimsInit; Tpl.Text i_varName; equation - i_varDecls = fun_201(i_varDecls, i_outStruct, i_var_name, i_var); - i_varName = fun_202(emptyTxt, i_outStruct, i_i, i_var_name); + i_varDecls = fun_202(i_varDecls, i_outStruct, i_var_name, i_var); + i_varName = fun_203(emptyTxt, i_outStruct, i_i, i_var_name); i_instDimsInit = Tpl.pushIter(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_203(i_instDimsInit, i_instDims, i_varDecls, i_varInits); + (i_instDimsInit, i_varDecls, i_varInits) = lm_204(i_instDimsInit, i_instDims, i_varDecls, i_varInits); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_varInits) = fun_204(txt, i_instDims, i_instDimsInit, i_varName, i_var_ty, i_varInits); + (txt, i_varInits) = fun_205(txt, i_instDims, i_instDimsInit, i_varName, i_var_ty, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8908,7 +8994,7 @@ algorithm end matchcontinue; end varInit; -protected function lm_206 +protected function lm_207 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -8941,7 +9027,7 @@ algorithm equation (txt, i_varInits, i_varDecls) = daeExp(txt, i_exp, SimCode.contextOther, i_varInits, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_varInits) = lm_206(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_207(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8951,12 +9037,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_varInits) = lm_206(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_207(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); end matchcontinue; -end lm_206; +end lm_207; -protected function fun_207 +protected function fun_208 input Tpl.Text in_txt; input list in_i_instDims; input Tpl.Text in_i_instDimsInit; @@ -9033,7 +9119,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then (txt, i_varInits); end matchcontinue; -end fun_207; +end fun_208; public function varOutput input Tpl.Text in_txt; @@ -9070,9 +9156,9 @@ algorithm Tpl.Text i_instDimsInit; equation i_instDimsInit = Tpl.pushIter(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_206(i_instDimsInit, i_instDims, i_varDecls, i_varInits); + (i_instDimsInit, i_varDecls, i_varInits) = lm_207(i_instDimsInit, i_instDims, i_varDecls, i_varInits); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_varInits) = fun_207(txt, i_instDims, i_instDimsInit, i_var_ty, i_varInits, i_var_name, i_i, i_dest); + (txt, i_varInits) = fun_208(txt, i_instDims, i_instDimsInit, i_var_ty, i_varInits, i_var_name, i_i, i_dest); then (txt, i_varDecls, i_varInits); case ( txt, @@ -9085,7 +9171,7 @@ algorithm end matchcontinue; end varOutput; -protected function lm_209 +protected function lm_210 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9118,7 +9204,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = extArg(txt, i_it, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_209(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_210(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -9128,12 +9214,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_209(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_210(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_209; +end lm_210; -protected function fun_210 +protected function fun_211 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -9157,9 +9243,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_210; +end fun_211; -protected function lm_211 +protected function lm_212 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9187,7 +9273,7 @@ algorithm equation (txt, i_varDecls) = extFunCallVardecl(txt, i_it, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_211(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_212(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9196,12 +9282,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_211(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_212(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_211; +end lm_212; -protected function fun_212 +protected function fun_213 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; input Tpl.Text in_i_varDecls; @@ -9229,9 +9315,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_212; +end fun_213; -protected function lm_213 +protected function lm_214 input Tpl.Text in_txt; input list in_items; @@ -9254,7 +9340,7 @@ algorithm equation txt = extFunCallVarcopy(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_213(txt, rest); + txt = lm_214(txt, rest); then txt; case ( txt, @@ -9262,12 +9348,12 @@ algorithm local list rest; equation - txt = lm_213(txt, rest); + txt = lm_214(txt, rest); then txt; end matchcontinue; -end lm_213; +end lm_214; -protected function fun_214 +protected function fun_215 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -9290,7 +9376,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_214; +end fun_215; public function extFunCall input Tpl.Text in_txt; @@ -9324,14 +9410,14 @@ algorithm equation i_fname = underscorePath(emptyTxt, i_name); i_args = Tpl.pushIter(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_209(i_args, i_extArgs, i_varDecls, i_preExp); + (i_args, i_varDecls, i_preExp) = lm_210(i_args, i_extArgs, i_varDecls, i_preExp); i_args = Tpl.popIter(i_args); - i_returnAssign = fun_210(emptyTxt, i_extReturn); + i_returnAssign = fun_211(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_211(txt, i_extArgs, i_varDecls); + (txt, i_varDecls) = lm_212(txt, i_extArgs, i_varDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - (txt, i_varDecls) = fun_212(txt, i_extReturn, i_varDecls); + (txt, i_varDecls) = fun_213(txt, i_extReturn, i_varDecls); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_returnAssign); txt = Tpl.writeStr(txt, i_extName); @@ -9339,10 +9425,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_213(txt, i_extArgs); + txt = lm_214(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - txt = fun_214(txt, i_extReturn); + txt = fun_215(txt, i_extReturn); then (txt, i_preExp, i_varDecls); case ( txt, @@ -9353,7 +9439,7 @@ algorithm end matchcontinue; end extFunCall; -protected function fun_216 +protected function fun_217 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input DAE.ComponentRef in_i_c; @@ -9395,9 +9481,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then (txt, i_varDecls); end matchcontinue; -end fun_216; +end fun_217; -protected function fun_217 +protected function fun_218 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9435,7 +9521,7 @@ algorithm i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_NEW_LINE()); then (txt, i_varDecls); end matchcontinue; -end fun_217; +end fun_218; public function extFunCallVardecl input Tpl.Text in_txt; @@ -9458,7 +9544,7 @@ algorithm DAE.ComponentRef i_c; DAE.ExpType i_ty; equation - (txt, i_varDecls) = fun_216(txt, i_ty, i_c, i_varDecls); + (txt, i_varDecls) = fun_217(txt, i_ty, i_c, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9469,7 +9555,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - (txt, i_varDecls) = fun_217(txt, i_oi, i_c, i_ty, i_varDecls); + (txt, i_varDecls) = fun_218(txt, i_oi, i_c, i_ty, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9479,7 +9565,7 @@ algorithm end matchcontinue; end extFunCallVardecl; -protected function fun_219 +protected function fun_220 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9516,7 +9602,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext;")); then txt; end matchcontinue; -end fun_219; +end fun_220; public function extFunCallVarcopy input Tpl.Text in_txt; @@ -9536,7 +9622,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - txt = fun_219(txt, i_oi, i_c, i_ty); + txt = fun_220(txt, i_oi, i_c, i_ty); then txt; case ( txt, @@ -9545,7 +9631,7 @@ algorithm end matchcontinue; end extFunCallVarcopy; -protected function fun_221 +protected function fun_222 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9575,9 +9661,9 @@ algorithm txt = Tpl.writeStr(txt, intString(i_oi)); then txt; end matchcontinue; -end fun_221; +end fun_222; -protected function fun_222 +protected function fun_223 input Tpl.Text in_txt; input Integer in_i_oi; @@ -9598,9 +9684,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_222; +end fun_223; -protected function fun_223 +protected function fun_224 input Tpl.Text in_txt; input DAE.ExpType in_i_t; @@ -9621,9 +9707,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_223; +end fun_224; -protected function fun_224 +protected function fun_225 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ExpType in_i_t; @@ -9640,7 +9726,7 @@ algorithm 0, i_t ) equation - txt = fun_223(txt, i_t); + txt = fun_224(txt, i_t); then txt; case ( txt, @@ -9650,9 +9736,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_224; +end fun_225; -protected function fun_225 +protected function fun_226 input Tpl.Text in_txt; input Integer in_i_outputIndex; input DAE.ComponentRef in_i_c; @@ -9682,7 +9768,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_outputIndex)); then txt; end matchcontinue; -end fun_225; +end fun_226; public function extArg input Tpl.Text in_txt; @@ -9712,7 +9798,7 @@ algorithm Tpl.Text i_shortTypeStr; Tpl.Text i_name; equation - i_name = fun_221(emptyTxt, i_oi, i_c); + i_name = fun_222(emptyTxt, i_oi, i_c); i_shortTypeStr = expTypeShort(emptyTxt, i_t); txt = Tpl.writeTok(txt, Tpl.ST_STRING("data_of_")); txt = Tpl.writeText(txt, i_shortTypeStr); @@ -9733,8 +9819,8 @@ algorithm Tpl.Text i_suffix; Tpl.Text i_prefix; equation - i_prefix = fun_222(emptyTxt, i_oi); - i_suffix = fun_224(emptyTxt, i_oi, i_t); + i_prefix = fun_223(emptyTxt, i_oi); + i_suffix = fun_225(emptyTxt, i_oi, i_t); txt = Tpl.writeText(txt, i_prefix); txt = cref(txt, i_c); txt = Tpl.writeText(txt, i_suffix); @@ -9764,7 +9850,7 @@ algorithm Tpl.Text i_typeStr; equation i_typeStr = expTypeShort(emptyTxt, i_type__); - i_name = fun_225(emptyTxt, i_outputIndex, i_c); + i_name = fun_226(emptyTxt, i_outputIndex, i_c); (i_dim, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, SimCode.contextOther, i_preExp, i_varDecls); txt = Tpl.writeTok(txt, Tpl.ST_STRING("size_of_dimension_")); txt = Tpl.writeText(txt, i_typeStr); @@ -9783,7 +9869,7 @@ algorithm end matchcontinue; end extArg; -protected function lm_227 +protected function lm_228 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9811,7 +9897,7 @@ algorithm equation (txt, i_varDecls) = funStatement(txt, i_stmt, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_227(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_228(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9820,10 +9906,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_227(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_228(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_227; +end lm_228; public function funBody input Tpl.Text txt; @@ -9836,14 +9922,14 @@ protected algorithm i_varDecls := emptyTxt; i_bodyPart := Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_bodyPart, i_varDecls) := lm_227(i_bodyPart, i_body, i_varDecls); + (i_bodyPart, i_varDecls) := lm_228(i_bodyPart, i_body, i_varDecls); i_bodyPart := Tpl.popIter(i_bodyPart); out_txt := Tpl.writeText(txt, i_varDecls); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeText(out_txt, i_bodyPart); end funBody; -protected function lm_229 +protected function lm_230 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9871,7 +9957,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, SimCode.contextOther, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_229(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_230(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9880,10 +9966,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_229(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_230(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_229; +end lm_230; public function funStatement input Tpl.Text in_txt; @@ -9906,7 +9992,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_229(txt, i_statementLst, i_varDecls); + (txt, i_varDecls) = lm_230(txt, i_statementLst, i_varDecls); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -9919,7 +10005,7 @@ algorithm end matchcontinue; end funStatement; -protected function fun_231 +protected function fun_232 input Tpl.Text in_txt; input String in_it; input DAE.ComponentRef in_i_cref; @@ -9978,9 +10064,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_231; +end fun_232; -protected function lm_232 +protected function lm_233 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_retStruct; @@ -10028,7 +10114,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_232(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -10040,12 +10126,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_232(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_232; +end lm_233; -protected function lm_233 +protected function lm_234 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10077,7 +10163,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_233(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10087,12 +10173,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_233(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_233; +end lm_234; -protected function fun_234 +protected function fun_235 input Tpl.Text in_txt; input Option in_i_rng_expOption; input Tpl.Text in_i_varDecls; @@ -10131,9 +10217,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_234; +end fun_235; -protected function lm_235 +protected function lm_236 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10165,7 +10251,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_235(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10175,12 +10261,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_235(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_235; +end lm_236; -protected function lm_236 +protected function lm_237 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10212,7 +10298,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_237(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10222,12 +10308,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_237(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_236; +end lm_237; -protected function fun_237 +protected function fun_238 input Tpl.Text in_txt; input Boolean in_i_boolean; input Tpl.Text in_i_ivar; @@ -10289,9 +10375,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_237; +end fun_238; -protected function lm_238 +protected function lm_239 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10323,7 +10409,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_238(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10333,12 +10419,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_238(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_238; +end lm_239; -protected function fun_239 +protected function fun_240 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -10370,9 +10456,9 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_239; +end fun_240; -protected function lm_240 +protected function lm_241 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_doneVar; @@ -10426,7 +10512,7 @@ algorithm txt = Tpl.popBlock(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("};")); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_240(txt, rest, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, rest, i_doneVar, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10437,12 +10523,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_240(txt, rest, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, rest, i_doneVar, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_240; +end lm_241; -protected function lm_241 +protected function lm_242 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10474,7 +10560,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_241(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10484,12 +10570,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_241(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_241; +end lm_242; -protected function lm_242 +protected function lm_243 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10521,7 +10607,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_243(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10531,10 +10617,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_243(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_242; +end lm_243; public function algStatement input Tpl.Text in_txt; @@ -10625,7 +10711,7 @@ algorithm (i_expPart, i_preExp, i_varDecls) = daeExp(emptyTxt, i_e, i_context, i_preExp, i_varDecls); (txt_2, i_preExp, i_varDecls) = indexSpecFromCref(emptyTxt, i_cref, i_context, i_preExp, i_varDecls); str_3 = Tpl.textString(txt_2); - txt = fun_231(txt, str_3, i_cref, i_expPart, i_t, i_preExp); + txt = fun_232(txt, str_3, i_cref, i_expPart, i_t, i_preExp); then (txt, i_varDecls); case ( txt, @@ -10643,7 +10729,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_232(txt, i_expExpLst, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, i_expExpLst, i_retStruct, i_varDecls, i_preExp, i_context); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -10667,7 +10753,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_233(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10709,7 +10795,7 @@ algorithm (i_r3, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); i_preExp = emptyTxt; (i_er1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rng_exp, i_context, i_preExp, i_varDecls); - (i_er2, i_varDecls, i_preExp) = fun_234(emptyTxt, i_rng_expOption, i_varDecls, i_preExp, i_context); + (i_er2, i_varDecls, i_preExp) = fun_235(emptyTxt, i_rng_expOption, i_varDecls, i_preExp, i_context); (i_er3, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rng_range, i_context, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); @@ -10757,7 +10843,7 @@ algorithm txt = Tpl.writeText(txt, i_stateVar); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" = get_memory_state();\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_235(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("restore_memory_state(")); @@ -10802,10 +10888,10 @@ algorithm i_preExp = emptyTxt; (i_evar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); i_statements = Tpl.pushIter(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_236(i_statements, i_statementLst, i_varDecls, i_context); + (i_statements, i_varDecls) = lm_237(i_statements, i_statementLst, i_varDecls, i_context); i_statements = Tpl.popIter(i_statements); i_id = Tpl.writeStr(emptyTxt, i_ident); - i_stmtStuff = fun_237(emptyTxt, i_boolean, i_ivar, i_identType, i_tvar, i_evar, i_arrayType, i_id); + i_stmtStuff = fun_238(emptyTxt, i_boolean, i_ivar, i_identType, i_tvar, i_evar, i_arrayType, i_id); txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("{\n")); @@ -10864,7 +10950,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_238(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10901,7 +10987,7 @@ algorithm local DAE.Statement i_when; equation - (txt, i_varDecls) = fun_239(txt, i_context, i_varDecls, i_when); + (txt, i_varDecls) = fun_240(txt, i_context, i_varDecls, i_when); then (txt, i_varDecls); case ( txt, @@ -10943,7 +11029,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_240(txt, i_caseStmt, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, i_caseStmt, i_doneVar, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10976,7 +11062,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(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_241(i_body, i_tryBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_242(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)); @@ -10995,7 +11081,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(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_242(i_body, i_catchBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_243(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)); @@ -11045,7 +11131,7 @@ algorithm end matchcontinue; end algStatement; -protected function lm_244 +protected function lm_245 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11077,7 +11163,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_244(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_245(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11087,12 +11173,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_244(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_245(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_244; +end lm_245; -protected function lm_245 +protected function lm_246 input Tpl.Text in_txt; input list in_items; @@ -11117,7 +11203,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_it)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_245(txt, rest); + txt = lm_246(txt, rest); then txt; case ( txt, @@ -11125,10 +11211,10 @@ algorithm local list rest; equation - txt = lm_245(txt, rest); + txt = lm_246(txt, rest); then txt; end matchcontinue; -end lm_245; +end lm_246; public function algStatementWhen input Tpl.Text in_txt; @@ -11161,14 +11247,14 @@ algorithm equation (i_preIf, i_varDecls) = algStatementWhenPre(emptyTxt, i_it, i_varDecls); i_statements = Tpl.pushIter(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_244(i_statements, i_statementLst, i_varDecls, i_context); + (i_statements, i_varDecls) = lm_245(i_statements, i_statementLst, i_varDecls, i_context); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(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_245(txt, i_helpVarIndices); + txt = lm_246(txt, i_helpVarIndices); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -11187,7 +11273,7 @@ algorithm end matchcontinue; end algStatementWhen; -protected function fun_247 +protected function fun_248 input Tpl.Text in_txt; input Option in_i_elseWhen; input Tpl.Text in_i_varDecls; @@ -11215,9 +11301,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_247; +end fun_248; -protected function fun_248 +protected function fun_249 input Tpl.Text in_txt; input Option in_i_when_elseWhen; input Tpl.Text in_i_varDecls; @@ -11245,9 +11331,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_248; +end fun_249; -protected function fun_249 +protected function fun_250 input Tpl.Text in_txt; input list in_i_helpVarIndices; input DAE.Exp in_i_when_exp; @@ -11276,7 +11362,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_248(emptyTxt, i_when_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_249(emptyTxt, i_when_elseWhen, i_varDecls); i_preExp = emptyTxt; (i_res, i_preExp, i_varDecls) = daeExp(emptyTxt, i_when_exp, SimCode.contextSimulationDescrete, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -11296,7 +11382,7 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_249; +end fun_250; public function algStatementWhenPre input Tpl.Text in_txt; @@ -11323,7 +11409,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_247(emptyTxt, i_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_248(emptyTxt, i_elseWhen, i_varDecls); i_preExp = emptyTxt; (i_assignments, i_preExp, i_varDecls) = algStatementWhenPreAssigns(emptyTxt, i_el, i_helpVarIndices, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -11342,7 +11428,7 @@ algorithm list i_helpVarIndices; DAE.Statement i_when; equation - (txt, i_varDecls) = fun_249(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); + (txt, i_varDecls) = fun_250(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); then (txt, i_varDecls); case ( txt, @@ -11352,7 +11438,7 @@ algorithm end matchcontinue; end algStatementWhenPre; -protected function lm_251 +protected function lm_252 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11380,7 +11466,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, SimCode.contextSimulationDescrete, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_251(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_252(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -11389,12 +11475,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_251(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_252(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_251; +end lm_252; -protected function lm_252 +protected function lm_253 input Tpl.Text in_txt; input list in_items; @@ -11419,7 +11505,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_it)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_252(txt, rest); + txt = lm_253(txt, rest); then txt; case ( txt, @@ -11427,10 +11513,10 @@ algorithm local list rest; equation - txt = lm_252(txt, rest); + txt = lm_253(txt, rest); then txt; end matchcontinue; -end lm_252; +end lm_253; public function algStatementWhenElse input Tpl.Text in_txt; @@ -11458,12 +11544,12 @@ algorithm Tpl.Text i_statements; equation i_statements = Tpl.pushIter(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_251(i_statements, i_when_statementLst, i_varDecls); + (i_statements, i_varDecls) = lm_252(i_statements, i_when_statementLst, i_varDecls); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(emptyTxt, i_when_elseWhen, i_varDecls); txt = Tpl.writeTok(txt, Tpl.ST_STRING("else 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_252(txt, i_when_helpVarIndices); + txt = lm_253(txt, i_when_helpVarIndices); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -11481,7 +11567,7 @@ algorithm end matchcontinue; end algStatementWhenElse; -protected function fun_254 +protected function fun_255 input Tpl.Text in_txt; input list in_i_ints; input DAE.Exp in_i_firstExp; @@ -11530,7 +11616,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_254; +end fun_255; public function algStatementWhenPreAssigns input Tpl.Text in_txt; @@ -11567,7 +11653,7 @@ algorithm list i_restExps; DAE.Exp i_firstExp; equation - (txt, i_varDecls, i_preExp) = fun_254(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); + (txt, i_varDecls, i_preExp) = fun_255(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); then (txt, i_preExp, i_varDecls); case ( txt, @@ -11579,7 +11665,7 @@ algorithm end matchcontinue; end algStatementWhenPreAssigns; -protected function lm_256 +protected function lm_257 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11611,7 +11697,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_256(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11621,12 +11707,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_256(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_256; +end lm_257; -protected function lm_257 +protected function lm_258 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11658,7 +11744,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11668,10 +11754,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_257; +end lm_258; public function elseExpr input Tpl.Text in_txt; @@ -11716,7 +11802,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_256(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -11736,7 +11822,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_257(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -11751,7 +11837,7 @@ algorithm end matchcontinue; end elseExpr; -protected function fun_259 +protected function fun_260 input Tpl.Text in_txt; input Boolean in_it; input DAE.ComponentRef in_i_cref_componentRef; @@ -11796,7 +11882,7 @@ algorithm txt = cref(txt, i_cref_componentRef); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_259; +end fun_260; public function scalarLhsCref input Tpl.Text in_txt; @@ -11829,7 +11915,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefNoSub(i_cref_componentRef); - (txt, i_varDecls, i_preExp) = fun_259(txt, ret_0, i_cref_componentRef, i_varDecls, i_preExp, i_context, i_cref); + (txt, i_varDecls, i_preExp) = fun_260(txt, ret_0, i_cref_componentRef, i_varDecls, i_preExp, i_context, i_cref); then (txt, i_preExp, i_varDecls); case ( txt, @@ -11924,7 +12010,7 @@ algorithm end matchcontinue; end rhsCrefType; -protected function fun_263 +protected function fun_264 input Tpl.Text in_txt; input Boolean in_i_bool; @@ -11947,7 +12033,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then txt; end matchcontinue; -end fun_263; +end fun_264; public function daeExp input Tpl.Text in_txt; @@ -12009,7 +12095,7 @@ algorithm local Boolean i_bool; equation - txt = fun_263(txt, i_bool); + txt = fun_264(txt, i_bool); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12267,7 +12353,7 @@ algorithm out_txt := Tpl.writeText(txt, i_strVar); end daeExpSconst; -protected function lm_266 +protected function lm_267 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -12304,7 +12390,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_266(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_267(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -12315,12 +12401,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_266(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_267(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_266; +end lm_267; -protected function fun_267 +protected function fun_268 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -12396,7 +12482,7 @@ algorithm ret_3 = listLength(i_subs); i_dimsLenStr = Tpl.writeStr(emptyTxt, intString(ret_3)); i_dimsValuesStr = Tpl.pushIter(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_266(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, i_varDecls, i_preExp) = lm_267(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); i_dimsValuesStr = Tpl.popIter(i_dimsValuesStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING("(*")); txt = Tpl.writeText(txt, i_arrayType); @@ -12409,9 +12495,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("))")); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_267; +end fun_268; -protected function fun_268 +protected function fun_269 input Tpl.Text in_txt; input DAE.ExpType in_i_cref_ty; @@ -12432,9 +12518,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_268; +end fun_269; -protected function fun_269 +protected function fun_270 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -12471,7 +12557,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefSubIsScalar(i_cref_componentRef); - (txt, i_preExp, i_varDecls) = fun_267(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_268(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12485,14 +12571,14 @@ algorithm local Tpl.Text i_cast; equation - i_cast = fun_268(emptyTxt, i_cref_ty); + i_cast = fun_269(emptyTxt, i_cref_ty); txt = Tpl.writeText(txt, i_cast); txt = cref(txt, i_cref_componentRef); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_269; +end fun_270; -protected function fun_270 +protected function fun_271 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_preExp; @@ -12529,7 +12615,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefNoSub(i_cref_componentRef); - (txt, i_preExp, i_varDecls) = fun_269(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_270(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12546,7 +12632,7 @@ algorithm txt = Tpl.writeStr(txt, str_1); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_270; +end fun_271; public function daeExpCrefRhs input Tpl.Text in_txt; @@ -12596,7 +12682,7 @@ algorithm equation (txt_0, i_preExp, i_varDecls) = daeExpCrefRhsArrayBox(emptyTxt, i_cref, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(txt_0); - (txt, i_preExp, i_varDecls) = fun_270(txt, str_1, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_271(txt, str_1, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12623,7 +12709,7 @@ algorithm end matchcontinue; end daeExpCrefRhs; -protected function fun_272 +protected function fun_273 input Tpl.Text in_txt; input DAE.Subscript in_i_sub; input Tpl.Text in_i_varDecls; @@ -12696,9 +12782,9 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_272; +end fun_273; -protected function lm_273 +protected function lm_274 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -12733,9 +12819,9 @@ algorithm list rest; DAE.Subscript i_sub; equation - (txt, i_varDecls, i_preExp) = fun_272(txt, i_sub, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = fun_273(txt, i_sub, i_varDecls, i_preExp, i_context); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_273(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_274(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -12746,10 +12832,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_273(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_274(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_273; +end lm_274; public function daeExpCrefRhsIndexSpec input Tpl.Text txt; @@ -12770,7 +12856,7 @@ algorithm ret_1 := listLength(i_subs); i_nridx__str := Tpl.writeStr(emptyTxt, intString(ret_1)); i_idx__str := Tpl.pushIter(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_273(i_idx__str, i_subs, i_varDecls, i_preExp, i_context); + (i_idx__str, out_i_varDecls, out_i_preExp) := lm_274(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(emptyTxt, "index_spec_t", out_i_varDecls); out_i_preExp := Tpl.writeTok(out_i_preExp, Tpl.ST_STRING("create_index_spec(&")); @@ -12784,7 +12870,7 @@ algorithm out_txt := Tpl.writeText(txt, i_tmp); end daeExpCrefRhsIndexSpec; -protected function lm_275 +protected function lm_276 input Tpl.Text in_txt; input list> in_items; @@ -12808,7 +12894,7 @@ algorithm equation txt = Tpl.writeStr(txt, intString(i_i)); txt = Tpl.nextIter(txt); - txt = lm_275(txt, rest); + txt = lm_276(txt, rest); then txt; case ( txt, @@ -12816,12 +12902,12 @@ algorithm local list> rest; equation - txt = lm_275(txt, rest); + txt = lm_276(txt, rest); then txt; end matchcontinue; -end lm_275; +end lm_276; -protected function fun_276 +protected function fun_277 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.ComponentRef in_i_cref_componentRef; @@ -12863,7 +12949,7 @@ algorithm ret_3 = listLength(i_dims); i_dimsLenStr = Tpl.writeStr(emptyTxt, intString(ret_3)); i_dimsValuesStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_dimsValuesStr = lm_275(i_dimsValuesStr, i_dims); + i_dimsValuesStr = lm_276(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(&")); @@ -12888,7 +12974,7 @@ algorithm _ ) then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_276; +end fun_277; public function daeExpCrefRhsArrayBox input Tpl.Text in_txt; @@ -12920,7 +13006,7 @@ algorithm DAE.ExpType i_aty; DAE.Exp i_cref; equation - (txt, i_preExp, i_varDecls) = fun_276(txt, i_context, i_cref_componentRef, i_preExp, i_dims, i_varDecls, i_aty); + (txt, i_preExp, i_varDecls) = fun_277(txt, i_context, i_cref_componentRef, i_preExp, i_dims, i_varDecls, i_aty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12932,7 +13018,7 @@ algorithm end matchcontinue; end daeExpCrefRhsArrayBox; -protected function fun_278 +protected function fun_279 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -12955,9 +13041,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_278; +end fun_279; -protected function fun_279 +protected function fun_280 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -12980,9 +13066,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_279; +end fun_280; -protected function fun_280 +protected function fun_281 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -13005,9 +13091,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_280; +end fun_281; -protected function fun_281 +protected function fun_282 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -13030,9 +13116,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_281; +end fun_282; -protected function fun_282 +protected function fun_283 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e2; @@ -13155,7 +13241,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_278(emptyTxt, i_ty); + i_type = fun_279(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13181,7 +13267,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_279(emptyTxt, i_ty); + i_type = fun_280(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13207,7 +13293,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_280(emptyTxt, i_ty); + i_type = fun_281(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13233,7 +13319,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_281(emptyTxt, i_ty); + i_type = fun_282(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13258,7 +13344,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpBinary:ERR")); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_282; +end fun_283; public function daeExpBinary input Tpl.Text in_txt; @@ -13293,7 +13379,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_282(txt, i_operator, i_e2, i_e1, i_preExp, i_varDecls); + (txt, i_preExp, i_varDecls) = fun_283(txt, i_operator, i_e2, i_e1, i_preExp, i_varDecls); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13305,7 +13391,7 @@ algorithm end matchcontinue; end daeExpBinary; -protected function fun_284 +protected function fun_285 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e; @@ -13357,7 +13443,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpUnary:ERR")); then txt; end matchcontinue; -end fun_284; +end fun_285; public function daeExpUnary input Tpl.Text in_txt; @@ -13389,7 +13475,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_284(txt, i_operator, i_e); + txt = fun_285(txt, i_operator, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13401,7 +13487,7 @@ algorithm end matchcontinue; end daeExpUnary; -protected function fun_286 +protected function fun_287 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e2; @@ -13448,7 +13534,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpLbinary:ERR")); then txt; end matchcontinue; -end fun_286; +end fun_287; public function daeExpLbinary input Tpl.Text in_txt; @@ -13483,7 +13569,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - txt = fun_286(txt, i_operator, i_e2, i_e1); + txt = fun_287(txt, i_operator, i_e2, i_e1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13495,7 +13581,7 @@ algorithm end matchcontinue; end daeExpLbinary; -protected function fun_288 +protected function fun_289 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e; @@ -13522,7 +13608,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_288; +end fun_289; public function daeExpLunary input Tpl.Text in_txt; @@ -13554,7 +13640,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_288(txt, i_operator, i_e); + txt = fun_289(txt, i_operator, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13566,7 +13652,7 @@ algorithm end matchcontinue; end daeExpLunary; -protected function fun_290 +protected function fun_291 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -13869,9 +13955,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpRelation:ERR")); then txt; end matchcontinue; -end fun_290; +end fun_291; -protected function fun_291 +protected function fun_292 input Tpl.Text in_txt; input String in_it; input DAE.Operator in_i_rel_operator; @@ -13910,7 +13996,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); - txt = fun_290(txt, i_rel_operator, i_e2, i_e1); + txt = fun_291(txt, i_rel_operator, i_e2, i_e1); then (txt, i_varDecls, i_preExp); case ( txt, @@ -13927,7 +14013,7 @@ algorithm txt = Tpl.writeStr(txt, str_1); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_291; +end fun_292; public function daeExpRelation input Tpl.Text in_txt; @@ -13963,7 +14049,7 @@ algorithm equation (txt_0, i_preExp, i_varDecls) = daeExpRelationSim(emptyTxt, i_rel, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(txt_0); - (txt, i_varDecls, i_preExp) = fun_291(txt, str_1, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_292(txt, str_1, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13975,7 +14061,7 @@ algorithm end matchcontinue; end daeExpRelation; -protected function fun_293 +protected function fun_294 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -14075,9 +14161,9 @@ algorithm i_preExp ) then (txt, i_preExp); end matchcontinue; -end fun_293; +end fun_294; -protected function fun_294 +protected function fun_295 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.Operator in_i_rel_operator; @@ -14116,7 +14202,7 @@ algorithm (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); (i_res, i_varDecls) = tempDecl(emptyTxt, "modelica_boolean", i_varDecls); - (txt, i_preExp) = fun_293(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); + (txt, i_preExp) = fun_294(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14128,7 +14214,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_294; +end fun_295; public function daeExpRelationSim input Tpl.Text in_txt; @@ -14160,7 +14246,7 @@ algorithm DAE.Exp i_rel_exp1; DAE.Exp i_rel; equation - (txt, i_varDecls, i_preExp) = fun_294(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_295(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -14257,7 +14343,7 @@ algorithm end matchcontinue; end daeExpIf; -protected function fun_297 +protected function fun_298 input Tpl.Text in_txt; input DAE.ExpType in_i_arg_ty; @@ -14278,9 +14364,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_297; +end fun_298; -protected function lm_298 +protected function lm_299 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14317,7 +14403,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_298(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14328,12 +14414,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_298(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_298; +end lm_299; -protected function lm_299 +protected function lm_300 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14370,7 +14456,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_299(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_300(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14381,12 +14467,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_300(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_299; +end lm_300; -protected function fun_300 +protected function fun_301 input Tpl.Text in_txt; input Boolean in_i_builtin; input Tpl.Text in_i_retType; @@ -14420,9 +14506,9 @@ algorithm txt = Tpl.writeText(txt, i_retVar); then txt; end matchcontinue; -end fun_300; +end fun_301; -protected function lm_301 +protected function lm_302 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14459,7 +14545,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_301(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_302(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14470,10 +14556,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_301(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_302(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_301; +end lm_302; public function daeExpCall input Tpl.Text in_txt; @@ -14509,7 +14595,7 @@ algorithm equation i_retType = expTypeArrayIf(emptyTxt, i_arg_ty); (i_retVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_retType), i_varDecls); - i_cast = fun_297(emptyTxt, i_arg_ty); + i_cast = fun_298(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); @@ -14752,7 +14838,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_298(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_299(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_preExp = daeExpCallBuiltinPrefix(i_preExp, i_builtin); @@ -14779,7 +14865,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_299(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_300(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_retType = Tpl.writeText(emptyTxt, i_funName); @@ -14793,7 +14879,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_300(txt, i_builtin, i_retType, i_retVar); + txt = fun_301(txt, i_builtin, i_retType, i_retVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -14811,7 +14897,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_301(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_302(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_retType = Tpl.writeText(emptyTxt, i_funName); @@ -14864,7 +14950,7 @@ algorithm end matchcontinue; end daeExpCallBuiltinPrefix; -protected function fun_304 +protected function fun_305 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -14885,9 +14971,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_304; +end fun_305; -protected function fun_305 +protected function fun_306 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -14908,9 +14994,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_305; +end fun_306; -protected function lm_306 +protected function lm_307 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14950,7 +15036,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); (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_306(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_307(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14961,10 +15047,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_306(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_307(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_306; +end lm_307; public function daeExpArray input Tpl.Text in_txt; @@ -15003,10 +15089,10 @@ algorithm equation i_arrayTypeStr = expTypeArray(emptyTxt, i_ty); (i_arrayVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_arrayTypeStr), i_varDecls); - i_scalarPrefix = fun_304(emptyTxt, i_scalar); - i_scalarRef = fun_305(emptyTxt, i_scalar); + i_scalarPrefix = fun_305(emptyTxt, i_scalar); + i_scalarRef = fun_306(emptyTxt, i_scalar); i_params = Tpl.pushIter(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_306(i_params, i_array, i_varDecls, i_preExp, i_context); + (i_params, i_varDecls, i_preExp) = lm_307(i_params, i_array, i_varDecls, i_preExp, i_context); 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); @@ -15032,7 +15118,7 @@ algorithm end matchcontinue; end daeExpArray; -protected function lm_308 +protected function lm_309 input Tpl.Text in_txt; input list>> in_items; input Tpl.Text in_i_vars2; @@ -15093,7 +15179,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_308(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_309(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); case ( txt, @@ -15106,10 +15192,10 @@ algorithm local list>> rest; equation - (txt, i_vars2, i_promote, i_varDecls) = lm_308(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_309(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); end matchcontinue; -end lm_308; +end lm_309; public function daeExpMatrix input Tpl.Text in_txt; @@ -15192,7 +15278,7 @@ algorithm i_vars2 = emptyTxt; i_promote = emptyTxt; i_catAlloc = Tpl.pushIter(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_308(i_catAlloc, i_m_scalar, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (i_catAlloc, i_vars2, i_promote, i_varDecls) = lm_309(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); @@ -15220,7 +15306,7 @@ algorithm end matchcontinue; end daeExpMatrix; -protected function fun_310 +protected function fun_311 input Tpl.Text in_txt; input Boolean in_i_b; @@ -15241,9 +15327,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_310; +end fun_311; -protected function fun_311 +protected function fun_312 input Tpl.Text in_txt; input Boolean in_i_b; @@ -15264,9 +15350,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_311; +end fun_312; -protected function lm_312 +protected function lm_313 input Tpl.Text in_txt; input list> in_items; input Tpl.Text in_i_varLstStr; @@ -15316,8 +15402,8 @@ algorithm Tpl.Text i_scalarRefStr; Tpl.Text i_scalarStr; equation - i_scalarStr = fun_310(emptyTxt, i_b); - i_scalarRefStr = fun_311(emptyTxt, i_b); + i_scalarStr = fun_311(emptyTxt, i_b); + i_scalarRefStr = fun_312(emptyTxt, i_b); (i_expVar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_e, i_context, i_preExp, i_varDecls); (i_tmp, i_varDecls) = tempDecl(emptyTxt, i_arrayTypeStr, i_varDecls); i_varLstStr = Tpl.writeTok(i_varLstStr, Tpl.ST_STRING(", &")); @@ -15332,7 +15418,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_312(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_313(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); case ( txt, @@ -15345,10 +15431,10 @@ algorithm local list> rest; equation - (txt, i_varLstStr, i_varDecls, i_preExp) = lm_312(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_313(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); end matchcontinue; -end lm_312; +end lm_313; public function daeExpMatrixRow input Tpl.Text txt; @@ -15367,14 +15453,14 @@ protected algorithm i_varLstStr := emptyTxt; i_preExp2 := Tpl.pushIter(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_312(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_313(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_314 +protected function fun_315 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input Tpl.Text in_i_preExp; @@ -15457,7 +15543,7 @@ algorithm _ ) then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_314; +end fun_315; public function daeExpCast input Tpl.Text in_txt; @@ -15489,7 +15575,7 @@ algorithm Tpl.Text i_expVar; equation (i_expVar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_314(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); + (txt, i_preExp, i_varDecls) = fun_315(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -15501,7 +15587,7 @@ algorithm end matchcontinue; end daeExpCast; -protected function fun_316 +protected function fun_317 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -15548,7 +15634,7 @@ algorithm txt = Tpl.writeText(txt, i_arrName); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_316; +end fun_317; public function daeExpAsub input Tpl.Text in_txt; @@ -15649,7 +15735,7 @@ algorithm equation ret_1 = SimCode.buildCrefExpFromAsub(i_cref, i_subs); (i_arrName, i_preExp, i_varDecls) = daeExpCrefRhs(emptyTxt, ret_1, i_context, i_preExp, i_varDecls); - (txt, i_varDecls, i_preExp) = fun_316(txt, i_context, i_varDecls, i_preExp, i_arrName, i_subs, i_cref_ty); + (txt, i_varDecls, i_preExp) = fun_317(txt, i_context, i_varDecls, i_preExp, i_arrName, i_subs, i_cref_ty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -15723,7 +15809,7 @@ algorithm end matchcontinue; end daeExpSize; -protected function fun_319 +protected function fun_320 input Tpl.Text in_txt; input String in_it; @@ -15744,9 +15830,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_319; +end fun_320; -protected function fun_320 +protected function fun_321 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_accFun; @@ -15773,12 +15859,12 @@ algorithm String str_0; equation str_0 = Tpl.textString(i_accFun); - txt = fun_319(txt, str_0); + txt = fun_320(txt, str_0); then txt; end matchcontinue; -end fun_320; +end fun_321; -protected function fun_321 +protected function fun_322 input Tpl.Text in_txt; input Option in_i_range_expOption; input Tpl.Text in_i_varDecls; @@ -15817,7 +15903,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_321; +end fun_322; public function daeExpReduction input Tpl.Text in_txt; @@ -15875,12 +15961,12 @@ algorithm i_tmpExpPre = emptyTxt; (i_tmpExpVar, i_tmpExpPre, i_varDecls) = daeExp(emptyTxt, i_expr, i_context, i_tmpExpPre, i_varDecls); str_8 = Tpl.textString(i_accFun); - i_cast = fun_320(emptyTxt, str_8, i_accFun); + i_cast = fun_321(emptyTxt, str_8, i_accFun); (i_r1, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_r2, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_r3, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_er1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_range_exp, i_context, i_preExp, i_varDecls); - (i_er2, i_varDecls, i_preExp) = fun_321(emptyTxt, i_range_expOption, i_varDecls, i_preExp, i_context); + (i_er2, i_varDecls, i_preExp) = fun_322(emptyTxt, i_range_expOption, i_varDecls, i_preExp, i_context); (i_er3, i_preExp, i_varDecls) = daeExp(emptyTxt, i_range_range, i_context, i_preExp, i_varDecls); i_preExp = Tpl.writeText(i_preExp, i_res); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING(" = ")); @@ -15964,7 +16050,7 @@ algorithm end matchcontinue; end daeExpReduction; -protected function fun_323 +protected function fun_324 input Tpl.Text in_txt; input String in_i_type; @@ -15993,9 +16079,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_323; +end fun_324; -protected function fun_324 +protected function fun_325 input Tpl.Text in_txt; input String in_i_type; @@ -16024,7 +16110,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_324; +end fun_325; public function daeExpReductionFnName input Tpl.Text in_txt; @@ -16043,14 +16129,14 @@ algorithm "sum", i_type ) equation - txt = fun_323(txt, i_type); + txt = fun_324(txt, i_type); then txt; case ( txt, "product", i_type ) equation - txt = fun_324(txt, i_type); + txt = fun_325(txt, i_type); then txt; case ( txt, @@ -16064,7 +16150,7 @@ algorithm end matchcontinue; end daeExpReductionFnName; -protected function fun_326 +protected function fun_327 input Tpl.Text in_txt; input String in_i_type; @@ -16093,9 +16179,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_326; +end fun_327; -protected function fun_327 +protected function fun_328 input Tpl.Text in_txt; input String in_i_type; @@ -16124,7 +16210,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_327; +end fun_328; public function daeExpReductionStartValue input Tpl.Text in_txt; @@ -16143,14 +16229,14 @@ algorithm "min", i_type ) equation - txt = fun_326(txt, i_type); + txt = fun_327(txt, i_type); then txt; case ( txt, "max", i_type ) equation - txt = fun_327(txt, i_type); + txt = fun_328(txt, i_type); then txt; case ( txt, @@ -16176,7 +16262,7 @@ algorithm end matchcontinue; end daeExpReductionStartValue; -protected function lm_329 +protected function lm_330 input Tpl.Text in_txt; input SimCode.Variables in_items; input Tpl.Text in_i_preExpInner; @@ -16209,7 +16295,7 @@ algorithm equation (txt, i_varDeclsInner, i_preExpInner) = varInit(txt, i_it, "", 0, i_varDeclsInner, i_preExpInner); txt = Tpl.nextIter(txt); - (txt, i_preExpInner, i_varDeclsInner) = lm_329(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_330(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); case ( txt, @@ -16219,12 +16305,12 @@ algorithm local SimCode.Variables rest; equation - (txt, i_preExpInner, i_varDeclsInner) = lm_329(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_330(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); end matchcontinue; -end lm_329; +end lm_330; -protected function lm_330 +protected function lm_331 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDeclsInner; @@ -16256,7 +16342,7 @@ algorithm equation (txt, i_varDeclsInner) = algStatement(txt, i_it, i_context, i_varDeclsInner); txt = Tpl.nextIter(txt); - (txt, i_varDeclsInner) = lm_330(txt, rest, i_varDeclsInner, i_context); + (txt, i_varDeclsInner) = lm_331(txt, rest, i_varDeclsInner, i_context); then (txt, i_varDeclsInner); case ( txt, @@ -16266,12 +16352,12 @@ algorithm local list rest; equation - (txt, i_varDeclsInner) = lm_330(txt, rest, i_varDeclsInner, i_context); + (txt, i_varDeclsInner) = lm_331(txt, rest, i_varDeclsInner, i_context); then (txt, i_varDeclsInner); end matchcontinue; -end lm_330; +end lm_331; -protected function fun_331 +protected function fun_332 input Tpl.Text in_txt; input DAE.Exp in_i_exp; input SimCode.Context in_i_context; @@ -16312,13 +16398,13 @@ algorithm i_varDeclsInner = emptyTxt; ret_4 = SimCode.valueblockVars(i_exp); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_preExpInner, i_varDeclsInner) = lm_329(i_0__, ret_4, i_preExpInner, i_varDeclsInner); + (i_0__, i_preExpInner, i_varDeclsInner) = lm_330(i_0__, ret_4, i_preExpInner, i_varDeclsInner); i_0__ = Tpl.popIter(i_0__); i_resType = expTypeModelica(emptyTxt, i_ty); txt_7 = expTypeModelica(emptyTxt, i_ty); (i_res, i_preExp) = tempDecl(emptyTxt, Tpl.textString(txt_7), i_preExp); i_stmts = Tpl.pushIter(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_varDeclsInner) = lm_330(i_stmts, i_body, i_varDeclsInner, i_context); + (i_stmts, i_varDeclsInner) = lm_331(i_stmts, i_body, i_varDeclsInner, i_context); i_stmts = Tpl.popIter(i_stmts); (i_expPart, i_preExpRes, i_varDeclsInner) = daeExp(emptyTxt, i_result, i_context, i_preExpRes, i_varDeclsInner); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE("{\n")); @@ -16346,7 +16432,7 @@ algorithm i_preExp ) then (txt, i_preExp); end matchcontinue; -end fun_331; +end fun_332; public function daeExpValueblock input Tpl.Text txt; @@ -16359,11 +16445,11 @@ public function daeExpValueblock output Tpl.Text out_i_preExp; output Tpl.Text out_i_varDecls; algorithm - (out_txt, out_i_preExp) := fun_331(txt, i_exp, i_context, i_preExp); + (out_txt, out_i_preExp) := fun_332(txt, i_exp, i_context, i_preExp); out_i_varDecls := i_varDecls; end daeExpValueblock; -protected function lm_333 +protected function lm_334 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16400,7 +16486,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_333(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_334(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16411,10 +16497,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_333(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_334(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_333; +end lm_334; public function arrayScalarRhs input Tpl.Text txt; @@ -16438,7 +16524,7 @@ algorithm ret_2 := listLength(i_subs); i_dimsLenStr := Tpl.writeStr(emptyTxt, intString(ret_2)); i_dimsValuesStr := Tpl.pushIter(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_333(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, out_i_varDecls, out_i_preExp) := lm_334(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); i_dimsValuesStr := Tpl.popIter(i_dimsValuesStr); out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("(*")); out_txt := Tpl.writeText(out_txt, i_arrayType); @@ -16609,7 +16695,7 @@ algorithm end matchcontinue; end daeExpCons; -protected function lm_338 +protected function lm_339 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16646,7 +16732,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_338(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_339(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16657,10 +16743,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_338(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_339(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_338; +end lm_339; public function daeExpMetaTuple input Tpl.Text in_txt; @@ -16696,7 +16782,7 @@ algorithm ret_1 = listLength(i_listExp); i_start = daeExpMetaHelperBoxStart(emptyTxt, ret_1); i_args = Tpl.pushIter(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_338(i_args, i_listExp, i_varDecls, i_preExp, i_context); + (i_args, i_varDecls, i_preExp) = lm_339(i_args, i_listExp, i_varDecls, i_preExp, i_context); i_args = Tpl.popIter(i_args); (i_tmp, i_varDecls) = tempDecl(emptyTxt, "modelica_metatype", i_varDecls); i_preExp = Tpl.writeText(i_preExp, i_tmp); @@ -16770,7 +16856,7 @@ algorithm end matchcontinue; end daeExpMetaOption; -protected function lm_341 +protected function lm_342 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16807,7 +16893,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_341(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16818,12 +16904,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_341(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_341; +end lm_342; -protected function fun_342 +protected function fun_343 input Tpl.Text in_txt; input list in_i_args; input Tpl.Text in_i_varDecls; @@ -16859,11 +16945,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_341(txt, i_args, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, i_args, i_varDecls, i_preExp, i_context); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_342; +end fun_343; public function daeExpMetarecordcall input Tpl.Text in_txt; @@ -16903,7 +16989,7 @@ algorithm equation ret_1 = SimCode.incrementInt(i_index, 3); i_newIndex = Tpl.writeStr(emptyTxt, intString(ret_1)); - (i_argsStr, i_varDecls, i_preExp) = fun_342(emptyTxt, i_args, i_varDecls, i_preExp, i_context); + (i_argsStr, i_varDecls, i_preExp) = fun_343(emptyTxt, i_args, i_varDecls, i_preExp, i_context); i_box = Tpl.writeTok(emptyTxt, Tpl.ST_STRING("mmc_mk_box")); ret_4 = listLength(i_args); ret_5 = SimCode.incrementInt(ret_4, 1); @@ -16951,7 +17037,7 @@ algorithm (out_txt, i_expPart, out_i_preExp, out_i_varDecls) := daeExpMetaHelperConstantNameType(txt, i_expPart, ret_1, i_context, out_i_preExp, out_i_varDecls); end daeExpMetaHelperConstant; -protected function lm_345 +protected function lm_346 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16998,7 +17084,7 @@ algorithm i_nameText = Tpl.writeStr(i_nameText, i_cvname); (txt, i_nameText, i_preExp, i_varDecls) = daeExpMetaHelperConstantNameType(txt, i_nameText, i_tp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_345(txt, rest, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, rest, i_varDecls, i_preExp, i_context, i_varname); then (txt, i_varDecls, i_preExp); case ( txt, @@ -17010,12 +17096,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_345(txt, rest, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, rest, i_varDecls, i_preExp, i_context, i_varname); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_345; +end lm_346; -protected function fun_346 +protected function fun_347 input Tpl.Text in_txt; input list in_i_varLst; input Tpl.Text in_i_varDecls; @@ -17055,13 +17141,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_345(txt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_346; +end fun_347; -protected function fun_347 +protected function fun_348 input Tpl.Text in_txt; input DAE.ExpType in_i_type; input Tpl.Text in_i_varname; @@ -17147,7 +17233,7 @@ algorithm ret_1 = listLength(i_varLst); ret_2 = SimCode.incrementInt(ret_1, 1); i_start = daeExpMetaHelperBoxStart(emptyTxt, ret_2); - (i_args, i_varDecls, i_preExp) = fun_346(emptyTxt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); + (i_args, i_varDecls, i_preExp) = fun_347(emptyTxt, i_varLst, i_varDecls, i_preExp, i_context, 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, &")); @@ -17167,7 +17253,7 @@ algorithm txt = Tpl.writeText(txt, i_varname); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_347; +end fun_348; public function daeExpMetaHelperConstantNameType input Tpl.Text txt; @@ -17182,7 +17268,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_347(txt, i_type, i_varname, i_context, i_preExp, i_varDecls); + (out_txt, out_i_preExp, out_i_varDecls) := fun_348(txt, i_type, i_varname, i_context, i_preExp, i_varDecls); out_i_varname := i_varname; end daeExpMetaHelperConstantNameType; @@ -17321,7 +17407,7 @@ algorithm out_txt := Tpl.writeText(txt, i_newVar); end tempDecl; -protected function fun_351 +protected function fun_352 input Tpl.Text in_txt; input list in_i_instDims; input SimCode.Type in_i_var_ty; @@ -17348,7 +17434,7 @@ algorithm txt = expTypeArray(txt, i_var_ty); then txt; end matchcontinue; -end fun_351; +end fun_352; public function varType input Tpl.Text in_txt; @@ -17368,7 +17454,7 @@ algorithm list i_instDims; SimCode.Variable i_var; equation - txt = fun_351(txt, i_instDims, i_var_ty); + txt = fun_352(txt, i_instDims, i_var_ty); then txt; case ( txt, @@ -17580,7 +17666,7 @@ algorithm end matchcontinue; end expTypeShort; -protected function fun_355 +protected function fun_356 input Tpl.Text in_txt; input Boolean in_i_array; input DAE.ExpType in_i_ty; @@ -17612,7 +17698,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_355; +end fun_356; public function expType input Tpl.Text txt; @@ -17621,7 +17707,7 @@ public function expType output Tpl.Text out_txt; algorithm - out_txt := fun_355(txt, i_array, i_ty); + out_txt := fun_356(txt, i_array, i_ty); end expType; public function expTypeModelica @@ -17687,7 +17773,7 @@ algorithm out_txt := expTypeFromExpFlag(txt, i_exp, 4); end expTypeFromExpArrayIf; -protected function fun_364 +protected function fun_365 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17716,9 +17802,9 @@ algorithm txt = expTypeShort(txt, i_ty); then txt; end matchcontinue; -end fun_364; +end fun_365; -protected function fun_365 +protected function fun_366 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17743,12 +17829,12 @@ algorithm local DAE.ExpType i_ty; equation - txt = fun_364(txt, i_ty); + txt = fun_365(txt, i_ty); then txt; end matchcontinue; -end fun_365; +end fun_366; -protected function fun_366 +protected function fun_367 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17776,9 +17862,9 @@ algorithm txt = expTypeFlag(txt, i_ty, 2); then txt; end matchcontinue; -end fun_366; +end fun_367; -protected function fun_367 +protected function fun_368 input Tpl.Text in_txt; input Integer in_i_flag; input DAE.ExpType in_i_ty; @@ -17802,7 +17888,7 @@ algorithm 2, i_ty ) equation - txt = fun_365(txt, i_ty); + txt = fun_366(txt, i_ty); then txt; case ( txt, @@ -17817,7 +17903,7 @@ algorithm 4, i_ty ) equation - txt = fun_366(txt, i_ty); + txt = fun_367(txt, i_ty); then txt; case ( txt, @@ -17825,7 +17911,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_367; +end fun_368; public function expTypeFlag input Tpl.Text txt; @@ -17834,10 +17920,10 @@ public function expTypeFlag output Tpl.Text out_txt; algorithm - out_txt := fun_367(txt, i_flag, i_ty); + out_txt := fun_368(txt, i_flag, i_ty); end expTypeFlag; -protected function fun_369 +protected function fun_370 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17860,9 +17946,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_integer")); then txt; end matchcontinue; -end fun_369; +end fun_370; -protected function fun_370 +protected function fun_371 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17885,9 +17971,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_real")); then txt; end matchcontinue; -end fun_370; +end fun_371; -protected function fun_371 +protected function fun_372 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17910,9 +17996,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_string")); then txt; end matchcontinue; -end fun_371; +end fun_372; -protected function fun_372 +protected function fun_373 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17935,7 +18021,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_372; +end fun_373; public function expTypeFromExpFlag input Tpl.Text in_txt; @@ -17954,28 +18040,28 @@ algorithm DAE.ICONST(integer = _), i_flag ) equation - txt = fun_369(txt, i_flag); + txt = fun_370(txt, i_flag); then txt; case ( txt, DAE.RCONST(real = _), i_flag ) equation - txt = fun_370(txt, i_flag); + txt = fun_371(txt, i_flag); then txt; case ( txt, DAE.SCONST(string = _), i_flag ) equation - txt = fun_371(txt, i_flag); + txt = fun_372(txt, i_flag); then txt; case ( txt, DAE.BCONST(bool = _), i_flag ) equation - txt = fun_372(txt, i_flag); + txt = fun_373(txt, i_flag); then txt; case ( txt, @@ -18133,7 +18219,7 @@ algorithm end matchcontinue; end expTypeFromExpFlag; -protected function fun_374 +protected function fun_375 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18156,9 +18242,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_374; +end fun_375; -protected function fun_375 +protected function fun_376 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18181,9 +18267,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_375; +end fun_376; -protected function fun_376 +protected function fun_377 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18206,7 +18292,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_376; +end fun_377; public function expTypeFromOpFlag input Tpl.Text in_txt; @@ -18557,7 +18643,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_374(txt, i_flag); + txt = fun_375(txt, i_flag); then txt; case ( txt, @@ -18566,7 +18652,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_375(txt, i_flag); + txt = fun_376(txt, i_flag); then txt; case ( txt, @@ -18575,7 +18661,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_376(txt, i_flag); + txt = fun_377(txt, i_flag); then txt; case ( txt, diff --git a/Compiler/susan_codegen/SimCode/SimCodeC.mo b/Compiler/susan_codegen/SimCode/SimCodeC.mo index 40d04fc0285..f012fc26ba2 100644 --- a/Compiler/susan_codegen/SimCode/SimCodeC.mo +++ b/Compiler/susan_codegen/SimCode/SimCodeC.mo @@ -69,9 +69,10 @@ algorithm Tpl.Text txt; case ( txt, - (i_functionCode as SimCode.FUNCTIONCODE(functions = i_functions, name = i_name)) ) + (i_functionCode as SimCode.FUNCTIONCODE(functions = i_functions, extraRecordDecls = i_extraRecordDecls, name = i_name)) ) local String i_name; + list i_extraRecordDecls; list i_functions; SimCode.FunctionCode i_functionCode; Tpl.Text txt_3; @@ -79,7 +80,7 @@ algorithm Tpl.Text txt_1; Tpl.Text i_functionsFileContent; equation - i_functionsFileContent = functionsFile2(emptyTxt, i_functions); + i_functionsFileContent = functionsFile2(emptyTxt, i_functions, i_extraRecordDecls); txt_1 = Tpl.writeStr(emptyTxt, i_name); txt_1 = Tpl.writeTok(txt_1, Tpl.ST_STRING(".c")); Tpl.textFile(i_functionsFileContent, Tpl.textString(txt_1)); @@ -5457,9 +5458,46 @@ algorithm end matchcontinue; end equation_; +protected function lm_126 + input Tpl.Text in_txt; + input list in_items; + + output Tpl.Text out_txt; +algorithm + out_txt := + matchcontinue(in_txt, in_items) + local + Tpl.Text txt; + + case ( txt, + {} ) + then txt; + + case ( txt, + i_rd :: rest ) + local + list rest; + SimCode.RecordDeclaration i_rd; + equation + txt = recordDeclaration(txt, i_rd); + txt = Tpl.nextIter(txt); + txt = lm_126(txt, rest); + then txt; + + case ( txt, + _ :: rest ) + local + list rest; + equation + txt = lm_126(txt, rest); + then txt; + end matchcontinue; +end lm_126; + public function functionsFile2 input Tpl.Text txt; input list i_functions; + input list i_extraRecordDecls; output Tpl.Text out_txt; algorithm @@ -5493,6 +5531,10 @@ algorithm out_txt := Tpl.softNewLine(out_txt); out_txt := functionHeaders(out_txt, i_functions); out_txt := Tpl.softNewLine(out_txt); + out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); + out_txt := lm_126(out_txt, i_extraRecordDecls); + out_txt := Tpl.popIter(out_txt); + out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING_LIST({ "/* End Header */\n", "\n", @@ -5542,7 +5584,7 @@ algorithm }, false)); end functionsFile; -protected function lm_128 +protected function lm_129 input Tpl.Text in_txt; input list in_items; @@ -5565,7 +5607,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_128(txt, rest); + txt = lm_129(txt, rest); then txt; case ( txt, @@ -5573,10 +5615,10 @@ algorithm local list rest; equation - txt = lm_128(txt, rest); + txt = lm_129(txt, rest); then txt; end matchcontinue; -end lm_128; +end lm_129; public function makefileFunction input Tpl.Text in_txt; @@ -5605,7 +5647,7 @@ algorithm Tpl.Text i_libsStr; equation i_libsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(" ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_libsStr = lm_128(i_libsStr, i_makefileParams_libs); + i_libsStr = lm_129(i_libsStr, i_makefileParams_libs); i_libsStr = Tpl.popIter(i_libsStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ "# Makefile generated by OpenModelica\n", @@ -5662,7 +5704,7 @@ algorithm end matchcontinue; end makefileFunction; -protected function fun_130 +protected function fun_131 input Tpl.Text in_txt; input String in_i_modelInfo_directory; @@ -5683,9 +5725,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("-L\"\"")); then txt; end matchcontinue; -end fun_130; +end fun_131; -protected function lm_131 +protected function lm_132 input Tpl.Text in_txt; input list in_items; @@ -5708,7 +5750,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_131(txt, rest); + txt = lm_132(txt, rest); then txt; case ( txt, @@ -5716,10 +5758,10 @@ algorithm local list rest; equation - txt = lm_131(txt, rest); + txt = lm_132(txt, rest); then txt; end matchcontinue; -end lm_131; +end lm_132; public function makefile input Tpl.Text in_txt; @@ -5749,9 +5791,9 @@ algorithm Tpl.Text i_libsStr; Tpl.Text i_dirExtra; equation - i_dirExtra = fun_130(emptyTxt, i_modelInfo_directory); + i_dirExtra = fun_131(emptyTxt, i_modelInfo_directory); i_libsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(" ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_libsStr = lm_131(i_libsStr, i_makefileParams_libs); + i_libsStr = lm_132(i_libsStr, i_makefileParams_libs); i_libsStr = Tpl.popIter(i_libsStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ "# Makefile generated by OpenModelica\n", @@ -5876,7 +5918,7 @@ algorithm end matchcontinue; end crefSubscript; -protected function lm_135 +protected function lm_136 input Tpl.Text in_txt; input list in_items; @@ -5899,7 +5941,7 @@ algorithm equation txt = subscriptTpl(txt, i_s); txt = Tpl.nextIter(txt); - txt = lm_135(txt, rest); + txt = lm_136(txt, rest); then txt; case ( txt, @@ -5907,10 +5949,10 @@ algorithm local list rest; equation - txt = lm_135(txt, rest); + txt = lm_136(txt, rest); then txt; end matchcontinue; -end lm_135; +end lm_136; public function subscriptsTpl input Tpl.Text in_txt; @@ -5934,14 +5976,14 @@ 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 = lm_135(txt, i_subscripts); + txt = lm_136(txt, i_subscripts); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("]")); then txt; end matchcontinue; end subscriptsTpl; -protected function fun_137 +protected function fun_138 input Tpl.Text in_txt; input DAE.Exp in_i_exp; @@ -5966,7 +6008,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("SUBSCRIPT_NOT_CONSTANT")); then txt; end matchcontinue; -end fun_137; +end fun_138; public function subscriptTpl input Tpl.Text in_txt; @@ -5984,7 +6026,7 @@ algorithm local DAE.Exp i_exp; equation - txt = fun_137(txt, i_exp); + txt = fun_138(txt, i_exp); then txt; case ( txt, @@ -6087,7 +6129,7 @@ algorithm end matchcontinue; end underscorePath; -protected function lm_141 +protected function lm_142 input Tpl.Text in_txt; input list in_items; @@ -6110,7 +6152,7 @@ algorithm equation txt = Tpl.writeStr(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_141(txt, rest); + txt = lm_142(txt, rest); then txt; case ( txt, @@ -6118,12 +6160,12 @@ algorithm local list rest; equation - txt = lm_141(txt, rest); + txt = lm_142(txt, rest); then txt; end matchcontinue; -end lm_141; +end lm_142; -protected function lm_142 +protected function lm_143 input Tpl.Text in_txt; input list in_items; @@ -6145,10 +6187,10 @@ algorithm list i_includes; 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 = lm_141(txt, i_includes); + txt = lm_142(txt, i_includes); txt = Tpl.popIter(txt); txt = Tpl.nextIter(txt); - txt = lm_142(txt, rest); + txt = lm_143(txt, rest); then txt; case ( txt, @@ -6156,10 +6198,10 @@ algorithm local list rest; equation - txt = lm_142(txt, rest); + txt = lm_143(txt, rest); then txt; end matchcontinue; -end lm_142; +end lm_143; public function externalFunctionIncludes input Tpl.Text txt; @@ -6173,7 +6215,7 @@ algorithm "#endif\n" }, true)); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_142(out_txt, i_functions); + out_txt := lm_143(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING_LIST({ @@ -6183,7 +6225,7 @@ algorithm }, false)); end externalFunctionIncludes; -protected function lm_144 +protected function lm_145 input Tpl.Text in_txt; input list in_items; @@ -6206,7 +6248,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_144(txt, rest); + txt = lm_145(txt, rest); then txt; case ( txt, @@ -6214,12 +6256,12 @@ algorithm local list rest; equation - txt = lm_144(txt, rest); + txt = lm_145(txt, rest); then txt; end matchcontinue; -end lm_144; +end lm_145; -protected function lm_145 +protected function lm_146 input Tpl.Text in_txt; input list in_items; @@ -6242,7 +6284,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_145(txt, rest); + txt = lm_146(txt, rest); then txt; case ( txt, @@ -6250,12 +6292,12 @@ algorithm local list rest; equation - txt = lm_145(txt, rest); + txt = lm_146(txt, rest); then txt; end matchcontinue; -end lm_145; +end lm_146; -protected function lm_146 +protected function lm_147 input Tpl.Text in_txt; input list in_items; @@ -6278,7 +6320,7 @@ algorithm equation txt = recordDeclaration(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_146(txt, rest); + txt = lm_147(txt, rest); then txt; case ( txt, @@ -6286,12 +6328,12 @@ algorithm local list rest; equation - txt = lm_146(txt, rest); + txt = lm_147(txt, rest); then txt; end matchcontinue; -end lm_146; +end lm_147; -protected function lm_147 +protected function lm_148 input Tpl.Text in_txt; input list in_items; @@ -6317,7 +6359,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_147(txt, rest); + txt = lm_148(txt, rest); then txt; case ( txt, @@ -6325,12 +6367,12 @@ algorithm local list rest; equation - txt = lm_147(txt, rest); + txt = lm_148(txt, rest); then txt; end matchcontinue; -end lm_147; +end lm_148; -protected function fun_148 +protected function fun_149 input Tpl.Text in_txt; input SimCode.Function in_i_it; @@ -6351,7 +6393,7 @@ algorithm Tpl.Text txt_0; 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 = lm_144(txt, i_recordDecls); + txt = lm_145(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt_0 = underscorePath(emptyTxt, i_name); @@ -6369,7 +6411,7 @@ algorithm Tpl.Text txt_0; 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 = lm_145(txt, i_recordDecls); + txt = lm_146(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt_0 = underscorePath(emptyTxt, i_name); @@ -6389,7 +6431,7 @@ algorithm equation i_fname = underscorePath(emptyTxt, i_name); 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_146(txt, i_recordDecls); + txt = lm_147(txt, i_recordDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("#define ")); @@ -6417,7 +6459,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_147(txt, i_funArgs); + txt = lm_148(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; @@ -6426,9 +6468,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_148; +end fun_149; -protected function lm_149 +protected function lm_150 input Tpl.Text in_txt; input list in_items; @@ -6449,9 +6491,9 @@ algorithm list rest; SimCode.Function i_it; equation - txt = fun_148(txt, i_it); + txt = fun_149(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_149(txt, rest); + txt = lm_150(txt, rest); then txt; case ( txt, @@ -6459,10 +6501,10 @@ algorithm local list rest; equation - txt = lm_149(txt, rest); + txt = lm_150(txt, rest); then txt; end matchcontinue; -end lm_149; +end lm_150; public function functionHeaders input Tpl.Text txt; @@ -6471,11 +6513,11 @@ public function functionHeaders output Tpl.Text out_txt; 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 := lm_149(out_txt, i_functions); + out_txt := lm_150(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); end functionHeaders; -protected function lm_151 +protected function lm_152 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6502,7 +6544,7 @@ algorithm txt = cref(txt, i_var_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_151(txt, rest); + txt = lm_152(txt, rest); then txt; case ( txt, @@ -6510,12 +6552,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_151(txt, rest); + txt = lm_152(txt, rest); then txt; end matchcontinue; -end lm_151; +end lm_152; -protected function lm_152 +protected function lm_153 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6540,7 +6582,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING("\"")); txt = Tpl.nextIter(txt); - txt = lm_152(txt, rest); + txt = lm_153(txt, rest); then txt; case ( txt, @@ -6548,12 +6590,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_152(txt, rest); + txt = lm_153(txt, rest); then txt; end matchcontinue; -end lm_152; +end lm_153; -protected function lm_153 +protected function lm_154 input Tpl.Text in_txt; input list in_items; @@ -6578,7 +6620,7 @@ algorithm txt = Tpl.writeStr(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING("\"")); txt = Tpl.nextIter(txt); - txt = lm_153(txt, rest); + txt = lm_154(txt, rest); then txt; case ( txt, @@ -6586,10 +6628,10 @@ algorithm local list rest; equation - txt = lm_153(txt, rest); + txt = lm_154(txt, rest); then txt; end matchcontinue; -end lm_153; +end lm_154; public function recordDeclaration input Tpl.Text in_txt; @@ -6617,7 +6659,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 = lm_151(txt, i_variables); + txt = lm_152(txt, i_variables); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -6625,7 +6667,7 @@ algorithm txt_0 = dotPath(emptyTxt, i_defPath); txt_1 = underscorePath(emptyTxt, i_defPath); txt_2 = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt_2 = lm_152(txt_2, i_variables); + txt_2 = lm_153(txt_2, i_variables); txt_2 = Tpl.popIter(txt_2); txt = recordDefinition(txt, Tpl.textString(txt_0), Tpl.textString(txt_1), Tpl.textString(txt_2)); then txt; @@ -6642,7 +6684,7 @@ algorithm txt_0 = dotPath(emptyTxt, i_path); txt_1 = underscorePath(emptyTxt, i_path); txt_2 = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(",")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - txt_2 = lm_153(txt_2, i_fieldNames); + txt_2 = lm_154(txt_2, i_fieldNames); txt_2 = Tpl.popIter(txt_2); txt = recordDefinition(txt, Tpl.textString(txt_0), Tpl.textString(txt_1), Tpl.textString(txt_2)); then txt; @@ -6686,7 +6728,7 @@ algorithm out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("};")); end recordDefinition; -protected function lm_156 +protected function lm_157 input Tpl.Text in_txt; input SimCode.Variables in_items; input String in_i_fname; @@ -6719,7 +6761,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" targ")); txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.nextIter(txt); - txt = lm_156(txt, rest, i_fname); + txt = lm_157(txt, rest, i_fname); then txt; case ( txt, @@ -6728,12 +6770,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_156(txt, rest, i_fname); + txt = lm_157(txt, rest, i_fname); then txt; end matchcontinue; -end lm_156; +end lm_157; -protected function fun_157 +protected function fun_158 input Tpl.Text in_txt; input Option in_i_it; @@ -6758,9 +6800,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(":")); then txt; end matchcontinue; -end fun_157; +end fun_158; -protected function lm_158 +protected function lm_159 input Tpl.Text in_txt; input list> in_items; @@ -6781,9 +6823,9 @@ algorithm list> rest; Option i_it; equation - txt = fun_157(txt, i_it); + txt = fun_158(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_158(txt, rest); + txt = lm_159(txt, rest); then txt; case ( txt, @@ -6791,12 +6833,12 @@ algorithm local list> rest; equation - txt = lm_158(txt, rest); + txt = lm_159(txt, rest); then txt; end matchcontinue; -end lm_158; +end lm_159; -protected function fun_159 +protected function fun_160 input Tpl.Text in_txt; input SimCode.Type in_i_ty; @@ -6814,7 +6856,7 @@ 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 = lm_158(txt, i_arrayDimensions); + txt = lm_159(txt, i_arrayDimensions); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("]")); then txt; @@ -6823,9 +6865,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_159; +end fun_160; -protected function lm_160 +protected function lm_161 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6855,10 +6897,10 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("; /* ")); txt = cref(txt, i_name); - txt = fun_159(txt, i_ty); + txt = fun_160(txt, i_ty); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" */")); txt = Tpl.nextIter(txt); - txt = lm_160(txt, rest); + txt = lm_161(txt, rest); then txt; case ( txt, @@ -6866,12 +6908,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_160(txt, rest); + txt = lm_161(txt, rest); then txt; end matchcontinue; -end lm_160; +end lm_161; -protected function lm_161 +protected function lm_162 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -6897,7 +6939,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_161(txt, rest); + txt = lm_162(txt, rest); then txt; case ( txt, @@ -6905,10 +6947,10 @@ algorithm local SimCode.Variables rest; equation - txt = lm_161(txt, rest); + txt = lm_162(txt, rest); then txt; end matchcontinue; -end lm_161; +end lm_162; public function functionHeader input Tpl.Text txt; @@ -6919,7 +6961,7 @@ public function functionHeader output Tpl.Text out_txt; 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 := lm_156(out_txt, i_outVars, i_fname); + out_txt := lm_157(out_txt, i_outVars, i_fname); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("typedef struct ")); @@ -6930,7 +6972,7 @@ algorithm }, true)); out_txt := Tpl.pushBlock(out_txt, Tpl.BT_INDENT(2)); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_160(out_txt, i_outVars); + out_txt := lm_161(out_txt, i_outVars); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.popBlock(out_txt); @@ -6953,12 +6995,12 @@ algorithm out_txt := Tpl.writeStr(out_txt, i_fname); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING("(")); out_txt := Tpl.pushIter(out_txt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - out_txt := lm_161(out_txt, i_fargs); + out_txt := lm_162(out_txt, i_fargs); out_txt := Tpl.popIter(out_txt); out_txt := Tpl.writeTok(out_txt, Tpl.ST_STRING(");")); end functionHeader; -protected function lm_163 +protected function lm_164 input Tpl.Text in_txt; input list in_items; @@ -6981,7 +7023,7 @@ algorithm equation txt = extFunDefArg(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_163(txt, rest); + txt = lm_164(txt, rest); then txt; case ( txt, @@ -6989,10 +7031,10 @@ algorithm local list rest; equation - txt = lm_163(txt, rest); + txt = lm_164(txt, rest); then txt; end matchcontinue; -end lm_163; +end lm_164; public function extFunDef input Tpl.Text in_txt; @@ -7018,7 +7060,7 @@ algorithm txt = Tpl.writeStr(txt, i_extName); 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 = lm_163(txt, i_extArgs); + txt = lm_164(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; @@ -7118,6 +7160,50 @@ algorithm txt = underscorePath(txt, i_rname); then txt; + case ( txt, + DAE.ET_METAOPTION(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_LIST(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_METATUPLE(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_UNIONTYPE() ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_POLYMORPHIC() ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + i_ET__META__ARRAY ) + local + SimCode.Type i_ET__META__ARRAY; + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + + case ( txt, + DAE.ET_BOXED(ty = _) ) + equation + txt = Tpl.writeTok(txt, Tpl.ST_STRING("void*")); + then txt; + case ( txt, _ ) equation @@ -7126,7 +7212,7 @@ algorithm end matchcontinue; end extType; -protected function fun_167 +protected function fun_168 input Tpl.Text in_txt; input String in_it; input DAE.ExpType in_i_t; @@ -7158,9 +7244,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" *")); then txt; end matchcontinue; -end fun_167; +end fun_168; -protected function fun_168 +protected function fun_169 input Tpl.Text in_txt; input Boolean in_i_ia; input DAE.ExpType in_i_t; @@ -7189,12 +7275,12 @@ algorithm equation txt_0 = extType(emptyTxt, i_t); str_1 = Tpl.textString(txt_0); - txt = fun_167(txt, str_1, i_t); + txt = fun_168(txt, str_1, i_t); then txt; end matchcontinue; -end fun_168; +end fun_169; -protected function fun_169 +protected function fun_170 input Tpl.Text in_txt; input Boolean in_i_ii; input Boolean in_i_ia; @@ -7223,10 +7309,10 @@ algorithm i_ia, i_t ) equation - txt = fun_168(txt, i_ia, i_t); + txt = fun_169(txt, i_ia, i_t); then txt; end matchcontinue; -end fun_169; +end fun_170; public function extFunDefArg input Tpl.Text in_txt; @@ -7250,7 +7336,7 @@ algorithm Tpl.Text i_name; equation i_name = cref(emptyTxt, i_c); - i_typeStr = fun_169(emptyTxt, i_ii, i_ia, i_t); + i_typeStr = fun_170(emptyTxt, i_ii, i_ia, i_t); txt = Tpl.writeText(txt, i_typeStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = Tpl.writeText(txt, i_name); @@ -7302,7 +7388,7 @@ algorithm (out_txt, i_preExp, i_varDecls) := daeExp(txt, i_exp, SimCode.contextOther, i_preExp, i_varDecls); end daeExpToString; -protected function lm_172 +protected function lm_173 input Tpl.Text in_txt; input list in_items; @@ -7325,7 +7411,7 @@ algorithm equation txt = functionBody(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_172(txt, rest); + txt = lm_173(txt, rest); then txt; case ( txt, @@ -7333,10 +7419,10 @@ algorithm local list rest; equation - txt = lm_172(txt, rest); + txt = lm_173(txt, rest); then txt; end matchcontinue; -end lm_172; +end lm_173; public function functionBodies input Tpl.Text txt; @@ -7345,11 +7431,11 @@ public function functionBodies output Tpl.Text out_txt; 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 := lm_172(out_txt, i_functions); + out_txt := lm_173(out_txt, i_functions); out_txt := Tpl.popIter(out_txt); end functionBodies; -protected function lm_174 +protected function lm_175 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varInits; @@ -7384,7 +7470,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_varInits) = varInit(txt, i_it, "", i_i1, i_varDecls, i_varInits); txt = Tpl.nextIter(txt); - (txt, i_varInits, i_varDecls) = lm_174(txt, rest, i_varInits, i_varDecls); + (txt, i_varInits, i_varDecls) = lm_175(txt, rest, i_varInits, i_varDecls); then (txt, i_varInits, i_varDecls); case ( txt, @@ -7394,12 +7480,12 @@ algorithm local list rest; equation - (txt, i_varInits, i_varDecls) = lm_174(txt, rest, i_varInits, i_varDecls); + (txt, i_varInits, i_varDecls) = lm_175(txt, rest, i_varInits, i_varDecls); then (txt, i_varInits, i_varDecls); end matchcontinue; -end lm_174; +end lm_175; -protected function lm_175 +protected function lm_176 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -7427,7 +7513,7 @@ algorithm equation (txt, i_varDecls) = funStatement(txt, i_stmt, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_175(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_176(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -7436,12 +7522,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_175(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_176(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_175; +end lm_176; -protected function lm_176 +protected function lm_177 input Tpl.Text in_txt; input SimCode.Variables in_items; input Tpl.Text in_i_varInits; @@ -7480,7 +7566,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_varInits) = varOutput(txt, i_it, Tpl.textString(i_retVar), i_i1, i_varDecls, i_varInits); txt = Tpl.nextIter(txt); - (txt, i_varInits, i_varDecls) = lm_176(txt, rest, i_varInits, i_varDecls, i_retVar); + (txt, i_varInits, i_varDecls) = lm_177(txt, rest, i_varInits, i_varDecls, i_retVar); then (txt, i_varInits, i_varDecls); case ( txt, @@ -7491,12 +7577,12 @@ algorithm local SimCode.Variables rest; equation - (txt, i_varInits, i_varDecls) = lm_176(txt, rest, i_varInits, i_varDecls, i_retVar); + (txt, i_varInits, i_varDecls) = lm_177(txt, rest, i_varInits, i_varDecls, i_retVar); then (txt, i_varInits, i_varDecls); end matchcontinue; -end lm_176; +end lm_177; -protected function lm_177 +protected function lm_178 input Tpl.Text in_txt; input list in_items; @@ -7522,7 +7608,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_177(txt, rest); + txt = lm_178(txt, rest); then txt; case ( txt, @@ -7530,12 +7616,12 @@ algorithm local list rest; equation - txt = lm_177(txt, rest); + txt = lm_178(txt, rest); then txt; end matchcontinue; -end lm_177; +end lm_178; -protected function lm_178 +protected function lm_179 input Tpl.Text in_txt; input list in_items; @@ -7562,7 +7648,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_178(txt, rest); + txt = lm_179(txt, rest); then txt; case ( txt, @@ -7570,12 +7656,12 @@ algorithm local list rest; equation - txt = lm_178(txt, rest); + txt = lm_179(txt, rest); then txt; end matchcontinue; -end lm_178; +end lm_179; -protected function lm_179 +protected function lm_180 input Tpl.Text in_txt; input list in_items; @@ -7598,7 +7684,7 @@ algorithm equation txt = readInVar(txt, it); txt = Tpl.nextIter(txt); - txt = lm_179(txt, rest); + txt = lm_180(txt, rest); then txt; case ( txt, @@ -7606,12 +7692,12 @@ algorithm local list rest; equation - txt = lm_179(txt, rest); + txt = lm_180(txt, rest); then txt; end matchcontinue; -end lm_179; +end lm_180; -protected function lm_180 +protected function lm_181 input Tpl.Text in_txt; input list in_items; @@ -7634,7 +7720,7 @@ algorithm equation txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_180(txt, rest); + txt = lm_181(txt, rest); then txt; case ( txt, @@ -7642,12 +7728,12 @@ algorithm local list rest; equation - txt = lm_180(txt, rest); + txt = lm_181(txt, rest); then txt; end matchcontinue; -end lm_180; +end lm_181; -protected function lm_181 +protected function lm_182 input Tpl.Text in_txt; input SimCode.Variables in_items; @@ -7672,7 +7758,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); txt = writeOutVar(txt, it, i_i1); txt = Tpl.nextIter(txt); - txt = lm_181(txt, rest); + txt = lm_182(txt, rest); then txt; case ( txt, @@ -7680,12 +7766,12 @@ algorithm local SimCode.Variables rest; equation - txt = lm_181(txt, rest); + txt = lm_182(txt, rest); then txt; end matchcontinue; -end lm_181; +end lm_182; -protected function fun_182 +protected function fun_183 input Tpl.Text in_txt; input SimCode.Variables in_i_outVars; @@ -7708,13 +7794,13 @@ algorithm SimCode.Variables i_outVars; 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 = lm_181(txt, i_outVars); + txt = lm_182(txt, i_outVars); txt = Tpl.popIter(txt); then txt; end matchcontinue; -end fun_182; +end fun_183; -protected function lm_183 +protected function lm_184 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_outputAlloc; @@ -7749,7 +7835,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); (txt, i_varDecls, i_outputAlloc) = varInit(txt, i_it, "out", i_i1, i_varDecls, i_outputAlloc); txt = Tpl.nextIter(txt); - (txt, i_outputAlloc, i_varDecls) = lm_183(txt, rest, i_outputAlloc, i_varDecls); + (txt, i_outputAlloc, i_varDecls) = lm_184(txt, rest, i_outputAlloc, i_varDecls); then (txt, i_outputAlloc, i_varDecls); case ( txt, @@ -7759,12 +7845,12 @@ algorithm local list rest; equation - (txt, i_outputAlloc, i_varDecls) = lm_183(txt, rest, i_outputAlloc, i_varDecls); + (txt, i_outputAlloc, i_varDecls) = lm_184(txt, rest, i_outputAlloc, i_varDecls); then (txt, i_outputAlloc, i_varDecls); end matchcontinue; -end lm_183; +end lm_184; -protected function lm_184 +protected function lm_185 input Tpl.Text in_txt; input list in_items; @@ -7791,7 +7877,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_184(txt, rest); + txt = lm_185(txt, rest); then txt; case ( txt, @@ -7799,12 +7885,12 @@ algorithm local list rest; equation - txt = lm_184(txt, rest); + txt = lm_185(txt, rest); then txt; end matchcontinue; -end lm_184; +end lm_185; -protected function lm_185 +protected function lm_186 input Tpl.Text in_txt; input list in_items; @@ -7827,7 +7913,7 @@ algorithm equation txt = readInVar(txt, it); txt = Tpl.nextIter(txt); - txt = lm_185(txt, rest); + txt = lm_186(txt, rest); then txt; case ( txt, @@ -7835,12 +7921,12 @@ algorithm local list rest; equation - txt = lm_185(txt, rest); + txt = lm_186(txt, rest); then txt; end matchcontinue; -end lm_185; +end lm_186; -protected function lm_186 +protected function lm_187 input Tpl.Text in_txt; input list in_items; @@ -7863,7 +7949,7 @@ algorithm equation txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_186(txt, rest); + txt = lm_187(txt, rest); then txt; case ( txt, @@ -7871,12 +7957,12 @@ algorithm local list rest; equation - txt = lm_186(txt, rest); + txt = lm_187(txt, rest); then txt; end matchcontinue; -end lm_186; +end lm_187; -protected function lm_187 +protected function lm_188 input Tpl.Text in_txt; input list in_items; @@ -7901,7 +7987,7 @@ algorithm i_i1 = Tpl.getIteri_i1(txt); txt = writeOutVar(txt, it, i_i1); txt = Tpl.nextIter(txt); - txt = lm_187(txt, rest); + txt = lm_188(txt, rest); then txt; case ( txt, @@ -7909,12 +7995,12 @@ algorithm local list rest; equation - txt = lm_187(txt, rest); + txt = lm_188(txt, rest); then txt; end matchcontinue; -end lm_187; +end lm_188; -protected function lm_188 +protected function lm_189 input Tpl.Text in_txt; input list in_items; @@ -7940,7 +8026,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_188(txt, rest); + txt = lm_189(txt, rest); then txt; case ( txt, @@ -7948,12 +8034,12 @@ algorithm local list rest; equation - txt = lm_188(txt, rest); + txt = lm_189(txt, rest); then txt; end matchcontinue; -end lm_188; +end lm_189; -protected function lm_189 +protected function lm_190 input Tpl.Text in_txt; input list in_items; @@ -7979,7 +8065,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(" ")); txt = cref(txt, i_name); txt = Tpl.nextIter(txt); - txt = lm_189(txt, rest); + txt = lm_190(txt, rest); then txt; case ( txt, @@ -7987,12 +8073,12 @@ algorithm local list rest; equation - txt = lm_189(txt, rest); + txt = lm_190(txt, rest); then txt; end matchcontinue; -end lm_189; +end lm_190; -protected function lm_190 +protected function lm_191 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_structVar; @@ -8024,7 +8110,7 @@ algorithm txt = cref(txt, i_name); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - txt = lm_190(txt, rest, i_structVar); + txt = lm_191(txt, rest, i_structVar); then txt; case ( txt, @@ -8033,10 +8119,10 @@ algorithm local list rest; equation - txt = lm_190(txt, rest, i_structVar); + txt = lm_191(txt, rest, i_structVar); then txt; end matchcontinue; -end lm_190; +end lm_191; public function functionBody input Tpl.Text in_txt; @@ -8076,20 +8162,20 @@ algorithm (i_retVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_retType), i_varDecls); (i_stateVar, i_varDecls) = tempDecl(emptyTxt, "state", i_varDecls); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_varInits, i_varDecls) = lm_174(i_0__, i_variableDeclarations, i_varInits, i_varDecls); + (i_0__, i_varInits, i_varDecls) = lm_175(i_0__, i_variableDeclarations, i_varInits, i_varDecls); i_0__ = Tpl.popIter(i_0__); i_bodyPart = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_bodyPart, i_varDecls) = lm_175(i_bodyPart, i_body, i_varDecls); + (i_bodyPart, i_varDecls) = lm_176(i_bodyPart, i_body, i_varDecls); i_bodyPart = Tpl.popIter(i_bodyPart); i_outVarsStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_outVarsStr, i_varInits, i_varDecls) = lm_176(i_outVarsStr, i_outVars, i_varInits, i_varDecls, i_retVar); + (i_outVarsStr, i_varInits, i_varDecls) = lm_177(i_outVarsStr, i_outVars, i_varInits, i_varDecls, i_retVar); i_outVarsStr = Tpl.popIter(i_outVarsStr); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_STRING(" _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_177(txt, i_functionArguments); + txt = lm_178(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8135,23 +8221,23 @@ algorithm }, true)); 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 = lm_178(txt, i_functionArguments); + txt = lm_179(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" out;\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_179(txt, i_functionArguments); + txt = lm_180(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("out = _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_180(txt, i_functionArguments); + txt = lm_181(txt, i_functionArguments); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(");\n")); - txt = fun_182(txt, i_outVars); + txt = fun_183(txt, i_outVars); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("return 0;\n")); txt = Tpl.popBlock(txt); @@ -8182,7 +8268,7 @@ algorithm i_outputAlloc = emptyTxt; (i_callPart, i_preExp, i_varDecls) = extFunCall(emptyTxt, i_fn, i_preExp, i_varDecls); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, NONE, 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_outputAlloc, i_varDecls) = lm_183(i_0__, i_outVars, i_outputAlloc, i_varDecls); + (i_0__, i_outputAlloc, i_varDecls) = lm_184(i_0__, i_outVars, i_outputAlloc, i_varDecls); i_0__ = Tpl.popIter(i_0__); txt = Tpl.writeTok(txt, Tpl.ST_STRING("int in_")); txt = Tpl.writeText(txt, i_fname); @@ -8192,24 +8278,24 @@ algorithm }, true)); 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 = lm_184(txt, i_funArgs); + txt = lm_185(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retType); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" out;\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_185(txt, i_funArgs); + txt = lm_186(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("out = _")); txt = Tpl.writeText(txt, i_fname); 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 = lm_186(txt, i_funArgs); + txt = lm_187(txt, i_funArgs); txt = Tpl.popIter(txt); 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_187(txt, i_outVars); + txt = lm_188(txt, i_outVars); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("return 0;\n")); @@ -8223,7 +8309,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_188(txt, i_funArgs); + txt = lm_189(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8271,7 +8357,7 @@ algorithm txt = Tpl.writeText(txt, i_fname); 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 = lm_189(txt, i_funArgs); + txt = lm_190(txt, i_funArgs); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING_LIST({ ")\n", @@ -8281,7 +8367,7 @@ algorithm txt = Tpl.writeText(txt, 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 = lm_190(txt, i_funArgs, i_structVar); + txt = lm_191(txt, i_funArgs, i_structVar); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_retVar); @@ -8346,7 +8432,7 @@ algorithm end matchcontinue; end readInVar; -protected function fun_193 +protected function fun_194 input Tpl.Text in_txt; input DAE.ExpType in_i_tp; input String in_i_subvar_name; @@ -8387,9 +8473,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); then txt; end matchcontinue; -end fun_193; +end fun_194; -protected function lm_194 +protected function lm_195 input Tpl.Text in_txt; input list in_items; input String in_i_prefix; @@ -8416,9 +8502,9 @@ algorithm DAE.ExpType i_tp; DAE.ExpVar i_subvar; equation - txt = fun_193(txt, i_tp, i_subvar_name, i_prefix); + txt = fun_194(txt, i_tp, i_subvar_name, i_prefix); txt = Tpl.nextIter(txt); - txt = lm_194(txt, rest, i_prefix); + txt = lm_195(txt, rest, i_prefix); then txt; case ( txt, @@ -8427,10 +8513,10 @@ algorithm local list rest; equation - txt = lm_194(txt, rest, i_prefix); + txt = lm_195(txt, rest, i_prefix); then txt; end matchcontinue; -end lm_194; +end lm_195; public function readInVarRecordMembers input Tpl.Text in_txt; @@ -8452,7 +8538,7 @@ algorithm list i_vl; equation 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_194(txt, i_vl, i_prefix); + txt = lm_195(txt, i_vl, i_prefix); txt = Tpl.popIter(txt); then txt; @@ -8507,7 +8593,7 @@ algorithm end matchcontinue; end writeOutVar; -protected function fun_197 +protected function fun_198 input Tpl.Text in_txt; input DAE.ExpType in_i_tp; input Integer in_i_index; @@ -8558,9 +8644,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); then txt; end matchcontinue; -end fun_197; +end fun_198; -protected function lm_198 +protected function lm_199 input Tpl.Text in_txt; input list in_items; input Integer in_i_index; @@ -8591,9 +8677,9 @@ algorithm DAE.ExpType i_tp; DAE.ExpVar i_subvar; equation - txt = fun_197(txt, i_tp, i_index, i_subvar_name, i_prefix); + txt = fun_198(txt, i_tp, i_index, i_subvar_name, i_prefix); txt = Tpl.nextIter(txt); - txt = lm_198(txt, rest, i_index, i_prefix); + txt = lm_199(txt, rest, i_index, i_prefix); then txt; case ( txt, @@ -8603,12 +8689,12 @@ algorithm local list rest; equation - txt = lm_198(txt, rest, i_index, i_prefix); + txt = lm_199(txt, rest, i_index, i_prefix); then txt; end matchcontinue; -end lm_198; +end lm_199; -protected function fun_199 +protected function fun_200 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_args; @@ -8634,7 +8720,7 @@ algorithm txt = Tpl.writeText(txt, i_args); then txt; end matchcontinue; -end fun_199; +end fun_200; public function writeOutVarRecordMembers input Tpl.Text in_txt; @@ -8664,13 +8750,13 @@ algorithm equation i_basename = underscorePath(emptyTxt, i_n); i_args = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_args = lm_198(i_args, i_vl, i_index, i_prefix); + i_args = lm_199(i_args, i_vl, i_index, i_prefix); i_args = Tpl.popIter(i_args); txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); txt = Tpl.writeText(txt, i_basename); txt = Tpl.writeTok(txt, Tpl.ST_STRING("__desc")); str_2 = Tpl.textString(i_args); - txt = fun_199(txt, str_2, i_args); + txt = fun_200(txt, str_2, i_args); txt = Tpl.writeTok(txt, Tpl.ST_STRING(", TYPE_DESC_NONE")); then txt; @@ -8682,7 +8768,7 @@ algorithm end matchcontinue; end writeOutVarRecordMembers; -protected function fun_201 +protected function fun_202 input Tpl.Text in_txt; input String in_i_outStruct; input DAE.ComponentRef in_i_var_name; @@ -8715,9 +8801,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_201; +end fun_202; -protected function fun_202 +protected function fun_203 input Tpl.Text in_txt; input String in_i_outStruct; input Integer in_i_i; @@ -8752,9 +8838,9 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i)); then txt; end matchcontinue; -end fun_202; +end fun_203; -protected function lm_203 +protected function lm_204 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -8787,7 +8873,7 @@ algorithm equation (txt, i_varInits, i_varDecls) = daeExp(txt, i_exp, SimCode.contextOther, i_varInits, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_varInits) = lm_203(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_204(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8797,12 +8883,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_varInits) = lm_203(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_204(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); end matchcontinue; -end lm_203; +end lm_204; -protected function fun_204 +protected function fun_205 input Tpl.Text in_txt; input list in_i_instDims; input Tpl.Text in_i_instDimsInit; @@ -8853,7 +8939,7 @@ algorithm i_varInits = Tpl.writeTok(i_varInits, Tpl.ST_NEW_LINE()); then (txt, i_varInits); end matchcontinue; -end fun_204; +end fun_205; public function varInit input Tpl.Text in_txt; @@ -8890,12 +8976,12 @@ algorithm Tpl.Text i_instDimsInit; Tpl.Text i_varName; equation - i_varDecls = fun_201(i_varDecls, i_outStruct, i_var_name, i_var); - i_varName = fun_202(emptyTxt, i_outStruct, i_i, i_var_name); + i_varDecls = fun_202(i_varDecls, i_outStruct, i_var_name, i_var); + i_varName = fun_203(emptyTxt, i_outStruct, i_i, i_var_name); i_instDimsInit = Tpl.pushIter(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_203(i_instDimsInit, i_instDims, i_varDecls, i_varInits); + (i_instDimsInit, i_varDecls, i_varInits) = lm_204(i_instDimsInit, i_instDims, i_varDecls, i_varInits); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_varInits) = fun_204(txt, i_instDims, i_instDimsInit, i_varName, i_var_ty, i_varInits); + (txt, i_varInits) = fun_205(txt, i_instDims, i_instDimsInit, i_varName, i_var_ty, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8908,7 +8994,7 @@ algorithm end matchcontinue; end varInit; -protected function lm_206 +protected function lm_207 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -8941,7 +9027,7 @@ algorithm equation (txt, i_varInits, i_varDecls) = daeExp(txt, i_exp, SimCode.contextOther, i_varInits, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_varInits) = lm_206(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_207(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); case ( txt, @@ -8951,12 +9037,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_varInits) = lm_206(txt, rest, i_varDecls, i_varInits); + (txt, i_varDecls, i_varInits) = lm_207(txt, rest, i_varDecls, i_varInits); then (txt, i_varDecls, i_varInits); end matchcontinue; -end lm_206; +end lm_207; -protected function fun_207 +protected function fun_208 input Tpl.Text in_txt; input list in_i_instDims; input Tpl.Text in_i_instDimsInit; @@ -9033,7 +9119,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then (txt, i_varInits); end matchcontinue; -end fun_207; +end fun_208; public function varOutput input Tpl.Text in_txt; @@ -9070,9 +9156,9 @@ algorithm Tpl.Text i_instDimsInit; equation i_instDimsInit = Tpl.pushIter(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_206(i_instDimsInit, i_instDims, i_varDecls, i_varInits); + (i_instDimsInit, i_varDecls, i_varInits) = lm_207(i_instDimsInit, i_instDims, i_varDecls, i_varInits); i_instDimsInit = Tpl.popIter(i_instDimsInit); - (txt, i_varInits) = fun_207(txt, i_instDims, i_instDimsInit, i_var_ty, i_varInits, i_var_name, i_i, i_dest); + (txt, i_varInits) = fun_208(txt, i_instDims, i_instDimsInit, i_var_ty, i_varInits, i_var_name, i_i, i_dest); then (txt, i_varDecls, i_varInits); case ( txt, @@ -9085,7 +9171,7 @@ algorithm end matchcontinue; end varOutput; -protected function lm_209 +protected function lm_210 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9118,7 +9204,7 @@ algorithm equation (txt, i_preExp, i_varDecls) = extArg(txt, i_it, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_209(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_210(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -9128,12 +9214,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_209(txt, rest, i_varDecls, i_preExp); + (txt, i_varDecls, i_preExp) = lm_210(txt, rest, i_varDecls, i_preExp); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_209; +end lm_210; -protected function fun_210 +protected function fun_211 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -9157,9 +9243,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_210; +end fun_211; -protected function lm_211 +protected function lm_212 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9187,7 +9273,7 @@ algorithm equation (txt, i_varDecls) = extFunCallVardecl(txt, i_it, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_211(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_212(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9196,12 +9282,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_211(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_212(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_211; +end lm_212; -protected function fun_212 +protected function fun_213 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; input Tpl.Text in_i_varDecls; @@ -9229,9 +9315,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_212; +end fun_213; -protected function lm_213 +protected function lm_214 input Tpl.Text in_txt; input list in_items; @@ -9254,7 +9340,7 @@ algorithm equation txt = extFunCallVarcopy(txt, i_it); txt = Tpl.nextIter(txt); - txt = lm_213(txt, rest); + txt = lm_214(txt, rest); then txt; case ( txt, @@ -9262,12 +9348,12 @@ algorithm local list rest; equation - txt = lm_213(txt, rest); + txt = lm_214(txt, rest); then txt; end matchcontinue; -end lm_213; +end lm_214; -protected function fun_214 +protected function fun_215 input Tpl.Text in_txt; input SimCode.SimExtArg in_i_extReturn; @@ -9290,7 +9376,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_214; +end fun_215; public function extFunCall input Tpl.Text in_txt; @@ -9324,14 +9410,14 @@ algorithm equation i_fname = underscorePath(emptyTxt, i_name); i_args = Tpl.pushIter(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_209(i_args, i_extArgs, i_varDecls, i_preExp); + (i_args, i_varDecls, i_preExp) = lm_210(i_args, i_extArgs, i_varDecls, i_preExp); i_args = Tpl.popIter(i_args); - i_returnAssign = fun_210(emptyTxt, i_extReturn); + i_returnAssign = fun_211(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_211(txt, i_extArgs, i_varDecls); + (txt, i_varDecls) = lm_212(txt, i_extArgs, i_varDecls); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - (txt, i_varDecls) = fun_212(txt, i_extReturn, i_varDecls); + (txt, i_varDecls) = fun_213(txt, i_extReturn, i_varDecls); txt = Tpl.softNewLine(txt); txt = Tpl.writeText(txt, i_returnAssign); txt = Tpl.writeStr(txt, i_extName); @@ -9339,10 +9425,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_213(txt, i_extArgs); + txt = lm_214(txt, i_extArgs); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); - txt = fun_214(txt, i_extReturn); + txt = fun_215(txt, i_extReturn); then (txt, i_preExp, i_varDecls); case ( txt, @@ -9353,7 +9439,7 @@ algorithm end matchcontinue; end extFunCall; -protected function fun_216 +protected function fun_217 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input DAE.ComponentRef in_i_c; @@ -9395,9 +9481,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); then (txt, i_varDecls); end matchcontinue; -end fun_216; +end fun_217; -protected function fun_217 +protected function fun_218 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9435,7 +9521,7 @@ algorithm i_varDecls = Tpl.writeTok(i_varDecls, Tpl.ST_NEW_LINE()); then (txt, i_varDecls); end matchcontinue; -end fun_217; +end fun_218; public function extFunCallVardecl input Tpl.Text in_txt; @@ -9458,7 +9544,7 @@ algorithm DAE.ComponentRef i_c; DAE.ExpType i_ty; equation - (txt, i_varDecls) = fun_216(txt, i_ty, i_c, i_varDecls); + (txt, i_varDecls) = fun_217(txt, i_ty, i_c, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9469,7 +9555,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - (txt, i_varDecls) = fun_217(txt, i_oi, i_c, i_ty, i_varDecls); + (txt, i_varDecls) = fun_218(txt, i_oi, i_c, i_ty, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9479,7 +9565,7 @@ algorithm end matchcontinue; end extFunCallVardecl; -protected function fun_219 +protected function fun_220 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9516,7 +9602,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext;")); then txt; end matchcontinue; -end fun_219; +end fun_220; public function extFunCallVarcopy input Tpl.Text in_txt; @@ -9536,7 +9622,7 @@ algorithm DAE.ExpType i_ty; Integer i_oi; equation - txt = fun_219(txt, i_oi, i_c, i_ty); + txt = fun_220(txt, i_oi, i_c, i_ty); then txt; case ( txt, @@ -9545,7 +9631,7 @@ algorithm end matchcontinue; end extFunCallVarcopy; -protected function fun_221 +protected function fun_222 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ComponentRef in_i_c; @@ -9575,9 +9661,9 @@ algorithm txt = Tpl.writeStr(txt, intString(i_oi)); then txt; end matchcontinue; -end fun_221; +end fun_222; -protected function fun_222 +protected function fun_223 input Tpl.Text in_txt; input Integer in_i_oi; @@ -9598,9 +9684,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_222; +end fun_223; -protected function fun_223 +protected function fun_224 input Tpl.Text in_txt; input DAE.ExpType in_i_t; @@ -9621,9 +9707,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_223; +end fun_224; -protected function fun_224 +protected function fun_225 input Tpl.Text in_txt; input Integer in_i_oi; input DAE.ExpType in_i_t; @@ -9640,7 +9726,7 @@ algorithm 0, i_t ) equation - txt = fun_223(txt, i_t); + txt = fun_224(txt, i_t); then txt; case ( txt, @@ -9650,9 +9736,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("_ext")); then txt; end matchcontinue; -end fun_224; +end fun_225; -protected function fun_225 +protected function fun_226 input Tpl.Text in_txt; input Integer in_i_outputIndex; input DAE.ComponentRef in_i_c; @@ -9682,7 +9768,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_outputIndex)); then txt; end matchcontinue; -end fun_225; +end fun_226; public function extArg input Tpl.Text in_txt; @@ -9712,7 +9798,7 @@ algorithm Tpl.Text i_shortTypeStr; Tpl.Text i_name; equation - i_name = fun_221(emptyTxt, i_oi, i_c); + i_name = fun_222(emptyTxt, i_oi, i_c); i_shortTypeStr = expTypeShort(emptyTxt, i_t); txt = Tpl.writeTok(txt, Tpl.ST_STRING("data_of_")); txt = Tpl.writeText(txt, i_shortTypeStr); @@ -9733,8 +9819,8 @@ algorithm Tpl.Text i_suffix; Tpl.Text i_prefix; equation - i_prefix = fun_222(emptyTxt, i_oi); - i_suffix = fun_224(emptyTxt, i_oi, i_t); + i_prefix = fun_223(emptyTxt, i_oi); + i_suffix = fun_225(emptyTxt, i_oi, i_t); txt = Tpl.writeText(txt, i_prefix); txt = cref(txt, i_c); txt = Tpl.writeText(txt, i_suffix); @@ -9764,7 +9850,7 @@ algorithm Tpl.Text i_typeStr; equation i_typeStr = expTypeShort(emptyTxt, i_type__); - i_name = fun_225(emptyTxt, i_outputIndex, i_c); + i_name = fun_226(emptyTxt, i_outputIndex, i_c); (i_dim, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, SimCode.contextOther, i_preExp, i_varDecls); txt = Tpl.writeTok(txt, Tpl.ST_STRING("size_of_dimension_")); txt = Tpl.writeText(txt, i_typeStr); @@ -9783,7 +9869,7 @@ algorithm end matchcontinue; end extArg; -protected function lm_227 +protected function lm_228 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9811,7 +9897,7 @@ algorithm equation (txt, i_varDecls) = funStatement(txt, i_stmt, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_227(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_228(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9820,10 +9906,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_227(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_228(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_227; +end lm_228; public function funBody input Tpl.Text txt; @@ -9836,14 +9922,14 @@ protected algorithm i_varDecls := emptyTxt; i_bodyPart := Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_bodyPart, i_varDecls) := lm_227(i_bodyPart, i_body, i_varDecls); + (i_bodyPart, i_varDecls) := lm_228(i_bodyPart, i_body, i_varDecls); i_bodyPart := Tpl.popIter(i_bodyPart); out_txt := Tpl.writeText(txt, i_varDecls); out_txt := Tpl.softNewLine(out_txt); out_txt := Tpl.writeText(out_txt, i_bodyPart); end funBody; -protected function lm_229 +protected function lm_230 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -9871,7 +9957,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, SimCode.contextOther, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_229(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_230(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -9880,10 +9966,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_229(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_230(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_229; +end lm_230; public function funStatement input Tpl.Text in_txt; @@ -9906,7 +9992,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_229(txt, i_statementLst, i_varDecls); + (txt, i_varDecls) = lm_230(txt, i_statementLst, i_varDecls); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -9919,7 +10005,7 @@ algorithm end matchcontinue; end funStatement; -protected function fun_231 +protected function fun_232 input Tpl.Text in_txt; input String in_it; input DAE.ComponentRef in_i_cref; @@ -9978,9 +10064,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_231; +end fun_232; -protected function lm_232 +protected function lm_233 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_retStruct; @@ -10028,7 +10114,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_i1)); txt = Tpl.writeTok(txt, Tpl.ST_STRING(";")); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_232(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -10040,12 +10126,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_232(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, rest, i_retStruct, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_232; +end lm_233; -protected function lm_233 +protected function lm_234 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10077,7 +10163,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_233(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10087,12 +10173,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_233(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_233; +end lm_234; -protected function fun_234 +protected function fun_235 input Tpl.Text in_txt; input Option in_i_rng_expOption; input Tpl.Text in_i_varDecls; @@ -10131,9 +10217,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_234; +end fun_235; -protected function lm_235 +protected function lm_236 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10165,7 +10251,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_235(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10175,12 +10261,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_235(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_235; +end lm_236; -protected function lm_236 +protected function lm_237 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10212,7 +10298,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_237(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10222,12 +10308,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_236(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_237(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_236; +end lm_237; -protected function fun_237 +protected function fun_238 input Tpl.Text in_txt; input Boolean in_i_boolean; input Tpl.Text in_i_ivar; @@ -10289,9 +10375,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(");")); then txt; end matchcontinue; -end fun_237; +end fun_238; -protected function lm_238 +protected function lm_239 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10323,7 +10409,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_238(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10333,12 +10419,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_238(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_238; +end lm_239; -protected function fun_239 +protected function fun_240 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -10370,9 +10456,9 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_239; +end fun_240; -protected function lm_240 +protected function lm_241 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_doneVar; @@ -10426,7 +10512,7 @@ algorithm txt = Tpl.popBlock(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("};")); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_240(txt, rest, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, rest, i_doneVar, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10437,12 +10523,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_240(txt, rest, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, rest, i_doneVar, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_240; +end lm_241; -protected function lm_241 +protected function lm_242 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10474,7 +10560,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_241(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10484,12 +10570,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_241(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_241; +end lm_242; -protected function lm_242 +protected function lm_243 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -10521,7 +10607,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_243(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -10531,10 +10617,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_242(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_243(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_242; +end lm_243; public function algStatement input Tpl.Text in_txt; @@ -10625,7 +10711,7 @@ algorithm (i_expPart, i_preExp, i_varDecls) = daeExp(emptyTxt, i_e, i_context, i_preExp, i_varDecls); (txt_2, i_preExp, i_varDecls) = indexSpecFromCref(emptyTxt, i_cref, i_context, i_preExp, i_varDecls); str_3 = Tpl.textString(txt_2); - txt = fun_231(txt, str_3, i_cref, i_expPart, i_t, i_preExp); + txt = fun_232(txt, str_3, i_cref, i_expPart, i_t, i_preExp); then (txt, i_varDecls); case ( txt, @@ -10643,7 +10729,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_232(txt, i_expExpLst, i_retStruct, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_233(txt, i_expExpLst, i_retStruct, i_varDecls, i_preExp, i_context); txt = Tpl.popIter(txt); then (txt, i_varDecls); @@ -10667,7 +10753,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_233(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_234(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10709,7 +10795,7 @@ algorithm (i_r3, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); i_preExp = emptyTxt; (i_er1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rng_exp, i_context, i_preExp, i_varDecls); - (i_er2, i_varDecls, i_preExp) = fun_234(emptyTxt, i_rng_expOption, i_varDecls, i_preExp, i_context); + (i_er2, i_varDecls, i_preExp) = fun_235(emptyTxt, i_rng_expOption, i_varDecls, i_preExp, i_context); (i_er3, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rng_range, i_context, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); @@ -10757,7 +10843,7 @@ algorithm txt = Tpl.writeText(txt, i_stateVar); txt = Tpl.writeTok(txt, Tpl.ST_LINE(" = get_memory_state();\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_235(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_236(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_STRING("restore_memory_state(")); @@ -10802,10 +10888,10 @@ algorithm i_preExp = emptyTxt; (i_evar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); i_statements = Tpl.pushIter(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_236(i_statements, i_statementLst, i_varDecls, i_context); + (i_statements, i_varDecls) = lm_237(i_statements, i_statementLst, i_varDecls, i_context); i_statements = Tpl.popIter(i_statements); i_id = Tpl.writeStr(emptyTxt, i_ident); - i_stmtStuff = fun_237(emptyTxt, i_boolean, i_ivar, i_identType, i_tvar, i_evar, i_arrayType, i_id); + i_stmtStuff = fun_238(emptyTxt, i_boolean, i_ivar, i_identType, i_tvar, i_evar, i_arrayType, i_id); txt = Tpl.writeText(txt, i_preExp); txt = Tpl.softNewLine(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE("{\n")); @@ -10864,7 +10950,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_238(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_239(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10901,7 +10987,7 @@ algorithm local DAE.Statement i_when; equation - (txt, i_varDecls) = fun_239(txt, i_context, i_varDecls, i_when); + (txt, i_varDecls) = fun_240(txt, i_context, i_varDecls, i_when); then (txt, i_varDecls); case ( txt, @@ -10943,7 +11029,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_240(txt, i_caseStmt, i_doneVar, i_varDecls, i_context); + (txt, i_varDecls) = lm_241(txt, i_caseStmt, i_doneVar, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -10976,7 +11062,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(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_241(i_body, i_tryBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_242(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)); @@ -10995,7 +11081,7 @@ algorithm Tpl.Text i_body; equation i_body = Tpl.pushIter(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_242(i_body, i_catchBody, i_varDecls, i_context); + (i_body, i_varDecls) = lm_243(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)); @@ -11045,7 +11131,7 @@ algorithm end matchcontinue; end algStatement; -protected function lm_244 +protected function lm_245 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11077,7 +11163,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_244(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_245(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11087,12 +11173,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_244(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_245(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_244; +end lm_245; -protected function lm_245 +protected function lm_246 input Tpl.Text in_txt; input list in_items; @@ -11117,7 +11203,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_it)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_245(txt, rest); + txt = lm_246(txt, rest); then txt; case ( txt, @@ -11125,10 +11211,10 @@ algorithm local list rest; equation - txt = lm_245(txt, rest); + txt = lm_246(txt, rest); then txt; end matchcontinue; -end lm_245; +end lm_246; public function algStatementWhen input Tpl.Text in_txt; @@ -11161,14 +11247,14 @@ algorithm equation (i_preIf, i_varDecls) = algStatementWhenPre(emptyTxt, i_it, i_varDecls); i_statements = Tpl.pushIter(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_244(i_statements, i_statementLst, i_varDecls, i_context); + (i_statements, i_varDecls) = lm_245(i_statements, i_statementLst, i_varDecls, i_context); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(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_245(txt, i_helpVarIndices); + txt = lm_246(txt, i_helpVarIndices); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -11187,7 +11273,7 @@ algorithm end matchcontinue; end algStatementWhen; -protected function fun_247 +protected function fun_248 input Tpl.Text in_txt; input Option in_i_elseWhen; input Tpl.Text in_i_varDecls; @@ -11215,9 +11301,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_247; +end fun_248; -protected function fun_248 +protected function fun_249 input Tpl.Text in_txt; input Option in_i_when_elseWhen; input Tpl.Text in_i_varDecls; @@ -11245,9 +11331,9 @@ algorithm i_varDecls ) then (txt, i_varDecls); end matchcontinue; -end fun_248; +end fun_249; -protected function fun_249 +protected function fun_250 input Tpl.Text in_txt; input list in_i_helpVarIndices; input DAE.Exp in_i_when_exp; @@ -11276,7 +11362,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_248(emptyTxt, i_when_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_249(emptyTxt, i_when_elseWhen, i_varDecls); i_preExp = emptyTxt; (i_res, i_preExp, i_varDecls) = daeExp(emptyTxt, i_when_exp, SimCode.contextSimulationDescrete, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -11296,7 +11382,7 @@ algorithm _ ) then (txt, i_varDecls); end matchcontinue; -end fun_249; +end fun_250; public function algStatementWhenPre input Tpl.Text in_txt; @@ -11323,7 +11409,7 @@ algorithm Tpl.Text i_preExp; Tpl.Text i_restPre; equation - (i_restPre, i_varDecls) = fun_247(emptyTxt, i_elseWhen, i_varDecls); + (i_restPre, i_varDecls) = fun_248(emptyTxt, i_elseWhen, i_varDecls); i_preExp = emptyTxt; (i_assignments, i_preExp, i_varDecls) = algStatementWhenPreAssigns(emptyTxt, i_el, i_helpVarIndices, i_preExp, i_varDecls); txt = Tpl.writeText(txt, i_preExp); @@ -11342,7 +11428,7 @@ algorithm list i_helpVarIndices; DAE.Statement i_when; equation - (txt, i_varDecls) = fun_249(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); + (txt, i_varDecls) = fun_250(txt, i_helpVarIndices, i_when_exp, i_varDecls, i_when_elseWhen); then (txt, i_varDecls); case ( txt, @@ -11352,7 +11438,7 @@ algorithm end matchcontinue; end algStatementWhenPre; -protected function lm_251 +protected function lm_252 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11380,7 +11466,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, SimCode.contextSimulationDescrete, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_251(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_252(txt, rest, i_varDecls); then (txt, i_varDecls); case ( txt, @@ -11389,12 +11475,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_251(txt, rest, i_varDecls); + (txt, i_varDecls) = lm_252(txt, rest, i_varDecls); then (txt, i_varDecls); end matchcontinue; -end lm_251; +end lm_252; -protected function lm_252 +protected function lm_253 input Tpl.Text in_txt; input list in_items; @@ -11419,7 +11505,7 @@ algorithm txt = Tpl.writeStr(txt, intString(i_it)); txt = Tpl.writeTok(txt, Tpl.ST_STRING("])")); txt = Tpl.nextIter(txt); - txt = lm_252(txt, rest); + txt = lm_253(txt, rest); then txt; case ( txt, @@ -11427,10 +11513,10 @@ algorithm local list rest; equation - txt = lm_252(txt, rest); + txt = lm_253(txt, rest); then txt; end matchcontinue; -end lm_252; +end lm_253; public function algStatementWhenElse input Tpl.Text in_txt; @@ -11458,12 +11544,12 @@ algorithm Tpl.Text i_statements; equation i_statements = Tpl.pushIter(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_251(i_statements, i_when_statementLst, i_varDecls); + (i_statements, i_varDecls) = lm_252(i_statements, i_when_statementLst, i_varDecls); i_statements = Tpl.popIter(i_statements); (i_else, i_varDecls) = algStatementWhenElse(emptyTxt, i_when_elseWhen, i_varDecls); txt = Tpl.writeTok(txt, Tpl.ST_STRING("else 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_252(txt, i_when_helpVarIndices); + txt = lm_253(txt, i_when_helpVarIndices); txt = Tpl.popIter(txt); txt = Tpl.writeTok(txt, Tpl.ST_LINE(") {\n")); txt = Tpl.pushBlock(txt, Tpl.BT_INDENT(2)); @@ -11481,7 +11567,7 @@ algorithm end matchcontinue; end algStatementWhenElse; -protected function fun_254 +protected function fun_255 input Tpl.Text in_txt; input list in_i_ints; input DAE.Exp in_i_firstExp; @@ -11530,7 +11616,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_254; +end fun_255; public function algStatementWhenPreAssigns input Tpl.Text in_txt; @@ -11567,7 +11653,7 @@ algorithm list i_restExps; DAE.Exp i_firstExp; equation - (txt, i_varDecls, i_preExp) = fun_254(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); + (txt, i_varDecls, i_preExp) = fun_255(txt, i_ints, i_firstExp, i_varDecls, i_preExp, i_restExps); then (txt, i_preExp, i_varDecls); case ( txt, @@ -11579,7 +11665,7 @@ algorithm end matchcontinue; end algStatementWhenPreAssigns; -protected function lm_256 +protected function lm_257 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11611,7 +11697,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_256(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11621,12 +11707,12 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_256(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_256; +end lm_257; -protected function lm_257 +protected function lm_258 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -11658,7 +11744,7 @@ algorithm equation (txt, i_varDecls) = algStatement(txt, i_it, i_context, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); case ( txt, @@ -11668,10 +11754,10 @@ algorithm local list rest; equation - (txt, i_varDecls) = lm_257(txt, rest, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, rest, i_varDecls, i_context); then (txt, i_varDecls); end matchcontinue; -end lm_257; +end lm_258; public function elseExpr input Tpl.Text in_txt; @@ -11716,7 +11802,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_256(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_257(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -11736,7 +11822,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_257(txt, i_statementLst, i_varDecls, i_context); + (txt, i_varDecls) = lm_258(txt, i_statementLst, i_varDecls, i_context); txt = Tpl.popIter(txt); txt = Tpl.softNewLine(txt); txt = Tpl.popBlock(txt); @@ -11751,7 +11837,7 @@ algorithm end matchcontinue; end elseExpr; -protected function fun_259 +protected function fun_260 input Tpl.Text in_txt; input Boolean in_it; input DAE.ComponentRef in_i_cref_componentRef; @@ -11796,7 +11882,7 @@ algorithm txt = cref(txt, i_cref_componentRef); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_259; +end fun_260; public function scalarLhsCref input Tpl.Text in_txt; @@ -11829,7 +11915,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefNoSub(i_cref_componentRef); - (txt, i_varDecls, i_preExp) = fun_259(txt, ret_0, i_cref_componentRef, i_varDecls, i_preExp, i_context, i_cref); + (txt, i_varDecls, i_preExp) = fun_260(txt, ret_0, i_cref_componentRef, i_varDecls, i_preExp, i_context, i_cref); then (txt, i_preExp, i_varDecls); case ( txt, @@ -11924,7 +12010,7 @@ algorithm end matchcontinue; end rhsCrefType; -protected function fun_263 +protected function fun_264 input Tpl.Text in_txt; input Boolean in_i_bool; @@ -11947,7 +12033,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then txt; end matchcontinue; -end fun_263; +end fun_264; public function daeExp input Tpl.Text in_txt; @@ -12009,7 +12095,7 @@ algorithm local Boolean i_bool; equation - txt = fun_263(txt, i_bool); + txt = fun_264(txt, i_bool); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12267,7 +12353,7 @@ algorithm out_txt := Tpl.writeText(txt, i_strVar); end daeExpSconst; -protected function lm_266 +protected function lm_267 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -12304,7 +12390,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_266(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_267(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -12315,12 +12401,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_266(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_267(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_266; +end lm_267; -protected function fun_267 +protected function fun_268 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -12396,7 +12482,7 @@ algorithm ret_3 = listLength(i_subs); i_dimsLenStr = Tpl.writeStr(emptyTxt, intString(ret_3)); i_dimsValuesStr = Tpl.pushIter(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_266(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, i_varDecls, i_preExp) = lm_267(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); i_dimsValuesStr = Tpl.popIter(i_dimsValuesStr); txt = Tpl.writeTok(txt, Tpl.ST_STRING("(*")); txt = Tpl.writeText(txt, i_arrayType); @@ -12409,9 +12495,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("))")); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_267; +end fun_268; -protected function fun_268 +protected function fun_269 input Tpl.Text in_txt; input DAE.ExpType in_i_cref_ty; @@ -12432,9 +12518,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_268; +end fun_269; -protected function fun_269 +protected function fun_270 input Tpl.Text in_txt; input Boolean in_it; input Tpl.Text in_i_preExp; @@ -12471,7 +12557,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefSubIsScalar(i_cref_componentRef); - (txt, i_preExp, i_varDecls) = fun_267(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_268(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12485,14 +12571,14 @@ algorithm local Tpl.Text i_cast; equation - i_cast = fun_268(emptyTxt, i_cref_ty); + i_cast = fun_269(emptyTxt, i_cref_ty); txt = Tpl.writeText(txt, i_cast); txt = cref(txt, i_cref_componentRef); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_269; +end fun_270; -protected function fun_270 +protected function fun_271 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_preExp; @@ -12529,7 +12615,7 @@ algorithm Boolean ret_0; equation ret_0 = SimCode.crefNoSub(i_cref_componentRef); - (txt, i_preExp, i_varDecls) = fun_269(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_270(txt, ret_0, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12546,7 +12632,7 @@ algorithm txt = Tpl.writeStr(txt, str_1); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_270; +end fun_271; public function daeExpCrefRhs input Tpl.Text in_txt; @@ -12596,7 +12682,7 @@ algorithm equation (txt_0, i_preExp, i_varDecls) = daeExpCrefRhsArrayBox(emptyTxt, i_cref, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(txt_0); - (txt, i_preExp, i_varDecls) = fun_270(txt, str_1, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); + (txt, i_preExp, i_varDecls) = fun_271(txt, str_1, i_preExp, i_context, i_subs, i_varDecls, i_cref_ty, i_cref_componentRef); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12623,7 +12709,7 @@ algorithm end matchcontinue; end daeExpCrefRhs; -protected function fun_272 +protected function fun_273 input Tpl.Text in_txt; input DAE.Subscript in_i_sub; input Tpl.Text in_i_varDecls; @@ -12696,9 +12782,9 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_272; +end fun_273; -protected function lm_273 +protected function lm_274 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -12733,9 +12819,9 @@ algorithm list rest; DAE.Subscript i_sub; equation - (txt, i_varDecls, i_preExp) = fun_272(txt, i_sub, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = fun_273(txt, i_sub, i_varDecls, i_preExp, i_context); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_273(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_274(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -12746,10 +12832,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_273(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_274(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_273; +end lm_274; public function daeExpCrefRhsIndexSpec input Tpl.Text txt; @@ -12770,7 +12856,7 @@ algorithm ret_1 := listLength(i_subs); i_nridx__str := Tpl.writeStr(emptyTxt, intString(ret_1)); i_idx__str := Tpl.pushIter(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_273(i_idx__str, i_subs, i_varDecls, i_preExp, i_context); + (i_idx__str, out_i_varDecls, out_i_preExp) := lm_274(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(emptyTxt, "index_spec_t", out_i_varDecls); out_i_preExp := Tpl.writeTok(out_i_preExp, Tpl.ST_STRING("create_index_spec(&")); @@ -12784,7 +12870,7 @@ algorithm out_txt := Tpl.writeText(txt, i_tmp); end daeExpCrefRhsIndexSpec; -protected function lm_275 +protected function lm_276 input Tpl.Text in_txt; input list> in_items; @@ -12808,7 +12894,7 @@ algorithm equation txt = Tpl.writeStr(txt, intString(i_i)); txt = Tpl.nextIter(txt); - txt = lm_275(txt, rest); + txt = lm_276(txt, rest); then txt; case ( txt, @@ -12816,12 +12902,12 @@ algorithm local list> rest; equation - txt = lm_275(txt, rest); + txt = lm_276(txt, rest); then txt; end matchcontinue; -end lm_275; +end lm_276; -protected function fun_276 +protected function fun_277 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.ComponentRef in_i_cref_componentRef; @@ -12863,7 +12949,7 @@ algorithm ret_3 = listLength(i_dims); i_dimsLenStr = Tpl.writeStr(emptyTxt, intString(ret_3)); i_dimsValuesStr = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_STRING(", ")), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - i_dimsValuesStr = lm_275(i_dimsValuesStr, i_dims); + i_dimsValuesStr = lm_276(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(&")); @@ -12888,7 +12974,7 @@ algorithm _ ) then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_276; +end fun_277; public function daeExpCrefRhsArrayBox input Tpl.Text in_txt; @@ -12920,7 +13006,7 @@ algorithm DAE.ExpType i_aty; DAE.Exp i_cref; equation - (txt, i_preExp, i_varDecls) = fun_276(txt, i_context, i_cref_componentRef, i_preExp, i_dims, i_varDecls, i_aty); + (txt, i_preExp, i_varDecls) = fun_277(txt, i_context, i_cref_componentRef, i_preExp, i_dims, i_varDecls, i_aty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -12932,7 +13018,7 @@ algorithm end matchcontinue; end daeExpCrefRhsArrayBox; -protected function fun_278 +protected function fun_279 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -12955,9 +13041,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_278; +end fun_279; -protected function fun_279 +protected function fun_280 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -12980,9 +13066,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_279; +end fun_280; -protected function fun_280 +protected function fun_281 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -13005,9 +13091,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_280; +end fun_281; -protected function fun_281 +protected function fun_282 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -13030,9 +13116,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("real_array")); then txt; end matchcontinue; -end fun_281; +end fun_282; -protected function fun_282 +protected function fun_283 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e2; @@ -13155,7 +13241,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_278(emptyTxt, i_ty); + i_type = fun_279(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13181,7 +13267,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_279(emptyTxt, i_ty); + i_type = fun_280(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13207,7 +13293,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_280(emptyTxt, i_ty); + i_type = fun_281(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13233,7 +13319,7 @@ algorithm Tpl.Text i_var; Tpl.Text i_type; equation - i_type = fun_281(emptyTxt, i_ty); + i_type = fun_282(emptyTxt, i_ty); (i_var, i_varDecls) = tempDecl(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); @@ -13258,7 +13344,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpBinary:ERR")); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_282; +end fun_283; public function daeExpBinary input Tpl.Text in_txt; @@ -13293,7 +13379,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_282(txt, i_operator, i_e2, i_e1, i_preExp, i_varDecls); + (txt, i_preExp, i_varDecls) = fun_283(txt, i_operator, i_e2, i_e1, i_preExp, i_varDecls); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13305,7 +13391,7 @@ algorithm end matchcontinue; end daeExpBinary; -protected function fun_284 +protected function fun_285 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e; @@ -13357,7 +13443,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpUnary:ERR")); then txt; end matchcontinue; -end fun_284; +end fun_285; public function daeExpUnary input Tpl.Text in_txt; @@ -13389,7 +13475,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_284(txt, i_operator, i_e); + txt = fun_285(txt, i_operator, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13401,7 +13487,7 @@ algorithm end matchcontinue; end daeExpUnary; -protected function fun_286 +protected function fun_287 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e2; @@ -13448,7 +13534,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpLbinary:ERR")); then txt; end matchcontinue; -end fun_286; +end fun_287; public function daeExpLbinary input Tpl.Text in_txt; @@ -13483,7 +13569,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp2, i_context, i_preExp, i_varDecls); - txt = fun_286(txt, i_operator, i_e2, i_e1); + txt = fun_287(txt, i_operator, i_e2, i_e1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13495,7 +13581,7 @@ algorithm end matchcontinue; end daeExpLbinary; -protected function fun_288 +protected function fun_289 input Tpl.Text in_txt; input DAE.Operator in_i_operator; input Tpl.Text in_i_e; @@ -13522,7 +13608,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_288; +end fun_289; public function daeExpLunary input Tpl.Text in_txt; @@ -13554,7 +13640,7 @@ algorithm Tpl.Text i_e; equation (i_e, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - txt = fun_288(txt, i_operator, i_e); + txt = fun_289(txt, i_operator, i_e); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13566,7 +13652,7 @@ algorithm end matchcontinue; end daeExpLunary; -protected function fun_290 +protected function fun_291 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -13869,9 +13955,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("daeExpRelation:ERR")); then txt; end matchcontinue; -end fun_290; +end fun_291; -protected function fun_291 +protected function fun_292 input Tpl.Text in_txt; input String in_it; input DAE.Operator in_i_rel_operator; @@ -13910,7 +13996,7 @@ algorithm equation (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); - txt = fun_290(txt, i_rel_operator, i_e2, i_e1); + txt = fun_291(txt, i_rel_operator, i_e2, i_e1); then (txt, i_varDecls, i_preExp); case ( txt, @@ -13927,7 +14013,7 @@ algorithm txt = Tpl.writeStr(txt, str_1); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_291; +end fun_292; public function daeExpRelation input Tpl.Text in_txt; @@ -13963,7 +14049,7 @@ algorithm equation (txt_0, i_preExp, i_varDecls) = daeExpRelationSim(emptyTxt, i_rel, i_context, i_preExp, i_varDecls); str_1 = Tpl.textString(txt_0); - (txt, i_varDecls, i_preExp) = fun_291(txt, str_1, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_292(txt, str_1, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_context, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -13975,7 +14061,7 @@ algorithm end matchcontinue; end daeExpRelation; -protected function fun_293 +protected function fun_294 input Tpl.Text in_txt; input DAE.Operator in_i_rel_operator; input Tpl.Text in_i_e2; @@ -14075,9 +14161,9 @@ algorithm i_preExp ) then (txt, i_preExp); end matchcontinue; -end fun_293; +end fun_294; -protected function fun_294 +protected function fun_295 input Tpl.Text in_txt; input SimCode.Context in_i_context; input DAE.Operator in_i_rel_operator; @@ -14116,7 +14202,7 @@ algorithm (i_e1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp1, i_context, i_preExp, i_varDecls); (i_e2, i_preExp, i_varDecls) = daeExp(emptyTxt, i_rel_exp2, i_context, i_preExp, i_varDecls); (i_res, i_varDecls) = tempDecl(emptyTxt, "modelica_boolean", i_varDecls); - (txt, i_preExp) = fun_293(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); + (txt, i_preExp) = fun_294(txt, i_rel_operator, i_e2, i_e1, i_res, i_preExp); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14128,7 +14214,7 @@ algorithm _ ) then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_294; +end fun_295; public function daeExpRelationSim input Tpl.Text in_txt; @@ -14160,7 +14246,7 @@ algorithm DAE.Exp i_rel_exp1; DAE.Exp i_rel; equation - (txt, i_varDecls, i_preExp) = fun_294(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); + (txt, i_varDecls, i_preExp) = fun_295(txt, i_context, i_rel_operator, i_rel_exp2, i_varDecls, i_preExp, i_rel_exp1); then (txt, i_preExp, i_varDecls); case ( txt, @@ -14257,7 +14343,7 @@ algorithm end matchcontinue; end daeExpIf; -protected function fun_297 +protected function fun_298 input Tpl.Text in_txt; input DAE.ExpType in_i_arg_ty; @@ -14278,9 +14364,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_297; +end fun_298; -protected function lm_298 +protected function lm_299 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14317,7 +14403,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_298(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14328,12 +14414,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_298(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_298; +end lm_299; -protected function lm_299 +protected function lm_300 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14370,7 +14456,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_299(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_300(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14381,12 +14467,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_299(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_300(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_299; +end lm_300; -protected function fun_300 +protected function fun_301 input Tpl.Text in_txt; input Boolean in_i_builtin; input Tpl.Text in_i_retType; @@ -14420,9 +14506,9 @@ algorithm txt = Tpl.writeText(txt, i_retVar); then txt; end matchcontinue; -end fun_300; +end fun_301; -protected function lm_301 +protected function lm_302 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14459,7 +14545,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_301(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_302(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14470,10 +14556,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_301(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_302(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_301; +end lm_302; public function daeExpCall input Tpl.Text in_txt; @@ -14509,7 +14595,7 @@ algorithm equation i_retType = expTypeArrayIf(emptyTxt, i_arg_ty); (i_retVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_retType), i_varDecls); - i_cast = fun_297(emptyTxt, i_arg_ty); + i_cast = fun_298(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); @@ -14752,7 +14838,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_298(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_299(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_preExp = daeExpCallBuiltinPrefix(i_preExp, i_builtin); @@ -14779,7 +14865,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_299(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_300(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_retType = Tpl.writeText(emptyTxt, i_funName); @@ -14793,7 +14879,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_300(txt, i_builtin, i_retType, i_retVar); + txt = fun_301(txt, i_builtin, i_retType, i_retVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -14811,7 +14897,7 @@ algorithm Tpl.Text i_argStr; equation i_argStr = Tpl.pushIter(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_301(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); + (i_argStr, i_varDecls, i_preExp) = lm_302(i_argStr, i_expLst, i_varDecls, i_preExp, i_context); i_argStr = Tpl.popIter(i_argStr); i_funName = underscorePath(emptyTxt, i_path); i_retType = Tpl.writeText(emptyTxt, i_funName); @@ -14864,7 +14950,7 @@ algorithm end matchcontinue; end daeExpCallBuiltinPrefix; -protected function fun_304 +protected function fun_305 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -14885,9 +14971,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_304; +end fun_305; -protected function fun_305 +protected function fun_306 input Tpl.Text in_txt; input Boolean in_i_scalar; @@ -14908,9 +14994,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("&")); then txt; end matchcontinue; -end fun_305; +end fun_306; -protected function lm_306 +protected function lm_307 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -14950,7 +15036,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING(")")); (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_306(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_307(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -14961,10 +15047,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_306(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_307(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_306; +end lm_307; public function daeExpArray input Tpl.Text in_txt; @@ -15003,10 +15089,10 @@ algorithm equation i_arrayTypeStr = expTypeArray(emptyTxt, i_ty); (i_arrayVar, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_arrayTypeStr), i_varDecls); - i_scalarPrefix = fun_304(emptyTxt, i_scalar); - i_scalarRef = fun_305(emptyTxt, i_scalar); + i_scalarPrefix = fun_305(emptyTxt, i_scalar); + i_scalarRef = fun_306(emptyTxt, i_scalar); i_params = Tpl.pushIter(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_306(i_params, i_array, i_varDecls, i_preExp, i_context); + (i_params, i_varDecls, i_preExp) = lm_307(i_params, i_array, i_varDecls, i_preExp, i_context); 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); @@ -15032,7 +15118,7 @@ algorithm end matchcontinue; end daeExpArray; -protected function lm_308 +protected function lm_309 input Tpl.Text in_txt; input list>> in_items; input Tpl.Text in_i_vars2; @@ -15093,7 +15179,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_308(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_309(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); case ( txt, @@ -15106,10 +15192,10 @@ algorithm local list>> rest; equation - (txt, i_vars2, i_promote, i_varDecls) = lm_308(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (txt, i_vars2, i_promote, i_varDecls) = lm_309(txt, rest, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); then (txt, i_vars2, i_promote, i_varDecls); end matchcontinue; -end lm_308; +end lm_309; public function daeExpMatrix input Tpl.Text in_txt; @@ -15192,7 +15278,7 @@ algorithm i_vars2 = emptyTxt; i_promote = emptyTxt; i_catAlloc = Tpl.pushIter(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_308(i_catAlloc, i_m_scalar, i_vars2, i_promote, i_context, i_varDecls, i_arrayTypeStr); + (i_catAlloc, i_vars2, i_promote, i_varDecls) = lm_309(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); @@ -15220,7 +15306,7 @@ algorithm end matchcontinue; end daeExpMatrix; -protected function fun_310 +protected function fun_311 input Tpl.Text in_txt; input Boolean in_i_b; @@ -15241,9 +15327,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("scalar_")); then txt; end matchcontinue; -end fun_310; +end fun_311; -protected function fun_311 +protected function fun_312 input Tpl.Text in_txt; input Boolean in_i_b; @@ -15264,9 +15350,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_311; +end fun_312; -protected function lm_312 +protected function lm_313 input Tpl.Text in_txt; input list> in_items; input Tpl.Text in_i_varLstStr; @@ -15316,8 +15402,8 @@ algorithm Tpl.Text i_scalarRefStr; Tpl.Text i_scalarStr; equation - i_scalarStr = fun_310(emptyTxt, i_b); - i_scalarRefStr = fun_311(emptyTxt, i_b); + i_scalarStr = fun_311(emptyTxt, i_b); + i_scalarRefStr = fun_312(emptyTxt, i_b); (i_expVar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_e, i_context, i_preExp, i_varDecls); (i_tmp, i_varDecls) = tempDecl(emptyTxt, i_arrayTypeStr, i_varDecls); i_varLstStr = Tpl.writeTok(i_varLstStr, Tpl.ST_STRING(", &")); @@ -15332,7 +15418,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_312(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_313(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); case ( txt, @@ -15345,10 +15431,10 @@ algorithm local list> rest; equation - (txt, i_varLstStr, i_varDecls, i_preExp) = lm_312(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); + (txt, i_varLstStr, i_varDecls, i_preExp) = lm_313(txt, rest, i_varLstStr, i_arrayTypeStr, i_varDecls, i_preExp, i_context); then (txt, i_varLstStr, i_varDecls, i_preExp); end matchcontinue; -end lm_312; +end lm_313; public function daeExpMatrixRow input Tpl.Text txt; @@ -15367,14 +15453,14 @@ protected algorithm i_varLstStr := emptyTxt; i_preExp2 := Tpl.pushIter(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_312(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_313(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_314 +protected function fun_315 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; input Tpl.Text in_i_preExp; @@ -15457,7 +15543,7 @@ algorithm _ ) then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_314; +end fun_315; public function daeExpCast input Tpl.Text in_txt; @@ -15489,7 +15575,7 @@ algorithm Tpl.Text i_expVar; equation (i_expVar, i_preExp, i_varDecls) = daeExp(emptyTxt, i_exp, i_context, i_preExp, i_varDecls); - (txt, i_preExp, i_varDecls) = fun_314(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); + (txt, i_preExp, i_varDecls) = fun_315(txt, i_ty, i_preExp, i_exp, i_varDecls, i_expVar); then (txt, i_preExp, i_varDecls); case ( txt, @@ -15501,7 +15587,7 @@ algorithm end matchcontinue; end daeExpCast; -protected function fun_316 +protected function fun_317 input Tpl.Text in_txt; input SimCode.Context in_i_context; input Tpl.Text in_i_varDecls; @@ -15548,7 +15634,7 @@ algorithm txt = Tpl.writeText(txt, i_arrName); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_316; +end fun_317; public function daeExpAsub input Tpl.Text in_txt; @@ -15649,7 +15735,7 @@ algorithm equation ret_1 = SimCode.buildCrefExpFromAsub(i_cref, i_subs); (i_arrName, i_preExp, i_varDecls) = daeExpCrefRhs(emptyTxt, ret_1, i_context, i_preExp, i_varDecls); - (txt, i_varDecls, i_preExp) = fun_316(txt, i_context, i_varDecls, i_preExp, i_arrName, i_subs, i_cref_ty); + (txt, i_varDecls, i_preExp) = fun_317(txt, i_context, i_varDecls, i_preExp, i_arrName, i_subs, i_cref_ty); then (txt, i_preExp, i_varDecls); case ( txt, @@ -15723,7 +15809,7 @@ algorithm end matchcontinue; end daeExpSize; -protected function fun_319 +protected function fun_320 input Tpl.Text in_txt; input String in_it; @@ -15744,9 +15830,9 @@ algorithm _ ) then txt; end matchcontinue; -end fun_319; +end fun_320; -protected function fun_320 +protected function fun_321 input Tpl.Text in_txt; input String in_it; input Tpl.Text in_i_accFun; @@ -15773,12 +15859,12 @@ algorithm String str_0; equation str_0 = Tpl.textString(i_accFun); - txt = fun_319(txt, str_0); + txt = fun_320(txt, str_0); then txt; end matchcontinue; -end fun_320; +end fun_321; -protected function fun_321 +protected function fun_322 input Tpl.Text in_txt; input Option in_i_range_expOption; input Tpl.Text in_i_varDecls; @@ -15817,7 +15903,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("(1)")); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_321; +end fun_322; public function daeExpReduction input Tpl.Text in_txt; @@ -15875,12 +15961,12 @@ algorithm i_tmpExpPre = emptyTxt; (i_tmpExpVar, i_tmpExpPre, i_varDecls) = daeExp(emptyTxt, i_expr, i_context, i_tmpExpPre, i_varDecls); str_8 = Tpl.textString(i_accFun); - i_cast = fun_320(emptyTxt, str_8, i_accFun); + i_cast = fun_321(emptyTxt, str_8, i_accFun); (i_r1, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_r2, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_r3, i_varDecls) = tempDecl(emptyTxt, Tpl.textString(i_identType), i_varDecls); (i_er1, i_preExp, i_varDecls) = daeExp(emptyTxt, i_range_exp, i_context, i_preExp, i_varDecls); - (i_er2, i_varDecls, i_preExp) = fun_321(emptyTxt, i_range_expOption, i_varDecls, i_preExp, i_context); + (i_er2, i_varDecls, i_preExp) = fun_322(emptyTxt, i_range_expOption, i_varDecls, i_preExp, i_context); (i_er3, i_preExp, i_varDecls) = daeExp(emptyTxt, i_range_range, i_context, i_preExp, i_varDecls); i_preExp = Tpl.writeText(i_preExp, i_res); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_STRING(" = ")); @@ -15964,7 +16050,7 @@ algorithm end matchcontinue; end daeExpReduction; -protected function fun_323 +protected function fun_324 input Tpl.Text in_txt; input String in_i_type; @@ -15993,9 +16079,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_323; +end fun_324; -protected function fun_324 +protected function fun_325 input Tpl.Text in_txt; input String in_i_type; @@ -16024,7 +16110,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_324; +end fun_325; public function daeExpReductionFnName input Tpl.Text in_txt; @@ -16043,14 +16129,14 @@ algorithm "sum", i_type ) equation - txt = fun_323(txt, i_type); + txt = fun_324(txt, i_type); then txt; case ( txt, "product", i_type ) equation - txt = fun_324(txt, i_type); + txt = fun_325(txt, i_type); then txt; case ( txt, @@ -16064,7 +16150,7 @@ algorithm end matchcontinue; end daeExpReductionFnName; -protected function fun_326 +protected function fun_327 input Tpl.Text in_txt; input String in_i_type; @@ -16093,9 +16179,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_326; +end fun_327; -protected function fun_327 +protected function fun_328 input Tpl.Text in_txt; input String in_i_type; @@ -16124,7 +16210,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("INVALID_TYPE")); then txt; end matchcontinue; -end fun_327; +end fun_328; public function daeExpReductionStartValue input Tpl.Text in_txt; @@ -16143,14 +16229,14 @@ algorithm "min", i_type ) equation - txt = fun_326(txt, i_type); + txt = fun_327(txt, i_type); then txt; case ( txt, "max", i_type ) equation - txt = fun_327(txt, i_type); + txt = fun_328(txt, i_type); then txt; case ( txt, @@ -16176,7 +16262,7 @@ algorithm end matchcontinue; end daeExpReductionStartValue; -protected function lm_329 +protected function lm_330 input Tpl.Text in_txt; input SimCode.Variables in_items; input Tpl.Text in_i_preExpInner; @@ -16209,7 +16295,7 @@ algorithm equation (txt, i_varDeclsInner, i_preExpInner) = varInit(txt, i_it, "", 0, i_varDeclsInner, i_preExpInner); txt = Tpl.nextIter(txt); - (txt, i_preExpInner, i_varDeclsInner) = lm_329(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_330(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); case ( txt, @@ -16219,12 +16305,12 @@ algorithm local SimCode.Variables rest; equation - (txt, i_preExpInner, i_varDeclsInner) = lm_329(txt, rest, i_preExpInner, i_varDeclsInner); + (txt, i_preExpInner, i_varDeclsInner) = lm_330(txt, rest, i_preExpInner, i_varDeclsInner); then (txt, i_preExpInner, i_varDeclsInner); end matchcontinue; -end lm_329; +end lm_330; -protected function lm_330 +protected function lm_331 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDeclsInner; @@ -16256,7 +16342,7 @@ algorithm equation (txt, i_varDeclsInner) = algStatement(txt, i_it, i_context, i_varDeclsInner); txt = Tpl.nextIter(txt); - (txt, i_varDeclsInner) = lm_330(txt, rest, i_varDeclsInner, i_context); + (txt, i_varDeclsInner) = lm_331(txt, rest, i_varDeclsInner, i_context); then (txt, i_varDeclsInner); case ( txt, @@ -16266,12 +16352,12 @@ algorithm local list rest; equation - (txt, i_varDeclsInner) = lm_330(txt, rest, i_varDeclsInner, i_context); + (txt, i_varDeclsInner) = lm_331(txt, rest, i_varDeclsInner, i_context); then (txt, i_varDeclsInner); end matchcontinue; -end lm_330; +end lm_331; -protected function fun_331 +protected function fun_332 input Tpl.Text in_txt; input DAE.Exp in_i_exp; input SimCode.Context in_i_context; @@ -16312,13 +16398,13 @@ algorithm i_varDeclsInner = emptyTxt; ret_4 = SimCode.valueblockVars(i_exp); i_0__ = Tpl.pushIter(emptyTxt, Tpl.ITER_OPTIONS(0, NONE, SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); - (i_0__, i_preExpInner, i_varDeclsInner) = lm_329(i_0__, ret_4, i_preExpInner, i_varDeclsInner); + (i_0__, i_preExpInner, i_varDeclsInner) = lm_330(i_0__, ret_4, i_preExpInner, i_varDeclsInner); i_0__ = Tpl.popIter(i_0__); i_resType = expTypeModelica(emptyTxt, i_ty); txt_7 = expTypeModelica(emptyTxt, i_ty); (i_res, i_preExp) = tempDecl(emptyTxt, Tpl.textString(txt_7), i_preExp); i_stmts = Tpl.pushIter(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_varDeclsInner) = lm_330(i_stmts, i_body, i_varDeclsInner, i_context); + (i_stmts, i_varDeclsInner) = lm_331(i_stmts, i_body, i_varDeclsInner, i_context); i_stmts = Tpl.popIter(i_stmts); (i_expPart, i_preExpRes, i_varDeclsInner) = daeExp(emptyTxt, i_result, i_context, i_preExpRes, i_varDeclsInner); i_preExp = Tpl.writeTok(i_preExp, Tpl.ST_LINE("{\n")); @@ -16346,7 +16432,7 @@ algorithm i_preExp ) then (txt, i_preExp); end matchcontinue; -end fun_331; +end fun_332; public function daeExpValueblock input Tpl.Text txt; @@ -16359,11 +16445,11 @@ public function daeExpValueblock output Tpl.Text out_i_preExp; output Tpl.Text out_i_varDecls; algorithm - (out_txt, out_i_preExp) := fun_331(txt, i_exp, i_context, i_preExp); + (out_txt, out_i_preExp) := fun_332(txt, i_exp, i_context, i_preExp); out_i_varDecls := i_varDecls; end daeExpValueblock; -protected function lm_333 +protected function lm_334 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16400,7 +16486,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_333(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_334(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16411,10 +16497,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_333(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_334(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_333; +end lm_334; public function arrayScalarRhs input Tpl.Text txt; @@ -16438,7 +16524,7 @@ algorithm ret_2 := listLength(i_subs); i_dimsLenStr := Tpl.writeStr(emptyTxt, intString(ret_2)); i_dimsValuesStr := Tpl.pushIter(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_333(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); + (i_dimsValuesStr, out_i_varDecls, out_i_preExp) := lm_334(i_dimsValuesStr, i_subs, i_varDecls, i_preExp, i_context); i_dimsValuesStr := Tpl.popIter(i_dimsValuesStr); out_txt := Tpl.writeTok(txt, Tpl.ST_STRING("(*")); out_txt := Tpl.writeText(out_txt, i_arrayType); @@ -16609,7 +16695,7 @@ algorithm end matchcontinue; end daeExpCons; -protected function lm_338 +protected function lm_339 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16646,7 +16732,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_338(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_339(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16657,10 +16743,10 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_338(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_339(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_338; +end lm_339; public function daeExpMetaTuple input Tpl.Text in_txt; @@ -16696,7 +16782,7 @@ algorithm ret_1 = listLength(i_listExp); i_start = daeExpMetaHelperBoxStart(emptyTxt, ret_1); i_args = Tpl.pushIter(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_338(i_args, i_listExp, i_varDecls, i_preExp, i_context); + (i_args, i_varDecls, i_preExp) = lm_339(i_args, i_listExp, i_varDecls, i_preExp, i_context); i_args = Tpl.popIter(i_args); (i_tmp, i_varDecls) = tempDecl(emptyTxt, "modelica_metatype", i_varDecls); i_preExp = Tpl.writeText(i_preExp, i_tmp); @@ -16770,7 +16856,7 @@ algorithm end matchcontinue; end daeExpMetaOption; -protected function lm_341 +protected function lm_342 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16807,7 +16893,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_341(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); case ( txt, @@ -16818,12 +16904,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_341(txt, rest, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, rest, i_varDecls, i_preExp, i_context); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_341; +end lm_342; -protected function fun_342 +protected function fun_343 input Tpl.Text in_txt; input list in_i_args; input Tpl.Text in_i_varDecls; @@ -16859,11 +16945,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_341(txt, i_args, i_varDecls, i_preExp, i_context); + (txt, i_varDecls, i_preExp) = lm_342(txt, i_args, i_varDecls, i_preExp, i_context); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_342; +end fun_343; public function daeExpMetarecordcall input Tpl.Text in_txt; @@ -16903,7 +16989,7 @@ algorithm equation ret_1 = SimCode.incrementInt(i_index, 3); i_newIndex = Tpl.writeStr(emptyTxt, intString(ret_1)); - (i_argsStr, i_varDecls, i_preExp) = fun_342(emptyTxt, i_args, i_varDecls, i_preExp, i_context); + (i_argsStr, i_varDecls, i_preExp) = fun_343(emptyTxt, i_args, i_varDecls, i_preExp, i_context); i_box = Tpl.writeTok(emptyTxt, Tpl.ST_STRING("mmc_mk_box")); ret_4 = listLength(i_args); ret_5 = SimCode.incrementInt(ret_4, 1); @@ -16951,7 +17037,7 @@ algorithm (out_txt, i_expPart, out_i_preExp, out_i_varDecls) := daeExpMetaHelperConstantNameType(txt, i_expPart, ret_1, i_context, out_i_preExp, out_i_varDecls); end daeExpMetaHelperConstant; -protected function lm_345 +protected function lm_346 input Tpl.Text in_txt; input list in_items; input Tpl.Text in_i_varDecls; @@ -16998,7 +17084,7 @@ algorithm i_nameText = Tpl.writeStr(i_nameText, i_cvname); (txt, i_nameText, i_preExp, i_varDecls) = daeExpMetaHelperConstantNameType(txt, i_nameText, i_tp, i_context, i_preExp, i_varDecls); txt = Tpl.nextIter(txt); - (txt, i_varDecls, i_preExp) = lm_345(txt, rest, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, rest, i_varDecls, i_preExp, i_context, i_varname); then (txt, i_varDecls, i_preExp); case ( txt, @@ -17010,12 +17096,12 @@ algorithm local list rest; equation - (txt, i_varDecls, i_preExp) = lm_345(txt, rest, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, rest, i_varDecls, i_preExp, i_context, i_varname); then (txt, i_varDecls, i_preExp); end matchcontinue; -end lm_345; +end lm_346; -protected function fun_346 +protected function fun_347 input Tpl.Text in_txt; input list in_i_varLst; input Tpl.Text in_i_varDecls; @@ -17055,13 +17141,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_345(txt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); + (txt, i_varDecls, i_preExp) = lm_346(txt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); txt = Tpl.popIter(txt); then (txt, i_varDecls, i_preExp); end matchcontinue; -end fun_346; +end fun_347; -protected function fun_347 +protected function fun_348 input Tpl.Text in_txt; input DAE.ExpType in_i_type; input Tpl.Text in_i_varname; @@ -17147,7 +17233,7 @@ algorithm ret_1 = listLength(i_varLst); ret_2 = SimCode.incrementInt(ret_1, 1); i_start = daeExpMetaHelperBoxStart(emptyTxt, ret_2); - (i_args, i_varDecls, i_preExp) = fun_346(emptyTxt, i_varLst, i_varDecls, i_preExp, i_context, i_varname); + (i_args, i_varDecls, i_preExp) = fun_347(emptyTxt, i_varLst, i_varDecls, i_preExp, i_context, 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, &")); @@ -17167,7 +17253,7 @@ algorithm txt = Tpl.writeText(txt, i_varname); then (txt, i_preExp, i_varDecls); end matchcontinue; -end fun_347; +end fun_348; public function daeExpMetaHelperConstantNameType input Tpl.Text txt; @@ -17182,7 +17268,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_347(txt, i_type, i_varname, i_context, i_preExp, i_varDecls); + (out_txt, out_i_preExp, out_i_varDecls) := fun_348(txt, i_type, i_varname, i_context, i_preExp, i_varDecls); out_i_varname := i_varname; end daeExpMetaHelperConstantNameType; @@ -17321,7 +17407,7 @@ algorithm out_txt := Tpl.writeText(txt, i_newVar); end tempDecl; -protected function fun_351 +protected function fun_352 input Tpl.Text in_txt; input list in_i_instDims; input SimCode.Type in_i_var_ty; @@ -17348,7 +17434,7 @@ algorithm txt = expTypeArray(txt, i_var_ty); then txt; end matchcontinue; -end fun_351; +end fun_352; public function varType input Tpl.Text in_txt; @@ -17368,7 +17454,7 @@ algorithm list i_instDims; SimCode.Variable i_var; equation - txt = fun_351(txt, i_instDims, i_var_ty); + txt = fun_352(txt, i_instDims, i_var_ty); then txt; case ( txt, @@ -17580,7 +17666,7 @@ algorithm end matchcontinue; end expTypeShort; -protected function fun_355 +protected function fun_356 input Tpl.Text in_txt; input Boolean in_i_array; input DAE.ExpType in_i_ty; @@ -17612,7 +17698,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_355; +end fun_356; public function expType input Tpl.Text txt; @@ -17621,7 +17707,7 @@ public function expType output Tpl.Text out_txt; algorithm - out_txt := fun_355(txt, i_array, i_ty); + out_txt := fun_356(txt, i_array, i_ty); end expType; public function expTypeModelica @@ -17687,7 +17773,7 @@ algorithm out_txt := expTypeFromExpFlag(txt, i_exp, 4); end expTypeFromExpArrayIf; -protected function fun_364 +protected function fun_365 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17716,9 +17802,9 @@ algorithm txt = expTypeShort(txt, i_ty); then txt; end matchcontinue; -end fun_364; +end fun_365; -protected function fun_365 +protected function fun_366 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17743,12 +17829,12 @@ algorithm local DAE.ExpType i_ty; equation - txt = fun_364(txt, i_ty); + txt = fun_365(txt, i_ty); then txt; end matchcontinue; -end fun_365; +end fun_366; -protected function fun_366 +protected function fun_367 input Tpl.Text in_txt; input DAE.ExpType in_i_ty; @@ -17776,9 +17862,9 @@ algorithm txt = expTypeFlag(txt, i_ty, 2); then txt; end matchcontinue; -end fun_366; +end fun_367; -protected function fun_367 +protected function fun_368 input Tpl.Text in_txt; input Integer in_i_flag; input DAE.ExpType in_i_ty; @@ -17802,7 +17888,7 @@ algorithm 2, i_ty ) equation - txt = fun_365(txt, i_ty); + txt = fun_366(txt, i_ty); then txt; case ( txt, @@ -17817,7 +17903,7 @@ algorithm 4, i_ty ) equation - txt = fun_366(txt, i_ty); + txt = fun_367(txt, i_ty); then txt; case ( txt, @@ -17825,7 +17911,7 @@ algorithm _ ) then txt; end matchcontinue; -end fun_367; +end fun_368; public function expTypeFlag input Tpl.Text txt; @@ -17834,10 +17920,10 @@ public function expTypeFlag output Tpl.Text out_txt; algorithm - out_txt := fun_367(txt, i_flag, i_ty); + out_txt := fun_368(txt, i_flag, i_ty); end expTypeFlag; -protected function fun_369 +protected function fun_370 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17860,9 +17946,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_integer")); then txt; end matchcontinue; -end fun_369; +end fun_370; -protected function fun_370 +protected function fun_371 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17885,9 +17971,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_real")); then txt; end matchcontinue; -end fun_370; +end fun_371; -protected function fun_371 +protected function fun_372 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17910,9 +17996,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_string")); then txt; end matchcontinue; -end fun_371; +end fun_372; -protected function fun_372 +protected function fun_373 input Tpl.Text in_txt; input Integer in_i_flag; @@ -17935,7 +18021,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_372; +end fun_373; public function expTypeFromExpFlag input Tpl.Text in_txt; @@ -17954,28 +18040,28 @@ algorithm DAE.ICONST(integer = _), i_flag ) equation - txt = fun_369(txt, i_flag); + txt = fun_370(txt, i_flag); then txt; case ( txt, DAE.RCONST(real = _), i_flag ) equation - txt = fun_370(txt, i_flag); + txt = fun_371(txt, i_flag); then txt; case ( txt, DAE.SCONST(string = _), i_flag ) equation - txt = fun_371(txt, i_flag); + txt = fun_372(txt, i_flag); then txt; case ( txt, DAE.BCONST(bool = _), i_flag ) equation - txt = fun_372(txt, i_flag); + txt = fun_373(txt, i_flag); then txt; case ( txt, @@ -18133,7 +18219,7 @@ algorithm end matchcontinue; end expTypeFromExpFlag; -protected function fun_374 +protected function fun_375 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18156,9 +18242,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_374; +end fun_375; -protected function fun_375 +protected function fun_376 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18181,9 +18267,9 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_375; +end fun_376; -protected function fun_376 +protected function fun_377 input Tpl.Text in_txt; input Integer in_i_flag; @@ -18206,7 +18292,7 @@ algorithm txt = Tpl.writeTok(txt, Tpl.ST_STRING("modelica_boolean")); then txt; end matchcontinue; -end fun_376; +end fun_377; public function expTypeFromOpFlag input Tpl.Text in_txt; @@ -18557,7 +18643,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_374(txt, i_flag); + txt = fun_375(txt, i_flag); then txt; case ( txt, @@ -18566,7 +18652,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_375(txt, i_flag); + txt = fun_376(txt, i_flag); then txt; case ( txt, @@ -18575,7 +18661,7 @@ algorithm local DAE.Operator i_o; equation - txt = fun_376(txt, i_flag); + txt = fun_377(txt, i_flag); then txt; case ( txt, diff --git a/Compiler/susan_codegen/SimCode/SimCodeC.tpl b/Compiler/susan_codegen/SimCode/SimCodeC.tpl index b0271624184..dbc0b8dab5e 100644 --- a/Compiler/susan_codegen/SimCode/SimCodeC.tpl +++ b/Compiler/susan_codegen/SimCode/SimCodeC.tpl @@ -23,7 +23,7 @@ case SIMCODE(modelInfo=MODELINFO) then translateFunctions(FunctionCode functionCode) ::= case FUNCTIONCODE then - # functionsFileContent = functionsFile2(functions) + # functionsFileContent = functionsFile2(functions, extraRecordDecls) # textFile(functionsFileContent, '.c') # makefileContent = makefileFunction(functionCode) # textFile(makefileContent, '.makefile') @@ -1161,7 +1161,8 @@ notimplemented = notimplemented; // SECTION: FUNCTION TARGET, FUNCTIONS FILE SPECIFIC TEMPLATES -functionsFile2(list functions) ::= +functionsFile2(list functions, + list extraRecordDecls) ::= << #include "modelica.h" #include \ @@ -1189,6 +1190,7 @@ extern "C" { /* Header */ + /* End Header */ /* Body */ @@ -1408,6 +1410,13 @@ extType(Type) ::= << struct >> + case ET_METAOPTION + case ET_LIST + case ET_METATUPLE + case ET_UNIONTYPE + case ET_POLYMORPHIC + case ET_META_ARRAY + case ET_BOXED then "void*" case _ then "OTHER_EXT_TYPE" // Assume that language is C for now. diff --git a/Compiler/susan_codegen/SimCode/SimCodeTV.mo b/Compiler/susan_codegen/SimCode/SimCodeTV.mo index 401bc33bb31..d94425870c5 100644 --- a/Compiler/susan_codegen/SimCode/SimCodeTV.mo +++ b/Compiler/susan_codegen/SimCode/SimCodeTV.mo @@ -103,6 +103,7 @@ package SimCode String name; list functions; MakefileParams makefileParams; + list extraRecordDecls; end FUNCTIONCODE; end FunctionCode;