From 9a217f2ad94299ab0dd80a2704528d1c6720435f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Doser?= Date: Fri, 22 Dec 2006 13:47:55 +0000 Subject: [PATCH] transform from XMI.Interface to Rep.Interface git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@5821 3260e6d1-4efc-4170-b0a7-36055960796d --- src/rep_parser.sml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/rep_parser.sml b/src/rep_parser.sml index 223d1a4..5e9e4ff 100644 --- a/src/rep_parser.sml +++ b/src/rep_parser.sml @@ -415,6 +415,21 @@ fun transform_classifier t (XMI.Class {xmiid,name,isActive,visibility,isLeaf, interfaces = nil, (* FIX *) thyname = NONE} end + | transform_classifier t (XMI.Interface { xmiid, name, generalizations, operations, invariant, + ...}) = + let + val checked_invariants = filter_exists t invariant + in + Rep.Interface { name = find_classifier_type t xmiid, + parents = map ((find_classifier_type t) o (find_parent t)) + generalizations, + operations = map (transform_operation t) operations, + stereotypes = [], (* map (find_stereotype t) stereotype,*) + invariant = map ((transform_constraint t) o + (find_constraint t)) checked_invariants, + thyname = NONE + } + end | transform_classifier t (_) = raise IllFormed "Not supported Classifier type found." @@ -482,13 +497,13 @@ fun transformXMI ({classifiers,constraints,packages, *) fun readFile f = map Rep.normalize ((transformXMI o XmiParser.readFile) f) handle XmiParser.IllFormed msg => - (print ("Warning: in RepParser.readXMI: could not parse file "^ + (print ("Warning: in RepParser.readFile: could not parse file "^ f^":\n"^msg^"\n"); nil) | Option => - (print ("Warning: in RepParser.readXMI: could not parse file "^ + (print ("Warning: in RepParser.readFile: could not parse file "^ f^"\n"); nil) | IllFormed msg => - (print ("Warning: in RepParser.readXMI: could not parse file "^ + (print ("Warning: in RepParser.readFile: could not parse file "^ f^": "^msg^"\n"); nil) end