git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7570 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
parent
825afa7468
commit
f24bf88e14
|
@ -16,36 +16,42 @@ val _ = Control.Print.printLength:=30
|
|||
val zargo = "../../../examples/meeting/Meeting.zargo"
|
||||
val ocl = ""
|
||||
*)
|
||||
|
||||
(*
|
||||
val zargo = "../../examples/SimpleChair/SimpleChair.zargo"
|
||||
val ocl = "../../examples/SimpleChair/AbstractSimpleChair01.ocl"
|
||||
val remP = ["AbstractSimpleChair02", "AbstractSimpleChair03","AbstractSimpleChair04","ConcreteSimpleChair01","ConcreteSimpleChair02"] ;
|
||||
*)
|
||||
|
||||
|
||||
(*
|
||||
(** EBANK **)
|
||||
val zargo = "../../examples/ebank/ebank.zargo"
|
||||
val ocl="../../examples/ebank/ebank.ocl"
|
||||
*)
|
||||
val remP = []
|
||||
(*
|
||||
(** ISP **)
|
||||
val zargo = "../../examples/isp/isp.zargo"
|
||||
val ocl="../../examples/isp/isp.ocl"
|
||||
*)
|
||||
|
||||
(*
|
||||
(** ROYALS AND LOYASL **)
|
||||
val zargo = "../../examples/royals_and_loyals/royals_and_loyals.zargo"
|
||||
val ocl="../../examples/royals_and_loyals/royals_and_loyals.ocl"
|
||||
val remP = []
|
||||
*)
|
||||
(*
|
||||
|
||||
|
||||
(** SIMPLE **)
|
||||
(*
|
||||
val zargo = "../../examples/simple/simple.zargo"
|
||||
val ocl="../../examples/simple/simple.ocl"
|
||||
val remP = []
|
||||
*)
|
||||
(*
|
||||
(** DIGRAPH **)
|
||||
(*
|
||||
val zargo = "../../examples/digraph/digraph.zargo"
|
||||
val ocl = "../../examples/digraph/digraph.ocl"
|
||||
val remP = []
|
||||
*)
|
||||
(*
|
||||
(** VEHICLES **)
|
||||
|
@ -55,7 +61,20 @@ val ocl = "../../examples/vehicles/vehicles.ocl"
|
|||
|
||||
|
||||
(** import model *)
|
||||
val i_model = import zargo ocl remP
|
||||
|
||||
val XMI = parseUML zargo
|
||||
val _ = init_offset()
|
||||
val OCL = parseOCL ocl
|
||||
val _ = init_offset()
|
||||
val (xmi_cls,xmi_assocs) = XMI
|
||||
val _ = init_offset()
|
||||
val fixed_ocl = Preprocessor.preprocess_context_list OCL ((OclLibrary.oclLib)@xmi_cls)
|
||||
val typed_cl = TypeChecker.check_context_list fixed_ocl (((OclLibrary.oclLib)@xmi_cls),xmi_assocs)
|
||||
val model = Update_Model.gen_updated_classifier_list typed_cl ((OclLibrary.oclLib)@xmi_cls)
|
||||
val model = removeOclLibrary model
|
||||
val model = removePackages remP (model,xmi_assocs)
|
||||
|
||||
|
||||
val (clist,alist) = normalize_ext i_model
|
||||
val model = ((clist@oclLib),(alist))
|
||||
val classifiers = removeOclLibrary clist
|
||||
|
|
|
@ -300,14 +300,16 @@ and resolve_OclTerm (Literal (s,typ)) model =
|
|||
res
|
||||
end
|
||||
(* TupleLiteral *)
|
||||
| resolve_OclTerm (TupleLiteral(fst,ftype,snd,stype)) model =
|
||||
| resolve_OclTerm (Tuple(x)) model =
|
||||
let
|
||||
val _ = trace function_calls ("TypeChecker.resolve_OclTerm TupleLiteral " ^ ocl2string false (TupleLiteral(fst,stype,snd,stype)) ^ "\n")
|
||||
val rfst = resolve_OclTerm fst model
|
||||
val rftype = type_of_term rfst
|
||||
val rsnd = resolve_OclTerm snd model
|
||||
val rstype = type_of_term rsnd
|
||||
val res = TupleLiteral(rfst,rftype,rsnd,rstype)
|
||||
val _ = trace function_calls ("TypeChecker.resolve_OclTerm TupleLiteral " ^ ocl2string false (Tuple(x)) ^ "\n")
|
||||
val res = Tuple (List.map (fn (a,b,c) =>
|
||||
let
|
||||
val rterm = resolve_OclTerm b model
|
||||
val rtype = type_of_term rterm
|
||||
in
|
||||
(a,rterm,rtype)
|
||||
end) x)
|
||||
val _ = trace function_ends ("TypeChecker.resolve_OclTerm\n")
|
||||
in
|
||||
res
|
||||
|
|
|
@ -992,7 +992,7 @@ fun type_of (Class{name,...}) = name
|
|||
| type_of (Template{classifier,...}) = type_of classifier
|
||||
|
||||
fun type_of_term (Literal (s,typ)) = typ
|
||||
| type_of_term (TupleLiteral(fst,ftype,snd,stype)) = Tuple(ftype,stype)
|
||||
| type_of_term (Tuple(x)) = TupleType (List.map (fn (a,b,c) => (a,c)) x)
|
||||
| type_of_term (AttributeCall (t,typ,p,res_typ)) = res_typ
|
||||
| type_of_term (AssociationEndCall (t,typ,p,res_typ)) = res_typ
|
||||
| type_of_term (OperationCall (t,typ,p,l,res_typ)) = res_typ
|
||||
|
|
|
@ -49,7 +49,7 @@ sig
|
|||
| Set of OclType | Sequence of OclType
|
||||
| OrderedSet of OclType | Bag of OclType
|
||||
| Collection of OclType
|
||||
| Tuple of (OclType * OclType)
|
||||
| TupleType of (string * OclType) list
|
||||
| Classifier of Path | OclVoid | DummyT | TemplateParameter of string
|
||||
|
||||
val short_name_of_OclType: OclType -> string
|
||||
|
@ -71,9 +71,8 @@ include REP_OCL_TYPE
|
|||
|
||||
datatype OclTerm =
|
||||
Literal of string * OclType (* Literal with type *)
|
||||
| TupleLiteral of
|
||||
OclTerm * OclType (* first of typle *)
|
||||
* OclTerm * OclType (* second of typle *)
|
||||
| Tuple of
|
||||
(string * OclTerm * OclType ) list
|
||||
| CollectionLiteral of CollectionPart list
|
||||
* OclType (* content with type *)
|
||||
| If of OclTerm * OclType (* condition *)
|
||||
|
@ -145,7 +144,7 @@ datatype OclType = Integer | Real | String | Boolean | OclAny
|
|||
| Set of OclType | Sequence of OclType
|
||||
| OrderedSet of OclType | Bag of OclType
|
||||
| Collection of OclType | OclVoid | DummyT
|
||||
| Tuple of (OclType * OclType)
|
||||
| TupleType of (string * OclType) list
|
||||
| Classifier of Path
|
||||
| TemplateParameter of string
|
||||
|
||||
|
@ -225,9 +224,8 @@ open Rep_OclType
|
|||
|
||||
datatype OclTerm =
|
||||
Literal of string * OclType (* Literal with type *)
|
||||
| TupleLiteral of
|
||||
OclTerm * OclType (* first of typle *)
|
||||
* OclTerm * OclType (* second of typle *)
|
||||
| Tuple of
|
||||
(string * OclTerm * OclType) list
|
||||
| CollectionLiteral of CollectionPart list
|
||||
* OclType (* content with type *)
|
||||
| If of OclTerm * OclType (* condition *)
|
||||
|
|
Loading…
Reference in New Issue