commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r948886 - in /commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js: AbstractEnumeratedStatechartGenerator.js AbstractStatechartGenerator.js StatePatternStatechartGenerator.js
Date Thu, 27 May 2010 16:28:31 GMT
Author: jbeard
Date: Thu May 27 16:28:31 2010
New Revision: 948886

URL: http://svn.apache.org/viewvc?rev=948886&view=rev
Log:
Executable content now works for switch and table backends.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractEnumeratedStatechartGenerator.js
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractStatechartGenerator.js
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/StatePatternStatechartGenerator.js

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractEnumeratedStatechartGenerator.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractEnumeratedStatechartGenerator.js?rev=948886&r1=948885&r2=948886&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractEnumeratedStatechartGenerator.js
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractEnumeratedStatechartGenerator.js
Thu May 27 16:28:31 2010
@@ -83,6 +83,8 @@ require.def("src/scxml/cgf/js/AbstractEn
 
 				AbstractStatechartGenerator.apply(this,[conf]);
 
+
+
 				self.genContextHooks = function(){
 					return <>
 						//enumeration of states int id's
@@ -265,6 +267,10 @@ require.def("src/scxml/cgf/js/AbstractEn
 					return "STATE_INT_ID_TO_OBJECT_MAP[state]";
 				}
 
+				self.genNonBasicTriggerDispatcherExitBlockIteratorExpression = function(){
+					return "currentConfiguration.map(function(state){return STATE_INT_ID_TO_OBJECT_MAP[state]}
)";	
+				}
+
 			}
 		}
 );

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractStatechartGenerator.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractStatechartGenerator.js?rev=948886&r1=948885&r2=948886&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractStatechartGenerator.js
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/AbstractStatechartGenerator.js
Thu May 27 16:28:31 2010
@@ -97,10 +97,6 @@ require.def("src/scxml/cgf/js/AbstractSt
 					return "";
 				}
 
-				self.genInternalRuntimeFunctions = function(){
-					return "";
-				}
-
 				//this is the context for the trigger handlers
 				self.genTriggerDispatcherContext = function (params,s,t){
 					return "";
@@ -529,9 +525,11 @@ require.def("src/scxml/cgf/js/AbstractSt
 					return <>
 							var statesExited = [];
 							var lca = {t.msdl::lca.text()};
-							{self.genForEach("currentConfiguration",
-											"state",	
-											self.genNonBasicTriggerDispatcherExitBlockInnerForEach())}
+
+							{self.genForEach(
+								self.genNonBasicTriggerDispatcherExitBlockIteratorExpression(),
+								"state",	
+								self.genNonBasicTriggerDispatcherExitBlockInnerForEach())}
 
 							//sort by depth
 							statesExited.sort(sortByDepthDeepToShallow);
@@ -543,6 +541,10 @@ require.def("src/scxml/cgf/js/AbstractSt
 					</>
 				}
 
+				self.genNonBasicTriggerDispatcherExitBlockIteratorExpression = function(){
+					return "";				
+				}
+
 				self.genNonBasicTriggerDispatcherExitBlockInnerForEach = function(){
 					return <>
 							&#x7B;
@@ -651,6 +653,15 @@ require.def("src/scxml/cgf/js/AbstractSt
 						&#x7D;
 					</>
 				}
+
+				self.genInternalRuntimeFunctions = function(){
+					return <>
+						function sortByDepthDeepToShallow(a,b)&#x7B;
+							return b.depth - a.depth;
+						&#x7D;
+					</>
+				}
+
 		}
 	}
 );

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/StatePatternStatechartGenerator.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/StatePatternStatechartGenerator.js?rev=948886&r1=948885&r2=948886&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/StatePatternStatechartGenerator.js
(original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js/StatePatternStatechartGenerator.js
Thu May 27 16:28:31 2010
@@ -29,14 +29,6 @@ require.def("src/scxml/cgf/js/StatePatte
 
 				AbstractStatechartGenerator.apply(this,[conf]);
 
-				self.genInternalRuntimeFunctions = function(){
-					return <>
-						function sortByDepthDeepToShallow(a,b)&#x7B;
-							return b.depth - a.depth;
-						&#x7D;
-					</>
-				}
-
 				self.genStateHooks = function(state){
 					return <>
 						//triggers are methods
@@ -134,6 +126,10 @@ require.def("src/scxml/cgf/js/StatePatte
 				self.genHistoryTriggerDispatcherInnerForEachStateReference = function(){
 					return "state";
 				}
+
+				self.genNonBasicTriggerDispatcherExitBlockIteratorExpression = function(){
+					return "currentConfiguration";				
+				}
 			}
 
 		}



Mime
View raw message