From: Chris M. <zm...@us...> - 2001-06-18 22:57:30
|
Update of /cvsroot/kuml/kuml/libkuml/uml/tools In directory usw-pr-cvs1:/tmp/cvs-serv15005/tools Modified Files: common_code.xsl gen_class_ccs.xsl gen_class_hs.xsl gen_proxy_hs.xsl Log Message: Zounds! Something compiled! But not much... Index: common_code.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/common_code.xsl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** common_code.xsl 2001/05/29 22:32:06 1.4 --- common_code.xsl 2001/06/18 22:57:27 1.5 *************** *** 156,159 **** --- 156,258 ---- + <!-- Template for mangling names. + Special care must be taken to process idl_substitute name tags. + --> + + + <xsl:template match="Model:Tag" mode="mangle-name"> + <xsl:param name="the_xmi_id"/> + <xsl:choose> + <xsl:when test='contains(@elements," ")'> + <xsl:if test='substring-before(@elements," ") = $the_xmi_id'> + <xsl:value-of select="@name"/> + </xsl:if> + <xsl:if test='substring-after(@elements," ") = $the_xmi_id'> + <xsl:value-of select="@name"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:if test='@elements = $the_xmi_id'> + <xsl:value-of select="@name"/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template name="get_name"> + <xsl:param name="the_xmi_id"/> + <xsl:param name="the_name"/> + + <xsl:variable name="other_name"> + <xsl:apply-templates mode="mangle-name" + select='/descendant::Model:Tag[attribute::tagId="org.omg.mof.idl_substitute_name"]'> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="$the_xmi_id"/> + </xsl:with-param> + </xsl:apply-templates> + </xsl:variable> + + <xsl:choose> + <!-- boolean($other_name) doesn't seem to work here. --> + <xsl:when test="string-length($other_name) = 0"> + <xsl:value-of select="$the_name"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select='substring-after($other_name,"=")'/> + </xsl:otherwise> + </xsl:choose> + + </xsl:template> + + + <!-- Templates for generating a collection name + from the structural features. --> + + + <xsl:template name="collection_name"> + + <xsl:variable name="lower" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=1]"/> + <xsl:variable name="upper" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=2]"/> + + <xsl:if test='not($lower=1 and $upper=1)'> + + <xsl:variable name="is_ordered" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=3]"/> + <xsl:variable name="is_unique" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/> + + <xsl:choose> + + <xsl:when test='$lower=0 and $upper=1'> + <xsl:text>Bag&</xsl:text> + </xsl:when> + + <xsl:when test='$is_ordered="false" and $is_unique="false"'> + <xsl:text>Bag&</xsl:text> + </xsl:when> + + <xsl:when test='$is_ordered="true" and $is_unique="false"'> + <xsl:text>List&</xsl:text> + </xsl:when> + + <xsl:when test='$is_ordered="false" and $is_unique="true"'> + <xsl:text>Set&</xsl:text> + </xsl:when> + + <xsl:when test='$is_ordered="false" and $is_unique="false"'> + <xsl:text>UList&</xsl:text> + </xsl:when> + + </xsl:choose> + + </xsl:if> + + </xsl:template> + + + <!-- Templates for finding CORBA IDL type implementations. --> <!-- These use the type_name mode and setup the CORBA_type variable. --> *************** *** 180,183 **** --- 279,312 ---- <xsl:text>DataTypes::</xsl:text> <xsl:value-of select="@xmi.tcName"/> + </xsl:template> + + + <xsl:template match="Model:Class" mode="type_name"> + + <xsl:variable name="package_name"> + <xsl:call-template name="toName"> + <xsl:with-param name="text"> + <xsl:value-of select="ancestor::Model:Package/@name"/> + </xsl:with-param> + <xsl:with-param name="position" select="1"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="class_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:value-of select="$package_name"/> + <xsl:text>::</xsl:text> + <xsl:value-of select="$class_name"/> + <xsl:text>_ptr</xsl:text> + </xsl:template> Index: gen_class_ccs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_ccs.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** gen_class_ccs.xsl 2001/05/16 22:21:39 1.2 --- gen_class_ccs.xsl 2001/06/18 22:57:27 1.3 *************** *** 15,19 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="@name"/> <xsl:variable name="processed_class_name"> <xsl:call-template name="to_name"> --- 15,29 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! <xsl:variable name="processed_class_name"> <xsl:call-template name="to_name"> *************** *** 63,80 **** <xsl:text>::_duplicate(_this())); </xsl:text> - <xsl:if test='@isAbstract = "false"'> - - <xsl:text> fc_all_of_class_</xsl:text> - <xsl:value-of select="$processed_class_name"/> - <xsl:text>.push_back( </xsl:text> - - <xsl:text> </xsl:text> - <xsl:value-of select="$package_name"/> - <xsl:text>::</xsl:text> - <xsl:value-of select="$class_name"/> - <xsl:text>::_duplicate(_this())); </xsl:text> - - </xsl:if> - <xsl:text>}; </xsl:text> --- 73,76 ---- *************** *** 113,117 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="ancestor::Model:Class/@name"/> <xsl:variable name="attribute" select="@name"/> --- 109,123 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="ancestor::Model:Class/@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="ancestor::Model:Class/@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> <xsl:variable name="attribute" select="@name"/> *************** *** 134,140 **** --> <xsl:variable name="CORBA_type"> ! <xsl:apply-templates ! select='/descendant::Model:DataType[attribute::xmi.id=$type_ref]/Model:DataType.typeCode' ! mode="type_name"/> </xsl:variable> --- 140,144 ---- --> <xsl:variable name="CORBA_type"> ! <xsl:apply-templates select='/descendant::*[@xmi.id=$type_ref]' mode="type_name"/> </xsl:variable> *************** *** 165,169 **** <xsl:text>() </xsl:text> ! <xsl:text> throw </xsl:text> <xsl:text> ::CORBA::SystemException, </xsl:text> <xsl:text> ::Reflective::NotSet, </xsl:text> --- 169,173 ---- <xsl:text>() </xsl:text> ! <xsl:text> throw( </xsl:text> <xsl:text> ::CORBA::SystemException, </xsl:text> <xsl:text> ::Reflective::NotSet, </xsl:text> *************** *** 260,264 **** <xsl:text>void </xsl:text> <xsl:value-of select="$class_name"/> ! <xsl:text>::set_</xsl:text> <xsl:value-of select="$attr_name"/> <xsl:text>( const </xsl:text> --- 264,268 ---- <xsl:text>void </xsl:text> <xsl:value-of select="$class_name"/> ! <xsl:text>_impl::set_</xsl:text> <xsl:value-of select="$attr_name"/> <xsl:text>( const </xsl:text> *************** *** 367,371 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="ancestor::Model:Class/@name"/> <xsl:variable name="ref_name"> --- 371,385 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="ancestor::Model:Class/@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="ancestor::Model:Class/@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> <xsl:variable name="ref_name"> *************** *** 698,702 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="@name"/> <xsl:variable name="filename"> <xsl:text>../</xsl:text> --- 712,727 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! <xsl:variable name="filename"> <xsl:text>../</xsl:text> Index: gen_class_hs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_hs.xsl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** gen_class_hs.xsl 2001/05/28 22:35:35 1.3 --- gen_class_hs.xsl 2001/06/18 22:57:27 1.4 *************** *** 122,130 **** <xsl:template name="CLASS_INSTANCE"> <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> - <xsl:variable name="class_name" select="@name"/> <xsl:text>#ifndef __</xsl:text> <xsl:call-template name="to_upper"> --- 122,233 ---- + <!-- Templates to do private variables. + These templates all use the private_var mode. + --> + + + <!-- Replace the default rule. --> + <xsl:template match="*" mode="private_var"/> + + + <!-- Certain nodes do nothing. --> + <xsl:template mode="private_var" match="Model:Namespace.contents"> + <xsl:apply-templates mode="private_var"/> + </xsl:template> + + + <xsl:template match="Model:Attribute" mode="private_var"> + + <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> + + <xsl:variable name="class_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="ancestor::Model:Class/@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="ancestor::Model:Class/@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="attribute"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="attr_name"> + <xsl:call-template name="to_name"> + <xsl:with-param name="text"> + <xsl:value-of select="$attribute"/> + </xsl:with-param> + <xsl:with-param name="position" select="1"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="type_ref" select="@type"/> + <xsl:variable name="is_changeable" select="@isChangeable"/> + + <!-- Define the value of the CORBA_type variable by applying templates + in the type_name mode to the Model:DataType.typeCode child of a + Model:DataType descendant of the root node whos xmi.id attribute + matches type_ref. + --> + <xsl:variable name="CORBA_type"> + <xsl:apply-templates select='/descendant::*[@xmi.id=$type_ref]' mode="type_name"/> + </xsl:variable> + + <xsl:variable name="is_const" + select='substring($CORBA_type, string-length($CORBA_type), 1) = "*"'/> + + <xsl:variable name="lower" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=1]"/> + <xsl:variable name="upper" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=2]"/> + <xsl:variable name="is_ordered" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=3]"/> + <xsl:variable name="is_unique" + select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/> + + <!-- xsl:if test='$lower=0 and $upper=1' --> + + <!--<AttributeType> <attribute_name> () + raises (Reflective::NotSet, Reflective::MofError); + --> + + <xsl:text> </xsl:text> + <xsl:value-of select="$CORBA_type"/> + <xsl:text> fc_</xsl:text> + <xsl:value-of select="$attr_name"/> + <xsl:text>; </xsl:text> + + </xsl:template> + + + + + + <xsl:template name="CLASS_INSTANCE"> <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> + <xsl:variable name="class_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:text>#ifndef __</xsl:text> <xsl:call-template name="to_upper"> *************** *** 199,202 **** --- 302,311 ---- <xsl:text> </xsl:text> + <xsl:text> private: </xsl:text> + + <xsl:text> </xsl:text> + + <xsl:apply-templates mode="private_var"/> + <xsl:text>}; </xsl:text> *************** *** 211,217 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> - <xsl:variable name="class_name" select="ancestor::Model:Class/@name"/> ! <xsl:variable name="attribute" select="@name"/> <xsl:variable name="attr_name"> <xsl:call-template name="to_name"> --- 320,346 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="ancestor::Model:Class/@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="ancestor::Model:Class/@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:variable name="attribute"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! <xsl:variable name="attr_name"> <xsl:call-template name="to_name"> *************** *** 232,238 **** --> <xsl:variable name="CORBA_type"> ! <xsl:apply-templates ! select='/descendant::Model:DataType[attribute::xmi.id=$type_ref]/Model:DataType.typeCode' ! mode="type_name"/> </xsl:variable> --- 361,365 ---- --> <xsl:variable name="CORBA_type"> ! <xsl:apply-templates select='/descendant::*[@xmi.id=$type_ref]' mode="type_name"/> </xsl:variable> *************** *** 259,262 **** --- 386,390 ---- <xsl:text> </xsl:text> + <xsl:value-of select="$attr_name"/> <xsl:text>() </xsl:text> *************** *** 552,561 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> - <xsl:variable name="class_name" select="ancestor::Model:Class/@name"/> <xsl:variable name="ref_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="@name"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> --- 680,710 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> + <xsl:variable name="class_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="ancestor::Model:Class/@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="ancestor::Model:Class/@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="reference"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ref_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="$reference"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> *************** *** 564,569 **** <xsl:variable name="type_ref" select="@type"/> ! <xsl:variable name="type_name" ! select='/descendant::Model:Class[@xmi.id=$type_ref]/@name'/> <xsl:variable name="is_changeable" select="@isChangeable"/> --- 713,728 ---- <xsl:variable name="type_ref" select="@type"/> ! <xsl:variable name="type_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of ! select='/descendant::Model:Class[@xmi.id=$type_ref]/@xmi.id'/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of ! select='/descendant::Model:Class[@xmi.id=$type_ref]/@name'/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> <xsl:variable name="is_changeable" select="@isChangeable"/> *************** *** 614,617 **** --- 773,782 ---- <xsl:value-of select="$type_name"/> <xsl:text>_ptr </xsl:text> + + <!-- Hack!! Deal with C++ reserved words (ahem) --> + <xsl:if test='$ref_name = "namespace"'> + <xsl:text>_cxx_</xsl:text> + </xsl:if> + <xsl:value-of select="$ref_name"/> <xsl:text>() </xsl:text> *************** *** 825,829 **** <xsl:text> ::CORBA::SystemException, </xsl:text> ! <xsl:text> ::Reflective:NotFound, </xsl:text> <xsl:text> ::Reflective::MofError) </xsl:text> <xsl:text> ; </xsl:text> --- 990,994 ---- <xsl:text> ::CORBA::SystemException, </xsl:text> ! <xsl:text> ::Reflective::NotFound, </xsl:text> <xsl:text> ::Reflective::MofError) </xsl:text> <xsl:text> ; </xsl:text> *************** *** 887,892 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> - <xsl:variable name="class_name" select="@name"/> <xsl:variable name="class_filename"> <xsl:text>../</xsl:text> --- 1052,1067 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> + <xsl:variable name="class_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id"> + <xsl:value-of select="@xmi.id"/> + </xsl:with-param> + <xsl:with-param name="the_name"> + <xsl:value-of select="@name"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="class_filename"> <xsl:text>../</xsl:text> *************** *** 905,914 **** <xsl:template match="Model:Attribute"> ! <xsl:call-template name="ATTRIBUTE"/> </xsl:template> <xsl:template match="Model:Reference"> ! <xsl:call-template name="REFERENCE"/> </xsl:template> --- 1080,1093 ---- <xsl:template match="Model:Attribute"> ! <xsl:if test='@scope="instance_level" and @visibility="public_vis"'> ! <xsl:call-template name="ATTRIBUTE"/> ! </xsl:if> </xsl:template> <xsl:template match="Model:Reference"> ! <xsl:if test='@visibility="public_vis"'> ! <xsl:call-template name="REFERENCE"/> ! </xsl:if> </xsl:template> Index: gen_proxy_hs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_proxy_hs.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** gen_proxy_hs.xsl 2001/05/29 22:32:06 1.7 --- gen_proxy_hs.xsl 2001/06/18 22:57:27 1.8 *************** *** 122,126 **** ! <!-- Templates to do parameters to the create_<class> method. These templates all use the create_params mode. --> --- 122,242 ---- ! <!-- Templates for finding CORBA IDL type implementations. --> ! <!-- These use the type_name mode and setup the CORBA_type variable. --> ! ! ! <xsl:template ! match="Model:DataType | Model:DataType.typeCode | XMI.CorbaTcAlias | XMI.CorbaTypeCode" ! mode="create_param_type_name"> ! <xsl:param name="collection"/> ! ! <xsl:apply-templates mode="create_param_type_name"> ! <xsl:with-param name="collection"> ! <xsl:value-of select="$collection"/> ! </xsl:with-param> ! </xsl:apply-templates> ! ! </xsl:template> ! ! ! <xsl:template match="XMI.CorbaTcBoolean" mode="create_param_type_name"> ! <xsl:param name="collection"/> ! <xsl:text>CORBA::Boolean</xsl:text> ! </xsl:template> ! ! ! <xsl:template match="XMI.CorbaTcString" mode="create_param_type_name"> ! <xsl:param name="collection"/> ! ! <xsl:variable name="package_name"> ! <xsl:call-template name="toName"> ! <xsl:with-param name="text"> ! <xsl:value-of select="ancestor::Model:Package/@name"/> ! </xsl:with-param> ! <xsl:with-param name="position" select="1"/> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:variable name="type_name" select="ancestor::Model:DataType/@name"/> ! ! <xsl:choose> ! <xsl:when test='not(string-length($collection) = 0)'> ! <xsl:text>const Core</xsl:text> ! </xsl:when> ! <xsl:otherwise> ! <xsl:value-of select="$package_name"/> ! </xsl:otherwise> ! </xsl:choose> ! ! <xsl:text>::</xsl:text> ! <xsl:value-of select="$type_name"/> ! <xsl:value-of select="$collection"/> ! ! </xsl:template> ! ! ! <xsl:template match="XMI.CorbaTcEnum" mode="create_param_type_name"> ! <xsl:param name="collection"/> ! ! <xsl:variable name="package_name"> ! <xsl:call-template name="toName"> ! <xsl:with-param name="text"> ! <xsl:value-of select="ancestor::Model:Package/@name"/> ! </xsl:with-param> ! <xsl:with-param name="position" select="1"/> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:choose> ! <xsl:when test='not(string-length($collection) = 0)'> ! <xsl:text>const Core</xsl:text> ! </xsl:when> ! <xsl:otherwise> ! <xsl:value-of select="$package_name"/> ! </xsl:otherwise> ! </xsl:choose> ! ! <xsl:text>::</xsl:text> ! <xsl:value-of select="@xmi.tcName"/> ! <xsl:value-of select="$collection"/> ! ! </xsl:template> ! ! ! <xsl:template match="Model:Class" mode="create_param_type_name"> ! <xsl:param name="collection"/> ! ! <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:choose> ! <xsl:when test='not(string-length($collection) = 0)'> ! <xsl:text>const Core</xsl:text> ! </xsl:when> ! <xsl:otherwise> ! <xsl:value-of select="$package_name"/> ! </xsl:otherwise> ! </xsl:choose> ! ! <xsl:text>::</xsl:text> ! ! <xsl:value-of select="$class_name"/> ! ! <xsl:value-of select="$collection"/> ! ! </xsl:template> ! ! ! <!-- Templates to do parameters to the create_<class> methods parameters. These templates all use the create_params mode. --> *************** *** 146,154 **** </xsl:if> <xsl:variable name="type_ref" select="@type"/> <xsl:apply-templates ! select='/descendant::Model:DataType[attribute::xmi.id=$type_ref]/Model:DataType.typeCode' ! mode="type_name"/> <xsl:text> </xsl:text> <xsl:call-template name="to_name"> <xsl:with-param name="text"> --- 262,280 ---- </xsl:if> + <xsl:variable name="collection"> + <xsl:call-template name="collection_name"/> + </xsl:variable> + <xsl:variable name="type_ref" select="@type"/> <xsl:apply-templates ! select='/descendant::*[attribute::xmi.id=$type_ref]' ! mode="create_param_type_name"> ! <xsl:with-param name="collection"> ! <xsl:value-of select="$collection"/> ! </xsl:with-param> ! </xsl:apply-templates> ! <xsl:text> </xsl:text> + <xsl:call-template name="to_name"> <xsl:with-param name="text"> *************** *** 157,160 **** --- 283,287 ---- <xsl:with-param name="position" select="1"/> </xsl:call-template> + </xsl:template> *************** *** 192,196 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="@name"/> <xsl:variable name="processed_cn"> --- 319,333 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> <xsl:variable name="processed_cn"> *************** *** 324,331 **** <xsl:if test='@isAbstract = "false"'> - <xsl:text> private: </xsl:text> - - <xsl:text> </xsl:text> - <xsl:text> static list<</xsl:text> <xsl:value-of select="$package_name"/> --- 461,464 ---- *************** *** 374,378 **** <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! <xsl:variable name="class_name" select="@name"/> <xsl:variable name="proxy_filename"> --- 507,521 ---- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> ! ! <xsl:variable name="class_name"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="@xmi.id"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of select="@name"/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> <xsl:variable name="proxy_filename"> |