git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7569 3260e6d1-4efc-4170-b0a7-36055960796d

This commit is contained in:
Manuel Krucker 2008-04-01 09:32:06 +00:00
parent 83ece1d877
commit 825afa7468
2 changed files with 23 additions and 9 deletions

View File

@ -299,16 +299,29 @@ and resolve_OclTerm (Literal (s,typ)) model =
in
res
end
(* TupleLiteral *)
| resolve_OclTerm (TupleLiteral(fst,ftype,snd,stype)) 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_ends ("TypeChecker.resolve_OclTerm\n")
in
res
end
(* Variable *)
| resolve_OclTerm (Variable ("self",typ)) model =
let
val _ = trace function_calls ("TypeChecker.resolve_OclTerm Variable " ^ ocl2string false (Variable("self",typ)) ^ "\n")
val res = (Variable ("self",typ))
val _ = trace function_ends ("TypeChecker.resolve_OclTerm Variable " ^ ocl2string false (Variable("self",typ)) ^ "\n")
in
res
end
| resolve_OclTerm (Variable (name,typ)) model =
| resolve_OclTerm (Variable ("self",typ)) model =
let
val _ = trace function_calls ("TypeChecker.resolve_OclTerm Variable " ^ ocl2string false (Variable("self",typ)) ^ "\n")
val res = (Variable ("self",typ))
val _ = trace function_ends ("TypeChecker.resolve_OclTerm Variable " ^ ocl2string false (Variable("self",typ)) ^ "\n")
in
res
end
| resolve_OclTerm (Variable (name,typ)) model =
let
val _ = trace function_calls ("TypeChecker.resolve_OclTerm Variable " ^ ocl2string false (Variable(name,typ)) ^ "\n")
val res = Variable (name,typ)

View File

@ -992,6 +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 (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