@@ -896,8 +896,10 @@ algorithm
896896 list< DAE . Element > xs1,xs2;
897897 list< list< DAE . Element >> trueBranches;
898898 list< DAE . Exp > conds;
899- String s;
899+ String s,s1,s2,sourceStr ;
900900 IOStream . IOStream str;
901+ DAE . ElementSource src;
902+ list< SCode . Comment > cmt;
901903
902904 case (DAE . INITIALEQUATION (exp1 = e1,exp2 = e2))
903905 equation
@@ -954,6 +956,27 @@ algorithm
954956 then
955957 ();
956958
959+ case (DAE . INITIAL_ASSERT (condition= e1,message = e2,source = src))
960+ equation
961+ cmt = ElementSource . getCommentsFromSource(src);
962+ sourceStr = cmtListToString(cmt);
963+ s1 = ExpressionDump . printExpStr(e1);
964+ s2 = ExpressionDump . printExpStr(e2);
965+ s = stringAppendList({" assert(" ,s1, "," ,s2,") " , sourceStr, "; \n " });
966+ Print . printBuf(s);
967+ then
968+ ();
969+
970+ case (DAE . INITIAL_TERMINATE (message= e1,source = src))
971+ equation
972+ cmt = ElementSource . getCommentsFromSource(src);
973+ sourceStr = cmtListToString(cmt);
974+ s1 = ExpressionDump . printExpStr(e1);
975+ s = stringAppendList({" terminate(" ,s1,") " , sourceStr, "; \n " });
976+ Print . printBuf(s);
977+ then
978+ ();
979+
957980 case (DAE . INITIAL_NORETCALL (exp = e1))
958981 equation
959982 ExpressionDump . printExp(e1);
@@ -2156,13 +2179,29 @@ algorithm
21562179 Print . printBuf(")" );
21572180 then
21582181 ();
2182+ case DAE . INITIAL_ASSERT (condition = e1,message = e2)
2183+ equation
2184+ Print . printBuf("INITIAL_ASSERT(" );
2185+ ExpressionDump . printExp(e1);
2186+ Print . printBuf("," );
2187+ ExpressionDump . printExp(e2);
2188+ Print . printBuf(")" );
2189+ then
2190+ ();
21592191 case DAE . TERMINATE (message = e1)
21602192 equation
21612193 Print . printBuf("TERMINATE(" );
21622194 ExpressionDump . printExp(e1);
21632195 Print . printBuf(")" );
21642196 then
21652197 ();
2198+ case DAE . INITIAL_TERMINATE (message = e1)
2199+ equation
2200+ Print . printBuf("INITIAL_TERMINATE(" );
2201+ ExpressionDump . printExp(e1);
2202+ Print . printBuf(")" );
2203+ then
2204+ ();
21662205 case DAE . REINIT ()
21672206 equation
21682207 Print . printBuf("REINIT()" );
@@ -2935,17 +2974,6 @@ algorithm
29352974 then
29362975 str;
29372976
2938- case ((DAE . ASSERT (condition= e1, message = e2, level = e3, source = src) :: xs), str)
2939- equation
2940- sourceStr = getSourceInformationStr(src);
2941- s1 = ExpressionDump . printExpStr(e1);
2942- s2 = ExpressionDump . printExpStr(e2);
2943- s3 = ExpressionDump . printExpStr(e3);
2944- str = IOStream . appendList(str, {" assert(" ,s1,"," ,s2,"," ,s3,")" ,sourceStr,"; \n " });
2945- str = dumpEquationsStream(xs, str);
2946- then
2947- str;
2948-
29492977 case (DAE . TERMINATE (message= e1, source = src) :: xs, str)
29502978 equation
29512979 sourceStr = getSourceInformationStr(src);
@@ -3075,13 +3103,14 @@ protected function dumpInitialEquationsStream "Dump initial equations to a strea
30753103algorithm
30763104 outStream := matchcontinue (inElementLst, inStream)
30773105 local
3078- String s1,s2;
3106+ String s1,s2,sourceStr ;
30793107 DAE . Exp e1,e2,e;
30803108 list< DAE . Element > xs,xs1,xs2;
30813109 list< list< DAE . Element >> trueBranches;
30823110 DAE . ComponentRef c;
30833111 IOStream . IOStream str;
30843112 list< DAE . Exp > conds;
3113+ DAE . ElementSource src;
30853114
30863115 case ({}, str) then str;
30873116
@@ -3143,6 +3172,25 @@ algorithm
31433172 then
31443173 str;
31453174
3175+ case ((DAE . INITIAL_ASSERT (condition= e1, message = e2, level = DAE . ENUM_LITERAL (index= 1 ), source = src) :: xs), str)
3176+ equation
3177+ sourceStr = getSourceInformationStr(src);
3178+ s1 = ExpressionDump . printExpStr(e1);
3179+ s2 = ExpressionDump . printExpStr(e2);
3180+ str = IOStream . appendList(str, {" assert(" ,s1,"," ,s2,")" , sourceStr, "; \n " });
3181+ str = dumpEquationsStream(xs, str);
3182+ then
3183+ str;
3184+
3185+ case (DAE . INITIAL_TERMINATE (message= e1, source = src) :: xs, str)
3186+ equation
3187+ sourceStr = getSourceInformationStr(src);
3188+ s1 = ExpressionDump . printExpStr(e1);
3189+ str = IOStream . appendList(str, {" terminate(" ,s1,")" , sourceStr, "; \n " });
3190+ str = dumpEquationsStream(xs, str);
3191+ then
3192+ str;
3193+
31463194 case ((_ :: xs), str)
31473195 equation
31483196 str = dumpInitialEquationsStream(xs, str);
@@ -3888,6 +3936,16 @@ algorithm
38883936 then
38893937 str;
38903938
3939+ case (DAE . INITIAL_ASSERT (condition= e1,message = e2,source = src))
3940+ equation
3941+ cmt = ElementSource . getCommentsFromSource(src);
3942+ sourceStr = cmtListToString(cmt);
3943+ s1 = ExpressionDump . printExpStr(e1);
3944+ s2 = ExpressionDump . printExpStr(e2);
3945+ str = stringAppendList({" /* initial */ assert(" ,s1, "," ,s2,") " , sourceStr, "; \n " });
3946+ then
3947+ str;
3948+
38913949 case (DAE . TERMINATE (message= e1,source = src))
38923950 equation
38933951 cmt = ElementSource . getCommentsFromSource(src);
@@ -3897,6 +3955,15 @@ algorithm
38973955 then
38983956 str;
38993957
3958+ case (DAE . INITIAL_TERMINATE (message= e1,source = src))
3959+ equation
3960+ cmt = ElementSource . getCommentsFromSource(src);
3961+ sourceStr = cmtListToString(cmt);
3962+ s1 = ExpressionDump . printExpStr(e1);
3963+ str = stringAppendList({" /* initial */ terminate(" ,s1,") " , sourceStr, "; \n " });
3964+ then
3965+ str;
3966+
39003967 case (DAE . REINIT (source = src))
39013968 equation
39023969 cmt = ElementSource . getCommentsFromSource(src);
0 commit comments