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/05/27 18:28:31 UTC
svn commit: r948886 - in
/commons/sandbox/gsoc/2010/scxml-js/trunk/src/scxml/cgf/js:
AbstractEnumeratedStatechartGenerator.js AbstractStatechartGenerator.js
StatePatternStatechartGenerator.js
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 <>
{
@@ -651,6 +653,15 @@ require.def("src/scxml/cgf/js/AbstractSt
}
</>
}
+
+ self.genInternalRuntimeFunctions = function(){
+ return <>
+ function sortByDepthDeepToShallow(a,b){
+ return b.depth - a.depth;
+ }
+ </>
+ }
+
}
}
);
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){
- return b.depth - a.depth;
- }
- </>
- }
-
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";
+ }
}
}