Skip to content

Commit

Permalink
- Renamed tplAbsynExpEEquationLstLst to elseBranches in SCode.EEquati…
Browse files Browse the repository at this point in the history
…on.EQ_WHEN.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9087 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed May 24, 2011
1 parent 2558fdd commit 1f9b57e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Compiler/FrontEnd/InstSection.mo
Expand Up @@ -583,7 +583,7 @@ algorithm
When statements are instantiated by evaluating the
conditional expression.
*/
case (cache,env,ih,mod,pre,csets,ci_state, eq as SCode.EQ_WHEN(condition = e,eEquationLst = el,tplAbsynExpEEquationLstLst = ((ee,eel) :: eex),info=info),(initial_ as SCode.NON_INITIAL()),impl,graph)
case (cache,env,ih,mod,pre,csets,ci_state, eq as SCode.EQ_WHEN(condition = e,eEquationLst = el,elseBranches = ((ee,eel) :: eex),info=info),(initial_ as SCode.NON_INITIAL()),impl,graph)
equation
checkForNestedWhen(eq);
(cache,e_1,prop1,_) = Static.elabExp(cache,env, e, impl,NONE(),true,pre,info);
Expand All @@ -607,7 +607,7 @@ algorithm
then
(cache,env_2,ih,dae,csets,ci_state_2,graph);

case (cache,env,ih,mod,pre,csets,ci_state, eq as SCode.EQ_WHEN(condition = e,eEquationLst = el,tplAbsynExpEEquationLstLst = {}, info = info),(initial_ as SCode.NON_INITIAL()),impl,graph)
case (cache,env,ih,mod,pre,csets,ci_state, eq as SCode.EQ_WHEN(condition = e,eEquationLst = el,elseBranches = {}, info = info),(initial_ as SCode.NON_INITIAL()),impl,graph)
equation
checkForNestedWhen(eq);
(cache,e_1,prop1,_) = Static.elabExp(cache,env, e, impl,NONE(),true,pre,info);
Expand Down Expand Up @@ -4379,7 +4379,7 @@ algorithm
list<SCode.EEquation> el;
list<list<SCode.EEquation>> el2;
list<tuple<Absyn.Exp, list<SCode.EEquation>>> tpl_el;
case SCode.EQ_WHEN(eEquationLst = el, tplAbsynExpEEquationLstLst = tpl_el)
case SCode.EQ_WHEN(eEquationLst = el, elseBranches = tpl_el)
equation
checkForNestedWhenInEqList(el);
el2 = Util.listMap(tpl_el, Util.tuple22);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/SCode.mo
Expand Up @@ -274,7 +274,7 @@ uniontype EEquation
record EQ_WHEN "the when equation"
Absyn.Exp condition "the when condition";
list<EEquation> eEquationLst "the equation list";
list<tuple<Absyn.Exp, list<EEquation>>> tplAbsynExpEEquationLstLst "the elsewhen expression and equation list";
list<tuple<Absyn.Exp, list<EEquation>>> elseBranches "the elsewhen expression and equation list";
Option<Comment> comment;
Absyn.Info info;
end EQ_WHEN;
Expand Down Expand Up @@ -1718,7 +1718,7 @@ algorithm
true = stringEq(id, id_1);
lst=Absyn.findIteratorInExp(id,e_1);
then lst;
case (id,EQ_WHEN(condition = e_1, eEquationLst = eeqLst, tplAbsynExpEEquationLstLst = ew))
case (id,EQ_WHEN(condition = e_1, eEquationLst = eeqLst, elseBranches = ew))
equation
lst_1=Absyn.findIteratorInExp(id,e_1);
lst_2=findIteratorInEEquationLst(id,eeqLst);
Expand Down
14 changes: 7 additions & 7 deletions Compiler/FrontEnd/SCodeDump.mo
Expand Up @@ -48,10 +48,10 @@ protected import Print;
protected function elseWhenEquationStr
"@author: adrpo
Return the elsewhen parts as a string."
input list<tuple<Absyn.Exp, list<SCode.EEquation>>> tplAbsynExpEEquationLstLst;
input list<tuple<Absyn.Exp, list<SCode.EEquation>>> elseBranches;
output String str;
algorithm
str := match(tplAbsynExpEEquationLstLst)
str := match(elseBranches)
local
Absyn.Exp exp;
list<SCode.EEquation> eqn_lst;
Expand All @@ -66,7 +66,7 @@ algorithm
s1 = Dump.printExpStr(exp);
str_lst = Util.listMap(eqn_lst, equationStr);
s2 = Util.stringDelimitList(str_lst, "\n");
s3 = elseWhenEquationStr(tplAbsynExpEEquationLstLst);
s3 = elseWhenEquationStr(elseBranches);
res = stringAppendList({"\nelsewhen ",s1," then\n",s2,"\n", s3});
then
res;
Expand All @@ -90,7 +90,7 @@ algorithm
list<list<SCode.EEquation>> tb;
Absyn.ComponentRef cr1,cr2,cr;
Absyn.FunctionArgs fargs;
list<tuple<Absyn.Exp, list<SCode.EEquation>>> tplAbsynExpEEquationLstLst;
list<tuple<Absyn.Exp, list<SCode.EEquation>>> elseBranches;

case (SCode.EQ_IF(condition = e1::ifexp,thenBranch = ttb::tb,elseBranch = fb))
equation
Expand Down Expand Up @@ -125,12 +125,12 @@ algorithm
res = stringAppendList({"for ",id," in ",s1," loop\n",s2,"\nend for;"});
then
res;
case (SCode.EQ_WHEN(condition=exp, eEquationLst=eqn_lst, tplAbsynExpEEquationLstLst=tplAbsynExpEEquationLstLst))
case (SCode.EQ_WHEN(condition=exp, eEquationLst=eqn_lst, elseBranches=elseBranches))
equation
s1 = Dump.printExpStr(exp);
str_lst = Util.listMap(eqn_lst, equationStr);
s2 = Util.stringDelimitList(str_lst, "\n");
s3 = elseWhenEquationStr(tplAbsynExpEEquationLstLst);
s3 = elseWhenEquationStr(elseBranches);
res = stringAppendList({"when ",s1," then\n",s2,s3,"\nend when;"});
then
res;
Expand Down Expand Up @@ -1012,4 +1012,4 @@ algorithm
end matchcontinue;
end prefixesStr;

end SCodeDump;
end SCodeDump;

0 comments on commit 1f9b57e

Please sign in to comment.