Skip to content

Commit

Permalink
Changed REDECL to contain SCode.Element list, so that an elaborated c…
Browse files Browse the repository at this point in the history
…lassdef can

be stored.

Additional mod printing (redeclare).


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@605 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
levsa committed Nov 20, 2001
1 parent 3a0c546 commit fe6a740
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions modeq/mod.rml
Expand Up @@ -29,7 +29,7 @@ module Mod:
datatype SubMod = NAMEMOD of Ident * Mod
| IDXMOD of int list * Mod
and Mod = MOD of bool * (SubMod list) * EqMod option
| REDECL of bool * Absyn.ElementSpec
| REDECL of bool * SCode.Element list
| NOMOD
(** This type is very similar to `SCode.Mod'. The main difference is
** that it uses `Exp.Exp' for the expressions. Expressions stored
Expand All @@ -48,6 +48,8 @@ module Mod:

end

with "dump.rml"

(** relation: elab_mod
**
** This relation elaborates on the expressions in a modification and
Expand All @@ -72,6 +74,15 @@ relation elab_mod : (Env.Env, Prefix.Prefix, SCode.Mod) => Mod =
elab_mod (env,pre,m as SCode.MOD(final,subs,SOME(e)))
=> MOD(final,subs',SOME((e'',prop)))

axiom elab_mod (env, pre, m as SCode.REDECL(final, elist))
=> REDECL(final, elist)

rule print "#-- elab_mod failed:\n" &
SCode.print_mod mod &
print "\n"
----------
elab_mod (_,pre,mod) => fail

end

(** relation: elab_submods
Expand Down Expand Up @@ -554,11 +565,15 @@ end

relation print_mod : Mod => () =

axiom print_mod(NOMOD)
rule print "()"
----------
print_mod(NOMOD)

rule print "(redeclared)"
rule print "(redeclare(" &
Dump.print_list(elist, SCode.print_element, ", ") &
print "))"
------------------------------
print_mod REDECL(_,_)
print_mod REDECL(final,elist)

rule print_final final &
print_subs1 subs &
Expand Down

0 comments on commit fe6a740

Please sign in to comment.