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@6996 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 12, 2010
1 parent 79713a7 commit 579e6f6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Compiler/BackendDAEOptimize.mo
Expand Up @@ -1436,7 +1436,7 @@ algorithm
s = Util.listMap(v3,intString);
str = Util.stringDelimitList(s,",");
Debug.fcall("markblocks",print,"Vars Indecies : " +& str +& "\n");
v4 = fill(0,listLength(comps1));
v4 = arrayCreate(listLength(comps1),0);
v4 = markArray(v3,comps1,v4);
(comps1,_) = splitBlocks2(comps1,v4,1);

Expand Down Expand Up @@ -1508,7 +1508,7 @@ algorithm
equation
i = Util.listlistPosition(var,vars);
Debug.fcall("markblocks",print,"Var " +& intString(var) +& " at pos : " +& intString(i) +& "\n");
arr1 = fill(1,i+1);
arr1 = arrayCreate(i+1,1);
arr = Util.arrayCopy(arr1,arr);
arr = markArray(rest,vars,arr);
s = Util.listMap(arrayList(arr),intString);
Expand Down
1 change: 1 addition & 0 deletions Compiler/Builtin.mo
Expand Up @@ -3034,6 +3034,7 @@ algorithm
// Array Operations
env = Env.extendFrameT(env, "arrayLength", marrayAny2int);
env = Env.extendFrameT(env, "arrayGet", marrayAInt2A);
env = Env.extendFrameT(env, "arrayNth", marrayAInt2A);
env = Env.extendFrameT(env, "arrayCreate", intA2marrayA);
env = Env.extendFrameT(env, "arrayList", marrayA2listA);
env = Env.extendFrameT(env, "listArray", listA2marrayA);
Expand Down
3 changes: 2 additions & 1 deletion Compiler/ComponentReference.mo
Expand Up @@ -861,9 +861,10 @@ public function crefEqualReturn
so returns the cref, otherwise fail."
input DAE.ComponentRef cr;
input DAE.ComponentRef cr2;
output DAE.ComponentRef cr;
output DAE.ComponentRef ocr;
algorithm
true := crefEqualNoStringCompare(cr, cr2);
ocr := cr;
end crefEqualReturn;

public function crefIsIdent
Expand Down
5 changes: 2 additions & 3 deletions Compiler/SimCode.mo
Expand Up @@ -3949,7 +3949,6 @@ algorithm
DAE.Exp e;
DAE.Exp e1,e2,new_exp,new_exp1,rhs_exp,rhs_exp_1,rhs_exp_2;
DAE.ExpType tp,tp1;
BackendDAE.Equation dlowEq;
list<Integer> ds;
list<Option<Integer>> ad;
list<DAE.Subscript> subs;
Expand Down Expand Up @@ -7853,7 +7852,7 @@ algorithm
arr := arrayCreate(1000, {});
// lst := Util.listFill(NONE, 100);
// emptyarr := listArray(lst);
emptyarr := fill(NONE(), 100);
emptyarr := arrayCreate(100, NONE());
hashTable := HASHTABLE(arr,VALUE_ARRAY(0,100,emptyarr),1000,0);
end emptyHashTable;
/*
Expand Down Expand Up @@ -8316,7 +8315,7 @@ algorithm
local
Key k;
Value v;
Integer n,pos,len;
Integer n,len;
array<Option<tuple<Key,Value>>> arr;
String ps,lens,ns;
case (VALUE_ARRAY(numberOfElements = n,valueArray = arr),pos)
Expand Down
21 changes: 11 additions & 10 deletions Compiler/Util.mo
Expand Up @@ -1012,21 +1012,22 @@ the array will first be initialized with the result of the first call.
assume the Indecies are in range 1,arrayLength(array).

"
input Type_a[:] array;
input array<Type_a> array;
input list<Integer> lst;
output Type_a[:] outArray;
output array<Type_a> outArray;
replaceable type Type_a subtypeof Any;
algorithm
outArray := arrayCreate(listLength(lst),array[1]);
outArray := arraySelectHelp(array,lst,outArray,1);
end arraySelect;

protected function arraySelectHelp "help function to arrayMap"
input Type_a[:] array;
input array<Type_a> array;
input list<Integer> posistions;
input Type_a[:] inArray;
input array<Type_a> inArray;
input Integer lstpos;
output Type_a[:] outArray;
output array<Type_a> outArray;
replaceable type Type_a subtypeof Any;
algorithm
outArray := matchcontinue(array,posistions,inArray,lstpos)
local
Expand All @@ -1052,7 +1053,7 @@ See also listMap, arrayMapNoCopy
"
input array<Type_a> array;
input FuncType func;
output Type_b[:] outArray;
output array<Type_b> outArray;
replaceable type Type_a subtypeof Any;
replaceable type Type_b subtypeof Any;
partial function FuncType
Expand All @@ -1067,11 +1068,11 @@ end arrayMap;

protected function arrayMapHelp1 "help function to arrayMap"
input array<Type_a> array;
input Type_b[:] newArray;
input array<Type_b> newArray;
input FuncType func;
input Integer pos "iterated 1..len";
input Integer len "length of array";
output Type_b[:] outArray;
output array<Type_b> outArray;
replaceable type Type_a subtypeof Any;
replaceable type Type_b subtypeof Any;
partial function FuncType
Expand Down Expand Up @@ -1763,8 +1764,8 @@ algorithm
outLst:=
matchcontinue (lst,func,a1,a2,a3,a4,a5)
local
Type_e f_1;
list<Type_e> r_1;
Type_i f_1;
list<Type_i> r_1;
Type_a f;
list<Type_a> r;

Expand Down

0 comments on commit 579e6f6

Please sign in to comment.