Skip to content

Commit

Permalink
Added check/error msg of lowering IF_EQUATIONS.
Browse files Browse the repository at this point in the history
Added noEvent as macro in modelica.h

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1898 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Sep 28, 2005
1 parent 9c4cf7f commit 8d467e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Compiler/DAELow.rml
Expand Up @@ -1952,6 +1952,22 @@ relation lower2: (DAE.DAElist, BinTree (* states *), WhenClause list)
--------------------------------
lower2(DAE.DAE(DAE.COMP(_,dae)::xs),states,whenclauses)
=> (vars,knvars,eqns,reqns,ieqns,algs,whenclauses'')

rule Print.print_error_buf "#Error, if-equations not supported. Please rewrite as if-expressions\n"
---------------------
lower2 (DAE.DAE(DAE.IF_EQUATION(_,_,_)::xs),states,whenclauses) => fail

rule Print.print_error_buf "#Error, if-equations not supported. Please rewrite as if-expressions\n"
---------------------
lower2 (DAE.DAE(DAE.INITIAL_IF_EQUATION(_,_,_)::xs),states,whenclauses) => fail

rule Print.print_error_buf "#Warning, Asserts are not supported/checked for.\n" &
lower2(DAE.DAE(xs),states,whenclauses)
=> (v,kv,e,re,ie,al,whenclauses')

---------------------
lower2 (DAE.DAE(DAE.ASSERT(_)::xs),states,whenclauses)
=> (v,kv,e,re,ie,al,whenclauses')

rule lower2(DAE.DAE(xs),states,whenclauses)
=> (v,kv,e,re,ie,al,whenclauses')
Expand Down
1 change: 1 addition & 0 deletions c_runtime/modelica.h
Expand Up @@ -66,5 +66,6 @@ double LessEq(double a,double b);
double Greater(double a,double b);
double GreaterEq(double a,double b);
#define ZEROCROSSING(ind,exp) gout[ind] = (zeroCrossingEnabled[ind])?double(zeroCrossingEnabled[ind])*exp:1.0
#define noEvent(arg) arg

#endif

0 comments on commit 8d467e3

Please sign in to comment.