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:
parent
b9dfc75e01
commit
0f0f3b2834
|
@ -123,7 +123,7 @@ fun info s = print (s^"\n")
|
||||||
|
|
||||||
(** output a warning that something is wrong,
|
(** output a warning that something is wrong,
|
||||||
* but it is dealt with somehow. *)
|
* but it is dealt with somehow. *)
|
||||||
fun warn s = print (s^"\n")
|
fun warn s = print ("Warning: "^s^"\n")
|
||||||
|
|
||||||
(** output an error message *)
|
(** output an error message *)
|
||||||
fun error_msg s = print (s^"\n")
|
fun error_msg s = print (s^"\n")
|
||||||
|
|
|
@ -245,6 +245,9 @@ fun transform_operation t {xmiid,name,isQuery,parameter,visibility,
|
||||||
fun transform_attribute t ({xmiid,name,type_id,changeability,visibility,ordering,
|
fun transform_attribute t ({xmiid,name,type_id,changeability,visibility,ordering,
|
||||||
multiplicity,taggedValue,ownerScope,targetScope,stereotype,initialValue}) =
|
multiplicity,taggedValue,ownerScope,targetScope,stereotype,initialValue}) =
|
||||||
let val cls_type = find_classifier_type t type_id
|
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
|
in
|
||||||
{name= name,
|
{name= name,
|
||||||
attr_type = if multiplicity = [(1,1)]
|
attr_type = if multiplicity = [(1,1)]
|
||||||
|
|
|
@ -508,8 +508,9 @@ fun mkAttribute tree =
|
||||||
|> map_optional (get_optional "OCL.Expressions.ExpressionInOcl.bodyExpression")
|
|> map_optional (get_optional "OCL.Expressions.ExpressionInOcl.bodyExpression")
|
||||||
|> Option.join
|
|> Option.join
|
||||||
|> map_optional mkOCLExpression,
|
|> map_optional mkOCLExpression,
|
||||||
type_id = tree |> get_one "UML:StructuralFeature.type"
|
type_id = tree |> get_optional "UML:StructuralFeature.type"
|
||||||
|> xmiidref,
|
|> map_optional xmiidref
|
||||||
|
|> get_optional_or_default "",
|
||||||
multiplicity = tree |> get_optional "UML:StructuralFeature.multiplicity"
|
multiplicity = tree |> get_optional "UML:StructuralFeature.multiplicity"
|
||||||
|> map_optional mkMultiplicity
|
|> map_optional mkMultiplicity
|
||||||
|> get_optional_or_default [(1,1)],
|
|> get_optional_or_default [(1,1)],
|
||||||
|
|
Loading…
Reference in New Issue