From: Chris M. <zm...@us...> - 2001-09-27 21:51:12
|
Update of /cvsroot/kuml/kuml/libkuml/uml/tools In directory usw-pr-cvs1:/tmp/cvs-serv10157 Modified Files: common_code.xsl common_proxy_code.xsl gen_assoc_hs.xsl gen_proxy_ccs.xsl Added Files: common_assoc_code.xsl gen_assoc_ccs.xsl Log Message: Associations compile but do nothing. --- NEW FILE --- <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect" xmlns:Model="omg.org/mof.Model/1.3" extension-element-prefixes="xalan" version="1.0" > <xsl:template name="assoc_collection_name"> <xsl:param name="lower"/> <xsl:param name="upper"/> <xsl:param name="is_ordered"/> <xsl:param name="is_unique"/> <xsl:param name="aggregation"/> <xsl:variable name="collection"> <xsl:call-template name="collection_name"> <xsl:with-param name="lower"> <xsl:value-of select="$lower"/> </xsl:with-param> <xsl:with-param name="upper"> <xsl:value-of select="$upper"/> </xsl:with-param> <xsl:with-param name="is_ordered"> <xsl:value-of select="$is_ordered"/> </xsl:with-param> <xsl:with-param name="is_unique"> <xsl:value-of select="$is_unique"/> </xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:choose> <!-- Why? --> <xsl:when test='$collection = "Bag"'> <xsl:text>_ptr </xsl:text> </xsl:when> <xsl:when test='string-length($collection) = 0'> <xsl:text>_ptr </xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="$collection"/> <xsl:text>* </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:transform> --- NEW FILE --- <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect" xmlns:Model="omg.org/mof.Model/1.3" extension-element-prefixes="xalan" version="1.0" > <xsl:include href="common_code.xsl"/> <xsl:include href="common_assoc_code.xsl"/> <xsl:template name="ASSOCIATION"> <xsl:param name="assocName"/> <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/> <xsl:variable name="ASSOC_NAME"> [...547 lines suppressed...] <xsl:text>../</xsl:text> <xsl:value-of select="$package_name"/> <xsl:text>/</xsl:text> <xsl:value-of select="$assocName"/> <xsl:text>_impl.cc</xsl:text> </xsl:variable> <xalan:write select="$filename"> <xsl:call-template name="ASSOCIATION"> <xsl:with-param name="assocName"> <xsl:value-of select="$assocName"/> </xsl:with-param> </xsl:call-template> </xalan:write> </xsl:if> </xsl:template> </xsl:transform> Index: common_code.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/common_code.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** common_code.xsl 2001/07/26 21:18:43 1.7 --- common_code.xsl 2001/09/27 21:51:09 1.8 *************** *** 245,281 **** <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> --- 245,275 ---- <xsl:template name="collection_name"> + <xsl:param name="lower"/> + <xsl:param name="upper"/> + <xsl:param name="is_ordered"/> + <xsl:param name="is_unique"/> <xsl:if test='not($lower=1 and $upper=1)'> <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="true" and $is_unique="true"'> ! <xsl:text>UList</xsl:text> </xsl:when> Index: common_proxy_code.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/common_proxy_code.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** common_proxy_code.xsl 2001/09/10 22:09:32 1.2 --- common_proxy_code.xsl 2001/09/27 21:51:09 1.3 *************** *** 51,54 **** --- 51,55 ---- <xsl:value-of select="$type_name"/> <xsl:value-of select="$collection"/> + <xsl:text>&</xsl:text> </xsl:when> <xsl:otherwise> *************** *** 86,89 **** --- 87,93 ---- <xsl:value-of select="@xmi.tcName"/> <xsl:value-of select="$collection"/> + <xsl:if test='not(string-length($collection) = 0)'> + <xsl:text>&</xsl:text> + </xsl:if> </xsl:template> *************** *** 129,132 **** --- 133,137 ---- <xsl:when test='not(string-length($collection) = 0)'> <xsl:value-of select="$collection"/> + <xsl:text>&</xsl:text> </xsl:when> <xsl:otherwise> *************** *** 163,167 **** <xsl:variable name="collection"> ! <xsl:call-template name="collection_name"/> </xsl:variable> --- 168,181 ---- <xsl:variable name="collection"> ! <xsl:call-template name="collection_name"> ! <xsl:with-param name="lower" ! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=1]"/> ! <xsl:with-param name="upper" ! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=2]"/> ! <xsl:with-param name="is_ordered" ! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=3]"/> ! <xsl:with-param name="is_unique" ! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/> ! </xsl:call-template> </xsl:variable> Index: gen_assoc_hs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_assoc_hs.xsl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** gen_assoc_hs.xsl 2001/09/10 22:09:32 1.3 --- gen_assoc_hs.xsl 2001/09/27 21:51:09 1.4 *************** *** 9,12 **** --- 9,13 ---- <xsl:include href="common_code.xsl"/> + <xsl:include href="common_assoc_code.xsl"/> *************** *** 33,45 **** </xsl:variable> <!-- Get association end 1 --> <xsl:variable name="assocEnd1Name"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@name'/> </xsl:variable> ! <xsl:variable name="assoc_end1_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="$assocEnd1Name"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> --- 34,65 ---- </xsl:variable> + <!-- Get association end 1 --> + + <xsl:variable name="assocEnd1Name"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@name'/> </xsl:variable> ! <xsl:variable name="assocEnd1Type"> ! <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@type'/> ! </xsl:variable> ! ! <xsl:variable name="assocEnd1TypeName"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="$assocEnd1Type"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of ! select='/descendant::Model:Class[@xmi.id=$assocEnd1Type]/@name'/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:variable name="tassoc_end1_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="$assocEnd1TypeName"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> *************** *** 47,56 **** </xsl:variable> ! <xsl:variable name="assocEnd1Type"> ! <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@type'/> ! </xsl:variable> ! ! <xsl:variable name="assocEnd1TypeName"> ! <xsl:value-of select='/descendant::Model:Class[@xmi.id=$assocEnd1Type]/@name'/> </xsl:variable> --- 67,76 ---- </xsl:variable> ! <xsl:variable name="assoc_end1_name"> ! <xsl:call-template name="reserved-word-processing"> ! <xsl:with-param name="the_word"> ! <xsl:value-of select="$tassoc_end1_name"/> ! </xsl:with-param> ! </xsl:call-template> </xsl:variable> *************** *** 63,66 **** --- 83,90 ---- </xsl:variable> + <xsl:variable name="assocEnd1_lower"> + <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/Model:AssociationEnd.multiplicity/XMI.field[position()=1]'/> + </xsl:variable> + <xsl:variable name="assocEnd1_upper"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/Model:AssociationEnd.multiplicity/XMI.field[position()=2]'/> *************** *** 71,94 **** </xsl:variable> <!-- Get association end 2 --> <xsl:variable name="assocEnd2Name"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@name'/> </xsl:variable> ! <xsl:variable name="assoc_end2_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="$assocEnd2Name"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> </xsl:call-template> </xsl:variable> - - <xsl:variable name="assocEnd2Type"> - <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@type'/> - </xsl:variable> ! <xsl:variable name="assocEnd2TypeName"> ! <xsl:value-of select='/descendant::Model:Class[@xmi.id=$assocEnd2Type]/@name'/> </xsl:variable> --- 95,161 ---- </xsl:variable> + <xsl:variable name="assocEnd1_is_unique"> + <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/Model:AssociationEnd.multiplicity/XMI.field[position()=4]'/> + </xsl:variable> + + <xsl:variable name="collection1"> + <xsl:call-template name="assoc_collection_name"> + <xsl:with-param name="lower"> + <xsl:value-of select="$assocEnd1_lower"/> + </xsl:with-param> + <xsl:with-param name="upper"> + <xsl:value-of select="$assocEnd1_upper"/> + </xsl:with-param> + <xsl:with-param name="is_ordered"> + <xsl:value-of select="$assocEnd1_is_ordered"/> + </xsl:with-param> + <xsl:with-param name="is_unique"> + <xsl:value-of select="$assocEnd1_is_unique"/> + </xsl:with-param> + <xsl:with-param name="aggregation"> + <xsl:value-of select="./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@aggregation"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <!-- Get association end 2 --> + + <xsl:variable name="assocEnd2Name"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@name'/> </xsl:variable> ! <xsl:variable name="assocEnd2Type"> ! <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@type'/> ! </xsl:variable> ! ! <xsl:variable name="assocEnd2TypeName"> ! <xsl:call-template name="get_name"> ! <xsl:with-param name="the_xmi_id"> ! <xsl:value-of select="$assocEnd2Type"/> ! </xsl:with-param> ! <xsl:with-param name="the_name"> ! <xsl:value-of ! select='/descendant::Model:Class[@xmi.id=$assocEnd2Type]/@name'/> ! </xsl:with-param> ! </xsl:call-template> ! </xsl:variable> ! ! <xsl:variable name="tassoc_end2_name"> <xsl:call-template name="to_name"> <xsl:with-param name="text"> ! <xsl:value-of select="$assocEnd2TypeName"/> </xsl:with-param> <xsl:with-param name="position" select="1"/> </xsl:call-template> </xsl:variable> ! <xsl:variable name="assoc_end2_name"> ! <xsl:call-template name="reserved-word-processing"> ! <xsl:with-param name="the_word"> ! <xsl:value-of select="$tassoc_end2_name"/> ! </xsl:with-param> ! </xsl:call-template> </xsl:variable> *************** *** 101,104 **** --- 168,175 ---- </xsl:variable> + <xsl:variable name="assocEnd2_lower"> + <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/Model:AssociationEnd.multiplicity/XMI.field[position()=1]'/> + </xsl:variable> + <xsl:variable name="assocEnd2_upper"> <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/Model:AssociationEnd.multiplicity/XMI.field[position()=2]'/> *************** *** 109,115 **** </xsl:variable> <!-- DO THE OUTPUT --> ! <xsl:text>#ifdef __</xsl:text> <xsl:value-of select="$ASSOC_NAME"/> <xsl:text>__ </xsl:text> --- 180,212 ---- </xsl:variable> + <xsl:variable name="assocEnd2_is_unique"> + <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/Model:AssociationEnd.multiplicity/XMI.field[position()=4]'/> + </xsl:variable> + + <xsl:variable name="collection2"> + <xsl:call-template name="assoc_collection_name"> + <xsl:with-param name="lower"> + <xsl:value-of select="$assocEnd2_lower"/> + </xsl:with-param> + <xsl:with-param name="upper"> + <xsl:value-of select="$assocEnd2_upper"/> + </xsl:with-param> + <xsl:with-param name="is_ordered"> + <xsl:value-of select="$assocEnd2_is_ordered"/> + </xsl:with-param> + <xsl:with-param name="is_unique"> + <xsl:value-of select="$assocEnd2_is_unique"/> + </xsl:with-param> + <xsl:with-param name="aggregation"> + <xsl:value-of select="./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@aggregation"/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <!-- DO THE OUTPUT --> + ! <xsl:text>#ifndef __</xsl:text> <xsl:value-of select="$ASSOC_NAME"/> <xsl:text>__ </xsl:text> *************** *** 125,129 **** <xsl:text> </xsl:text> ! <xsl:text>#include "Foundation.h" </xsl:text> <xsl:text> </xsl:text> --- 222,226 ---- <xsl:text> </xsl:text> ! <xsl:text>#include "Core.h" </xsl:text> <xsl:text> </xsl:text> *************** *** 137,140 **** --- 234,259 ---- <xsl:text> </xsl:text> + <xsl:text> // assocEnd1_lower </xsl:text> + <xsl:value-of select="$assocEnd1_lower"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd1_upper </xsl:text> + <xsl:value-of select="$assocEnd1_upper"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd1_is_ordered </xsl:text> + <xsl:value-of select="$assocEnd1_is_ordered"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd1_is_unique </xsl:text> + <xsl:value-of select="$assocEnd1_is_unique"/> + <xsl:text> </xsl:text> + + <xsl:text> // collection1 </xsl:text> + <xsl:value-of select="$collection1"/> + <xsl:text> </xsl:text> + + <xsl:text> </xsl:text> + <xsl:text> // assocEnd2Name </xsl:text> <xsl:value-of select="$assocEnd2Name"/> *************** *** 145,150 **** --- 264,289 ---- <xsl:text> </xsl:text> + <xsl:text> // assocEnd2_lower </xsl:text> + <xsl:value-of select="$assocEnd2_lower"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd2_upper </xsl:text> + <xsl:value-of select="$assocEnd2_upper"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd2_is_ordered </xsl:text> + <xsl:value-of select="$assocEnd2_is_ordered"/> + <xsl:text> </xsl:text> + + <xsl:text> // assocEnd2_is_unique </xsl:text> + <xsl:value-of select="$assocEnd2_is_unique"/> + <xsl:text> </xsl:text> + + <xsl:text> // collection2 </xsl:text> + <xsl:value-of select="$collection2"/> <xsl:text> </xsl:text> + <xsl:text> </xsl:text> + <xsl:text>class </xsl:text> <xsl:value-of select="$assocName"/> *************** *** 155,159 **** <xsl:text> virtual public POA_Core::</xsl:text> <xsl:value-of select="$assocName"/> ! <xsl:text>_impl </xsl:text> <xsl:text>{ </xsl:text> --- 294,298 ---- <xsl:text> virtual public POA_Core::</xsl:text> <xsl:value-of select="$assocName"/> ! <xsl:text> </xsl:text> <xsl:text>{ </xsl:text> *************** *** 163,171 **** --> ! <xsl:text> </xsl:text> <xsl:value-of select="$assocName"/> ! <xsl:text>LinkSet all_</xsl:text> <xsl:value-of select="$assoc_name"/> ! <xsl:text>_links () </xsl:text> <xsl:text> throw( </xsl:text> --- 302,310 ---- --> ! <xsl:text> Core::</xsl:text> <xsl:value-of select="$assocName"/> ! <xsl:text>LinkSet* all_</xsl:text> <xsl:value-of select="$assoc_name"/> ! <xsl:text>_links() </xsl:text> <xsl:text> throw( </xsl:text> *************** *** 206,210 **** <xsl:text> Core::</xsl:text> <xsl:value-of select="$assocEnd1TypeName"/> ! <xsl:text>Set* </xsl:text> <xsl:value-of select="$assoc_end1_name"/> <xsl:text>( Core::</xsl:text> --- 345,350 ---- <xsl:text> Core::</xsl:text> <xsl:value-of select="$assocEnd1TypeName"/> ! <xsl:value-of select="$collection1"/> ! <xsl:value-of select="$assoc_end1_name"/> <xsl:text>( Core::</xsl:text> *************** *** 230,234 **** <xsl:text> Core::</xsl:text> <xsl:value-of select="$assocEnd2TypeName"/> ! <xsl:text>Set* </xsl:text> <xsl:value-of select="$assoc_end2_name"/> <xsl:text>( Core::</xsl:text> --- 370,375 ---- <xsl:text> Core::</xsl:text> <xsl:value-of select="$assocEnd2TypeName"/> ! <xsl:value-of select="$collection2"/> ! <xsl:value-of select="$assoc_end2_name"/> <xsl:text>( Core::</xsl:text> *************** *** 358,362 **** <xsl:text>, Core::</xsl:text> <xsl:value-of select="$assocEnd2TypeName"/> ! <xsl:text>_ptr</xsl:text> <xsl:value-of select="$assoc_end2_name"/> <xsl:text>, Core::</xsl:text> --- 499,503 ---- <xsl:text>, Core::</xsl:text> <xsl:value-of select="$assocEnd2TypeName"/> ! <xsl:text>_ptr </xsl:text> <xsl:value-of select="$assoc_end2_name"/> <xsl:text>, Core::</xsl:text> *************** *** 392,396 **** <xsl:text>, Core::</xsl:text> <xsl:value-of select="$assocEnd1TypeName"/> ! <xsl:text>_ptr</xsl:text> <xsl:value-of select="$assoc_end1_name"/> <xsl:text>, Core::</xsl:text> --- 533,537 ---- <xsl:text>, Core::</xsl:text> <xsl:value-of select="$assocEnd1TypeName"/> ! <xsl:text>_ptr </xsl:text> <xsl:value-of select="$assoc_end1_name"/> <xsl:text>, Core::</xsl:text> *************** *** 433,436 **** --- 574,583 ---- </xsl:if> + + <xsl:text> </xsl:text> + <xsl:text>}; </xsl:text> + <xsl:text> </xsl:text> + + <xsl:text>#endif </xsl:text> </xsl:template> Index: gen_proxy_ccs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_proxy_ccs.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** gen_proxy_ccs.xsl 2001/09/10 22:09:32 1.2 --- gen_proxy_ccs.xsl 2001/09/27 21:51:09 1.3 *************** *** 52,56 **** <xsl:variable name="collection"> ! <xsl:call-template name="collection_name"/> </xsl:variable> --- 52,62 ---- <xsl:variable name="collection"> ! <xsl:call-template name="collection_name"> ! <xsl:with-param name="lower" select="$lower"/> ! <xsl:with-param name="upper" select="$upper"/> ! <xsl:with-param name="is_ordered" select="$is_ordered"/> ! <xsl:with-param name="is_unique" select="$is_unique"/> ! </xsl:call-template> ! <xsl:text>&</xsl:text> </xsl:variable> |