You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jb...@apache.org on 2010/06/12 21:41:49 UTC
svn commit: r954114 - in /commons/sandbox/gsoc/2010/scxml-js/trunk:
src/scxml/cgf/ test/ test/xslt/
Author: jbeard
Date: Sat Jun 12 19:41:49 2010
New Revision: 954114
URL: http://svn.apache.org/viewvc?rev=954114&view=rev
Log:
Fixed the issue where it was not generating good ids for initial states.
Added:
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueInitialStateIds.xsl
- copied, changed from r954113, commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/SCXMLCompiler.js
commons/sandbox/gsoc/2010/scxml-js/trunk/test/testScript.sh
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StateTableStatechartGenerator.xsl
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl
commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/normalizeInitialStates.xsl
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/SCXMLCompiler.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/SCXMLCompiler.js?rev=954114&r1=954113&r2=954114&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/SCXMLCompiler.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/SCXMLCompiler.js Sat Jun 12 19:41:49 2010
@@ -62,6 +62,7 @@ require.def("src/scxml/cgf/SCXMLCompiler
var baseIRFilters = ["test/xslt/enumerateEvents",
"test/xslt/normalizeInitialStates",
"test/xslt/generateUniqueStateIds",
+ "test/xslt/generateUniqueInitialStateIds",
"test/xslt/splitTransitionTargets",
"test/xslt/changeTransitionsPointingToCompoundStatesToPointToInitialStates",
"test/xslt/computeLCA",
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=954114&r1=954113&r2=954114&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:49 2010
@@ -1,6 +1,7 @@
xsltproc xslt/enumerateEvents.xsl kitchen_sink/KitchenSink_executableContent.xml | \
xsltproc xslt/normalizeInitialStates.xsl - | \
xsltproc xslt/generateUniqueStateIds.xsl - | \
+xsltproc xslt/generateUniqueInitialStateIds.xsl | \
xsltproc xslt/splitTransitionTargets.xsl - | \
xsltproc xslt/changeTransitionsPointingToCompoundStatesToPointToInitialStates.xsl - | \
xsltproc xslt/computeLCA.xsl - | \
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StateTableStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StateTableStatechartGenerator.xsl?rev=954114&r1=954113&r2=954114&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StateTableStatechartGenerator.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/StateTableStatechartGenerator.xsl Sat Jun 12 19:41:49 2010
@@ -26,7 +26,7 @@
<text>var STATE_TRANSITION_TABLE = [ </text>
<for-each select="$basicStates">
- <sort select="@c:stateNum"/>
+ <sort select="@c:stateNum" data-type="number"/>
<variable name="currentState" select="."/>
@@ -35,7 +35,7 @@
<text>[</text>
<for-each select="$eventsEnum">
- <sort select="c:id"/>
+ <sort select="c:id" data-type="number"/>
<variable name="currentEvent" select="."/>
@@ -50,7 +50,9 @@
<message>
state: <value-of select="$currentState/@id"/>
+ stateNum: <value-of select="$currentState/@c:stateNum"/>
event: <value-of select="$currentEvent/c:name"/>
+ eventId: <value-of select="$currentEvent/c:id"/>
transitions to: <value-of select="$correspondingTransitions/@target"/>
</message>
Copied: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueInitialStateIds.xsl (from r954113, commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl)
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueInitialStateIds.xsl?p2=commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueInitialStateIds.xsl&p1=commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl&r1=954113&r2=954114&rev=954114&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueInitialStateIds.xsl Sat Jun 12 19:41:49 2010
@@ -12,8 +12,8 @@
</xsl:copy>
</xsl:template>
- <xsl:template match="s:state | s:initial | s:parallel | s:final | s:scxml | s:history">
- <xsl:variable name="newId" select="concat(local-name(),'_',generate-id() )" />
+ <xsl:template match="s:initial">
+ <xsl:variable name="newId" select="concat(../@id,'_initial')" />
<xsl:copy>
<xsl:apply-templates select="@*"/>
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl?rev=954114&r1=954113&r2=954114&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/generateUniqueStateIds.xsl Sat Jun 12 19:41:49 2010
@@ -12,7 +12,7 @@
</xsl:copy>
</xsl:template>
- <xsl:template match="s:state | s:initial | s:parallel | s:final | s:scxml | s:history">
+ <xsl:template match="s:state | s:parallel | s:final | s:scxml | s:history">
<xsl:variable name="newId" select="concat(local-name(),'_',generate-id() )" />
<xsl:copy>
<xsl:apply-templates select="@*"/>
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/normalizeInitialStates.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/normalizeInitialStates.xsl?rev=954114&r1=954113&r2=954114&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/normalizeInitialStates.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/xslt/normalizeInitialStates.xsl Sat Jun 12 19:41:49 2010
@@ -16,7 +16,7 @@
<xsl:copy>
<xsl:apply-templates select="@*"/>
- <initial id="{concat(local-name(),'_',@id,'_initial')}">
+ <initial id="{concat(@id,'_initial')}">
<transition target="{@initial}"/>
</initial>
<xsl:apply-templates select="node()"/>