3030 */
3131
3232package Convert
33- " file: Convert.mo
34- package: Convert
33+ " file: Convert.mo
34+ package: Convert
3535 description: This file is part of a work-around implemented for the
36- valueblock construct in order to avoid ciruclar file dependencies.
37- It converts uniontypes located in Exp to similiar uniontypes located in DAE
38- and vise versa.
36+ valueblock construct in order to avoid ciruclar file dependencies.
37+ It converts uniontypes located in Exp to similiar uniontypes located
38+ in DAE and vice- versa.
3939
4040 RCS: $Id$"
4141
42+ // public imports
4243public import Absyn ;
4344public import DAE ;
4445
46+ // protected imports
4547protected import ComponentReference ;
4648protected import Expression ;
4749
@@ -74,22 +76,23 @@ algorithm
7476 list< Absyn . AlgorithmItem > localAccList1;
7577 list< DAE . Element > restLd,localAccList2;
7678 DAE . FunctionTree funcs;
79+ Absyn . AlgorithmItem stmt;
80+ DAE . Exp exp1,exp2;
81+ Absyn . Exp left,right;
82+ DAE . Element firstLd;
83+
7784 case ({},localAccList1,localAccList2) then (listReverse(localAccList1),listReverse(localAccList2));
85+
7886 case (DAE . EQUATION (exp1,exp2,_) :: restLd,localAccList1,localAccList2)
79- local
80- Absyn . AlgorithmItem stmt;
81- DAE . Exp exp1,exp2;
82- Absyn . Exp left,right;
8387 equation
8488 left = fromExpExpToAbsynExp(exp1);
8589 right = fromExpExpToAbsynExp(exp2);
8690 stmt = Absyn . ALGORITHMITEM (Absyn . ALG_ASSIGN (left,right),NONE (),Absyn . dummyInfo /* TODO: Use the elementsource from the DAE.EQUATION? */ );
8791 localAccList1 = stmt::localAccList1;
8892 (localAccList1,localAccList2) = fromDAEEqsToAbsynAlgElts(restLd,localAccList1,localAccList2);
8993 then (localAccList1,localAccList2);
94+
9095 case (firstLd :: restLd,localAccList1,localAccList2)
91- local
92- DAE . Element firstLd;
9396 equation
9497 localAccList2 = firstLd::localAccList2;
9598 (localAccList1,localAccList2) = fromDAEEqsToAbsynAlgElts(restLd,localAccList1,localAccList2);
@@ -113,8 +116,3 @@ algorithm
113116end fromExpCrefToAbsynCref;
114117
115118end Convert ;
116-
117-
118-
119-
120-
0 commit comments