@@ -9115,7 +9115,7 @@ public function dimensionsEqualAllowZero
91159115 input DAE . Dimension dim2;
91169116 output Boolean res;
91179117algorithm
9118- res := matchcontinue (dim1, dim2)
9118+ res := match (dim1, dim2)
91199119 local
91209120 Boolean b;
91219121 Integer d1, d2;
@@ -9136,7 +9136,7 @@ algorithm
91369136 boolAnd(intEq(d2,0 ), intNe(d1,0 ))));
91379137 then
91389138 b;
9139- end matchcontinue ;
9139+ end match ;
91409140end dimensionsEqualAllowZero;
91419141
91429142public function dimensionsKnownAndEqual
@@ -9157,26 +9157,26 @@ public function dimensionKnown
91579157 input DAE . Dimension dim;
91589158 output Boolean known;
91599159algorithm
9160- known := matchcontinue (dim)
9160+ known := match (dim)
91619161 case DAE . DIM_UNKNOWN () then false ;
91629162 case DAE . DIM_EXP (exp = DAE . ICONST ()) then true ;
91639163 case DAE . DIM_EXP (exp = DAE . BCONST ()) then true ;
91649164 case DAE . DIM_EXP (exp = DAE . ENUM_LITERAL ()) then true ;
91659165 case DAE . DIM_EXP () then false ;
9166- case _ then true ;
9167- end matchcontinue ;
9166+ else true ;
9167+ end match ;
91689168end dimensionKnown;
91699169
91709170public function dimensionKnownAndNonZero
91719171 "Checks whether a dimensions is known or not."
91729172 input DAE . Dimension dim;
91739173 output Boolean known;
91749174algorithm
9175- known := matchcontinue (dim)
9175+ known := match (dim)
91769176 case DAE . DIM_EXP (exp = DAE . ICONST (0 )) then false ;
91779177 case DAE . DIM_INTEGER (0 ) then false ;
91789178 else dimensionKnown(dim);
9179- end matchcontinue ;
9179+ end match ;
91809180end dimensionKnownAndNonZero;
91819181
91829182public function dimensionsKnownAndNonZero
@@ -9193,13 +9193,23 @@ public function dimensionUnknownOrExp
91939193 input DAE . Dimension dim;
91949194 output Boolean known;
91959195algorithm
9196- known := matchcontinue (dim)
9196+ known := match (dim)
91979197 case DAE . DIM_UNKNOWN () then true ;
91989198 case DAE . DIM_EXP () then true ;
9199- case _ then false ;
9200- end matchcontinue ;
9199+ else false ;
9200+ end match ;
92019201end dimensionUnknownOrExp;
92029202
9203+ public function dimensionUnknown
9204+ input DAE . Dimension inDimension;
9205+ output Boolean outUnknown;
9206+ algorithm
9207+ outUnknown := match(inDimension)
9208+ case DAE . DIM_UNKNOWN () then true ;
9209+ else false ;
9210+ end match;
9211+ end dimensionUnknown;
9212+
92039213public function subscriptEqual
92049214"Returns true if two subscript lists are equal."
92059215 input list< DAE . Subscript > inSubscriptLst1;
@@ -11989,5 +11999,26 @@ algorithm
1198911999 end match;
1199012000end isAsubExp;
1199112001
12002+ public function typeCast
12003+ input DAE . Exp inExp;
12004+ input DAE . Type inType;
12005+ output DAE . Exp outExp;
12006+ algorithm
12007+ outExp := DAE . CAST (inType, inExp);
12008+ outExp := ExpressionSimplify . simplify1(outExp);
12009+ end typeCast;
12010+
12011+ public function typeCastElements
12012+ input DAE . Exp inExp;
12013+ input DAE . Type inType;
12014+ output DAE . Exp outExp;
12015+ protected
12016+ DAE . Type ty;
12017+ algorithm
12018+ ty := typeof(inExp);
12019+ ty := Types . setArrayElementType(ty, inType);
12020+ outExp := typeCast(inExp, ty);
12021+ end typeCastElements;
12022+
1199212023annotation(__OpenModelica_Interface= "frontend" );
1199312024end Expression ;
0 commit comments