OMCompiler/Compiler/FrontEnd/NFInstDump.mo
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file is part of OpenModelica. | ||
| 3 | * | ||
| 4 | * Copyright (c) 1998-2026, Open Source Modelica Consortium (OSMC), | ||
| 5 | * c/o Linköpings universitet, Department of Computer and Information Science, | ||
| 6 | * SE-58183 Linköping, Sweden. | ||
| 7 | * | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF AGPL VERSION 3 LICENSE OR | ||
| 11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.8. | ||
| 12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES | ||
| 13 | * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GNU AGPL | ||
| 14 | * VERSION 3, ACCORDING TO RECIPIENTS CHOICE. | ||
| 15 | * | ||
| 16 | * The OpenModelica software and the OSMC (Open Source Modelica Consortium) | ||
| 17 | * Public License (OSMC-PL) are obtained from OSMC, either from the above | ||
| 18 | * address, from the URLs: | ||
| 19 | * http://www.openmodelica.org or | ||
| 20 | * https://github.com/OpenModelica/ or | ||
| 21 | * http://www.ida.liu.se/projects/OpenModelica, | ||
| 22 | * and in the OpenModelica distribution. | ||
| 23 | * | ||
| 24 | * GNU AGPL version 3 is obtained from: | ||
| 25 | * https://www.gnu.org/licenses/licenses.html#GPL | ||
| 26 | * | ||
| 27 | * This program is distributed WITHOUT ANY WARRANTY; without | ||
| 28 | * even the implied warranty of MERCHANTABILITY or FITNESS | ||
| 29 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH | ||
| 30 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. | ||
| 31 | * | ||
| 32 | * See the full OSMC Public License conditions for more details. | ||
| 33 | * | ||
| 34 | */ | ||
| 35 | |||
| 36 | encapsulated package NFInstDump | ||
| 37 | " file: NFInstDump.mo | ||
| 38 | package: NFInstDump | ||
| 39 | description: Dumping functions for the intermediary instantiation structures. | ||
| 40 | |||
| 41 | |||
| 42 | This package contains dumping functions for the intermediary instantiation | ||
| 43 | structures, mostly wrappers for NFInstDumpTpl. | ||
| 44 | " | ||
| 45 | |||
| 46 | //public import NFConnect2; | ||
| 47 | public import NFInstTypes; | ||
| 48 | |||
| 49 | protected import NFInstDumpTpl; | ||
| 50 | protected import Array; | ||
| 51 | protected import Tpl; | ||
| 52 | |||
| 53 | public function modelStr | ||
| 54 | input String inName; | ||
| 55 | input NFInstTypes.Class inClass; | ||
| 56 | output String outString; | ||
| 57 | algorithm | ||
| 58 | ✗ | outString := Tpl.tplString2(NFInstDumpTpl.dumpModel, inName, inClass); | |
| 59 | end modelStr; | ||
| 60 | |||
| 61 | public function elementStr | ||
| 62 | input NFInstTypes.Element inElement; | ||
| 63 | output String outString; | ||
| 64 | algorithm | ||
| 65 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpElement, inElement); | |
| 66 | end elementStr; | ||
| 67 | |||
| 68 | public function componentStr | ||
| 69 | input NFInstTypes.Component inComponent; | ||
| 70 | output String outString; | ||
| 71 | algorithm | ||
| 72 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpComponent, inComponent); | |
| 73 | end componentStr; | ||
| 74 | |||
| 75 | public function bindingStr | ||
| 76 | input NFInstTypes.Binding inBinding; | ||
| 77 | output String outString; | ||
| 78 | algorithm | ||
| 79 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpBinding, inBinding); | |
| 80 | end bindingStr; | ||
| 81 | |||
| 82 | public function prefixStr | ||
| 83 | input NFInstTypes.Prefix inPrefix; | ||
| 84 | output String outString; | ||
| 85 | algorithm | ||
| 86 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpPrefix, inPrefix); | |
| 87 | end prefixStr; | ||
| 88 | |||
| 89 | public function equationStr | ||
| 90 | input NFInstTypes.Equation inEquation; | ||
| 91 | output String outString; | ||
| 92 | algorithm | ||
| 93 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpEquation, inEquation); | |
| 94 | end equationStr; | ||
| 95 | |||
| 96 | //public function connectionsStr | ||
| 97 | // input NFConnect2.Connections inConnections; | ||
| 98 | // output String outString; | ||
| 99 | //algorithm | ||
| 100 | // outString := Tpl.tplString(NFInstDumpTpl.dumpConnections, inConnections); | ||
| 101 | //end connectionsStr; | ||
| 102 | |||
| 103 | public function dimensionStr | ||
| 104 | input NFInstTypes.Dimension inDimension; | ||
| 105 | output String outString; | ||
| 106 | algorithm | ||
| 107 | ✗ | outString := Tpl.tplString(NFInstDumpTpl.dumpDimension, inDimension); | |
| 108 | end dimensionStr; | ||
| 109 | |||
| 110 | public function dumpUntypedComponentDims | ||
| 111 | input NFInstTypes.Component inComponent; | ||
| 112 | output String outString; | ||
| 113 | algorithm | ||
| 114 | outString := match inComponent | ||
| 115 | local | ||
| 116 | array<NFInstTypes.Dimension> dims; | ||
| 117 | String dims_str; | ||
| 118 | |||
| 119 | case NFInstTypes.UNTYPED_COMPONENT(dimensions = dims) | ||
| 120 | algorithm | ||
| 121 | ✗ | dims_str := Array.toString(dims, dimensionStr, "", "[", ", ", "]", false); | |
| 122 | then | ||
| 123 | dims_str; | ||
| 124 | |||
| 125 | end match; | ||
| 126 | end dumpUntypedComponentDims; | ||
| 127 | |||
| 128 | annotation(__OpenModelica_Interface="frontend"); | ||
| 129 | end NFInstDump; | ||
| 130 |