diff --git a/su4sml/src/ocl2string.sml b/su4sml/src/ocl2string.sml index 89b49c7..41a1726 100644 --- a/su4sml/src/ocl2string.sml +++ b/su4sml/src/ocl2string.sml @@ -203,7 +203,15 @@ fun ocl2string show_types oclterm = (* Iterate *) (**************************************) (* Error *) - | Iterate (_,s,_,_,src,_,c,_,_) => error ("error: unknown Iterate '"^(s)^"' in in ocl2string") + | Iterate ([],acc_name,acc_type,acc_term,sterm,stype,bterm,btype,res_type) => + (ocl2string false sterm) ^ "->" ^ "iterate(" ^ acc_name ^ ":" ^ (Rep_OclType.string_of_OclType acc_type) ^ (ocl2string false acc_term) ^ (ocl2string false bterm) + | Iterate (iter_vars,acc_name,acc_type,acc_term,sterm,stype,bterm,btype,res_type) => + let + fun string_of_vars [] = "" + | string_of_vars ((string,typ)::tail) = (string ^ ":" ^ (Rep_OclType.string_of_OclType typ))^(string_of_vars tail) + in + (ocl2string false sterm) ^ "->" ^ "iterate(" ^ (string_of_vars iter_vars) ^ acc_name ^ ":" ^ (Rep_OclType.string_of_OclType acc_type) ^ (ocl2string false acc_term) ^ (ocl2string false bterm) + end (**************************************) (* Iterator *) (**************************************) @@ -217,17 +225,17 @@ fun ocl2string show_types oclterm = else (ocl2string show_types src)^"->"^iname^"(" ^(cs_list (map #1 vars)) ^"|"^(ocl2string show_types c)^")" +(* (* OCL Collection *) - (* | Iterate (src,styp,["oclLib",classifier,"iterate"],args,Collection _) => OclIterate u C be e | Iterate (src,styp,["oclLib",classifier,"isUnique"],args,Collection _) => OclIsUnique u C be | Iterate (src,styp,["oclLib",classifier,"one"],args,Collection _) => OclOne u C be | Iterate (src,styp,["oclLib",classifier,"any"],args,Collection _) => OclAny u C be (* OCL OrderedSet *) - | Iterate (src,styp,["oclLib",classifier,"count"],[(arg,_)],OrderedSet _) => OclOSetCount u S e *) + | Iterate (src,styp,["oclLib",classifier,"count"],[(arg,_)],OrderedSet _) => OclOSetCount u S e *) (* Error *) - (* | Iterator (s,_,_,_,_,_,_) => error ("error: unknown Iterator '"^(s)^"' in in ocl2string") - *) (**************************************) + (* | Iterator (s,_,_,_,_,_,_) => error ("error: unknown Iterator '"^(s)^"' in in ocl2string") *) + (**************************************) (* Catch out *) (**************************************) (* Error *) diff --git a/su4sml/src/ocl_parser/context_declarations.sml b/su4sml/src/ocl_parser/context_declarations.sml index 6f0e252..f09c4f5 100644 --- a/su4sml/src/ocl_parser/context_declarations.sml +++ b/su4sml/src/ocl_parser/context_declarations.sml @@ -229,6 +229,18 @@ fun add_source (source,(AttributeCall (_, _, path, res_typ ))) = | add_source (source, If (paras)) = (* If has no source *) If (paras) + | add_source (source, Iterate([],acc_var_name,acc_var_type,acc_var_term,sterm,stype,bterm,btype,res_type)) = + let + val _ = trace low ("source added for Iterate ..." ^ "\n"); + in + (Iterate ([],acc_var_name,acc_var_type,acc_var_term,source,DummyT,bterm,btype,res_type)) + end + | add_source (source, Iterate(iter_vars,acc_var_name,acc_var_type,acc_var_term,sterm,stype,bterm,btype,res_type)) = + let + val _ = trace high ("source added for Iterate ..." ^ "\n"); + in + (Iterate (iter_vars,acc_var_name,acc_var_type,acc_var_term,source,DummyT,bterm,btype,res_type)) + end (* RETURN: OclTerm list *) fun add_source_to_list source (h::tail) = (add_source (source,h))::tail diff --git a/su4sml/src/ocl_parser/library.sml b/su4sml/src/ocl_parser/library.sml index 52933c4..9b8ec97 100644 --- a/su4sml/src/ocl_parser/library.sml +++ b/su4sml/src/ocl_parser/library.sml @@ -341,6 +341,14 @@ and prefix_expression ext_path (Variable (s,t)) = (Variable (s,t)) (OperationWithType (prefix_expression ext_path sterm,stype,para_name,para_type,res_type)) | prefix_expression ext_path (CollectionLiteral (coll_part_list,typ)) = (CollectionLiteral (List.map (prefix_collectionpart ext_path) coll_part_list,typ)) + | prefix_expression ext_path (Iterate (iter_vars,acc_var_name,acc_var_type,acc_var_term,sterm,stype,bterm,btype,restype)) = + let + val prefixed_vars = List.map (fn a => (#1 a,prefix_type ext_path (#2 a))) iter_vars + val prefix_acc_type = prefix_type ext_path acc_var_type + in + (Iterate (prefixed_vars,acc_var_name,prefix_acc_type,acc_var_term,sterm,stype,bterm,btype,restype)) + end + (* RETURN: OclType *) fun template_parameter typ = diff --git a/su4sml/src/ocl_parser/ocl.grm b/su4sml/src/ocl_parser/ocl.grm index 7bf12bd..672125f 100644 --- a/su4sml/src/ocl_parser/ocl.grm +++ b/su4sml/src/ocl_parser/ocl.grm @@ -262,7 +262,7 @@ exception NotYetSupported of string | msg_operator_cs of OclTerm | property_call_parameters_cs of (OclTerm * OclType) list | qualifiers of CollectionPart list - | iterate_vars_cs + | iterate_vars_cs of (string * OclType) list | initialized_variable_cs of (string * OclType * OclTerm) | actual_parameter_list_cs of (OclTerm * OclType) list | actual_parameter_list_tail_cs of (OclTerm * OclType) list @@ -625,14 +625,14 @@ arrow_property_call_exp_cs: iterator_name_cs PAREN_OPEN expression P | simple_name PAREN_OPEN PAREN_CLOSE (trace low ("arrow_property_call_exp_cs..." ^ "\n");OperationCall (Variable ("dummy_source",DummyT),DummyT,(["arrow"]@[simple_name]),[],DummyT)) | simple_name PAREN_OPEN actual_parameter_list_cs PAREN_CLOSE (OperationCall (Variable ("dummy_source",DummyT),DummyT,(["arrow"]@[simple_name]),actual_parameter_list_cs,DummyT)) (* - | ITERATE PAREN_OPEN initialized_variable_cs VERTICAL_BAR expression PAREN_CLOSE () - | ITERATE PAREN_OPEN iterate_vars_cs initialize_variable_cs VERTICAL_BAR expression PAREN_CLOSE () + | ITERATE PAREN_OPEN initialized_variable_cs VERTICAL_BAR expression PAREN_CLOSE (Iterate ([],(#1 initialized_variable_cs),(#2 initialized_variable_cs),(#3 initialized_variable_cs),Variable ("dummy_source",DummyT),DummyT,expression,DummyT,DummyT)) *) + | ITERATE PAREN_OPEN iterate_vars_cs initialized_variable_cs VERTICAL_BAR expression PAREN_CLOSE (Iterate (iterate_vars_cs,(#1 (initialized_variable_cs)),(#2 (initialized_variable_cs)),(#3 (initialized_variable_cs)),Variable ("dummy_source",DummyT),DummyT,expression,DummyT,DummyT)) + -(* (* RETURN: (string * OclType) list *) -iterate_vars_cs : actual_parameter_list_cs SEMI_COLON () -*) +iterate_vars_cs : formal_parameter_list_cs SEMI_COLON (formal_parameter_list_cs) + (* RETURN: (string * OclType) list *) iterator_vars_cs : formal_parameter_list_cs VERTICAL_BAR (formal_parameter_list_cs) @@ -707,7 +707,7 @@ initialized_variable_list_tail_cs_p : initialized_variable_list_tail_cs (* RETURN: (string * OclType * OclTerm) *) initialized_variable_list_tail_cs : COMMA initialized_variable_cs (initialized_variable_cs) -(* RETURN: (string * OclType * OclTerm*) +(* RETURN: string * OclType * OclTerm *) initialized_variable_cs : formal_parameter_cs variable_initializer ((#1 formal_parameter_cs),(#2 formal_parameter_cs),variable_initializer) (* RETURN: (string * OclType) *) diff --git a/su4sml/src/ocl_parser/ocl.grm.sig b/su4sml/src/ocl_parser/ocl.grm.sig index 3d38f94..08fc942 100644 --- a/su4sml/src/ocl_parser/ocl.grm.sig +++ b/su4sml/src/ocl_parser/ocl.grm.sig @@ -1,44 +1,3 @@ -(***************************************************************************** - * su4sml --- a SML repository for managing (Secure)UML/OCL models - * http://projects.brucker.ch/su4sml/ - * - * ocl.grm.sig --- - * This file is part of su4sml. - * - * Copyright (c) 2005-2007, ETH Zurich, Switzerland - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************) -(* $Id$ *) - signature OclParser_TOKENS = sig type ('a,'b) token diff --git a/su4sml/src/ocl_parser/ocl.grm.sml b/su4sml/src/ocl_parser/ocl.grm.sml index eba540f..15a7444 100644 --- a/su4sml/src/ocl_parser/ocl.grm.sml +++ b/su4sml/src/ocl_parser/ocl.grm.sml @@ -1,8 +1,18 @@ +functor OclParserLrValsFun(structure Token : TOKEN) + : sig structure ParserData : PARSER_DATA + structure Tokens : OclParser_TOKENS + end + = +struct +structure ParserData= +struct +structure Header = +struct (***************************************************************************** * su4sml --- a SML repository for managing (Secure)UML/OCL models * http://projects.brucker.ch/su4sml/ * - * ocl.grm.sml --- + * ocl.grm --- * This file is part of su4sml. * * Copyright (c) 2005-2007, ETH Zurich, Switzerland @@ -39,16 +49,6 @@ ******************************************************************************) (* $Id$ *) -functor OclParserLrValsFun(structure Token : TOKEN) - : sig structure ParserData : PARSER_DATA - structure Tokens : OclParser_TOKENS - end - = -struct -structure ParserData= -struct -structure Header = -struct (* THIS POINTS HAVE TO BE NOTICED TO UNDERSTAND THE SEMANTICS OF: @@ -102,11 +102,12 @@ val table=let val actionRows = \\001\000\007\000\134\000\000\000\ \\001\000\007\000\192\000\000\000\ \\001\000\007\000\193\000\000\000\ +\\001\000\009\000\006\001\000\000\ \\001\000\010\000\188\000\000\000\ -\\001\000\010\000\223\000\000\000\ +\\001\000\010\000\224\000\000\000\ \\001\000\014\000\078\000\015\000\077\000\016\000\076\000\017\000\075\000\ \\018\000\074\000\032\000\112\000\033\000\026\000\034\000\111\000\ -\\035\000\110\000\039\000\109\000\044\000\108\000\045\000\218\000\ +\\035\000\110\000\039\000\109\000\044\000\108\000\045\000\219\000\ \\050\000\025\000\051\000\024\000\052\000\023\000\053\000\022\000\ \\054\000\021\000\055\000\020\000\056\000\019\000\057\000\018\000\ \\058\000\017\000\059\000\016\000\060\000\015\000\061\000\107\000\ @@ -114,7 +115,7 @@ val table=let val actionRows = \\078\000\014\000\000\000\ \\001\000\014\000\078\000\015\000\077\000\016\000\076\000\017\000\075\000\ \\018\000\074\000\032\000\112\000\033\000\026\000\034\000\111\000\ -\\035\000\110\000\039\000\109\000\044\000\108\000\045\000\247\000\ +\\035\000\110\000\039\000\109\000\044\000\108\000\045\000\249\000\ \\050\000\025\000\051\000\024\000\052\000\023\000\053\000\022\000\ \\054\000\021\000\055\000\020\000\056\000\019\000\057\000\018\000\ \\058\000\017\000\059\000\016\000\060\000\015\000\061\000\107\000\ @@ -122,7 +123,7 @@ val table=let val actionRows = \\078\000\014\000\000\000\ \\001\000\014\000\078\000\015\000\077\000\016\000\076\000\017\000\075\000\ \\018\000\074\000\032\000\112\000\033\000\026\000\034\000\111\000\ -\\035\000\110\000\039\000\109\000\044\000\108\000\047\000\211\000\ +\\035\000\110\000\039\000\109\000\044\000\108\000\047\000\212\000\ \\050\000\025\000\051\000\024\000\052\000\023\000\053\000\022\000\ \\054\000\021\000\055\000\020\000\056\000\019\000\057\000\018\000\ \\058\000\017\000\059\000\016\000\060\000\015\000\061\000\107\000\ @@ -154,67 +155,61 @@ val table=let val actionRows = \\001\000\025\000\057\000\041\000\056\000\042\000\055\000\000\000\ \\001\000\026\000\036\000\031\000\035\000\000\000\ \\001\000\028\000\133\000\037\000\132\000\000\000\ -\\001\000\029\000\252\000\000\000\ -\\001\000\030\000\003\001\000\000\ +\\001\000\029\000\000\001\000\000\ +\\001\000\030\000\010\001\000\000\ \\001\000\031\000\039\000\000\000\ \\001\000\033\000\026\000\050\000\025\000\051\000\024\000\052\000\023\000\ \\053\000\022\000\054\000\021\000\055\000\020\000\056\000\019\000\ \\057\000\018\000\058\000\017\000\059\000\016\000\060\000\015\000\ \\078\000\014\000\000\000\ -\\001\000\033\000\026\000\051\000\024\000\052\000\023\000\053\000\022\000\ -\\054\000\021\000\055\000\020\000\056\000\019\000\057\000\018\000\ -\\078\000\014\000\000\000\ -\\001\000\036\000\221\000\000\000\ +\\001\000\033\000\026\000\050\000\200\000\051\000\024\000\052\000\023\000\ +\\053\000\022\000\054\000\021\000\055\000\020\000\056\000\019\000\ +\\057\000\018\000\078\000\014\000\000\000\ +\\001\000\036\000\222\000\000\000\ \\001\000\040\000\006\000\000\000\ -\\001\000\043\000\225\000\000\000\ +\\001\000\043\000\226\000\000\000\ \\001\000\044\000\129\000\000\000\ -\\001\000\044\000\230\000\000\000\ \\001\000\044\000\231\000\000\000\ +\\001\000\044\000\232\000\000\000\ +\\001\000\044\000\233\000\000\000\ \\001\000\045\000\064\000\078\000\014\000\000\000\ \\001\000\045\000\113\000\000\000\ -\\001\000\045\000\219\000\000\000\ -\\001\000\045\000\227\000\000\000\ -\\001\000\045\000\239\000\000\000\ -\\001\000\045\000\254\000\000\000\ -\\001\000\045\000\000\001\000\000\ +\\001\000\045\000\220\000\000\000\ +\\001\000\045\000\228\000\000\000\ +\\001\000\045\000\241\000\000\000\ \\001\000\045\000\002\001\000\000\ +\\001\000\045\000\004\001\000\000\ +\\001\000\045\000\008\001\000\000\ +\\001\000\045\000\012\001\000\000\ \\001\000\046\000\167\000\000\000\ -\\001\000\047\000\235\000\000\000\ -\\001\000\048\000\255\000\000\000\ +\\001\000\047\000\237\000\000\000\ +\\001\000\048\000\003\001\000\000\ +\\001\000\048\000\009\001\000\000\ \\001\000\078\000\014\000\000\000\ -\\005\001\000\000\ -\\006\001\000\000\ -\\007\001\040\000\006\000\000\000\ -\\008\001\000\000\ -\\009\001\000\000\ -\\010\001\000\000\ -\\011\001\026\000\036\000\000\000\ -\\012\001\000\000\ -\\013\001\000\000\ \\014\001\000\000\ \\015\001\000\000\ -\\016\001\000\000\ +\\016\001\040\000\006\000\000\000\ \\017\001\000\000\ \\018\001\000\000\ \\019\001\000\000\ -\\020\001\000\000\ +\\020\001\026\000\036\000\000\000\ \\021\001\000\000\ -\\022\001\028\000\133\000\037\000\132\000\000\000\ +\\022\001\000\000\ \\023\001\000\000\ -\\024\001\027\000\049\000\038\000\048\000\000\000\ +\\024\001\000\000\ \\025\001\000\000\ -\\026\001\025\000\057\000\041\000\056\000\042\000\055\000\000\000\ +\\026\001\000\000\ \\027\001\000\000\ -\\028\001\049\000\046\000\000\000\ +\\028\001\000\000\ \\029\001\000\000\ \\030\001\000\000\ -\\031\001\000\000\ +\\031\001\028\000\133\000\037\000\132\000\000\000\ \\032\001\000\000\ -\\033\001\000\000\ +\\033\001\027\000\049\000\038\000\048\000\000\000\ \\034\001\000\000\ -\\035\001\000\000\ +\\035\001\025\000\057\000\041\000\056\000\042\000\055\000\000\000\ \\036\001\000\000\ -\\037\001\000\000\ +\\037\001\049\000\046\000\000\000\ \\038\001\000\000\ \\039\001\000\000\ \\040\001\000\000\ @@ -222,30 +217,30 @@ val table=let val actionRows = \\042\001\000\000\ \\043\001\000\000\ \\044\001\000\000\ -\\045\001\007\000\119\000\000\000\ +\\045\001\000\000\ \\046\001\000\000\ -\\047\001\007\000\119\000\000\000\ +\\047\001\000\000\ \\048\001\000\000\ \\049\001\000\000\ \\050\001\000\000\ \\051\001\000\000\ \\052\001\000\000\ \\053\001\000\000\ -\\054\001\000\000\ -\\055\001\003\000\234\000\000\000\ -\\056\001\000\000\ +\\054\001\007\000\119\000\000\000\ +\\055\001\000\000\ +\\056\001\007\000\119\000\000\000\ \\057\001\000\000\ \\058\001\000\000\ -\\059\001\006\000\232\000\000\000\ +\\059\001\000\000\ \\060\001\000\000\ \\061\001\000\000\ \\062\001\000\000\ \\063\001\000\000\ -\\064\001\000\000\ +\\064\001\003\000\236\000\000\000\ \\065\001\000\000\ \\066\001\000\000\ \\067\001\000\000\ -\\068\001\000\000\ +\\068\001\006\000\234\000\000\000\ \\069\001\000\000\ \\070\001\000\000\ \\071\001\000\000\ @@ -261,176 +256,189 @@ val table=let val actionRows = \\081\001\000\000\ \\082\001\000\000\ \\083\001\000\000\ -\\084\001\008\000\027\000\000\000\ -\\085\001\008\000\037\000\000\000\ +\\084\001\000\000\ +\\085\001\000\000\ \\086\001\000\000\ -\\086\001\007\000\117\000\000\000\ \\087\001\000\000\ \\088\001\000\000\ \\089\001\000\000\ \\090\001\000\000\ \\091\001\000\000\ \\092\001\000\000\ -\\093\001\000\000\ -\\094\001\000\000\ +\\093\001\008\000\027\000\000\000\ +\\094\001\008\000\037\000\000\000\ \\095\001\000\000\ +\\095\001\007\000\117\000\000\000\ \\096\001\000\000\ \\097\001\000\000\ \\098\001\000\000\ \\099\001\000\000\ \\100\001\000\000\ \\101\001\000\000\ -\\102\001\070\000\166\000\071\000\165\000\072\000\164\000\073\000\163\000\000\000\ +\\102\001\000\000\ \\103\001\000\000\ -\\104\001\070\000\166\000\071\000\165\000\072\000\164\000\073\000\163\000\000\000\ +\\104\001\000\000\ \\105\001\000\000\ \\106\001\000\000\ \\107\001\000\000\ \\108\001\000\000\ \\109\001\000\000\ \\110\001\000\000\ -\\111\001\010\000\159\000\065\000\158\000\066\000\157\000\067\000\156\000\ -\\068\000\155\000\069\000\154\000\000\000\ +\\111\001\070\000\166\000\071\000\165\000\072\000\164\000\073\000\163\000\000\000\ \\112\001\000\000\ -\\113\001\000\000\ +\\113\001\070\000\166\000\071\000\165\000\072\000\164\000\073\000\163\000\000\000\ \\114\001\000\000\ \\115\001\000\000\ \\116\001\000\000\ \\117\001\000\000\ \\118\001\000\000\ \\119\001\000\000\ -\\120\001\061\000\151\000\064\000\150\000\000\000\ +\\120\001\010\000\159\000\065\000\158\000\066\000\157\000\067\000\156\000\ +\\068\000\155\000\069\000\154\000\000\000\ \\121\001\000\000\ -\\122\001\061\000\151\000\064\000\150\000\000\000\ +\\122\001\000\000\ \\123\001\000\000\ \\124\001\000\000\ \\125\001\000\000\ \\126\001\000\000\ -\\127\001\062\000\146\000\063\000\145\000\000\000\ +\\127\001\000\000\ \\128\001\000\000\ -\\129\001\062\000\146\000\063\000\145\000\000\000\ +\\129\001\061\000\151\000\064\000\150\000\000\000\ \\130\001\000\000\ -\\131\001\000\000\ +\\131\001\061\000\151\000\064\000\150\000\000\000\ \\132\001\000\000\ \\133\001\000\000\ \\134\001\000\000\ \\135\001\000\000\ -\\136\001\000\000\ +\\136\001\062\000\146\000\063\000\145\000\000\000\ \\137\001\000\000\ -\\138\001\004\000\140\000\005\000\139\000\000\000\ +\\138\001\062\000\146\000\063\000\145\000\000\000\ \\139\001\000\000\ \\140\001\000\000\ \\141\001\000\000\ \\142\001\000\000\ \\143\001\000\000\ \\144\001\000\000\ -\\145\001\004\000\140\000\005\000\139\000\000\000\ +\\145\001\000\000\ \\146\001\000\000\ -\\147\001\000\000\ +\\147\001\004\000\140\000\005\000\139\000\000\000\ \\148\001\000\000\ -\\149\001\013\000\172\000\044\000\171\000\000\000\ -\\150\001\044\000\171\000\000\000\ +\\149\001\000\000\ +\\150\001\000\000\ \\151\001\000\000\ \\152\001\000\000\ \\153\001\000\000\ -\\154\001\000\000\ +\\154\001\004\000\140\000\005\000\139\000\000\000\ \\155\001\000\000\ \\156\001\000\000\ \\157\001\000\000\ -\\159\001\000\000\ +\\158\001\013\000\172\000\044\000\171\000\000\000\ +\\159\001\044\000\171\000\000\000\ \\160\001\000\000\ -\\161\001\003\000\238\000\000\000\ +\\161\001\000\000\ \\162\001\000\000\ -\\163\001\003\000\238\000\000\000\ +\\163\001\000\000\ \\164\001\000\000\ \\165\001\000\000\ \\166\001\000\000\ \\167\001\000\000\ -\\168\001\003\000\115\000\000\000\ -\\169\001\000\000\ +\\168\001\000\000\ \\170\001\000\000\ \\171\001\000\000\ -\\172\001\000\000\ +\\172\001\003\000\240\000\000\000\ \\173\001\000\000\ -\\174\001\000\000\ +\\174\001\003\000\240\000\000\000\ \\175\001\000\000\ \\176\001\000\000\ \\177\001\000\000\ -\\178\001\003\000\180\000\000\000\ -\\179\001\000\000\ +\\178\001\000\000\ +\\179\001\003\000\115\000\000\000\ \\180\001\000\000\ \\181\001\000\000\ +\\182\001\000\000\ \\183\001\000\000\ +\\184\001\000\000\ +\\185\001\000\000\ +\\186\001\000\000\ +\\187\001\000\000\ +\\188\001\000\000\ +\\189\001\003\000\180\000\000\000\ +\\190\001\000\000\ +\\191\001\000\000\ +\\192\001\000\000\ +\\194\001\000\000\ \" val actionRowNumbers = -"\033\000\052\000\051\000\050\000\ -\\030\000\053\000\135\000\134\000\ -\\129\000\131\000\030\000\025\000\ -\\063\000\128\000\126\000\127\000\ -\\125\000\124\000\122\000\123\000\ -\\120\000\119\000\118\000\133\000\ -\\121\000\136\000\130\000\061\000\ -\\060\000\059\000\058\000\056\000\ -\\029\000\054\000\030\000\137\000\ -\\057\000\055\000\002\000\073\000\ -\\066\000\024\000\069\000\064\000\ -\\003\000\038\000\004\000\005\000\ -\\023\000\074\000\006\000\071\000\ -\\065\000\096\000\095\000\097\000\ -\\070\000\007\000\020\000\039\000\ -\\213\000\008\000\090\000\010\000\ -\\020\000\011\000\049\000\218\000\ -\\219\000\035\000\220\000\026\000\ -\\107\000\111\000\109\000\110\000\ -\\108\000\012\000\020\000\072\000\ -\\020\000\188\000\184\000\181\000\ -\\022\000\173\000\166\000\157\000\ -\\148\000\114\000\142\000\141\000\ -\\140\000\138\000\139\000\186\000\ -\\115\000\083\000\189\000\046\000\ -\\195\000\145\000\144\000\143\000\ -\\183\000\182\000\020\000\001\000\ -\\021\000\146\000\147\000\092\000\ -\\214\000\049\000\216\000\023\000\ -\\091\000\023\000\020\000\077\000\ -\\049\000\088\000\087\000\086\000\ -\\015\000\079\000\009\000\023\000\ -\\067\000\062\000\013\000\014\000\ -\\020\000\081\000\084\000\191\000\ -\\185\000\030\000\031\000\180\000\ -\\021\000\175\000\174\000\179\000\ -\\178\000\021\000\167\000\168\000\ -\\171\000\172\000\021\000\158\000\ -\\164\000\163\000\162\000\161\000\ -\\165\000\160\000\149\000\021\000\ -\\150\000\156\000\155\000\154\000\ -\\153\000\019\000\197\000\112\000\ -\\196\000\017\000\113\000\117\000\ -\\040\000\223\000\222\000\221\000\ -\\032\000\016\000\049\000\034\000\ -\\093\000\215\000\217\000\094\000\ -\\078\000\080\000\020\000\089\000\ -\\041\000\068\000\020\000\020\000\ -\\082\000\192\000\193\000\194\000\ -\\036\000\037\000\177\000\176\000\ -\\170\000\169\000\159\000\152\000\ -\\151\000\104\000\103\000\100\000\ -\\047\000\098\000\198\000\206\000\ -\\042\000\211\000\212\000\132\000\ -\\205\000\187\000\224\000\020\000\ -\\226\000\020\000\225\000\020\000\ -\\085\000\106\000\075\000\076\000\ -\\020\000\018\000\020\000\101\000\ -\\020\000\099\000\207\000\208\000\ -\\020\000\204\000\116\000\227\000\ -\\027\000\020\000\043\000\048\000\ -\\044\000\201\000\105\000\102\000\ -\\209\000\210\000\020\000\045\000\ -\\199\000\203\000\202\000\028\000\ -\\200\000\190\000\000\000" +"\034\000\056\000\055\000\054\000\ +\\031\000\057\000\139\000\138\000\ +\\133\000\135\000\031\000\026\000\ +\\067\000\132\000\130\000\131\000\ +\\129\000\128\000\126\000\127\000\ +\\124\000\123\000\122\000\137\000\ +\\125\000\140\000\134\000\065\000\ +\\064\000\063\000\062\000\060\000\ +\\030\000\058\000\031\000\141\000\ +\\061\000\059\000\002\000\077\000\ +\\070\000\025\000\073\000\068\000\ +\\003\000\040\000\004\000\005\000\ +\\024\000\078\000\006\000\075\000\ +\\069\000\100\000\099\000\101\000\ +\\074\000\007\000\021\000\041\000\ +\\219\000\008\000\094\000\010\000\ +\\021\000\011\000\053\000\224\000\ +\\225\000\036\000\226\000\027\000\ +\\111\000\115\000\113\000\114\000\ +\\112\000\012\000\021\000\076\000\ +\\021\000\192\000\188\000\185\000\ +\\023\000\177\000\170\000\161\000\ +\\152\000\118\000\146\000\145\000\ +\\144\000\142\000\143\000\190\000\ +\\119\000\087\000\193\000\049\000\ +\\199\000\149\000\148\000\147\000\ +\\187\000\186\000\021\000\001\000\ +\\022\000\150\000\151\000\096\000\ +\\220\000\053\000\222\000\024\000\ +\\095\000\024\000\021\000\081\000\ +\\053\000\092\000\091\000\090\000\ +\\016\000\083\000\009\000\024\000\ +\\071\000\066\000\013\000\014\000\ +\\021\000\085\000\088\000\195\000\ +\\189\000\031\000\032\000\184\000\ +\\022\000\179\000\178\000\183\000\ +\\182\000\022\000\171\000\172\000\ +\\175\000\176\000\022\000\162\000\ +\\168\000\167\000\166\000\165\000\ +\\169\000\164\000\153\000\022\000\ +\\154\000\160\000\159\000\158\000\ +\\157\000\020\000\201\000\116\000\ +\\200\000\018\000\117\000\121\000\ +\\042\000\229\000\228\000\227\000\ +\\033\000\017\000\053\000\035\000\ +\\097\000\221\000\223\000\098\000\ +\\082\000\084\000\021\000\093\000\ +\\043\000\072\000\021\000\021\000\ +\\086\000\196\000\197\000\198\000\ +\\037\000\038\000\039\000\181\000\ +\\180\000\174\000\173\000\163\000\ +\\156\000\155\000\108\000\107\000\ +\\104\000\050\000\102\000\202\000\ +\\212\000\044\000\217\000\218\000\ +\\136\000\211\000\191\000\230\000\ +\\021\000\232\000\021\000\231\000\ +\\021\000\089\000\110\000\079\000\ +\\080\000\021\000\019\000\053\000\ +\\021\000\105\000\021\000\103\000\ +\\213\000\214\000\021\000\210\000\ +\\120\000\233\000\028\000\021\000\ +\\045\000\051\000\046\000\205\000\ +\\053\000\015\000\109\000\106\000\ +\\215\000\216\000\021\000\047\000\ +\\203\000\209\000\206\000\052\000\ +\\208\000\029\000\204\000\021\000\ +\\194\000\048\000\207\000\000\000" val gotoT = "\ -\\001\000\002\001\009\000\003\000\010\000\002\000\011\000\001\000\000\000\ +\\001\000\011\001\009\000\003\000\010\000\002\000\011\000\001\000\000\000\ \\010\000\005\000\011\000\001\000\000\000\ \\000\000\ \\000\000\ @@ -637,25 +645,25 @@ val gotoT = \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ \\052\000\098\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ -\\068\000\091\000\069\000\090\000\088\000\198\000\090\000\084\000\ +\\068\000\091\000\069\000\090\000\088\000\199\000\090\000\084\000\ \\091\000\083\000\094\000\082\000\095\000\081\000\000\000\ -\\085\000\199\000\086\000\141\000\089\000\140\000\000\000\ +\\085\000\200\000\086\000\141\000\089\000\140\000\000\000\ \\000\000\ \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ \\052\000\098\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ -\\068\000\091\000\069\000\090\000\084\000\200\000\088\000\085\000\ +\\068\000\091\000\069\000\090\000\084\000\201\000\088\000\085\000\ \\090\000\084\000\091\000\083\000\094\000\082\000\095\000\081\000\000\000\ \\000\000\ -\\081\000\147\000\082\000\201\000\087\000\145\000\000\000\ +\\081\000\147\000\082\000\202\000\087\000\145\000\000\000\ \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ \\052\000\098\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ -\\068\000\091\000\069\000\090\000\080\000\202\000\084\000\086\000\ +\\068\000\091\000\069\000\090\000\080\000\203\000\084\000\086\000\ \\088\000\085\000\090\000\084\000\091\000\083\000\094\000\082\000\ \\095\000\081\000\000\000\ \\000\000\ @@ -669,16 +677,16 @@ val gotoT = \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ \\052\000\098\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ -\\068\000\091\000\069\000\090\000\076\000\203\000\080\000\087\000\ +\\068\000\091\000\069\000\090\000\076\000\204\000\080\000\087\000\ \\084\000\086\000\088\000\085\000\090\000\084\000\091\000\083\000\ \\094\000\082\000\095\000\081\000\000\000\ -\\075\000\160\000\079\000\159\000\115\000\204\000\000\000\ +\\075\000\160\000\079\000\159\000\115\000\205\000\000\000\ \\000\000\ \\000\000\ \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\044\000\208\000\045\000\207\000\047\000\206\000\048\000\205\000\ +\\044\000\209\000\045\000\208\000\047\000\207\000\048\000\206\000\ \\052\000\098\000\055\000\171\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ @@ -687,24 +695,24 @@ val gotoT = \\095\000\081\000\000\000\ \\000\000\ \\000\000\ -\\099\000\210\000\000\000\ -\\012\000\100\000\013\000\010\000\033\000\215\000\038\000\214\000\ -\\043\000\099\000\048\000\213\000\052\000\098\000\055\000\171\000\ +\\099\000\211\000\000\000\ +\\012\000\100\000\013\000\010\000\033\000\216\000\038\000\215\000\ +\\043\000\099\000\048\000\214\000\052\000\098\000\055\000\171\000\ \\056\000\096\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ \\068\000\091\000\069\000\090\000\074\000\089\000\076\000\088\000\ \\080\000\087\000\084\000\086\000\088\000\085\000\090\000\084\000\ -\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\212\000\ -\\106\000\211\000\000\000\ +\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\213\000\ +\\106\000\212\000\000\000\ \\000\000\ \\000\000\ \\000\000\ -\\109\000\218\000\110\000\173\000\000\000\ +\\109\000\219\000\110\000\173\000\000\000\ \\000\000\ \\000\000\ \\000\000\ -\\111\000\220\000\000\000\ -\\033\000\061\000\038\000\177\000\102\000\222\000\000\000\ +\\111\000\221\000\000\000\ +\\033\000\061\000\038\000\177\000\102\000\223\000\000\000\ \\000\000\ \\000\000\ \\000\000\ @@ -713,7 +721,7 @@ val gotoT = \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\052\000\098\000\055\000\224\000\056\000\096\000\060\000\008\000\ +\\052\000\098\000\055\000\225\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ \\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ @@ -723,19 +731,19 @@ val gotoT = \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\052\000\098\000\055\000\226\000\056\000\096\000\060\000\008\000\ -\\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ -\\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ -\\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ -\\088\000\085\000\090\000\084\000\091\000\083\000\094\000\082\000\ -\\095\000\081\000\000\000\ -\\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ \\052\000\098\000\055\000\227\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ \\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ \\088\000\085\000\090\000\084\000\091\000\083\000\094\000\082\000\ \\095\000\081\000\000\000\ +\\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ +\\052\000\098\000\055\000\228\000\056\000\096\000\060\000\008\000\ +\\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ +\\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ +\\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ +\\088\000\085\000\090\000\084\000\091\000\083\000\094\000\082\000\ +\\095\000\081\000\000\000\ \\000\000\ \\000\000\ \\000\000\ @@ -751,11 +759,12 @@ val gotoT = \\000\000\ \\000\000\ \\000\000\ -\\046\000\231\000\000\000\ +\\000\000\ +\\046\000\233\000\000\000\ \\000\000\ \\000\000\ \\000\000\ -\\104\000\235\000\105\000\234\000\000\000\ +\\104\000\237\000\105\000\236\000\000\000\ \\000\000\ \\000\000\ \\000\000\ @@ -764,7 +773,7 @@ val gotoT = \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\048\000\238\000\052\000\098\000\055\000\171\000\056\000\096\000\ +\\048\000\240\000\052\000\098\000\055\000\171\000\056\000\096\000\ \\060\000\008\000\061\000\007\000\062\000\006\000\063\000\095\000\ \\064\000\094\000\066\000\093\000\067\000\092\000\068\000\091\000\ \\069\000\090\000\074\000\089\000\076\000\088\000\080\000\087\000\ @@ -772,7 +781,7 @@ val gotoT = \\094\000\082\000\095\000\081\000\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\052\000\098\000\055\000\239\000\056\000\096\000\060\000\008\000\ +\\052\000\098\000\055\000\241\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ \\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ @@ -780,7 +789,7 @@ val gotoT = \\095\000\081\000\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\052\000\098\000\055\000\240\000\056\000\096\000\060\000\008\000\ +\\052\000\098\000\055\000\242\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ \\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ @@ -790,24 +799,25 @@ val gotoT = \\000\000\ \\000\000\ \\000\000\ -\\012\000\100\000\013\000\010\000\033\000\215\000\038\000\060\000\ -\\039\000\243\000\043\000\099\000\048\000\242\000\052\000\098\000\ +\\012\000\100\000\013\000\010\000\033\000\216\000\038\000\060\000\ +\\039\000\245\000\043\000\099\000\048\000\244\000\052\000\098\000\ \\055\000\171\000\056\000\096\000\060\000\008\000\061\000\007\000\ \\062\000\006\000\063\000\095\000\064\000\094\000\066\000\093\000\ \\067\000\092\000\068\000\091\000\069\000\090\000\074\000\089\000\ \\076\000\088\000\080\000\087\000\084\000\086\000\088\000\085\000\ \\090\000\084\000\091\000\083\000\094\000\082\000\095\000\081\000\ -\\108\000\241\000\000\000\ -\\012\000\100\000\013\000\010\000\033\000\215\000\038\000\214\000\ -\\043\000\099\000\048\000\213\000\052\000\098\000\055\000\171\000\ +\\108\000\243\000\000\000\ +\\012\000\100\000\013\000\010\000\033\000\216\000\038\000\215\000\ +\\043\000\099\000\048\000\214\000\052\000\098\000\055\000\171\000\ \\056\000\096\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ \\068\000\091\000\069\000\090\000\074\000\089\000\076\000\088\000\ \\080\000\087\000\084\000\086\000\088\000\085\000\090\000\084\000\ -\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\244\000\ -\\106\000\211\000\000\000\ +\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\246\000\ +\\106\000\212\000\000\000\ +\\033\000\061\000\038\000\060\000\039\000\249\000\101\000\248\000\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\048\000\246\000\052\000\098\000\055\000\171\000\056\000\096\000\ +\\048\000\250\000\052\000\098\000\055\000\171\000\056\000\096\000\ \\060\000\008\000\061\000\007\000\062\000\006\000\063\000\095\000\ \\064\000\094\000\066\000\093\000\067\000\092\000\068\000\091\000\ \\069\000\090\000\074\000\089\000\076\000\088\000\080\000\087\000\ @@ -815,7 +825,7 @@ val gotoT = \\094\000\082\000\095\000\081\000\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\044\000\247\000\045\000\207\000\047\000\206\000\048\000\205\000\ +\\044\000\251\000\045\000\208\000\047\000\207\000\048\000\206\000\ \\052\000\098\000\055\000\171\000\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ @@ -824,21 +834,21 @@ val gotoT = \\095\000\081\000\000\000\ \\000\000\ \\000\000\ -\\104\000\235\000\105\000\248\000\000\000\ -\\012\000\100\000\013\000\010\000\033\000\215\000\038\000\214\000\ -\\043\000\099\000\048\000\213\000\052\000\098\000\055\000\171\000\ +\\104\000\237\000\105\000\252\000\000\000\ +\\012\000\100\000\013\000\010\000\033\000\216\000\038\000\215\000\ +\\043\000\099\000\048\000\214\000\052\000\098\000\055\000\171\000\ \\056\000\096\000\060\000\008\000\061\000\007\000\062\000\006\000\ \\063\000\095\000\064\000\094\000\066\000\093\000\067\000\092\000\ \\068\000\091\000\069\000\090\000\074\000\089\000\076\000\088\000\ \\080\000\087\000\084\000\086\000\088\000\085\000\090\000\084\000\ -\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\249\000\ -\\106\000\211\000\000\000\ +\\091\000\083\000\094\000\082\000\095\000\081\000\103\000\253\000\ +\\106\000\212\000\000\000\ \\000\000\ \\000\000\ \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\048\000\251\000\052\000\098\000\055\000\171\000\056\000\096\000\ +\\048\000\255\000\052\000\098\000\055\000\171\000\056\000\096\000\ \\060\000\008\000\061\000\007\000\062\000\006\000\063\000\095\000\ \\064\000\094\000\066\000\093\000\067\000\092\000\068\000\091\000\ \\069\000\090\000\074\000\089\000\076\000\088\000\080\000\087\000\ @@ -848,12 +858,14 @@ val gotoT = \\000\000\ \\000\000\ \\000\000\ +\\033\000\061\000\038\000\177\000\102\000\003\001\000\000\ +\\000\000\ \\000\000\ \\000\000\ \\000\000\ \\000\000\ \\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ -\\052\000\098\000\055\000\255\000\056\000\096\000\060\000\008\000\ +\\052\000\098\000\055\000\005\001\056\000\096\000\060\000\008\000\ \\061\000\007\000\062\000\006\000\063\000\095\000\064\000\094\000\ \\066\000\093\000\067\000\092\000\068\000\091\000\069\000\090\000\ \\074\000\089\000\076\000\088\000\080\000\087\000\084\000\086\000\ @@ -867,9 +879,20 @@ val gotoT = \\000\000\ \\000\000\ \\000\000\ +\\012\000\100\000\013\000\010\000\033\000\009\000\043\000\099\000\ +\\048\000\009\001\052\000\098\000\055\000\171\000\056\000\096\000\ +\\060\000\008\000\061\000\007\000\062\000\006\000\063\000\095\000\ +\\064\000\094\000\066\000\093\000\067\000\092\000\068\000\091\000\ +\\069\000\090\000\074\000\089\000\076\000\088\000\080\000\087\000\ +\\084\000\086\000\088\000\085\000\090\000\084\000\091\000\083\000\ +\\094\000\082\000\095\000\081\000\000\000\ +\\000\000\ +\\000\000\ +\\000\000\ +\\000\000\ \" -val numstates = 259 -val numrules = 182 +val numstates = 268 +val numrules = 184 val s = ref "" and index = ref 0 val string_to_int = fn () => let val i = !index @@ -989,6 +1012,7 @@ datatype svalue = VOID | ntVOID of unit -> unit | actual_parameter_list_tail_cs of unit -> ( ( OclTerm * OclType ) list) | actual_parameter_list_cs of unit -> ( ( OclTerm * OclType ) list) | initialized_variable_cs of unit -> ( ( string * OclType * OclTerm ) ) + | iterate_vars_cs of unit -> ( ( string * OclType ) list) | qualifiers of unit -> (CollectionPart list) | property_call_parameters_cs of unit -> ( ( OclTerm * OclType ) list) | msg_operator_cs of unit -> (OclTerm) @@ -2951,7 +2975,42 @@ end) in ( LrTable.NT 95, ( result, simple_name1left, PAREN_CLOSE1right), rest671) end -| ( 152, ( ( _, ( MlyValue.VERTICAL_BAR VERTICAL_BAR1, _, +| ( 152, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, +PAREN_CLOSE1right)) :: ( _, ( MlyValue.expression expression1, _, _)) + :: ( _, ( MlyValue.VERTICAL_BAR VERTICAL_BAR1, _, _)) :: ( _, ( +MlyValue.initialized_variable_cs initialized_variable_cs1, _, _)) :: ( + _, ( MlyValue.iterate_vars_cs iterate_vars_cs1, _, _)) :: ( _, ( +MlyValue.PAREN_OPEN PAREN_OPEN1, _, _)) :: ( _, ( MlyValue.ITERATE +ITERATE1, ITERATE1left, _)) :: rest671)) => let val result = +MlyValue.arrow_property_call_exp_cs (fn _ => let val ITERATE1 = +ITERATE1 () + val PAREN_OPEN1 = PAREN_OPEN1 () + val (iterate_vars_cs as iterate_vars_cs1) = iterate_vars_cs1 () + val (initialized_variable_cs as initialized_variable_cs1) = +initialized_variable_cs1 () + val VERTICAL_BAR1 = VERTICAL_BAR1 () + val (expression as expression1) = expression1 () + val PAREN_CLOSE1 = PAREN_CLOSE1 () + in ( +Iterate (iterate_vars_cs,(#1 (initialized_variable_cs)),(#2 (initialized_variable_cs)),(#3 (initialized_variable_cs)),Variable ("dummy_source",DummyT),DummyT,expression,DummyT,DummyT) +) +end) + in ( LrTable.NT 95, ( result, ITERATE1left, PAREN_CLOSE1right), +rest671) +end +| ( 153, ( ( _, ( MlyValue.SEMI_COLON SEMI_COLON1, _, +SEMI_COLON1right)) :: ( _, ( MlyValue.formal_parameter_list_cs +formal_parameter_list_cs1, formal_parameter_list_cs1left, _)) :: +rest671)) => let val result = MlyValue.iterate_vars_cs (fn _ => let + val (formal_parameter_list_cs as formal_parameter_list_cs1) = +formal_parameter_list_cs1 () + val SEMI_COLON1 = SEMI_COLON1 () + in (formal_parameter_list_cs) +end) + in ( LrTable.NT 100, ( result, formal_parameter_list_cs1left, +SEMI_COLON1right), rest671) +end +| ( 154, ( ( _, ( MlyValue.VERTICAL_BAR VERTICAL_BAR1, _, VERTICAL_BAR1right)) :: ( _, ( MlyValue.formal_parameter_list_cs formal_parameter_list_cs1, formal_parameter_list_cs1left, _)) :: rest671)) => let val result = MlyValue.iterator_vars_cs (fn _ => let @@ -2963,7 +3022,7 @@ end) in ( LrTable.NT 107, ( result, formal_parameter_list_cs1left, VERTICAL_BAR1right), rest671) end -| ( 153, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, +| ( 155, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, PAREN_CLOSE1right)) :: ( _, ( MlyValue.type_specifier type_specifier1, _, _)) :: ( _, ( MlyValue.PAREN_OPEN PAREN_OPEN1, PAREN_OPEN1left, _) ) :: rest671)) => let val result = MlyValue.ntVOID (fn _ => ( let @@ -2975,7 +3034,7 @@ end; ())) in ( LrTable.NT 115, ( result, PAREN_OPEN1left, PAREN_CLOSE1right), rest671) end -| ( 154, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, +| ( 156, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, PAREN_CLOSE1right)) :: ( _, ( MlyValue.actual_parameter_list_cs actual_parameter_list_cs1, _, _)) :: ( _, ( MlyValue.PAREN_OPEN PAREN_OPEN1, PAREN_OPEN1left, _)) :: rest671)) => let val result = @@ -2989,7 +3048,7 @@ end) in ( LrTable.NT 98, ( result, PAREN_OPEN1left, PAREN_CLOSE1right), rest671) end -| ( 155, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, +| ( 157, ( ( _, ( MlyValue.PAREN_CLOSE PAREN_CLOSE1, _, PAREN_CLOSE1right)) :: ( _, ( MlyValue.PAREN_OPEN PAREN_OPEN1, PAREN_OPEN1left, _)) :: rest671)) => let val result = MlyValue.property_call_parameters_cs (fn _ => let val PAREN_OPEN1 = @@ -3000,7 +3059,7 @@ end) in ( LrTable.NT 98, ( result, PAREN_OPEN1left, PAREN_CLOSE1right), rest671) end -| ( 156, ( ( _, ( MlyValue.actual_parameter_list_element_cs +| ( 158, ( ( _, ( MlyValue.actual_parameter_list_element_cs actual_parameter_list_element_cs1, actual_parameter_list_element_cs1left, actual_parameter_list_element_cs1right)) :: rest671)) => let val @@ -3012,7 +3071,7 @@ end) in ( LrTable.NT 102, ( result, actual_parameter_list_element_cs1left, actual_parameter_list_element_cs1right), rest671) end -| ( 157, ( ( _, ( MlyValue.actual_parameter_list_tail_cs_p +| ( 159, ( ( _, ( MlyValue.actual_parameter_list_tail_cs_p actual_parameter_list_tail_cs_p1, _, actual_parameter_list_tail_cs_p1right)) :: ( _, ( MlyValue.actual_parameter_list_element_cs @@ -3031,7 +3090,7 @@ end) in ( LrTable.NT 102, ( result, actual_parameter_list_element_cs1left, actual_parameter_list_tail_cs_p1right), rest671) end -| ( 158, ( ( _, ( MlyValue.actual_parameter_list_tail_cs +| ( 160, ( ( _, ( MlyValue.actual_parameter_list_tail_cs actual_parameter_list_tail_cs1, actual_parameter_list_tail_cs1left, actual_parameter_list_tail_cs1right)) :: rest671)) => let val result = MlyValue.actual_parameter_list_tail_cs_p (fn _ => let val ( @@ -3042,7 +3101,7 @@ end) in ( LrTable.NT 104, ( result, actual_parameter_list_tail_cs1left, actual_parameter_list_tail_cs1right), rest671) end -| ( 159, ( ( _, ( MlyValue.actual_parameter_list_tail_cs_p +| ( 161, ( ( _, ( MlyValue.actual_parameter_list_tail_cs_p actual_parameter_list_tail_cs_p1, _, actual_parameter_list_tail_cs_p1right)) :: ( _, ( MlyValue.actual_parameter_list_tail_cs actual_parameter_list_tail_cs1, @@ -3059,7 +3118,7 @@ end) in ( LrTable.NT 104, ( result, actual_parameter_list_tail_cs1left, actual_parameter_list_tail_cs_p1right), rest671) end -| ( 160, ( ( _, ( MlyValue.actual_parameter_list_cs +| ( 162, ( ( _, ( MlyValue.actual_parameter_list_cs actual_parameter_list_cs1, _, actual_parameter_list_cs1right)) :: ( _, ( MlyValue.COMMA COMMA1, COMMA1left, _)) :: rest671)) => let val result = MlyValue.actual_parameter_list_tail_cs (fn _ => let val @@ -3071,7 +3130,7 @@ end) in ( LrTable.NT 103, ( result, COMMA1left, actual_parameter_list_cs1right), rest671) end -| ( 161, ( ( _, ( MlyValue.expression expression1, expression1left, +| ( 163, ( ( _, ( MlyValue.expression expression1, expression1left, expression1right)) :: rest671)) => let val result = MlyValue.actual_parameter_list_element_cs (fn _ => let val ( expression as expression1) = expression1 () @@ -3080,7 +3139,7 @@ end) in ( LrTable.NT 105, ( result, expression1left, expression1right), rest671) end -| ( 162, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, +| ( 164, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, formal_parameter_cs1left, formal_parameter_cs1right)) :: rest671)) => let val result = MlyValue.actual_parameter_list_element_cs (fn _ => let val (formal_parameter_cs as formal_parameter_cs1) = @@ -3092,7 +3151,7 @@ end) in ( LrTable.NT 105, ( result, formal_parameter_cs1left, formal_parameter_cs1right), rest671) end -| ( 163, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, +| ( 165, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, formal_parameter_cs1left, formal_parameter_cs1right)) :: rest671)) => let val result = MlyValue.formal_parameter_list_cs (fn _ => let val (formal_parameter_cs as formal_parameter_cs1) = formal_parameter_cs1 @@ -3102,7 +3161,7 @@ end) in ( LrTable.NT 38, ( result, formal_parameter_cs1left, formal_parameter_cs1right), rest671) end -| ( 164, ( ( _, ( MlyValue.formal_parameter_list_tail_cs +| ( 166, ( ( _, ( MlyValue.formal_parameter_list_tail_cs formal_parameter_list_tail_cs1, _, formal_parameter_list_tail_cs1right )) :: ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, formal_parameter_cs1left, _)) :: rest671)) => let val result = @@ -3115,7 +3174,7 @@ end) in ( LrTable.NT 38, ( result, formal_parameter_cs1left, formal_parameter_list_tail_cs1right), rest671) end -| ( 165, ( ( _, ( MlyValue.formal_parameter_list_cs +| ( 167, ( ( _, ( MlyValue.formal_parameter_list_cs formal_parameter_list_cs1, _, formal_parameter_list_cs1right)) :: ( _, ( MlyValue.COMMA COMMA1, COMMA1left, _)) :: rest671)) => let val result = MlyValue.formal_parameter_list_tail_cs (fn _ => let val @@ -3127,7 +3186,7 @@ end) in ( LrTable.NT 39, ( result, COMMA1left, formal_parameter_list_cs1right), rest671) end -| ( 166, ( ( _, ( MlyValue.formal_parameter_type_specifier +| ( 168, ( ( _, ( MlyValue.formal_parameter_type_specifier formal_parameter_type_specifier1, _, formal_parameter_type_specifier1right)) :: ( _, ( MlyValue.simple_name simple_name1, simple_name1left, _)) :: rest671)) => let val result = @@ -3141,7 +3200,7 @@ end) in ( LrTable.NT 37, ( result, simple_name1left, formal_parameter_type_specifier1right), rest671) end -| ( 167, ( ( _, ( MlyValue.type_specifier type_specifier1, _, +| ( 169, ( ( _, ( MlyValue.type_specifier type_specifier1, _, type_specifier1right)) :: ( _, ( MlyValue.COLON COLON1, COLON1left, _) ) :: rest671)) => let val result = MlyValue.formal_parameter_type_specifier (fn _ => let val COLON1 = @@ -3152,7 +3211,7 @@ end) in ( LrTable.NT 106, ( result, COLON1left, type_specifier1right), rest671) end -| ( 168, ( ( _, ( MlyValue.simple_type_specifier_cs +| ( 170, ( ( _, ( MlyValue.simple_type_specifier_cs simple_type_specifier_cs1, simple_type_specifier_cs1left, simple_type_specifier_cs1right)) :: rest671)) => let val result = MlyValue.type_specifier (fn _ => let val (simple_type_specifier_cs @@ -3163,7 +3222,7 @@ end) in ( LrTable.NT 19, ( result, simple_type_specifier_cs1left, simple_type_specifier_cs1right), rest671) end -| ( 169, ( ( _, ( MlyValue.collection_type_specifier_cs +| ( 171, ( ( _, ( MlyValue.collection_type_specifier_cs collection_type_specifier_cs1, collection_type_specifier_cs1left, collection_type_specifier_cs1right)) :: rest671)) => let val result = MlyValue.type_specifier (fn _ => let val ( @@ -3174,7 +3233,7 @@ end) in ( LrTable.NT 19, ( result, collection_type_specifier_cs1left, collection_type_specifier_cs1right), rest671) end -| ( 170, ( ( _, ( MlyValue.simple_name simple_name1, simple_name1left +| ( 172, ( ( _, ( MlyValue.simple_name simple_name1, simple_name1left , simple_name1right)) :: rest671)) => let val result = MlyValue.simple_type_specifier_cs (fn _ => let val (simple_name as simple_name1) = simple_name1 () @@ -3183,7 +3242,7 @@ end) in ( LrTable.NT 52, ( result, simple_name1left, simple_name1right), rest671) end -| ( 171, ( ( _, ( MlyValue.initialized_variable_cs +| ( 173, ( ( _, ( MlyValue.initialized_variable_cs initialized_variable_cs1, initialized_variable_cs1left, initialized_variable_cs1right)) :: rest671)) => let val result = MlyValue.initialized_variable_list_cs (fn _ => let val ( @@ -3194,7 +3253,7 @@ end) in ( LrTable.NT 72, ( result, initialized_variable_cs1left, initialized_variable_cs1right), rest671) end -| ( 172, ( ( _, ( MlyValue.initialized_variable_list_tail_cs_p +| ( 174, ( ( _, ( MlyValue.initialized_variable_list_tail_cs_p initialized_variable_list_tail_cs_p1, initialized_variable_list_tail_cs_p1left, initialized_variable_list_tail_cs_p1right)) :: rest671)) => let val @@ -3208,7 +3267,7 @@ end) initialized_variable_list_tail_cs_p1left, initialized_variable_list_tail_cs_p1right), rest671) end -| ( 173, ( ( _, ( MlyValue.initialized_variable_list_tail_cs +| ( 175, ( ( _, ( MlyValue.initialized_variable_list_tail_cs initialized_variable_list_tail_cs1, initialized_variable_list_tail_cs1left, initialized_variable_list_tail_cs1right)) :: rest671)) => let val @@ -3221,7 +3280,7 @@ end) in ( LrTable.NT 108, ( result, initialized_variable_list_tail_cs1left , initialized_variable_list_tail_cs1right), rest671) end -| ( 174, ( ( _, ( MlyValue.initialized_variable_list_tail_cs_p +| ( 176, ( ( _, ( MlyValue.initialized_variable_list_tail_cs_p initialized_variable_list_tail_cs_p1, _, initialized_variable_list_tail_cs_p1right)) :: ( _, ( MlyValue.initialized_variable_list_tail_cs @@ -3241,7 +3300,7 @@ end) in ( LrTable.NT 108, ( result, initialized_variable_list_tail_cs1left , initialized_variable_list_tail_cs_p1right), rest671) end -| ( 175, ( ( _, ( MlyValue.initialized_variable_cs +| ( 177, ( ( _, ( MlyValue.initialized_variable_cs initialized_variable_cs1, _, initialized_variable_cs1right)) :: ( _, ( MlyValue.COMMA COMMA1, COMMA1left, _)) :: rest671)) => let val result = MlyValue.initialized_variable_list_tail_cs (fn _ => let val @@ -3253,7 +3312,7 @@ end) in ( LrTable.NT 109, ( result, COMMA1left, initialized_variable_cs1right), rest671) end -| ( 176, ( ( _, ( MlyValue.variable_initializer variable_initializer1 +| ( 178, ( ( _, ( MlyValue.variable_initializer variable_initializer1 , _, variable_initializer1right)) :: ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, formal_parameter_cs1left, _)) :: rest671)) => let val result = @@ -3268,7 +3327,7 @@ end) in ( LrTable.NT 101, ( result, formal_parameter_cs1left, variable_initializer1right), rest671) end -| ( 177, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, +| ( 179, ( ( _, ( MlyValue.formal_parameter_cs formal_parameter_cs1, formal_parameter_cs1left, formal_parameter_cs1right)) :: rest671)) => let val result = MlyValue.variable_declaration_cs (fn _ => let val (formal_parameter_cs as formal_parameter_cs1) = formal_parameter_cs1 @@ -3278,7 +3337,7 @@ end) in ( LrTable.NT 111, ( result, formal_parameter_cs1left, formal_parameter_cs1right), rest671) end -| ( 178, ( ( _, ( MlyValue.ocl_expression_cs ocl_expression_cs1, _, +| ( 180, ( ( _, ( MlyValue.ocl_expression_cs ocl_expression_cs1, _, ocl_expression_cs1right)) :: ( _, ( MlyValue.EQUALS EQUALS1, EQUALS1left, _)) :: rest671)) => let val result = MlyValue.variable_initializer (fn _ => let val EQUALS1 = EQUALS1 () @@ -3289,7 +3348,7 @@ end) in ( LrTable.NT 110, ( result, EQUALS1left, ocl_expression_cs1right), rest671) end -| ( 179, ( ( _, ( MlyValue.variable_declaration_cs +| ( 181, ( ( _, ( MlyValue.variable_declaration_cs variable_declaration_cs1, variable_declaration_cs1left, variable_declaration_cs1right)) :: rest671)) => let val result = MlyValue.variable_declaration_list_cs (fn _ => let val ( @@ -3300,7 +3359,7 @@ end) in ( LrTable.NT 112, ( result, variable_declaration_cs1left, variable_declaration_cs1right), rest671) end -| ( 180, ( ( _, ( MlyValue.variable_declaration_list_tail_cs +| ( 182, ( ( _, ( MlyValue.variable_declaration_list_tail_cs variable_declaration_list_tail_cs1, _, variable_declaration_list_tail_cs1right)) :: ( _, ( MlyValue.variable_declaration_cs variable_declaration_cs1, @@ -3316,7 +3375,7 @@ end) in ( LrTable.NT 112, ( result, variable_declaration_cs1left, variable_declaration_list_tail_cs1right), rest671) end -| ( 181, ( ( _, ( MlyValue.variable_declaration_list_cs +| ( 183, ( ( _, ( MlyValue.variable_declaration_list_cs variable_declaration_list_cs1, _, variable_declaration_list_cs1right)) :: ( _, ( MlyValue.COMMA COMMA1, COMMA1left, _)) :: rest671)) => let val result = MlyValue.variable_declaration_list_tail_cs (fn _ => let diff --git a/su4sml/src/ocl_parser/preprocessor.sml b/su4sml/src/ocl_parser/preprocessor.sml index db5755a..0013d6f 100644 --- a/su4sml/src/ocl_parser/preprocessor.sml +++ b/su4sml/src/ocl_parser/preprocessor.sml @@ -187,7 +187,8 @@ and embed_atPre_expressions (Variable (str,typ)) = (Variable (str,typ)) (Let (var_name,var_type,embed_atPre_expressions rhs,rhs_type,embed_atPre_expressions in_e,in_type)) | embed_atPre_expressions (Iterator (name,iter_vars,sterm,stype,body_e,body_type,res_type)) = (Iterator (name,iter_vars,embed_atPre_expressions sterm,stype,embed_atPre_expressions body_e,body_type,res_type)) - + | embed_atPre_expressions (Iterate (iter_vars,acc_var_name,acc_var_type,acc_var_term,sterm,stype,bterm,btype,res_type)) = + (Iterate (iter_vars,acc_var_name,acc_var_type,acc_var_term,embed_atPre_expressions sterm,stype,embed_atPre_expressions bterm,btype,res_type)) (* RETURN: OclTerm *) fun embed_bound_variable (str,typ) (Variable(s,t)) = let @@ -220,6 +221,12 @@ fun embed_bound_variable (str,typ) (Variable(s,t)) = in (Iterator (name,iter_list,embed_bound_variable (s,typ) sterm,styp,embed_bound_variables iter_list (embed_bound_variable (s,typ) expr),expr_typ,rtyp)) end +| embed_bound_variable (s,typ) (Iterate (iter_vars,acc_name,acc_type,acc_term,sterm,stype,bterm,btype,res_type)) = + let + val _ = trace medium ("Bound variable '" ^ s ^ "' in 'Iterate': " ^ Ocl2String.ocl2string false (Iterate (iter_vars,acc_name,acc_type,acc_term,sterm,stype,bterm,btype,res_type)) ^ "\n") + in + (Iterate (iter_vars,acc_name,acc_type,acc_term,embed_bound_variable (s,typ) sterm,stype,embed_bound_variable (s,typ) bterm,btype,res_type)) + end | embed_bound_variable (s,typ) (Let (var_name,var_type,rhs,rhs_type,in_e,in_type)) = let val _ = trace zero ("Bound variable '" ^ s ^ "' in 'Let': " ^ Ocl2String.ocl2string false (Let (var_name,var_type,rhs,rhs_type,in_e,in_type)) ^ "\n") @@ -353,10 +360,16 @@ check_for_self arg_list typ (AttributeCall (Variable("dummy_source",_),_,path,_) end | check_for_self arg_list typ (Iterator (name,iter_var,sterm,styp,expr,expr_typ,res_typ)) model = let - val _ = trace zero ("check_for_self: complex OperationCall "^ "\n") + val _ = trace zero ("check_for_self: Iterator "^ "\n") in (Iterator (name,iter_var,(check_for_self arg_list typ sterm model),styp,(check_for_self arg_list typ expr model),expr_typ,res_typ)) end +| check_for_self arg_list typ (Iterate (iter_vars,acc_name,acc_type,acc_term,sterm,stype,bterm,btype,res_type)) model = + let + val _ = trace zero ("check_for_self: Iterate "^ "\n") + in + (Iterate (iter_vars,acc_name,acc_type,acc_term,(check_for_self arg_list typ sterm model),stype,(check_for_self arg_list typ bterm model),btype,res_type)) + end | check_for_self arg_list typ (Let (str,ttyp,rhs_term,rhs_typ,in_term,in_typ)) model = let val self_rhs_term = check_for_self arg_list typ rhs_term model diff --git a/su4sml/src/ocl_parser/type_checker.sml b/su4sml/src/ocl_parser/type_checker.sml index cd6316d..c37995b 100644 --- a/su4sml/src/ocl_parser/type_checker.sml +++ b/su4sml/src/ocl_parser/type_checker.sml @@ -51,6 +51,8 @@ sig exception NotYetSupportedError of string exception WrongContextChecked of Context.context exception IterateError of string + exception IterateAccumulatorTypeError of string + exception IterateTypeMissMatch of string val check_context_list : Context.context list -> Rep_Core.Classifier list -> Context.context option list val check_context : Context.context -> Rep_Core.Classifier list -> Context.context option @@ -75,8 +77,6 @@ open Ext_Library type operation = Rep_Core.operation type attribute = Rep_Core.attribute - - exception wrongCollectionLiteral of Rep_OclTerm.OclTerm * string exception CollectionRangeError of Rep_OclTerm.CollectionPart * string exception IteratorTypeMissMatch of Rep_OclTerm.OclTerm * string @@ -87,6 +87,8 @@ exception WrongContextChecked of context exception AsSetError of (OclTerm * string list * int * (OclTerm * OclType) list * Classifier list) exception DesugaratorCall of (OclTerm * string list * int * (OclTerm * OclType) list * Classifier list) exception IterateError of string +exception IterateAccumulatorTypeError of string +exception IterateTypeMissMatch of string (* RETURN: bool *) fun check_argument_type [] [] = true @@ -440,48 +442,6 @@ let | NoCollectionTypeError typ => AsSet_desugarator rterm meth_path 0 rargs model ) end - end -(* generic iterate: Iterate *) -| resolve_OclTerm (Iterate (iter_vars,res_var_name,res_var_typ,res_var_term,sterm,_,body_expr,_,res_typ)) model = -let - val _ = trace low ("RESOLVE Iterte: iterate = " ^ res_var_name ^ "\n") - - - (* resolve source *) - val rsterm = resolve_OclTerm sterm model - val rtyp = type_of_term rsterm - val typ_of_iter = template_parameter rtyp - - (* check type of iterate variables *) - val class_list = List.map (fn (a,b) => class_of_type b model) iter_vars - val typ_list = List.map type_of class_list - - val list_conf = List.map (fn a => conforms_to a typ_of_iter model) typ_list -in - if (List.all (fn (a) => if (a) then true else false) list_conf) - then - let - (* resolve res term *) - val res_var_rterm = resolve_OclTerm res_var_term model - val res_var_rtyp = type_of_term res_var_rterm - (* embed 'iterate'-variable in body_expr term *) - val embed_body = embed_bound_variables iter_vars body_expr - (* resolve body_expr *) - val rbody = resolve_OclTerm embed_body model - val rbody_typ = type_of_term rbody - in - if (conforms_to res_var_rtyp res_var_typ model) - then - if (conforms_to rbody_typ res_var_typ model) - then - Iterate (iter_vars,res_var_name,res_var_typ,res_var_rterm,rsterm,rtyp,rbody,rbody_typ,res_var_typ) - else - raise IterateError ("Bodytermtyp (" ^ string_of_OclType rbody_typ ^") does not conform to result typ of expression (" ^ string_of_OclType res_var_typ ^ "\n") - else - raise IterateError ("Static type of result variable (" ^ string_of_OclType res_var_typ ^ ") does not conform to dynamic type result variable (" ^ string_of_OclType res_var_rtyp ^ ") \n") - end - else - raise IterateError ("Type of iteratores [] doesn't conform to type of source (" ^ (string_of_OclType rtyp) ^ "\n") end (* Iterator *) | resolve_OclTerm (Iterator (name,iter_vars,source_term,_,expr,expr_typ,res_typ)) model = @@ -541,6 +501,53 @@ end else raise IteratorTypeMissMatch (Iterator (name,iter_vars,source_term,DummyT,expr,expr_typ,res_typ),("Iterator variable doesn't conform to choosen set \n")) end +| resolve_OclTerm (Iterate (iter_vars,acc_var_name,acc_var_type,acc_var_term,sterm,stype,bterm,btype,res_type)) model = +let + (* resolve source term, type *) + val _ = trace medium ("RESOLVE Iterate: accumulator " ^ acc_var_name ^ "\n") + val rterm = resolve_OclTerm sterm model + val rtyp = type_of_term rterm + val _ = trace medium ("res Iterate: source type " ^ string_of_OclType (type_of_term rterm) ^ "\n\n") + (* get source classifier *) + val source_class = get_classifier rterm model + val _ = trace medium ("res Iterate: type of classifier: " ^ string_of_OclType (type_of source_class) ^ "\n") + (* prefix types *) + val prfx = (package_of_template_parameter (type_of source_class)) + val _ = trace medium ("res Iterate: Type prefixed ... \n") + val piter_vars = List.map (fn (a,b) => (a,prefix_type prfx b)) iter_vars + val piter_types = List.map (fn (a,b) => b) piter_vars + val _ = trace medium ("res Iterate: first iter types: " ^ string_of_OclType (List.hd piter_types) ^ "\n") + (* check if iterator types correspond to source type *) + val static_iter_type = template_parameter (type_of (source_class)) + val _ = trace medium ("Length of iter_types: " ^ Int.toString (List.length piter_types) ^ "\n") + val _ = trace medium ("parent of classifier: " ^ string_of_OclType (type_of_parent source_class) ^ "\n") + val _ = trace medium ("\nstatic iter type : " ^ string_of_OclType static_iter_type ^ " \n") + val _ = trace medium ("iter types: " ^ string_of_OclType (List.hd piter_types) ^ "\n") + val h2 = List.map (fn a => conforms_to a static_iter_type model) (piter_types) + val check = List.all (fn a => a=true) h2 + (* check if initial value of accumulator has correct type *) + val racc_var_term = resolve_OclTerm acc_var_term model + val racc_var_type = type_of_term racc_var_term + in + if (check) then + if (racc_var_type = acc_var_type) then + let + val _ = trace medium ("res Iterate: types conforms \n") + val bound_expr = embed_bound_variables piter_vars bterm + val bound_expr2 = embed_bound_variables [(acc_var_name,acc_var_type)] bound_expr + val _ = trace medium ("myres Iterate: term : " ^ Ocl2String.ocl2string false bound_expr2 ^ "\n") + val rexpr = resolve_OclTerm bound_expr2 model + val _ = trace medium (" manuel " ^ string_of_OclType (type_of_term rexpr) ^ "\n") + val _ = trace medium (" ma " ^ string_of_OclType (Set(static_iter_type)) ^ "\n") + val _ = trace medium ("res Iterate: \n\n\n") + in + Iterate(piter_vars,acc_var_name,racc_var_type,racc_var_term,rterm,rtyp,rexpr,type_of_term rexpr,racc_var_type) + end + else + raise IterateAccumulatorTypeError ("Type of accumulator does not conform to type of expression of accumulator") + else + raise IterateTypeMissMatch ("Iterate variables doesn't conform to choosen set \n") + end | resolve_OclTerm (CollectionLiteral ([],typ)) model = let val _ = trace medium ("RESOLVE CollectionLiteral\n")