Skip to content

Commit

Permalink
Added locating protected annotations for icon and diagram
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1050 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Dec 3, 2003
1 parent 125e96f commit c43b5e2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
26 changes: 24 additions & 2 deletions modeq/interactive.rml
Expand Up @@ -1997,7 +1997,9 @@ end
relation get_icon_annotation_in_class : (Absyn.Class) => string =

rule get_public_list(parts) => publst &
get_icon_annotation_in_elementitemlist(publst) => str
get_protected_list(parts) => protlst &
list_append(publst,protlst) => lst &
get_icon_annotation_in_elementitemlist(lst) => str
----------------------------
get_icon_annotation_in_class (Absyn.CLASS(_,_,_,_,_,Absyn.PARTS(parts,_))) => str
end
Expand Down Expand Up @@ -2043,7 +2045,9 @@ end
relation get_diagram_annotation_in_class : (Absyn.Class) => string =

rule get_public_list(parts) => publst &
get_diagram_annotation_in_elementitemlist(publst) => str
get_protected_list(parts) => protlst &
list_append(publst,protlst) => lst &
get_diagram_annotation_in_elementitemlist(lst) => str
----------------------------
get_diagram_annotation_in_class (Absyn.CLASS(_,_,_,_,_,Absyn.PARTS(parts,_))) => str
end
Expand Down Expand Up @@ -2872,6 +2876,24 @@ relation get_public_list: Absyn.ClassPart list => Absyn.ElementItem list =

end


(** relation: get_public_list
** This relation takes a ClassPart List and returns an appended list of all protected lists.
**
*)
relation get_protected_list: Absyn.ClassPart list => Absyn.ElementItem list =
axiom get_protected_list([]) => []

rule get_protected_list(rest) => res2 &
list_append(res1,res2) => res
-----------------------------
get_protected_list Absyn.PROTECTED(res1)::rest => res

rule get_protected_list(xs) => ys
---------------------------
get_protected_list(x::xs) => ys
end

(** relation: get_equation_list
** This relation takes a ClassPart List and returns the first EquationItem list of the class.
**
Expand Down
9 changes: 5 additions & 4 deletions modeq/main.rml
Expand Up @@ -192,22 +192,23 @@ relation translate_file : string list => () =
& Debug.fprint ("info", "---elaborating\n")
& SCode.elaborate(p) => p'

(* & Dump.dump p' *)
(* & Dump.dump p' *)

& Debug.fprint ("info", "---instantiating\n")
& Inst.instantiate(p') => d'
& Debug.fcall ("beforefixmodout", DAE.dump_debug, d')
& fix_modelica_output (d') => d
(* & Debug. print "\nJust instantiated" *)
& Debug.fprint ("info", "---dumping\n")
& Print.clear_buf()
& DAE.dump_str d => s
& print "f" & print s
& Debug.fcall ("daedump", DAE.dump, d)
& Debug.fcall ("daedump2", DAE.dump2, d)
& Debug.fcall ("daedumpdebug", DAE.dump_debug, d)
& Debug.fcall ("daedumpgraphv", DAE.dump_graphviz, d)
& ModUtil.string_prefix_params d => d'
& Debug.fcall ("codegen", Codegen.generate_functions, d') &
Print.get_string() => str &
print str
& Debug.fcall ("codegen", Codegen.generate_functions, d')
------------------------------
translate_file [f]

Expand Down

0 comments on commit c43b5e2

Please sign in to comment.