Skip to content

Commit

Permalink
Clean up DAEUtil.splitElements.
Browse files Browse the repository at this point in the history
- Clean up DAEUtil.splitElements.
- Move DAEDump.dumpDAEList -> DAEUtil.splitComponent
  • Loading branch information
perost authored and OpenModelica-Hudson committed Apr 13, 2016
1 parent 89c4bb6 commit f35a0e2
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 258 deletions.
39 changes: 1 addition & 38 deletions Compiler/FrontEnd/DAEDump.mo
Expand Up @@ -2530,7 +2530,7 @@ protected
algorithm
DAE.DAE(elementLst = daelist) := inDAElist;
funList := dumpFunctionList(functionTree);
fixedDae := List.map(daelist, dumpDAEList);
fixedDae := List.map(daelist, DAEUtil.splitComponent);
outString := Tpl.tplString2(DAEDumpTpl.dumpDAE, fixedDae, funList);
end dumpStr;

Expand Down Expand Up @@ -2621,43 +2621,6 @@ algorithm
end match;
end dumpStream;

public function dumpDAEList " returns split DAE elements(Mainly important for template based DAE unparser) :
variables, initial equations, initial algorithms,
equations, algorithms, constraints and external objects"
input DAE.Element inElement;
output compWithSplitElements outCompWSplElem;
algorithm
(outCompWSplElem) := match (inElement)
local
String n;
list<DAE.Element> l;
Option<SCode.Comment> c;

list<DAE.Element> v;
list<DAE.Element> ie;
list<DAE.Element> ia;
list<DAE.Element> e;
list<DAE.Element> a;
list<DAE.Element> co;
list<DAE.Element> o;
list<DAE.Element> ca;
list<compWithSplitElements> sm;
splitElements loc_splelem;

compWithSplitElements compWSplElem;


case (DAE.COMP(ident = n,dAElist = l,comment = c))
equation
(v,ie,ia,e,a,ca,co,o,sm) = DAEUtil.splitElements(l);
loc_splelem = SPLIT_ELEMENTS(v,ie,ia,e,a,ca,co,o,sm);
compWSplElem = COMP_WITH_SPLIT(n, loc_splelem, c);
then
(compWSplElem);

end match;
end dumpDAEList;

public function dumpFunctionList " returns sorted functions and record constructors in alphabetical order
(mainly important for template based DAE unparser)."
input DAE.FunctionTree functionTree;
Expand Down

0 comments on commit f35a0e2

Please sign in to comment.