Skip to content

Commit

Permalink
- Update some RML syntax to MetaModelica
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6995 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 12, 2010
1 parent 841b8ec commit 79713a7
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 92 deletions.
12 changes: 6 additions & 6 deletions Compiler/BackendDAEOptimize.mo
Expand Up @@ -1453,7 +1453,7 @@ protected function splitBlocks2
//function: splitBlocks2
//author: wbraun
input list<list<Integer>> inIntegerLstLst;
input Integer[:] inIntegerArray;
input array<Integer> inIntegerArray;
input Integer inPos;
output list<list<Integer>> outIntegerLstLst1;
output list<list<Integer>> outIntegerLstLst2;
Expand Down Expand Up @@ -1490,8 +1490,8 @@ protected function markArray
// author : wbraun
input list<Integer> inVars1;
input list<list<Integer>> inVars2;
input Integer[:] inInt;
output Integer[:] outJacobian;
input array<Integer> inInt;
output array<Integer> outJacobian;
algorithm
outJacobian := matchcontinue(inVars1,inVars2,inInt)
local
Expand All @@ -1500,7 +1500,7 @@ algorithm
Integer var;
list<Integer> intlst,ilst2;
Integer i;
Integer[:] arr,arr1;
array<Integer> arr,arr1;
list<String> s,s1;
String str;
case({},_,arr) then arr;
Expand Down Expand Up @@ -1600,7 +1600,7 @@ algorithm
BackendDAE.ExternalObjectClasses extObjClasses, jacExtObjClasses;
// end DAE

list<BackendDAE.Var> allVars, inputVars, paramVars, stateVars, derivedVariables;
list<BackendDAE.Var> allVars, derivedVariables;
list<BackendDAE.Equation> solvedEquations, derivedEquations, derivedEquations2;
list<DAE.Algorithm> derivedAlgorithms;
list<tuple<Integer, DAE.ComponentRef>> derivedAlgorithmsLookUp;
Expand Down Expand Up @@ -2403,7 +2403,7 @@ algorithm
case(DAE.STMT_IF(exp=exp, statementLst=statementLst, else_=DAE.NOELSE(), source=source)::restStatements, var, functions)
equation
derivedStatements1 = differentiateAlgorithmStatements(statementLst, var, functions);
derivedStatements1 = {DAE.STMT_IF(exp, derivedStatements1, DAE.NOELSE, source)};
derivedStatements1 = {DAE.STMT_IF(exp, derivedStatements1, DAE.NOELSE(), source)};
derivedStatements2 = differentiateAlgorithmStatements(restStatements, var, functions);
derivedStatements1 = listAppend(derivedStatements1, derivedStatements2);
then derivedStatements1;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackendDAEUtil.mo
Expand Up @@ -3239,7 +3239,7 @@ public function absIncidenceMatrix
list<list<BackendDAE.Value>> lst,lst_1;
algorithm
lst := arrayList(m);
lst_1 := Util.listListMap(lst, int_abs);
lst_1 := Util.listListMap(lst, intAbs);
res := listArray(lst_1);
end absIncidenceMatrix;

Expand Down
11 changes: 5 additions & 6 deletions Compiler/CevalScript.mo
Expand Up @@ -3516,10 +3516,10 @@ algorithm
p_1 = SCodeUtil.translateAbsyn2SCode(ptot);
(cache,env) = Inst.makeEnvFromProgram(cache,p_1, Absyn.IDENT(""));
(cache,(c as SCode.CLASS(name=n,encapsulatedPrefix=encflag,restriction=r)),env_1) = Lookup.lookupClass(cache,env, classname_1, true);
env3 = Env.openScope(env_1, encflag, SOME(n), SOME(Env.CLASS_SCOPE));
env3 = Env.openScope(env_1, encflag, SOME(n), SOME(Env.CLASS_SCOPE()));
ci_state = ClassInf.start(r, Env.getEnvName(env3));
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy,UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
ci_state, c, false, {}, false, Inst.INNER_CALL, ConnectionGraph.EMPTY,NONE());
ci_state, c, false, {}, false, Inst.INNER_CALL(), ConnectionGraph.EMPTY,NONE());
cref_1 = ComponentReference.crefPrependIdent(cref, "stateSelect",{},DAE.ET_OTHER());
(cache,attr,ty,DAE.EQBOUND(exp,_,_,_),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
Expand Down Expand Up @@ -3557,10 +3557,10 @@ algorithm
p_1 = SCodeUtil.translateAbsyn2SCode(ptot);
(cache,env) = Inst.makeEnvFromProgram(cache,p_1, Absyn.IDENT(""));
(cache,(c as SCode.CLASS(name=n,encapsulatedPrefix=encflag,restriction=r)),env_1) = Lookup.lookupClass(cache,env, classname_1, true);
env3 = Env.openScope(env_1, encflag, SOME(n), SOME(Env.CLASS_SCOPE));
env3 = Env.openScope(env_1, encflag, SOME(n), SOME(Env.CLASS_SCOPE()));
ci_state = ClassInf.start(r, Env.getEnvName(env3));
(cache,env4,_,_,dae1,csets_1,ci_state_1,tys,_,_,_,_) = Inst.instClassIn(cache,env3, InnerOuter.emptyInstHierarchy, UnitAbsyn.noStore,DAE.NOMOD(), Prefix.NOPRE(), Connect.emptySet,
ci_state, c, false, {}, false, Inst.INNER_CALL, ConnectionGraph.EMPTY,NONE());
ci_state, c, false, {}, false, Inst.INNER_CALL(), ConnectionGraph.EMPTY,NONE());
cref_1 = ComponentReference.crefPrependIdent(cref,attribute,{},DAE.ET_OTHER());
(cache,attr,ty,DAE.VALBOUND(v,_),_,_,_,_,_) = Lookup.lookupVar(cache, env4, cref_1);
ic_1 = Interactive.addInstantiatedClass(ic, Interactive.INSTCLASS(classname_1,dae1,env4));
Expand Down Expand Up @@ -3623,7 +3623,7 @@ To get a correct Within-path with unknown input-path."
algorithm op := matchcontinue(ip)
local Absyn.Path path;
case(path) equation path = Absyn.stripLast(path); then Absyn.WITHIN(path);
case(path) then Absyn.TOP;
case(path) then Absyn.TOP();
end matchcontinue;
end getWithinStatement;

Expand Down Expand Up @@ -3931,7 +3931,6 @@ algorithm
matchcontinue (inCache,inEnv,className,inInteractiveSymbolTable,inMsg)
local
list<Absyn.Path> allClassPaths;
Absyn.Path className;
list<SCode.Class> sp;
list<Interactive.InstantiatedClass> ic;
Interactive.InteractiveSymbolTable st;
Expand Down
8 changes: 4 additions & 4 deletions Compiler/DAEQuery.mo
Expand Up @@ -67,7 +67,7 @@ algorithm
fileName := matchcontinue(dlow, fileNamePrefix, flatModelicaStr)
local
String file, strIMatrix, strVariables, flatStr, strEquations;
list<String>[:] m;
array<list<String>> m;

case (dlow, fileNamePrefix, flatStr)
equation
Expand Down Expand Up @@ -177,7 +177,7 @@ end equationStr;

protected function getIncidenceMatrix "function: getIncidenceMatrix
gets the incidence matrix as a string"
input list<String>[:] m;
input array<list<String>> m;
output String strIMatrix;
Integer mlen;
String mlen_str;
Expand Down Expand Up @@ -471,14 +471,14 @@ public function incidenceMatrix
Calculates the incidence matrix, i.e. which
variables are present in each equation."
input BackendDAE.BackendDAE inBackendDAE;
output list<String>[:] outIncidenceMatrix;
output array<list<String>> outIncidenceMatrix;
algorithm
outIncidenceMatrix:=
matchcontinue (inBackendDAE)
local
list<BackendDAE.Equation> eqnsl;
list<list<String>> lstlst;
list<String>[:] arr;
array<list<String>> arr;
BackendDAE.Variables vars;
BackendDAE.EquationArray eqns;
case (BackendDAE.DAE(orderedVars = vars,orderedEqs = eqns))
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Expression.mo
Expand Up @@ -388,12 +388,12 @@ algorithm

case(DAE.CODE(Absyn.C_VARIABLENAME(cref),_))
equation
(_,e_cref) = Static.elabUntypedCref(Env.emptyCache(),Env.emptyEnv,cref,false,Prefix.NOPRE,Absyn.dummyInfo);
(_,e_cref) = Static.elabUntypedCref(Env.emptyCache(),Env.emptyEnv,cref,false,Prefix.NOPRE(),Absyn.dummyInfo);
then DAE.CREF(e_cref,DAE.ET_OTHER());

case(DAE.CODE(Absyn.C_EXPRESSION(Absyn.CALL(Absyn.CREF_IDENT("der",{}),Absyn.FUNCTIONARGS({Absyn.CREF(cref)},{}))),_))
equation
(_,e_cref) = Static.elabUntypedCref(Env.emptyCache(),Env.emptyEnv,cref,false,Prefix.NOPRE,Absyn.dummyInfo);
(_,e_cref) = Static.elabUntypedCref(Env.emptyCache(),Env.emptyEnv,cref,false,Prefix.NOPRE(),Absyn.dummyInfo);
then DAE.CALL(Absyn.IDENT("der"),{DAE.CREF(e_cref,DAE.ET_OTHER())},false,false,DAE.ET_OTHER(),DAE.NO_INLINE());
end matchcontinue;
end CodeVarToCref;
Expand Down
16 changes: 8 additions & 8 deletions Compiler/PartFn.mo
Expand Up @@ -75,7 +75,7 @@ algorithm
BackendDAE.EquationArray removedEqs;
BackendDAE.EquationArray initialEqs;
array<BackendDAE.MultiDimEquation> arrayEqs;
DAE.Algorithm[:] algorithms;
array<DAE.Algorithm> algorithms;
BackendDAE.EventInfo eventInfo;
BackendDAE.ExternalObjectClasses extObjClasses;
/*case(dae,dlow)
Expand Down Expand Up @@ -106,14 +106,14 @@ end partEvalBackendDAE;
protected function partEvalAlgs
"function: partEvalAlgs
elabs an algorithm section in BackendDAE"
input DAE.Algorithm[:] inAlgorithms;
input array<DAE.Algorithm> inAlgorithms;
input list<DAE.Function> inElementList;
output DAE.Algorithm[:] outAlgorithms;
output array<DAE.Algorithm> outAlgorithms;
output list<DAE.Function> outElementList;
algorithm
(outAlgorithms,outElementList) := matchcontinue(inAlgorithms,inElementList)
local
DAE.Algorithm[:] algarr,algarr_1;
array<DAE.Algorithm> algarr,algarr_1;
list<DAE.Algorithm> alglst,alglst_1;
list<DAE.Function> dae;
case(algarr,dae)
Expand Down Expand Up @@ -206,9 +206,9 @@ algorithm
local
list<DAE.Function> dae;
array<list<BackendDAE.CrefIndex>> crind;
list<BackendDAE.StringIndex>[:] strind;
array<list<BackendDAE.StringIndex>> strind;
Integer bsi,nov,noe,asi;
Option<BackendDAE.Var>[:] varr,varr_1;
array<Option<BackendDAE.Var>> varr,varr_1;
list<Option<BackendDAE.Var>> vlst,vlst_1;
case(BackendDAE.VARIABLES(crind,strind,BackendDAE.VARIABLE_ARRAY(noe,asi,varr),bsi,nov),dae)
equation
Expand Down Expand Up @@ -286,7 +286,7 @@ algorithm
local
list<DAE.Function> dae;
list<Option<BackendDAE.Equation>> eqlst;
Option<BackendDAE.Equation>[:] eqarr;
array<Option<BackendDAE.Equation>> eqarr;
Integer num,size;
case(BackendDAE.EQUATION_ARRAY(num,size,eqarr),dae)
equation
Expand Down Expand Up @@ -1347,7 +1347,7 @@ algorithm
fail();
case((e as DAE.VAR(direction = DAE.INPUT())) :: cdr,inputs)
equation
DAE.VAR(direction = DAE.INPUT) = Util.listFirst(cdr);
DAE.VAR(direction = DAE.INPUT()) = Util.listFirst(cdr);
res = insertAfterInputs(cdr,inputs);
then
e :: res;
Expand Down

0 comments on commit 79713a7

Please sign in to comment.