commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r1037491 - in /commons/sandbox/gsoc/2010/scxml-js/trunk: ./ src/xslt/backends/js/ src/xslt/ir-compiler/ src/xslt/util/ src/xslt/util/language-frontend-module-generators/
Date Sun, 21 Nov 2010 16:07:12 GMT
Author: jbeard
Date: Sun Nov 21 16:07:12 2010
New Revision: 1037491

URL: http://svn.apache.org/viewvc?rev=1037491&view=rev
Log:
All tests pass for the JavaScript frontend. Still need to test the python frontend.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/build-common.xml
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StateTableStatechartGenerator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/SwitchyardStatechartGenerator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/appendTransitionInformation.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/flattenTransitions.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/nameTransitions.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/numberStatesAndTransitions.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/splitTransitionTargets.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/topo-sort.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/build-common.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/build-common.xml?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/build-common.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/build-common.xml Sun Nov 21 16:07:12 2010
@@ -46,9 +46,9 @@
 	<property name="language-frontends" value="js,py,sh"/>
 
 	<!--
-	<property name="backends" value="switch,table,state"/>
-	-->
 	<property name="backends" value="state"/>
+	-->
+	<property name="backends" value="switch,table,state"/>
 	<property name="browsers" value="firefox,chrome"/>
 	<!--
 	<property name="browsers" value="firefox,${ie_browser_name},chrome"/>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StateTableStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StateTableStatechartGenerator.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StateTableStatechartGenerator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StateTableStatechartGenerator.xsl
Sun Nov 21 16:07:12 2010
@@ -20,6 +20,13 @@
 	xmlns:c="http://commons.apache.org/scxml-js"
 	version="1.0">
 
+	<import href="AbstractEnumeratedStatechartGenerator.xsl"/>
+
+	<c:enabledConditionalDependencyProperties>
+		<c:enabledConditionalDependencyProperty name="flatten-transitions"/>
+	</c:enabledConditionalDependencyProperties>
+	
+
 	<c:dependencies>
 		<c:dependency path="ir-compiler/splitTransitionTargets.xsl"/>
 		<c:dependency path="ir-compiler/addBasicDescendantsToTransitions.xsl"/>
@@ -43,8 +50,6 @@
 		<c:dependency path="layout/addTransitionTargetIds.xsl"/>
 	</c:dependencies>
 
-	<import href="AbstractEnumeratedStatechartGenerator.xsl"/>
-
 	<variable name="enumeratedEventDispatchInvocation" select="'STATE_TRANSITION_TABLE[state][e]();'"/>
 
 	<variable name="nullTransitionFunctionName" select="'$nt'"/>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/SwitchyardStatechartGenerator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/SwitchyardStatechartGenerator.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/SwitchyardStatechartGenerator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/SwitchyardStatechartGenerator.xsl
Sun Nov 21 16:07:12 2010
@@ -20,6 +20,12 @@
 	xmlns:c="http://commons.apache.org/scxml-js"
 	version="1.0">
 
+	<import href="AbstractEnumeratedStatechartGenerator.xsl"/>
+
+	<c:enabledConditionalDependencyProperties>
+		<c:enabledConditionalDependencyProperty name="flatten-transitions"/>
+	</c:enabledConditionalDependencyProperties>
+
 	<c:dependencies>
 		<c:dependency path="ir-compiler/splitTransitionTargets.xsl"/>
 		<c:dependency path="ir-compiler/addBasicDescendantsToTransitions.xsl"/>
@@ -43,8 +49,6 @@
 		<c:dependency path="layout/addTransitionTargetIds.xsl"/>
 	</c:dependencies>
 
-	<import href="AbstractEnumeratedStatechartGenerator.xsl"/>
-
 	<variable name="enumeratedEventDispatchInvocation" select="'dispatch(state,e)'"/>
 
 	<template name="genEnumeratedHooks">

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/appendTransitionInformation.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/appendTransitionInformation.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/appendTransitionInformation.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/appendTransitionInformation.xsl
Sun Nov 21 16:07:12 2010
@@ -36,6 +36,7 @@ region (a child of <parallel>), and the 
 		<c:dependency path="ir-compiler/changeTransitionsPointingToCompoundStatesToPointToInitialStates.xsl"/>
 		<c:dependency path="ir-compiler/generateUniqueInitialStateIds.xsl"/>
 		<c:dependency path="ir-compiler/generateUniqueStateIds.xsl"/>
+		<c:dependency path="ir-compiler/flattenTransitions.xsl" when-property-is-enabled="flatten-transitions"/>
 	</c:dependencies>
 
 	<!-- identity transform -->

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/copyEnumeratedEventTransitions.xsl
Sun Nov 21 16:07:12 2010
@@ -17,6 +17,7 @@
 
 	<c:dependencies>
 		<c:dependency path="ir-compiler/computeLCA.xsl"/>
+		<c:dependency path="ir-compiler/nameTransitions.xsl"/>
 	</c:dependencies>
 
 	<!-- identity transform -->

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/flattenTransitions.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/flattenTransitions.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/flattenTransitions.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/flattenTransitions.xsl Sun
Nov 21 16:07:12 2010
@@ -29,7 +29,7 @@ collision. 
 	<xsl:output method="xml"/>
 
 	<c:dependencies>
-		<c:dependency path="ir-compiler/normalizeInitialStates.xsl"/>
+		<c:dependency path="ir-compiler/computeLCA.xsl"/>
 	</c:dependencies>
 
 	<!-- identity transform -->

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/nameTransitions.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/nameTransitions.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/nameTransitions.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/nameTransitions.xsl Sun
Nov 21 16:07:12 2010
@@ -34,6 +34,10 @@ enuemrated statechart backends.
 	version="1.0">
 	<xsl:output method="xml"/>
 
+	<c:dependencies>
+		<c:dependency path="ir-compiler/flattenTransitions.xsl" when-property-is-enabled="flatten-transitions"/>
+	</c:dependencies>
+
 	<!-- identity transform -->
 	<xsl:template match="@*|node()">
 		<xsl:copy>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/numberStatesAndTransitions.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/numberStatesAndTransitions.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/numberStatesAndTransitions.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/numberStatesAndTransitions.xsl
Sun Nov 21 16:07:12 2010
@@ -9,6 +9,7 @@
 	<c:dependencies>
 		<c:dependency path="ir-compiler/appendBasicStateInformation.xsl"/>
 		<c:dependency path="ir-compiler/normalizeInitialStates.xsl"/>
+		<c:dependency path="ir-compiler/copyEnumeratedEventTransitions.xsl"/>
 	</c:dependencies>
 
 	<!-- we copy them, so that we can use their positions as identifiers -->

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/splitTransitionTargets.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/splitTransitionTargets.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/splitTransitionTargets.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/ir-compiler/splitTransitionTargets.xsl
Sun Nov 21 16:07:12 2010
@@ -6,6 +6,10 @@
 	version="1.0">
 	<xsl:output method="xml"/>
 
+	<c:dependencies>
+		<c:dependency path="ir-compiler/normalizeInitialStates.xsl"/>
+	</c:dependencies>
+
 	<!-- identity transform -->
 	<xsl:template match="@*|node()">
 	   <xsl:copy>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/language-frontend-module-generators/sh-from-topo-sort-list-generator.xsl
Sun Nov 21 16:07:12 2010
@@ -15,8 +15,7 @@
 	<for-each select="c:stylesheet">
 		<text>xsltproc </text><value-of select="$xsl-base-dir"/><value-of
select="@path"/><text> - | \&#10;</text>
 	</for-each> 
-	<text>xsltproc </text><value-of select="$xsl-base-dir"/><value-of select="@source-path"/><text>
- | \&#10;</text>
-	<text>cat > out.js</text>
+	<text>xsltproc </text><value-of select="$xsl-base-dir"/><value-of select="@source-path"/><text>
- &#10;</text>
 	</template>
 </stylesheet>
 

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/topo-sort.xsl
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/topo-sort.xsl?rev=1037491&r1=1037490&r2=1037491&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/topo-sort.xsl (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/util/topo-sort.xsl Sun Nov 21 16:07:12
2010
@@ -32,8 +32,17 @@ in topologically-sorted order. 
 	<xsl:param name="source-path" select="'root'"/>
 	<xsl:param name="dependency-base-dir" select="'../'"/>
 
+	<!-- conditional properties declared in the source allow a bit more filtering/parameterization
-->
+	<xsl:variable name="enabledConditionalDependencyProperties" select="/xsl:stylesheet/c:enabledConditionalDependencyProperties/c:enabledConditionalDependencyProperty/@name"/>
 
 	<xsl:template match="/">
+
+		<!--
+		<xsl:message>
+			enabledConditionalDependencyProperties : <xsl:value-of select="$enabledConditionalDependencyProperties"/>
+		</xsl:message>
+		-->
+
 		<xsl:variable name="dependency-graph-fragment">
 			<xsl:call-template name="load-dependency-graph">
 				<xsl:with-param name="paths-already-visited" select="/.."/>
@@ -48,7 +57,8 @@ in topologically-sorted order. 
 		<xsl:variable name="unique-dependency-graph-node-set" 
 			select="$dependency-graph-node-set/c:stylesheet[not(@path = preceding-sibling::c:stylesheet/@path)]"/>
 
-		<xsl:variable name="starting-nodes-without-dependencies" select="$unique-dependency-graph-node-set[not(c:dependency)]"/>
+		<xsl:variable name="starting-nodes-without-dependencies" 
+			select="$unique-dependency-graph-node-set[not(c:dependency)]"/>
 
 		<!--
 		<xsl:copy-of select="$starting-nodes-without-dependencies"/>
@@ -133,7 +143,8 @@ in topologically-sorted order. 
 			<xsl:variable name="next-nodes-without-dependencies" 
 				select="$dependency-graph-node-set[
 						not($next-processed-nodes/@path = @path) 
-						and count(c:dependency) = count(c:dependency[$next-processed-nodes/@path = @path])]"/>
+						and count(c:dependency) 
+						= count(c:dependency[$next-processed-nodes/@path = @path])]"/>
 
 			<xsl:if test="$next-nodes-without-dependencies">
 				<xsl:call-template name="topo-sort">
@@ -152,7 +163,20 @@ in topologically-sorted order. 
 		<xsl:param name="current-node"/>
 		<xsl:param name="is-first-call"/>
 
-		<xsl:variable name="dep-paths" select="$current-node/xsl:stylesheet/c:dependencies/c:dependency"/>
+		<xsl:variable name="dep-paths" select="$current-node/xsl:stylesheet/c:dependencies/c:dependency[not(@when-property-is-enabled)
or (@when-property-is-enabled = $enabledConditionalDependencyProperties)]"/>
+
+		<!--
+		<xsl:message>
+			%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+			<xsl:value-of select="$this-path"/>
+			<xsl:for-each select="$dep-paths">
+				path : <xsl:value-of select="@path"/>
+				whenPropertyIsEnabled : <xsl:value-of select="@when-property-is-enabled"/>
+			</xsl:for-each>
+			enabledConditionalDependencyProperties : <xsl:value-of select="$enabledConditionalDependencyProperties"/>
+			============================================================
+		</xsl:message>
+		-->
 
 		<!--
 		<xsl:message>



Mime
View raw message