be liberal in parsing attributes without type

git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@6820 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Jürgen Doser 2007-09-12 08:59:01 +00:00
parent b9dfc75e01
commit 0f0f3b2834
3 changed files with 7 additions and 3 deletions

View File

@ -123,7 +123,7 @@ fun info s = print (s^"\n")
(** output a warning that something is wrong,
* but it is dealt with somehow. *)
fun warn s = print (s^"\n")
fun warn s = print ("Warning: "^s^"\n")
(** output an error message *)
fun error_msg s = print (s^"\n")

View File

@ -245,6 +245,9 @@ fun transform_operation t {xmiid,name,isQuery,parameter,visibility,
fun transform_attribute t ({xmiid,name,type_id,changeability,visibility,ordering,
multiplicity,taggedValue,ownerScope,targetScope,stereotype,initialValue}) =
let val cls_type = find_classifier_type t type_id
handle _ => (warn ("no type found for attribute '"^name^
"', defaulting to OclVoid");
Rep_OclType.OclVoid)
in
{name= name,
attr_type = if multiplicity = [(1,1)]

View File

@ -508,8 +508,9 @@ fun mkAttribute tree =
|> map_optional (get_optional "OCL.Expressions.ExpressionInOcl.bodyExpression")
|> Option.join
|> map_optional mkOCLExpression,
type_id = tree |> get_one "UML:StructuralFeature.type"
|> xmiidref,
type_id = tree |> get_optional "UML:StructuralFeature.type"
|> map_optional xmiidref
|> get_optional_or_default "",
multiplicity = tree |> get_optional "UML:StructuralFeature.multiplicity"
|> map_optional mkMultiplicity
|> get_optional_or_default [(1,1)],