build_cmake/OMCompiler/Compiler/generated-mo/Template/SimCodeDump.mo
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | encapsulated package SimCodeDump | ||
| 2 | " | ||
| 3 | file: SimCodeDump.mo | ||
| 4 | package: SimCodeDump | ||
| 5 | description: Generated by Susan. | ||
| 6 | " | ||
| 7 | |||
| 8 | public import Tpl; | ||
| 9 | |||
| 10 | public import SimCodeVar; | ||
| 11 | public import HashTableCrefSimVar; | ||
| 12 | public import SimCode; | ||
| 13 | public import SimCodeFunction; | ||
| 14 | public import SimCodeCodegenUtil; | ||
| 15 | public import SimCodeFunctionUtil; | ||
| 16 | public import BackendDAE; | ||
| 17 | public import System; | ||
| 18 | public import Autoconf; | ||
| 19 | protected import Absyn; | ||
| 20 | protected import AbsynUtil; | ||
| 21 | public import MMath; | ||
| 22 | public import DAE; | ||
| 23 | public import ClassInf; | ||
| 24 | public import ClassInfUtil; | ||
| 25 | protected import SCode; | ||
| 26 | protected import SCodeDump; | ||
| 27 | public import StringUtil; | ||
| 28 | public import Util; | ||
| 29 | public import List; | ||
| 30 | public import ComponentReferenceBasics; | ||
| 31 | public import ComponentReference; | ||
| 32 | public import Expression; | ||
| 33 | protected import ExpressionDump; | ||
| 34 | public import ExpressionBasics; | ||
| 35 | public import Config; | ||
| 36 | public import Testsuite; | ||
| 37 | public import Flags; | ||
| 38 | public import FlagsUtil; | ||
| 39 | public import Settings; | ||
| 40 | public import Patternm; | ||
| 41 | public import Error; | ||
| 42 | public import Values; | ||
| 43 | public import ValuesUtil; | ||
| 44 | public import DAEDump; | ||
| 45 | public import Algorithm; | ||
| 46 | protected import ElementSource; | ||
| 47 | public import DAEUtil; | ||
| 48 | public import TypesDump; | ||
| 49 | public import Types; | ||
| 50 | public import HashTableCrIListArray; | ||
| 51 | public import CodegenUtil; | ||
| 52 | public import DAEDumpTpl; | ||
| 53 | public import SCodeDumpTpl; | ||
| 54 | protected import ExpressionDumpTpl; | ||
| 55 | |||
| 56 | protected function lm_47 | ||
| 57 | input output Tpl.Text txt; | ||
| 58 | input list<SimCodeVar.SimVar> items; | ||
| 59 | algorithm | ||
| 60 | ✗ | for lstElt_47 in items loop | |
| 61 | txt := match lstElt_47 | ||
| 62 | local | ||
| 63 | Integer x_index0; | ||
| 64 | DAE.ComponentRef i_v_name; | ||
| 65 | String ret_1; | ||
| 66 | Tpl.Text txt_0; | ||
| 67 | |||
| 68 | case SimCodeVar.SIMVAR(name = i_v_name) | ||
| 69 | algorithm | ||
| 70 | ✗ | x_index0 := Tpl.getIteri_i0(txt); | |
| 71 | ✗ | txt := Tpl.writeStr(txt, intString(x_index0)); | |
| 72 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING(": ")); | |
| 73 | ✗ | txt_0 := CodegenUtil.crefStrNoUnderscore(Tpl.emptyTxt, i_v_name); | |
| 74 | ✗ | ret_1 := Util.escapeModelicaStringToXmlString(Tpl.textString(txt_0)); | |
| 75 | ✗ | txt := Tpl.writeStr(txt, ret_1); | |
| 76 | ✗ | txt := Tpl.nextIter(txt); | |
| 77 | then txt; | ||
| 78 | |||
| 79 | case _ | ||
| 80 | then txt; | ||
| 81 | end match; | ||
| 82 | end for; | ||
| 83 | end lm_47; | ||
| 84 | |||
| 85 | public function dumpVarsShort | ||
| 86 | input Tpl.Text txt; | ||
| 87 | input list<SimCodeVar.SimVar> a_vars; | ||
| 88 | |||
| 89 | output Tpl.Text out_txt; | ||
| 90 | protected | ||
| 91 | Tpl.Text l_varsString; | ||
| 92 | algorithm | ||
| 93 | ✗ | l_varsString := Tpl.pushIter(Tpl.emptyTxt, Tpl.ITER_OPTIONS(0, SOME(Tpl.ST_STRING("")), SOME(Tpl.ST_NEW_LINE()), 0, 0, Tpl.ST_NEW_LINE(), 0, Tpl.ST_NEW_LINE())); | |
| 94 | ✗ | l_varsString := lm_47(l_varsString, a_vars); | |
| 95 | ✗ | l_varsString := Tpl.popIter(l_varsString); | |
| 96 | ✗ | out_txt := Tpl.writeText(txt, l_varsString); | |
| 97 | ✗ | out_txt := Tpl.softNewLine(out_txt); | |
| 98 | ✗ | out_txt := Tpl.writeTok(out_txt, Tpl.ST_NEW_LINE()); | |
| 99 | end dumpVarsShort; | ||
| 100 | |||
| 101 | public function dumpAlias | ||
| 102 | input Tpl.Text in_txt; | ||
| 103 | input SimCodeVar.AliasVariable in_a_alias; | ||
| 104 | |||
| 105 | output Tpl.Text out_txt; | ||
| 106 | algorithm | ||
| 107 | out_txt := | ||
| 108 | match(in_txt, in_a_alias) | ||
| 109 | local | ||
| 110 | Tpl.Text txt; | ||
| 111 | DAE.ComponentRef i_varName; | ||
| 112 | String ret_3; | ||
| 113 | Tpl.Text txt_2; | ||
| 114 | String ret_1; | ||
| 115 | Tpl.Text txt_0; | ||
| 116 | |||
| 117 | case ( txt, | ||
| 118 | SimCodeVar.ALIAS(varName = i_varName) ) | ||
| 119 | algorithm | ||
| 120 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<alias>")); | |
| 121 | ✗ | txt_0 := CodegenUtil.crefStrNoUnderscore(Tpl.emptyTxt, i_varName); | |
| 122 | ✗ | ret_1 := Util.escapeModelicaStringToXmlString(Tpl.textString(txt_0)); | |
| 123 | ✗ | txt := Tpl.writeStr(txt, ret_1); | |
| 124 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</alias>")); | |
| 125 | then txt; | ||
| 126 | |||
| 127 | case ( txt, | ||
| 128 | SimCodeVar.NEGATEDALIAS(varName = i_varName) ) | ||
| 129 | algorithm | ||
| 130 | ✗ | txt := Tpl.pushBlock(txt, Tpl.BT_INDENT(1)); | |
| 131 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("<alias negated=\"true\">")); | |
| 132 | ✗ | txt_2 := CodegenUtil.crefStrNoUnderscore(Tpl.emptyTxt, i_varName); | |
| 133 | ✗ | ret_3 := Util.escapeModelicaStringToXmlString(Tpl.textString(txt_2)); | |
| 134 | ✗ | txt := Tpl.writeStr(txt, ret_3); | |
| 135 | ✗ | txt := Tpl.writeTok(txt, Tpl.ST_STRING("</alias>")); | |
| 136 | ✗ | txt := Tpl.popBlock(txt); | |
| 137 | then txt; | ||
| 138 | |||
| 139 | case ( txt, | ||
| 140 | _ ) | ||
| 141 | then txt; | ||
| 142 | end match; | ||
| 143 | end dumpAlias; | ||
| 144 | |||
| 145 | public function printExpStrEscaped | ||
| 146 | input Tpl.Text txt; | ||
| 147 | input DAE.Exp a_exp; | ||
| 148 | |||
| 149 | output Tpl.Text out_txt; | ||
| 150 | protected | ||
| 151 | String ret_1; | ||
| 152 | Tpl.Text txt_0; | ||
| 153 | algorithm | ||
| 154 | ✗ | txt_0 := ExpressionDumpTpl.dumpExp(Tpl.emptyTxt, a_exp, "\""); | |
| 155 | ✗ | ret_1 := Util.escapeModelicaStringToXmlString(Tpl.textString(txt_0)); | |
| 156 | ✗ | out_txt := Tpl.writeStr(txt, ret_1); | |
| 157 | end printExpStrEscaped; | ||
| 158 | |||
| 159 | annotation(__OpenModelica_Interface="backend"); | ||
| 160 | end SimCodeDump; | ||
| 161 |