Skip to content

Commit

Permalink
Changed get_modification_names to new design of getting modifiers.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1731 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Apr 27, 2005
1 parent 7ad74d9 commit fb2422c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modeq/absyn.rml
Expand Up @@ -452,6 +452,7 @@ module Absyn:
relation element_spec_name : ElementSpec => Ident
relation cref_to_path : ComponentRef => Path
relation path_to_cref : Path => ComponentRef
relation join_crefs : (ComponentRef, ComponentRef) => ComponentRef
relation path_string : Path => string
relation opt_path_string: Path option => string
relation path_string2 : (Path, string) => string
Expand Down Expand Up @@ -735,6 +736,16 @@ relation path_to_cref : Path => ComponentRef =
path_to_cref QUALIFIED(i,p) => CREF_QUAL(i,[],c)
end


relation join_crefs : (ComponentRef, ComponentRef) => ComponentRef =

axiom join_crefs ( CREF_IDENT(id,sub),cr2) => CREF_QUAL(id,sub,cr2)

rule join_crefs(cr,cr2) => cr'
------------------------
join_crefs (CREF_QUAL(id,sub,cr),cr2) => CREF_QUAL(id,sub,cr')
end

(** relation: cref_get_first
**
** Returns first ident from a ComponentRef
Expand Down
21 changes: 21 additions & 0 deletions modeq/interactive.rml
Expand Up @@ -1671,6 +1671,27 @@ relation get_modification_names:(Absyn.ElementArg list)

axiom get_modification_names([]) => []

rule (* has submodifiers, add these instead of this modifier name*)
get_modification_names(rest) => names &
get_modification_names(args) => names2 &
Util.list_map_1(names2,string_append,".") => names2' &
Util.list_map_1(names2', string_append,name) => names2'' &
list_append(names2'',names) => res
---------------
get_modification_names(Absyn.MODIFICATION(f,each,Absyn.CREF_IDENT(name,_),SOME(Absyn.CLASSMOD(args as _::_,_)),cmt)::rest)
=> res

rule (* no submodifiers, add name*)
get_modification_names(rest) => names
--------------------------------
get_modification_names(Absyn.MODIFICATION(f,each,Absyn.CREF_IDENT(name,_),SOME(Absyn.CLASSMOD([],_)),cmt)::rest)
=> name::names

rule (* no submodifiers 2, add name*)
get_modification_names(rest) => names
--------------------------------
get_modification_names(Absyn.MODIFICATION(f,each,Absyn.CREF_IDENT(name,_),NONE,cmt)::rest)
=> name::names
rule get_modification_names(rest) => names
---------------
get_modification_names(Absyn.MODIFICATION(f,each,Absyn.CREF_IDENT(name,_),mod,cmt)::rest)
Expand Down

0 comments on commit fb2422c

Please sign in to comment.