Skip to content

Commit

Permalink
Fixed some operators
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@715 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
henjo committed Feb 5, 2002
1 parent 151b63c commit 8933b4d
Show file tree
Hide file tree
Showing 14 changed files with 939 additions and 359 deletions.
34 changes: 17 additions & 17 deletions modeq/Makefile
Expand Up @@ -107,27 +107,27 @@ depend:
$(RM) .dep Makefile.save

## dependencies
debug.o: debug.rml rtopts.rml dump.rml
util.o: util.rml
types.o: types.rml classinf.rml absyn.rml exp.rml values.rml explode.rml dump.rml debug.rml
absyn.o: absyn.rml debug.rml
explode.o: explode.rml absyn.rml dump.rml debug.rml
algorithm.o: algorithm.rml exp.rml types.rml staticexp.rml explode.rml
builtin.o: builtin.rml absyn.rml explode.rml env.rml exp.rml types.rml classinf.rml
classinf.o: classinf.rml absyn.rml
codegen.o: codegen.rml dae.rml dump.rml debug.rml absyn.rml algorithm.rml classinf.rml exp.rml modutil.rml types.rml util.rml
connect.o: connect.rml exp.rml staticexp.rml dae.rml dump.rml
dae.o: dae.rml absyn.rml dump.rml exp.rml explode.rml algorithm.rml types.rml staticexp.rml rtopts.rml graphviz.rml
debug.o: debug.rml rtopts.rml dump.rml
dump.o: dump.rml absyn.rml debug.rml classinf.rml rtopts.rml
dumpgraphviz.o: dumpgraphviz.rml absyn.rml debug.rml graphviz.rml classinf.rml dump.rml
graphviz.o: graphviz.rml
prefix.o: prefix.rml absyn.rml exp.rml env.rml lookup.rml
env.o: env.rml absyn.rml values.rml explode.rml types.rml classinf.rml exp.rml dump.rml graphviz.rml dae.rml
lookup.o: lookup.rml classinf.rml types.rml absyn.rml exp.rml env.rml explode.rml parse.rml debug.rml
builtin.o: builtin.rml absyn.rml explode.rml env.rml exp.rml types.rml classinf.rml
connect.o: connect.rml exp.rml staticexp.rml dae.rml dump.rml
classinf.o: classinf.rml absyn.rml
exp.o: exp.rml absyn.rml rtopts.rml
algorithm.o: algorithm.rml exp.rml types.rml staticexp.rml explode.rml
staticexp.o: staticexp.rml absyn.rml exp.rml explode.rml types.rml env.rml values.rml classinf.rml lookup.rml debug.rml dump.rml
values.o: values.rml
dae.o: dae.rml absyn.rml dump.rml exp.rml explode.rml algorithm.rml types.rml staticexp.rml rtopts.rml graphviz.rml
explode.o: explode.rml absyn.rml dump.rml debug.rml
graphviz.o: graphviz.rml
inst.o: inst.rml classinf.rml connect.rml dae.rml debug.rml env.rml exp.rml explode.rml mod.rml prefix.rml types.rml absyn.rml algorithm.rml builtin.rml dump.rml lookup.rml modutil.rml rtopts.rml staticexp.rml values.rml
lookup.o: lookup.rml classinf.rml types.rml absyn.rml exp.rml env.rml explode.rml parse.rml debug.rml
main.o: main.rml modutil.rml parse.rml dump.rml dumpgraphviz.rml explode.rml dae.rml inst.rml rtopts.rml debug.rml codegen.rml
mod.o: mod.rml absyn.rml dae.rml env.rml exp.rml prefix.rml explode.rml types.rml staticexp.rml values.rml dump.rml
modutil.o: modutil.rml absyn.rml dae.rml exp.rml rtopts.rml algorithm.rml
inst.o: inst.rml explode.rml dae.rml debug.rml env.rml prefix.rml mod.rml connect.rml types.rml classinf.rml exp.rml modutil.rml algorithm.rml values.rml absyn.rml lookup.rml builtin.rml dump.rml staticexp.rml rtopts.rml
codegen.o: codegen.rml dae.rml exp.rml types.rml algorithm.rml util.rml modutil.rml dump.rml debug.rml staticexp.rml inst.rml rtopts.rml absyn.rml classinf.rml
main.o: main.rml modutil.rml parse.rml dump.rml dumpgraphviz.rml explode.rml dae.rml inst.rml rtopts.rml debug.rml codegen.rml
prefix.o: prefix.rml absyn.rml exp.rml env.rml lookup.rml
staticexp.o: staticexp.rml absyn.rml exp.rml explode.rml types.rml env.rml values.rml classinf.rml lookup.rml debug.rml dump.rml
types.o: types.rml classinf.rml absyn.rml exp.rml values.rml explode.rml dump.rml debug.rml
util.o: util.rml
values.o: values.rml
4 changes: 2 additions & 2 deletions modeq/absyn_builder/walker.g
Expand Up @@ -1139,8 +1139,8 @@ arithmetic_expression returns [void* ast]

unary_arithmetic_expression returns [void* ast]
:
(#(UNARY_PLUS ast = term) { ast = Absyn__UNARY(Absyn__ADD,ast); }
|#(UNARY_MINUS ast = term) { ast = Absyn__UNARY(Absyn__SUB,ast); }
(#(UNARY_PLUS ast = term) { ast = Absyn__UNARY(Absyn__UPLUS,ast); }
|#(UNARY_MINUS ast = term) { ast = Absyn__UNARY(Absyn__UMINUS,ast); }
| ast = term
)
;
Expand Down
7 changes: 5 additions & 2 deletions modeq/algorithm.rml
Expand Up @@ -26,7 +26,7 @@ module Algorithm:
datatype Statement = ASSIGN of Exp.Type * Exp.ComponentRef * Exp.Exp
| ASSIGN_ARR of Exp.Type * Exp.ComponentRef * Exp.Exp
| IF of Exp.Exp * Statement list * Else
| FOR of Ident * Exp.Exp * Statement list
| FOR of Exp.Type * bool * Ident * Exp.Exp * Statement list
| WHILE of Exp.Exp * Statement list
| WHEN of Exp.Exp * Statement list
(** There are four kinds of statements. Assignments (`a := b;'),
Expand Down Expand Up @@ -207,7 +207,10 @@ end
relation make_for : (Ident, Exp.Exp, Static.Properties,
Statement list) => Statement =

axiom make_for(i,e,Static.PROP(Types.T_ARRAY(_,_),_),stmts) => FOR(i,e,stmts)
rule Types.is_array t => array &
Static.elab_type t => et
-----------------------
make_for(i,e,Static.PROP(Types.T_ARRAY(_,t),_),stmts) => FOR(et,array,i,e,stmts)

rule print "# Type error in for conditional.\n" &
print " Expected array, got " &
Expand Down

0 comments on commit 8933b4d

Please sign in to comment.