commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r954108 - in /commons/sandbox/gsoc/2010/scxml-js/trunk/test: testScript.sh xslt/AbstractStatechartGenerator.xsl xslt/StatePatternStatechartGenerator.xsl
Date Sat, 12 Jun 2010 19:41:04 GMT
Author: jbeard
Date: Sat Jun 12 19:41:04 2010
New Revision: 954108

URL: http://svn.apache.org/viewvc?rev=954108&view=rev
Log:
Refactored test/xslt/AbstractStatechartGenerator.xsl to use eventsEnum markup rather than
computing unique events in the stylesheet.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh
    commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StatePatternStatechartGenerator.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh?rev=954108&r1=954107&r2=954108&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh Sat Jun 12 19:41:04 2010
@@ -1,4 +1,5 @@
-xsltproc xslt/normalizeInitialStates.xsl kitchen_sink/KitchenSink_executableContent.xml |
\
+xsltproc xslt/enumerateEvents.xsl kitchen_sink/KitchenSink_executableContent.xml | \
+xsltproc xslt/normalizeInitialStates.xsl - | \
 xsltproc xslt/generateUniqueStateIds.xsl - | \
 xsltproc xslt/splitTransitionTargets.xsl - | \
 xsltproc xslt/changeTransitionsPointingToCompoundStatesToPointToInitialStates.xsl - | \
@@ -8,9 +9,8 @@ xsltproc xslt/appendStateInformation.xsl
 xsltproc xslt/appendBasicStateInformation.xsl - | \
 xsltproc xslt/appendTransitionInformation.xsl - | \
 xsltproc xslt/nameTransitions.xsl - | \
-xsltproc xslt/flattenTransitions.xsl - | \
-xsltproc xslt/numberStatesAndTransitions.xsl - | \
+#xsltproc xslt/flattenTransitions.xsl - | \
+#xsltproc xslt/numberStatesAndTransitions.xsl - | \
 #todo: this next one can happen earlier, and for state pattern as well.
-xsltproc xslt/enumerateEvents.xsl - | \
 xmlindent > tmp_IR.xml;
 #xsltproc xslt/StatePatternStatechartGenerator.xsl tmp_IR.xml

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl?rev=954108&r1=954107&r2=954108&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/AbstractStatechartGenerator.xsl Sat
Jun 12 19:41:04 2010
@@ -37,11 +37,7 @@
 		select="$allStates[.//*[(self::s:state or self::s:parallel or self::s:final or self::s:initial
or self::s:scxml or self::s:history)]]"/>
 	<variable name="parallelRegions" select="$parallels/s:state"/>
 
-	<!-- TODO: this actually gets computed before in an xsl transformation. should take this
thing out,
-		and refactor code that uses it to use /c:eventsEnum instead -->
-	<key name="events" match="s:transition" use="@event"/>	<!-- used for generating
unique list -->
-
-	<variable name="uniqueEvents" select="//s:transition[generate-id(.)=generate-id(key('events',@event)[1])]/@event"/>
+	<variable name="eventsEnum" select="/s:scxml/c:eventsEnum/c:event"/>
 
 	<template match="/s:scxml">
 
@@ -64,7 +60,7 @@
 				//abstract state
 
 				<call-template name="genAbstractState">
-					<with-param name="events" select="$uniqueEvents"/>
+					<with-param name="events" select="$eventsEnum"/>
 				</call-template>
 
 				//states
@@ -81,7 +77,7 @@
 				</call-template>
 
 				//trigger methods for synchronous interaction
-				<for-each select="$uniqueEvents">
+				<for-each select="$eventsEnum">
 					<call-template name="genExternalTriggerDispatcher">
 						<with-param name="event" select="."/>
 					</call-template>
@@ -112,7 +108,7 @@
 			//triggers are methods
 
 			<for-each select="$events">
-			this.<value-of select="."/> = function(){};
+				this.<value-of select="./c:name"/> = function(){};
 			</for-each>
 
 			this.$default = function(){};

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StatePatternStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StatePatternStatechartGenerator.xsl?rev=954108&r1=954107&r2=954108&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StatePatternStatechartGenerator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StatePatternStatechartGenerator.xsl
Sat Jun 12 19:41:04 2010
@@ -28,9 +28,9 @@
 	<template name="genExternalTriggerDispatcher">
 		<param name="event"/>
 
-		this.<value-of select="$event"/> = function(){
+		this.<value-of select="$event/c:name"/> = function(){
 			if(isInStableState){
-				runToCompletion("<value-of select="$event"/>");
+				runToCompletion("<value-of select="$event/c:name"/>");
 			}else{
 				return undefined;
 			}



Mime
View raw message