summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-03-11 14:45:38 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-03-11 14:45:38 (GMT)
commitc34e0ce034586a05308e552cbbdff48beec7dd96 (patch)
tree39c73ba64b0d228b3c53913ea4e7ab6dda6ad5c1 /test
parentca46aa711fb5d08a8fd1cc6b91593c281189e8e3 (diff)
downloaduscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.zip
uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.gz
uscxml-c34e0ce034586a05308e552cbbdff48beec7dd96.tar.bz2
Integrated debugger into browser (use -d command line parameter)
Diffstat (limited to 'test')
-rw-r--r--test/samples/uscxml/test-dirmon.scxml2
-rw-r--r--test/samples/w3c/draft/calc.scxml158
2 files changed, 159 insertions, 1 deletions
diff --git a/test/samples/uscxml/test-dirmon.scxml b/test/samples/uscxml/test-dirmon.scxml
index 872757f..1fba300 100644
--- a/test/samples/uscxml/test-dirmon.scxml
+++ b/test/samples/uscxml/test-dirmon.scxml
@@ -2,7 +2,7 @@
<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />
<state id="start">
<invoke type="dirmon">
- <param name="dir" expr="'.'" />
+ <param name="dir" expr="'./audio'" />
<param name="recurse" expr="'true'" />
<param name="reportexisting" expr="'true'" />
<param name="suffix" expr="'.scxml'" />
diff --git a/test/samples/w3c/draft/calc.scxml b/test/samples/w3c/draft/calc.scxml
new file mode 100644
index 0000000..e854401
--- /dev/null
+++ b/test/samples/w3c/draft/calc.scxml
@@ -0,0 +1,158 @@
+<?xml version="1.0" ?>
+<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
+ initial="on" datamodel="ecmascript" name="calc">
+ <datamodel>
+ <data id="long_expr" />
+ <data id="short_expr" expr="0" />
+ <data id="res" />
+ </datamodel>
+ <state id="wrapper" initial="on">
+ <state id="on" initial="ready">
+ <onentry>
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <state id="ready" initial="begin">
+ <state id="begin">
+ <transition event="OPER.MINUS" target="negated1" />
+ <onentry>
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ </state>
+ <state id="result">
+ </state>
+ <transition event="OPER" target="opEntered" />
+ <transition event="DIGIT.0" target="zero1">
+ <assign location="short_expr" expr="''" />
+ </transition>
+ <transition event="DIGIT" target="int1">
+ <assign location="short_expr" expr="''" />
+ </transition>
+ <transition event="POINT" target="frac1">
+ <assign location="short_expr" expr="''" />
+ </transition>
+ </state>
+ <state id="negated1">
+ <onentry>
+ <assign location="short_expr" expr="'-'" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <transition event="DIGIT.0" target="zero1" />
+ <transition event="DIGIT" target="int1" />
+ <transition event="POINT" target="frac1" />
+ </state>
+ <state id="operand1">
+ <state id="zero1">
+ <transition event="DIGIT" cond="_event.name != 'DIGIT.0'" target="int1" />
+ <transition event="POINT" target="frac1" />
+ </state>
+ <state id="int1">
+ <transition event="POINT" target="frac1" />
+ <transition event="DIGIT">
+ <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </transition>
+ <onentry>
+ <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ </state>
+ <state id="frac1">
+ <onentry>
+ <assign location="short_expr" expr="short_expr+'.'" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <transition event="DIGIT">
+ <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </transition>
+ </state>
+ <transition event="OPER" target="opEntered" />
+ </state>
+ <state id="opEntered">
+ <transition event="OPER.MINUS" target="negated2" />
+ <transition event="POINT" target="frac2" />
+ <transition event="DIGIT.0" target="zero2" />
+ <transition event="DIGIT" target="int2" />
+ <onentry>
+ <raise event="CALC.SUB" />
+ <send target="_internal" event="OP.INSERT">
+ <param name="operator" expr="_event.name" />
+ </send>
+ </onentry>
+ </state>
+ <state id="negated2">
+ <onentry>
+ <assign location="short_expr" expr="'-'" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <transition event="DIGIT.0" target="zero2" />
+ <transition event="DIGIT" target="int2" />
+ <transition event="POINT" target="frac2" />
+ </state>
+ <state id="operand2">
+ <state id="zero2">
+ <transition event="DIGIT" cond="_event.name != 'DIGIT.0'" target="int2" />
+ <transition event="POINT" target="frac2" />
+ </state>
+ <state id="int2">
+ <transition event="DIGIT">
+ <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </transition>
+ <onentry>
+ <assign location="short_expr" expr="short_expr+_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <transition event="POINT" target="frac2" />
+ </state>
+ <state id="frac2">
+ <onentry>
+ <assign location="short_expr" expr="short_expr +'.'" />
+ <send event="DISPLAY.UPDATE" />
+ </onentry>
+ <transition event="DIGIT">
+ <assign location="short_expr" expr="short_expr +_event.name.substr(_event.name.lastIndexOf('.')+1)" />
+ <send event="DISPLAY.UPDATE" />
+ </transition>
+ </state>
+ <transition event="OPER" target="opEntered">
+ <raise event="CALC.SUB" />
+ <raise event="OP.INSERT" />
+ </transition>
+ <transition event="EQUALS" target="result">
+ <raise event="CALC.SUB" />
+ <raise event="CALC.DO" />
+ </transition>
+ </state>
+ <transition event="C" target="on" />
+ </state>
+ <transition event="CALC.DO">
+ <assign location="short_expr" expr="''+ res" />
+ <assign location="long_expr" expr="''" />
+ <assign location="res" expr="0" />
+ </transition>
+ <transition event="CALC.SUB">
+ <if cond="short_expr!=''">
+ <assign location="long_expr" expr="long_expr+'('+short_expr+')'" />
+ </if>
+ <assign location="res" expr="eval(long_expr)" />
+ <assign location="short_expr" expr="''" />
+ <send event="DISPLAY.UPDATE" />
+ </transition>
+ <transition event="DISPLAY.UPDATE">
+ <!--log level="0" label="'result'" expr=".short_expr==''?res:short_expr" / -->
+ </transition>
+ <transition event="OP.INSERT">
+ <log level="0" expr="_event.data[0]" />
+ <if cond="_event.data[0] == 'OPER.PLUS'">
+ <assign location="long_expr" expr="long_expr+'+'" />
+ <elseif cond="_event.data[0]=='OPER.MINUS'" />
+ <assign location="long_expr" expr="long_expr+'-'" />
+ <elseif cond="_event.data[0]=='OPER.STAR'" />
+ <assign location="long_expr" expr="long_expr+'*'" />
+ <elseif cond="_event.data[0]=='OPER.DIV'" />
+ <assign location="long_expr" expr="long_expr+'/'" />
+ </if>
+ </transition>
+ </state>
+</scxml>