summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2015-12-04 08:00:18 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2015-12-04 08:00:18 (GMT)
commitb8ba0e7c31f397a66f9d509ff20a85b33619475a (patch)
tree9a5adb4f891cdc29eb80f597510e0cef8ee0a47f /apps
parent57ba362eae6e8209cf560555fd4cc4bb76dbe2a1 (diff)
downloaduscxml-b8ba0e7c31f397a66f9d509ff20a85b33619475a.zip
uscxml-b8ba0e7c31f397a66f9d509ff20a85b33619475a.tar.gz
uscxml-b8ba0e7c31f397a66f9d509ff20a85b33619475a.tar.bz2
All changes up to my dissertation
Diffstat (limited to 'apps')
-rw-r--r--apps/samples/server-push/server-push.scxml4
-rw-r--r--apps/samples/vrml/vrml-server.caching.scxml4
-rw-r--r--apps/samples/vrml/vrml-server.pre-osgjs.scxml4
-rw-r--r--apps/samples/vrml/vrml-server.scxml4
-rw-r--r--apps/uscxml-browser.cpp7
-rw-r--r--apps/uscxml-transform.cpp76
-rw-r--r--apps/w3c-mmi/im/uscxml-interaction-manager.cpp2
-rw-r--r--apps/w3c-mmi/mc/uscxml-modality-component.cpp2
8 files changed, 66 insertions, 37 deletions
diff --git a/apps/samples/server-push/server-push.scxml b/apps/samples/server-push/server-push.scxml
index a9d231e..c0f0a21 100644
--- a/apps/samples/server-push/server-push.scxml
+++ b/apps/samples/server-push/server-push.scxml
@@ -6,7 +6,7 @@
<scxml name="push" datamodel="ecmascript">
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
- <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string.endsWith.js" />
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string. .js" />
<state id="main">
<!-- We will only answer http requests when the heartbeat is emitted -->
@@ -25,7 +25,7 @@
</transition>
<transition event="http.post" target="idle">
- <if cond="_event.name.endsWith('postponed')">
+ <if cond="_event.name. ('postponed')">
<!-- This is an event we postponed before the heartbeat, respond -->
<respond to="_event.origin">
<content>This is awesome!</content>
diff --git a/apps/samples/vrml/vrml-server.caching.scxml b/apps/samples/vrml/vrml-server.caching.scxml
index 70a7c3a..2d935cd 100644
--- a/apps/samples/vrml/vrml-server.caching.scxml
+++ b/apps/samples/vrml/vrml-server.caching.scxml
@@ -1,6 +1,6 @@
<scxml datamodel="ecmascript" name="vrml">
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
- <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string.endsWith.js" />
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string. .js" />
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/array.last.js" />
<script>
var wrls = {}; // information of the wrl, vrml files
@@ -294,7 +294,7 @@
<content fileexpr="processed[_event['fileStruct'].key][_event['fileStruct'].format].path" />
</respond>
<else />
- <if cond="_event.name.endsWith('postponed')">
+ <if cond="_event.name. ('postponed')">
<!--
A postponed event we couldn't answer
-->
diff --git a/apps/samples/vrml/vrml-server.pre-osgjs.scxml b/apps/samples/vrml/vrml-server.pre-osgjs.scxml
index e08afd4..a51c5f3 100644
--- a/apps/samples/vrml/vrml-server.pre-osgjs.scxml
+++ b/apps/samples/vrml/vrml-server.pre-osgjs.scxml
@@ -1,6 +1,6 @@
<scxml datamodel="ecmascript" name="vrml">
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
- <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string.endsWith.js" />
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string. .js" />
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/array.last.js" />
<script>
var wrls = {}; // information of the wrl, vrml files
@@ -201,7 +201,7 @@
</script>
<if cond="'context' in _event.data">
<!-- this was generated in reply to a request -->
- <if cond="_event.name.endsWith('success')">
+ <if cond="_event.name. ('success')">
<respond status="200" to="_event.data.context">
<header name="Connection" value="close" />
<header name="Content-Type" value="application/json" />
diff --git a/apps/samples/vrml/vrml-server.scxml b/apps/samples/vrml/vrml-server.scxml
index 5c65afb..529a469 100644
--- a/apps/samples/vrml/vrml-server.scxml
+++ b/apps/samples/vrml/vrml-server.scxml
@@ -1,6 +1,6 @@
<scxml datamodel="ecmascript" name="vrml">
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
- <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string.endsWith.js" />
+ <script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/string. .js" />
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/array.last.js" />
<script>
var wrls = {}; // information of the wrl, vrml files
@@ -206,7 +206,7 @@
</script>
<if cond="'context' in _event.data">
<!-- this was generated in reply to a request -->
- <if cond="_event.name.endsWith('success')">
+ <if cond="_event.name. ('success')">
<respond status="200" to="_event.data.context">
<header name="Connection" value="close" />
<header name="Access-Control-Allow-Origin" value="*" />
diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp
index 0562ba7..ede6f06 100644
--- a/apps/uscxml-browser.cpp
+++ b/apps/uscxml-browser.cpp
@@ -35,7 +35,6 @@ void printBacktrace(void** array, int size) {
}
#ifdef HAS_DLFCN_H
-#if 0 // deactivated as we use exceptions to signal errors now
// see https://gist.github.com/nkuln/2020860
typedef void (*cxa_throw_type)(void *, void *, void (*) (void *));
cxa_throw_type orig_cxa_throw = 0;
@@ -45,7 +44,7 @@ void load_orig_throw_code() {
}
extern "C"
-void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) {
+CXA_THROW_SIGNATURE {
std::cerr << __FUNCTION__ << " will throw exception from " << std::endl;
if (orig_cxa_throw == 0)
load_orig_throw_code();
@@ -57,13 +56,11 @@ void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) {
}
#endif
#endif
-#endif
// see http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c
void customTerminate() {
static bool tried_throw = false;
-
try {
// try once to re-throw currently active exception
if (!tried_throw) {
@@ -142,6 +139,7 @@ int main(int argc, char** argv) {
DebuggerServlet* debugger;
if (options.withDebugger) {
debugger = new DebuggerServlet();
+ debugger->copyToInvokers(true);
HTTPServer::getInstance()->registerServlet("/debug", debugger);
}
#endif
@@ -173,6 +171,7 @@ int main(int argc, char** argv) {
if (options.verbose) {
StateTransitionMonitor* vm = new StateTransitionMonitor();
+ vm->copyToInvokers(true);
interpreter.addMonitor(vm);
}
diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp
index c2c0215..77537f5 100644
--- a/apps/uscxml-transform.cpp
+++ b/apps/uscxml-transform.cpp
@@ -75,11 +75,15 @@ void printUsageAndExit(const char* progName) {
printf("\t-t tex : write global state transition table as tex file\n");
printf("\t-a {OPTIONS} : annotate SCXML elements with comma seperated options\n");
printf("\t 'priority' - transitions with their priority for transition selection\n");
+ printf("\t 'exitset' - annotate all transitions with their exit sets\n");
+ printf("\t 'entryset' - annotate all transitions with their entry sets\n");
+ printf("\t 'conflicts' - annotate all transitions with their conflicts\n");
+ printf("\t 'domain' - annotate all transitions with their domain\n");
printf("\t 'step' - global states with their step identifier (-tflat only)\n");
printf("\t 'members' - global transitions with their member transitions per index (-tflat only)\n");
printf("\t 'sends' - transititve number of sends to external queue for global transitions (-tflat only)\n");
printf("\t 'raises' - transititve number of raises to internal queue for global transitions (-tflat only)\n");
- printf("\t 'verbose' - comments detailling state changes and transitions for content selection (-tflat only)\n");
+ printf("\t 'verbose' - comments detailling state changes and transitions for content selection (-tflat only)\n");
printf("\t 'progress' - insert comments documenting progress in dociment (-tmin only)\n");
printf("\t 'nocomment' - surpress the generation of comments in output\n");
printf("\t-v : be verbose\n");
@@ -174,6 +178,18 @@ int main(int argc, char** argv) {
if (ANNOTATE("USCXML_ANNOTATE_VERBOSE_COMMENTS", "verbose"))
setenv("USCXML_ANNOTATE_VERBOSE_COMMENTS", "YES", 1);
+ if (ANNOTATE("USCXML_ANNOTATE_TRANS_EXITSET", "exitset"))
+ setenv("USCXML_ANNOTATE_TRANS_EXITSET", "YES", 1);
+
+ if (ANNOTATE("USCXML_ANNOTATE_TRANS_DOMAIN", "domain"))
+ setenv("USCXML_ANNOTATE_TRANS_DOMAIN", "YES", 1);
+
+ if (ANNOTATE("USCXML_ANNOTATE_TRANS_CONFLICTS", "conflicts"))
+ setenv("USCXML_ANNOTATE_TRANS_CONFLICTS", "YES", 1);
+
+ if (ANNOTATE("USCXML_ANNOTATE_TRANS_ENTRYSET", "entryset"))
+ setenv("USCXML_ANNOTATE_TRANS_ENTRYSET", "YES", 1);
+
if(ANNOTATE("USCXML_ANNOTATE_GLOBAL_TRANS_MEMBERS", "members"))
setenv("USCXML_ANNOTATE_GLOBAL_TRANS_MEMBERS", "YES", 1);
@@ -202,11 +218,15 @@ int main(int argc, char** argv) {
// printUsageAndExit(argv[0]);
if (outType != "flat" &&
- outType != "scxml" &&
- outType != "pml" &&
- outType != "min" &&
- outType != "tex" &&
- std::find(annotations.begin(), annotations.end(), "priority") == annotations.end())
+ outType != "scxml" &&
+ outType != "pml" &&
+ outType != "min" &&
+ outType != "tex" &&
+ std::find(annotations.begin(), annotations.end(), "priority") == annotations.end() &&
+ std::find(annotations.begin(), annotations.end(), "domain") == annotations.end() &&
+ std::find(annotations.begin(), annotations.end(), "conflicts") == annotations.end() &&
+ std::find(annotations.begin(), annotations.end(), "exitset") == annotations.end() &&
+ std::find(annotations.begin(), annotations.end(), "entryset") == annotations.end())
printUsageAndExit(argv[0]);
// register plugins
@@ -243,7 +263,7 @@ int main(int argc, char** argv) {
std::cerr << *issueIter << std::endl;
}
}
-
+
if (outType == "pml") {
if (outputFile.size() == 0 || outputFile == "-") {
ChartToPromela::transform(interpreter).writeTo(std::cout);
@@ -292,24 +312,34 @@ int main(int argc, char** argv) {
exit(EXIT_SUCCESS);
}
+
#if 1
- if (annotations.size() > 0) {
- ChartToFSM annotater(interpreter);
- if (std::find(annotations.begin(), annotations.end(), "priority") != annotations.end())
- annotater.indexTransitions();
-
- if (outputFile.size() == 0 || outputFile == "-") {
- std::cout << annotater.getDocument();
- } else {
- std::ofstream outStream;
- outStream.open(outputFile.c_str());
- outStream << annotater.getDocument();
- outStream.close();
- }
- exit(EXIT_SUCCESS);
- }
+ if (annotations.size() > 0) {
+ ChartToFSM annotater(interpreter);
+ if (std::find(annotations.begin(), annotations.end(), "priority") != annotations.end())
+ annotater.indexTransitions();
+ if (std::find(annotations.begin(), annotations.end(), "conflicts") != annotations.end())
+ annotater.annotateConflicts();
+ if (std::find(annotations.begin(), annotations.end(), "exitset") != annotations.end())
+ annotater.annotateExitSet();
+ if (std::find(annotations.begin(), annotations.end(), "entryset") != annotations.end())
+ annotater.annotateEntrySet();
+ if (std::find(annotations.begin(), annotations.end(), "domain") != annotations.end())
+ annotater.annotateDomain();
+
+ if (outputFile.size() == 0 || outputFile == "-") {
+ std::cout << annotater.getDocument();
+ } else {
+ std::ofstream outStream;
+ outStream.open(outputFile.c_str());
+ outStream << annotater.getDocument();
+ outStream.close();
+ }
+ exit(EXIT_SUCCESS);
+ }
#endif
-
+
+
} catch (Event e) {
std::cout << e << std::endl;
}
diff --git a/apps/w3c-mmi/im/uscxml-interaction-manager.cpp b/apps/w3c-mmi/im/uscxml-interaction-manager.cpp
index 9d93a55..b6b75f6 100644
--- a/apps/w3c-mmi/im/uscxml-interaction-manager.cpp
+++ b/apps/w3c-mmi/im/uscxml-interaction-manager.cpp
@@ -62,7 +62,7 @@ void load_orig_throw_code() {
}
extern "C"
-void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) {
+CXA_THROW_SIGNATURE {
std::cerr << __FUNCTION__ << " will throw exception from " << std::endl;
if (orig_cxa_throw == 0)
load_orig_throw_code();
diff --git a/apps/w3c-mmi/mc/uscxml-modality-component.cpp b/apps/w3c-mmi/mc/uscxml-modality-component.cpp
index 5b06279..4901dbd 100644
--- a/apps/w3c-mmi/mc/uscxml-modality-component.cpp
+++ b/apps/w3c-mmi/mc/uscxml-modality-component.cpp
@@ -59,7 +59,7 @@ void load_orig_throw_code() {
}
extern "C"
-void __cxa_throw (void *thrown_exception, void *pvtinfo, void (*dest)(void *)) {
+CXA_THROW_SIGNATURE {
std::cerr << __FUNCTION__ << " will throw exception from " << std::endl;
if (orig_cxa_throw == 0)
load_orig_throw_code();