From c577246acff22d885194ee0137450398508b4d27 Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Tue, 5 Jun 2007 11:40:12 +0000 Subject: [PATCH] added another bunch of update functions git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@6541 3260e6d1-4efc-4170-b0a7-36055960796d --- src/rep_core.sml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/rep_core.sml b/src/rep_core.sml index 410d1b6..cd27699 100644 --- a/src/rep_core.sml +++ b/src/rep_core.sml @@ -141,8 +141,12 @@ val connected_classifiers_of : Classifier -> Classifier list -> Classifier list val assoc_to_attr_type : associationend -> Rep_OclType.OclType -val update_thyname : string -> Classifier -> Classifier -val update_invariant : (string option * Rep_OclTerm.OclTerm) list -> Classifier -> Classifier +val update_thyname : string -> Classifier -> Classifier +val update_invariant : (string option * Rep_OclTerm.OclTerm) list -> Classifier -> Classifier +val update_operations : operation list -> Classifier -> Classifier + +val update_precondition : (string option * Rep_OclTerm.OclTerm) list -> operation -> operation +val update_postcondition : (string option * Rep_OclTerm.OclTerm) list -> operation -> operation end @@ -456,8 +460,39 @@ fun update_invariant invariant' (Class{name,parent,attributes,operations,invaria = Primitive{name=name,parent=parent,operations=operations, associationends=associationends,invariant=invariant', stereotypes=stereotypes,interfaces=interfaces,thyname=thyname} + + +fun update_operations operations' (Class{name,parent,attributes,invariant,operations, + stereotypes,interfaces,associationends,activity_graphs,thyname}) + = Class{name=name,parent=parent,attributes=attributes,invariant=invariant, + associationends=associationends,operations=operations',stereotypes=stereotypes, + interfaces=interfaces,thyname=thyname,activity_graphs=activity_graphs } + | update_operations operations' (Interface{name,parents,invariant,stereotypes,operations,thyname}) + = Interface{name=name,parents=parents,invariant=invariant,stereotypes=stereotypes, + operations=operations',thyname=thyname} + | update_operations operations' (Enumeration{name,parent,invariant,literals,operations, + stereotypes,interfaces,thyname}) + = Enumeration{name=name,parent=parent,invariant=invariant,literals=literals, + operations=operations',stereotypes=stereotypes,interfaces=interfaces, + thyname=thyname} + | update_operations operations' (Primitive{name,parent,invariant,associationends,operations, + stereotypes,interfaces,thyname}) + = Primitive{name=name,parent=parent,invariant=invariant, + associationends=associationends,operations=operations', + stereotypes=stereotypes,interfaces=interfaces,thyname=thyname} + +fun update_precondition pre' ({name,precondition,postcondition,arguments,result,isQuery,scope,visibility}:operation) + = ({name=name,precondition=pre',postcondition=postcondition, + arguments=arguments,result=result,isQuery=isQuery,scope=scope, + visibility=visibility}:operation) + +fun update_postcondition post' ({name,precondition,postcondition,arguments,result,isQuery,scope,visibility}:operation) + = ({name=name,precondition=precondition,postcondition=post', + arguments=arguments,result=result,isQuery=isQuery,scope=scope, + visibility=visibility}:operation) + fun type_of (Class{name,...}) = name