Further restructuring.

git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@3035 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Achim D. Brucker 2005-09-07 17:44:26 +00:00
parent fc39c1e45d
commit e2bee654b9
7 changed files with 45 additions and 13 deletions

View File

@ -41,6 +41,7 @@ use "rep_activity_graphs.sml";
use "rep_core.sig";
use "rep_core.sml";
use "rep.sig";
use "rep.sml";
use "xmi.sml";
use "xmltree_parser.sml";
use "xml2xmi.sml";

View File

@ -22,11 +22,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
signature MDR =
signature REP =
sig
include MDR_CORE
(* include STATE_MACHINE *)
include REP_ACTIVITY_GRAPH
end

31
src/rep.sml Normal file
View File

@ -0,0 +1,31 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* sc_import.sig - generic state diagram import signature for su4sml
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
* Jürgen Doser <doserj@inf.ethz.ch>
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
structure Rep : REP =
struct
open mdr_core Rep_StateMachine Rep_ActivityGraph
end

View File

@ -23,7 +23,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
structure rep_ActivityGraph : REP_ACTIVITY_GRAPH =
structure Rep_ActivityGraph : REP_ACTIVITY_GRAPH =
struct
open Rep_StateMachine
type ActivityGraph = StateMachine

View File

@ -50,7 +50,7 @@ datatype Classifier =
stereotypes : string list,
interfaces : ocl_type.Path list,
thyname : string option,
activity_graphs : rep_ActivityGraph.ActivityGraph list
activity_graphs : Rep_ActivityGraph.ActivityGraph list
}
| Interface of (* not supported yet *)
{ name : ocl_type.Path,

View File

@ -47,7 +47,7 @@ datatype Classifier =
stereotypes : string list,
interfaces : ocl_type.Path list,
thyname : string option,
activity_graphs : rep_ActivityGraph.ActivityGraph list
activity_graphs : Rep_ActivityGraph.ActivityGraph list
}
| Interface of (* not supported yet *)
{ name : ocl_type.Path,

View File

@ -26,8 +26,8 @@
structure Xmi2Rep :
sig
val transformXMI : XMI.XmiContent -> mdr_core.Classifier list
val readXMI : string -> mdr_core.Classifier list
val transformXMI : XMI.XmiContent -> Rep.Classifier list
val readXMI : string -> Rep.Classifier list
(* generic exception if something is wrong *)
exception IllFormed of string
end =
@ -169,7 +169,7 @@ fun insert_attribute table path_prefix (a:XMI.Attribute) =
fun insert_operation table path_prefix (a:XMI.Operation) =
HashTable.insert table (#xmiid a, Operation (path_prefix @ [#name a]))
fun add_aend table xmiid (aend:mdr_core.associationend) = () (* FIX *)
fun add_aend table xmiid (aend:Rep.associationend) = () (* FIX *)
fun insert_classifier table package_prefix class =
@ -326,7 +326,7 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf,
generalizations
val filtered_parents = filter (fn x => x <> ocl_type.OclAny) parents
in
mdr_core.Class {name = path_of_classifier (find_classifier_type t xmiid),
Rep.Class {name = path_of_classifier (find_classifier_type t xmiid),
parent = case filtered_parents
of [] => NONE
| xs => SOME (path_of_classifier (hd xs)),
@ -343,7 +343,7 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf,
end
| transform_classifier t (XMI.Primitive {xmiid,name,generalizations,
operations,invariant}) =
mdr_core.Primitive {name = case find_classifier_type t xmiid of ocl_type.Classifier x => x
Rep.Primitive {name = case find_classifier_type t xmiid of ocl_type.Classifier x => x
| _ => raise Option,
parent = NONE, (* FIX *)
operations = map (transform_operation t) operations,
@ -356,7 +356,7 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf,
thyname = NONE}
| transform_classifier t (XMI.Enumeration {xmiid,name,generalizations,
operations,literals,invariant}) =
mdr_core.Enumeration {name = case find_classifier_type t xmiid of ocl_type.Classifier x => x
Rep.Enumeration {name = case find_classifier_type t xmiid of ocl_type.Classifier x => x
| _ => raise Option,
parent = NONE, (* FIX *)
literals = literals,
@ -441,7 +441,7 @@ fun transform_associations t (XMI.Package p) =
(map (transform_associations t) (#packages p);
List.app (transform_assocation t) (#associations p))
(* transform a UML model into a list of mdr_core classes *)
(* transform a UML model into a list of Rep classes *)
(* 1. traverse package hierarchy and put xmi.id of all interesting *)
(* model elements into the hashtable *)
(* 2. traverse again to find all associations, transform them into *)
@ -469,7 +469,7 @@ fun transformXMI ({classifiers,constraints,packages,
in
insert_model xmiid_table model; (* fill xmi.id table *)
transform_associations xmiid_table model; (* handle associations *)
map mdr_core.normalize (transform_package xmiid_table model) (* transform classes *)
map Rep.normalize (transform_package xmiid_table model) (* transform classes *)
end
handle Empty => raise Option