From: Chris M. <zm...@us...> - 2001-10-31 22:40:41
|
Update of /cvsroot/kuml/kuml/libkuml/uml/tools In directory usw-pr-cvs1:/tmp/cvs-serv17661 Modified Files: gen_assoc_ccs.xsl gen_class_ccs.xsl gen_class_hs.xsl Log Message: Associations partially done. Improved scalability of class generation (more recursion!) Index: gen_assoc_ccs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_assoc_ccs.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** gen_assoc_ccs.xsl 2001/09/27 21:51:09 1.1 --- gen_assoc_ccs.xsl 2001/10/31 22:40:38 1.2 *************** *** 39,42 **** --- 39,67 ---- </xsl:variable> + + <xsl:variable name="t2assoc_end1_name"> + <xsl:call-template name="get_name"> + <xsl:with-param name="the_xmi_id" select="./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@xmi.id"/> + <xsl:with-param name="the_name" select="./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@name"/> + </xsl:call-template> + </xsl:variable> [...527 lines suppressed...] --- 671,689 ---- <xsl:text> ::Reflective::NotFound, </xsl:text> <xsl:text> ::Reflective::MofError) </xsl:text> ! ! <xsl:text>{ for(list<Reflective::Link>::iterator i = fc_ref_all_links.begin(); </xsl:text> ! <xsl:text> i != fc_ref_all_links.end(); i++) </xsl:text> ! <xsl:text> { if ((*i)[0] == </xsl:text> ! <xsl:value-of select="$assoc_end1_type_name"/> ! <xsl:text> && (*i)[1] == </xsl:text> ! <xsl:value-of select="$assoc_end2_type_name"/> ! <xsl:text>) </xsl:text> ! <xsl:text> { fc_ref_all_links.erase(i); </xsl:text> ! <xsl:text> return; </xsl:text> ! <xsl:text> } </xsl:text> ! <xsl:text> } </xsl:text> ! <xsl:text> throw ::Reflective::NotFound(); </xsl:text> ! <xsl:text>} </xsl:text> ! <xsl:text> </xsl:text> Index: gen_class_ccs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_ccs.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** gen_class_ccs.xsl 2001/09/10 22:09:32 1.7 --- gen_class_ccs.xsl 2001/10/31 22:40:38 1.8 *************** *** 35,41 **** </xsl:variable> - <xsl:variable name="supertypes" select="@supertypes"/> - <xsl:variable name="superclass" select="/descendant::Model:Class[@xmi.id=$supertypes]/@name"/> - <!-- Includes. --> --- 35,38 ---- *************** *** 135,141 **** <!-- 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"> --- 132,137 ---- <!-- Define the value of the CORBA_type variable by applying templates ! in the type_name mode to the descendant of the root node whos xmi.id ! attribute matches type_ref. --> <xsl:variable name="CORBA_type"> *************** *** 155,161 **** select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/> ! <!-- Define the value of the CORBA_type variable by applying templates in the type_name mode to the descendant of the root node whos xmi.id ! attribute matches type_ref. --> <xsl:variable name="CORBA_set_type"> --- 151,157 ---- select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/> ! <!-- Define the value of the CORBA_set_type variable by applying templates in the type_name mode to the descendant of the root node whos xmi.id ! attribute matches type_ref but only if the multiplicity is "many". --> <xsl:variable name="CORBA_set_type"> *************** *** 517,521 **** </xsl:if> ! <xsl:if test='($upper > 1 or $upper = -1) and $upper != $lower and $is_changeable="true" and $is_ordered="true" and $is_unique+"false"'> <!-- void remove_ <attribute_name>_at ( --- 513,517 ---- </xsl:if> ! <xsl:if test='($upper > 1 or $upper = -1) and $upper != $lower and $is_changeable="true" and $is_ordered="true" and $is_unique="false"'> <!-- void remove_ <attribute_name>_at ( Index: gen_class_hs.xsl =================================================================== RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_hs.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** gen_class_hs.xsl 2001/09/10 22:09:32 1.7 --- gen_class_hs.xsl 2001/10/31 22:40:38 1.8 *************** *** 34,38 **** <xsl:template match="Model:Class" mode="include"> - <xsl:variable name="classname" select="@name"/> <xsl:text>#include "</xsl:text> <xsl:value-of select="@name"/> --- 34,37 ---- *************** *** 45,68 **** <xsl:template name="include-supertypes"> ! <xsl:if test="count(attribute::supertypes) > 0"> ! <xsl:variable name="supertypes" select="@supertypes"/> ! <xsl:choose> ! <xsl:when test='contains(@supertypes," ")'> ! <xsl:apply-templates mode="include" ! select='/descendant::Model:Class[@xmi.id=substring-before($supertypes," ")]'/> ! <xsl:apply-templates mode="include" ! select='/descendant::Model:Class[@xmi.id=substring-after($supertypes," ")]'/> ! </xsl:when> ! <xsl:otherwise> ! <xsl:apply-templates mode="include" ! select='/descendant::Model:Class[@xmi.id=$supertypes]'/> ! </xsl:otherwise> ! </xsl:choose> ! </xsl:if> </xsl:template> --- 44,68 ---- <xsl:template name="include-supertypes"> ! <xsl:param name="st_xmi_ids"/> ! ! <xsl:choose> ! <xsl:when test='contains($st_xmi_ids," ")'> ! <xsl:apply-templates mode="include" ! select='/descendant::Model:Class[@xmi.id=substring-before($st_xmi_ids," ")]'/> ! <xsl:call-template name="include-supertypes"> ! <xsl:with-param name="st_xmi_ids" ! select='substring-after($st_xmi_ids," ")'/> ! </xsl:call-template> ! </xsl:when> ! <xsl:otherwise> ! <xsl:apply-templates mode="include" ! select='/descendant::Model:Class[@xmi.id=$st_xmi_ids]'/> ! </xsl:otherwise> ! </xsl:choose> </xsl:template> *************** *** 96,109 **** <xsl:template name="inherits"> ! <xsl:if test="count(attribute::supertypes) > 0"> ! <xsl:variable name="supertypes" select="@supertypes"/> <xsl:choose> ! <xsl:when test='contains(@supertypes," ")'> <xsl:apply-templates mode="inherit" ! select='/descendant::Model:Class[@xmi.id=substring-before($supertypes," ")]'/> ! <xsl:apply-templates mode="inherit" ! select='/descendant::Model:Class[@xmi.id=substring-after($supertypes," ")]'/> </xsl:when> --- 96,111 ---- <xsl:template name="inherits"> ! <xsl:param name="st_xmi_ids"/> ! <xsl:choose> ! <xsl:when test='contains($st_xmi_ids," ")'> <xsl:apply-templates mode="inherit" ! select='/descendant::Model:Class[@xmi.id=substring-before($st_xmi_ids," ")]'/> ! <xsl:call-template name="inherits"> ! <xsl:with-param name="st_xmi_ids" ! select='substring-after($st_xmi_ids," ")'/> ! </xsl:call-template> </xsl:when> *************** *** 111,119 **** <xsl:apply-templates mode="inherit" ! select='/descendant::Model:Class[@xmi.id=$supertypes]'/> </xsl:otherwise> </xsl:choose> ! </xsl:if> </xsl:template> --- 113,121 ---- <xsl:apply-templates mode="inherit" ! select='/descendant::Model:Class[@xmi.id=$st_xmi_ids]'/> </xsl:otherwise> </xsl:choose> ! </xsl:template> *************** *** 249,253 **** <xsl:text> </xsl:text> ! <xsl:call-template name="include-supertypes"/> <xsl:text>#include "Core.h" </xsl:text> --- 251,259 ---- <xsl:text> </xsl:text> ! <xsl:if test="count(attribute::supertypes) > 0"> ! <xsl:call-template name="include-supertypes"> ! <xsl:with-param name="st_xmi_ids" select="@supertypes"/> ! </xsl:call-template> ! </xsl:if> <xsl:text>#include "Core.h" </xsl:text> *************** *** 267,271 **** <xsl:text>Class_impl, </xsl:text> ! <xsl:call-template name="inherits"/> <xsl:text> virtual public POA_</xsl:text> --- 273,281 ---- <xsl:text>Class_impl, </xsl:text> ! <xsl:if test="count(attribute::supertypes) > 0"> ! <xsl:call-template name="inherits"> ! <xsl:with-param name="st_xmi_ids" select="@supertypes"/> ! </xsl:call-template> ! </xsl:if> <xsl:text> virtual public POA_</xsl:text> |