Skip to content

Commit aa2067a

Browse files
author
Jens Frenkel
committed
- continue to copy all functions do something with a ComponentRef from Exp into ComponentReference
git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6569 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent cbb6110 commit aa2067a

26 files changed

+554
-561
lines changed

Compiler/Algorithm.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ package Algorithm
4949
"
5050

5151
public import Absyn;
52+
public import ComponentReference;
5253
public import DAE;
5354
public import SCode;
5455

@@ -168,7 +169,7 @@ algorithm
168169
case ((lhs as DAE.CREF(componentRef=cr)),lhprop,rhs,rhprop,_,SCode.NON_INITIAL(),source)
169170
equation
170171
DAE.C_PARAM() = Types.propAnyConst(lhprop);
171-
true = Exp.isRecord(cr);
172+
true = ComponentReference.isRecord(cr);
172173
outStatement = makeAssignment2(lhs,lhprop,rhs,rhprop,source);
173174
then outStatement;
174175

@@ -658,7 +659,7 @@ public function getCrefFromAlg "Returns all crefs from an algorithm"
658659
input Algorithm alg;
659660
output list<DAE.ComponentRef> crs;
660661
algorithm
661-
crs := Util.listListUnionOnTrue(Util.listMap(getAllExps(alg),Exp.getCrefFromExp),Exp.crefEqual);
662+
crs := Util.listListUnionOnTrue(Util.listMap(getAllExps(alg),Exp.getCrefFromExp),ComponentReference.crefEqual);
662663
end getCrefFromAlg;
663664

664665

Compiler/Ceval.mo

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,17 +2201,17 @@ algorithm
22012201
case (cache,env ,cr)
22022202
equation
22032203
(env as (Env.FRAME(connectionSet = (crs,prefix))::_)) = Env.stripForLoopScope(env);
2204-
cr_lst = Util.listSelect1(crs, cr, Exp.crefContainedIn);
2204+
cr_lst = Util.listSelect1(crs, cr, ComponentReference.crefContainedIn);
22052205
currentPrefixIdent= ComponentReference.crefLastIdent(prefix);
22062206
currentPrefix = ComponentReference.makeCrefIdent(currentPrefixIdent,DAE.ET_OTHER(),{});
22072207
// Select connect references that has cr as suffix and correct Prefix.
2208-
cr_lst = Util.listSelect1R(cr_lst, currentPrefix, Exp.crefPrefixOf);
2208+
cr_lst = Util.listSelect1R(cr_lst, currentPrefix, ComponentReference.crefPrefixOf);
22092209

22102210
// Select connect references that are identifiers (inside connectors)
2211-
cr_lst2 = Util.listSelect(crs,Exp.crefIsIdent);
2212-
cr_lst2 = Util.listSelect1(cr_lst2,cr,Exp.crefEqual);
2211+
cr_lst2 = Util.listSelect(crs,ComponentReference.crefIsIdent);
2212+
cr_lst2 = Util.listSelect1(cr_lst2,cr,ComponentReference.crefEqual);
22132213

2214-
cr_totlst = Util.listUnionOnTrue(listAppend(cr_lst,cr_lst2),{},Exp.crefEqual);
2214+
cr_totlst = Util.listUnionOnTrue(listAppend(cr_lst,cr_lst2),{},ComponentReference.crefEqual);
22152215
res = listLength(cr_totlst);
22162216

22172217
/*print("inFrame :");print(Env.printEnvPathStr(env));print("\n");
@@ -5179,7 +5179,7 @@ output Boolean res;
51795179
algorithm
51805180
res := matchcontinue(cr,exp)
51815181
case(cr,exp) equation
5182-
res = Util.boolOrList(Util.listMap1(Exp.getCrefFromExp(exp),Exp.crefEqual,cr));
5182+
res = Util.boolOrList(Util.listMap1(Exp.getCrefFromExp(exp),ComponentReference.crefEqual,cr));
51835183
then res;
51845184
case(_,_) then false;
51855185
end matchcontinue;
@@ -5455,7 +5455,7 @@ algorithm outBoolean := matchcontinue(c,v)
54555455
case(c,(v as DAE.EQBOUND(DAE.CREF(c2,_),NONE(),_,_)))
54565456
local DAE.ComponentRef c2;
54575457
equation
5458-
true = Exp.crefEqual(c,c2);
5458+
true = ComponentReference.crefEqual(c,c2);
54595459
then
54605460
true;
54615461
case(_,_) then false;

Compiler/CevalScript.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3666,7 +3666,7 @@ algorithm
36663666
equation
36673667
classname_1 = Static.componentRefToPath(classname) "Check cached instantiated class" ;
36683668
Interactive.INSTCLASS(_,dae,env) = Interactive.getInstantiatedClass(ic, classname_1);
3669-
cref_1 = Exp.joinCrefs(cref, ComponentReference.makeCrefIdent("stateSelect",DAE.ET_OTHER(),{}));
3669+
cref_1 = ComponentReference.joinCrefs(cref, ComponentReference.makeCrefIdent("stateSelect",DAE.ET_OTHER(),{}));
36703670
(cache,attr,ty,DAE.EQBOUND(exp,_,_,_),_,_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
36713671
str = Exp.printExpStr(exp);
36723672
then
@@ -3691,7 +3691,7 @@ algorithm
36913691
ci_state = ClassInf.start(r, Env.getEnvName(env3));
36923692
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy,UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
36933693
ci_state, c, false, {}, false, Inst.INNER_CALL, ConnectionGraph.EMPTY,NONE());
3694-
cref_1 = Exp.joinCrefs(cref, ComponentReference.makeCrefIdent("stateSelect",DAE.ET_OTHER(),{}));
3694+
cref_1 = ComponentReference.crefPrependIdent(cref, "stateSelect",{},DAE.ET_OTHER());
36953695
(cache,attr,ty,DAE.EQBOUND(exp,_,_,_),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
36963696
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
36973697
str = Exp.printExpStr(exp);
@@ -3708,7 +3708,7 @@ algorithm
37083708
equation
37093709
classname_1 = Static.componentRefToPath(classname);
37103710
Interactive.INSTCLASS(_,dae,env) = Interactive.getInstantiatedClass(ic, classname_1);
3711-
cref_1 = Exp.joinCrefs(cref, ComponentReference.makeCrefIdent(attribute,DAE.ET_OTHER(),{}));
3711+
cref_1 = ComponentReference.crefPrependIdent(cref, attribute,{},DAE.ET_OTHER());
37123712
(cache,attr,ty,DAE.VALBOUND(v,_),_,_,_,_,_) = Lookup.lookupVar(cache, env, cref_1);
37133713
then
37143714
(cache,v,st);
@@ -3732,7 +3732,7 @@ algorithm
37323732
ci_state = ClassInf.start(r, Env.getEnvName(env3));
37333733
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy, UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
37343734
ci_state, c, false, {}, false, Inst.INNER_CALL, ConnectionGraph.EMPTY,NONE());
3735-
cref_1 = Exp.joinCrefs(cref, ComponentReference.makeCrefIdent(attribute,DAE.ET_OTHER(),{}));
3735+
cref_1 = ComponentReference.crefPrependIdent(cref,attribute,DAE.ET_OTHER(),{});
37363736
(cache,attr,ty,DAE.VALBOUND(v,_),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
37373737
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
37383738
then

0 commit comments

Comments
 (0)