summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
Commit message (Expand)AuthorAgeFilesLines
* Clang-format of source filesAllen Byrne2020-09-301-588/+514
* Merge branch 'develop' into mdc_sl_optmainzer2020-08-151-13/+3
|\
| * Clean up private / package / static namespace issues (function naming, whichQuincey Koziol2020-08-061-13/+3
* | Tab to space conversions.mainzer2020-08-141-140/+140
* | Merge branch 'develop' into mdc_sl_optmainzer2020-08-131-31/+41
|\ \ | |/
| * Fixes -Wnull-dereference warnings around the cache logging callsDana Robinson2020-08-061-30/+40
| * Minor normalizations with 1.12 branchDana Robinson2020-08-011-1/+1
* | When flushing, the metadata cache attempts to flush entries in increasingmainzer2020-08-051-158/+325
|/
* Normalization with hdf5_1_10Dana Robinson2020-06-011-141/+142
* Trim trailing whitespaceQuincey Koziol2020-04-201-33/+33
* Checkin for new shutting down free-space manager.Vailin Choi2019-06-201-41/+27
* Merge branch 'develop' into c_stdlib_posix_call_cleanupDana Robinson2019-02-191-3/+13
|\
| * Modification based on feedback from pull request.Vailin Choi2019-02-061-0/+5
| * There is performance issue when closing an object. The slow down is due to t...Vailin Choi2019-02-051-2/+7
| * Fixed a valgrind issue with the unprotect log message. The loggingDana Robinson2019-01-311-1/+1
* | C and POSIX call cleanupDana Robinson2019-01-111-1/+1
|/
* Updated the log function names.Dana Robinson2018-12-281-24/+24
* Squash merge of MDC logging changes.Dana Robinson2018-12-211-585/+125
* Normalization with vol_integration (misc internal and datatype)Dana Robinson2018-09-201-9/+10
* Fixed HDFFV-10404Binh-Minh Ribler2018-07-131-3/+3
* Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into ...Quincey Koziol2018-03-181-1/+0
|\
* | Add API context interface and use it throughout the library.Quincey Koziol2018-03-151-266/+65
|/
* Merge pull request #426 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5...Larry Knox2017-04-251-6/+4
* Minor style cleanupsQuincey Koziol2017-03-221-1/+2
* Revert "Switch h5clear for cache images to use existing H5Pget_cache_image_co...Quincey Koziol2017-03-221-0/+25
* Checkin of additions to cache image parallel test code andmainzer2017-03-161-2/+11
* Final merge of page buffering branch to developQuincey Koziol2017-03-141-0/+120
* Minor cleanups and bring over "prefetched dirty" fixes for entries loaded fromQuincey Koziol2017-03-121-5/+4
* Align w/incoming page buffering changes.Quincey Koziol2017-02-251-3/+9
* Misc. style cleanups from the page_buffering branch.Quincey Koziol2017-02-181-51/+51
* Cache image feature and testingQuincey Koziol2017-01-291-2/+114
* Bring change to use array of metadata cache entry classes for H5C_createQuincey Koziol2017-01-281-37/+41
* Switch list lengths to unsigned integers (to align better w/cache image merge)Quincey Koziol2017-01-281-1/+1
* Bring changes to metadata cache "get entry status" call and newQuincey Koziol2017-01-061-0/+132
* Add "image up to date" flag / parameter to metadata cache entry status calls.Quincey Koziol2017-01-061-1/+4
* Bring file shutdown code from cache image branchQuincey Koziol2017-01-051-0/+86
* More normalizations against incoming cache image branch.Quincey Koziol2016-12-291-5/+2
* Updated the H5FS cache code to grab the correct tag and modifiedDana Robinson2016-12-081-0/+34
* Bring SWMR support in to the main development branch. (Finally!) More testsQuincey Koziol2016-12-021-0/+189
* Remove 'clear' callback from metadata cache client interface, using theQuincey Koziol2016-11-181-2/+2
* Remove explicit support within the metadata cache for tracked compressedQuincey Koziol2016-11-171-3/+1
* Switch to new, more scalable, metadata cache entry tagging.Quincey Koziol2016-11-071-26/+9
* Code style and warning cleanups, from revise_chunks branch.Quincey Koziol2016-11-061-7/+5
* Bring cache logging routines from revise_chunks branch to develop.Quincey Koziol2016-11-041-4/+199
* Remove static definition for debugging routines. *sigh*Quincey Koziol2016-11-041-2/+0
* Move cache debugging routines into separate module.Quincey Koziol2016-11-031-179/+0
* Merge branch 'develop' into evict_on_closeDana Robinson2016-09-141-1/+3
|\
| * [svn-r30126] Description:Quincey Koziol2016-06-301-1/+3
* | [svn-r30118] Sync with trunk.Dana Robinson2016-06-291-112/+6
|\ \ | |/
| * [svn-r30113] Description:Quincey Koziol2016-06-281-5/+6
mples/w3c/txml/test236.txml | 43 - test/samples/w3c/txml/test237.txml | 45 - test/samples/w3c/txml/test239.txml | 36 - test/samples/w3c/txml/test239sub1.txml | 9 - test/samples/w3c/txml/test240.txml | 71 - test/samples/w3c/txml/test241.txml | 102 - test/samples/w3c/txml/test242.txml | 57 - test/samples/w3c/txml/test242sub1.txml | 9 - test/samples/w3c/txml/test243.txml | 40 - test/samples/w3c/txml/test244.txml | 43 - test/samples/w3c/txml/test245.txml | 38 - test/samples/w3c/txml/test247.txml | 26 - test/samples/w3c/txml/test250.txml | 46 - test/samples/w3c/txml/test252.txml | 51 - test/samples/w3c/txml/test253.txml | 83 - test/samples/w3c/txml/test276.txml | 21 - test/samples/w3c/txml/test276sub1.txml | 24 - test/samples/w3c/txml/test277.txml | 32 - test/samples/w3c/txml/test278.txml | 22 - test/samples/w3c/txml/test279.txml | 25 - test/samples/w3c/txml/test280.txml | 34 - test/samples/w3c/txml/test286.txml | 23 - test/samples/w3c/txml/test287.txml | 23 - test/samples/w3c/txml/test294.txml | 49 - test/samples/w3c/txml/test298.txml | 28 - test/samples/w3c/txml/test301.txml | 17 - test/samples/w3c/txml/test302.txml | 20 - test/samples/w3c/txml/test303.txml | 25 - test/samples/w3c/txml/test304.txml | 18 - test/samples/w3c/txml/test307.txml | 43 - test/samples/w3c/txml/test309.txml | 16 - test/samples/w3c/txml/test310.txml | 23 - test/samples/w3c/txml/test311.txml | 21 - test/samples/w3c/txml/test312.txml | 25 - test/samples/w3c/txml/test313.txml | 26 - test/samples/w3c/txml/test314.txml | 39 - test/samples/w3c/txml/test318.txml | 31 - test/samples/w3c/txml/test319.txml | 25 - test/samples/w3c/txml/test321.txml | 19 - test/samples/w3c/txml/test322.txml | 37 - test/samples/w3c/txml/test323.txml | 19 - test/samples/w3c/txml/test324.txml | 25 - test/samples/w3c/txml/test325.txml | 22 - test/samples/w3c/txml/test326.txml | 38 - test/samples/w3c/txml/test329.txml | 55 - test/samples/w3c/txml/test330.txml | 27 - test/samples/w3c/txml/test331.txml | 62 - test/samples/w3c/txml/test332.txml | 33 - test/samples/w3c/txml/test333.txml | 20 - test/samples/w3c/txml/test335.txml | 20 - test/samples/w3c/txml/test336.txml | 29 - test/samples/w3c/txml/test337.txml | 20 - test/samples/w3c/txml/test338.txml | 43 - test/samples/w3c/txml/test339.txml | 20 - test/samples/w3c/txml/test342.txml | 28 - test/samples/w3c/txml/test343.txml | 37 - test/samples/w3c/txml/test344.txml | 27 - test/samples/w3c/txml/test346.txml | 57 - test/samples/w3c/txml/test347.txml | 44 - test/samples/w3c/txml/test348.txml | 20 - test/samples/w3c/txml/test349.txml | 33 - test/samples/w3c/txml/test350.txml | 26 - test/samples/w3c/txml/test351.txml | 52 - test/samples/w3c/txml/test352.txml | 32 - test/samples/w3c/txml/test354.txml | 56 - test/samples/w3c/txml/test355.txml | 18 - test/samples/w3c/txml/test364.txml | 77 - test/samples/w3c/txml/test372.txml | 32 - test/samples/w3c/txml/test375.txml | 30 - test/samples/w3c/txml/test376.txml | 26 - test/samples/w3c/txml/test377.txml | 35 - test/samples/w3c/txml/test378.txml | 29 - test/samples/w3c/txml/test387.txml | 101 - test/samples/w3c/txml/test388.txml | 80 - test/samples/w3c/txml/test396.txml | 20 - test/samples/w3c/txml/test399.txml | 70 - test/samples/w3c/txml/test401.txml | 25 - test/samples/w3c/txml/test402.txml | 44 - test/samples/w3c/txml/test403a.txml | 47 - test/samples/w3c/txml/test403b.txml | 44 - test/samples/w3c/txml/test403c.txml | 58 - test/samples/w3c/txml/test404.txml | 64 - test/samples/w3c/txml/test405.txml | 71 - test/samples/w3c/txml/test406.txml | 68 - test/samples/w3c/txml/test407.txml | 24 - test/samples/w3c/txml/test409.txml | 36 - test/samples/w3c/txml/test411.txml | 36 - test/samples/w3c/txml/test412.txml | 56 - test/samples/w3c/txml/test413.txml | 49 - test/samples/w3c/txml/test415.txml | 15 - test/samples/w3c/txml/test416.txml | 26 - test/samples/w3c/txml/test417.txml | 39 - test/samples/w3c/txml/test419.txml | 22 - test/samples/w3c/txml/test421.txml | 33 - test/samples/w3c/txml/test422.txml | 78 - test/samples/w3c/txml/test423.txml | 28 - test/samples/w3c/txml/test436.txml | 24 - test/samples/w3c/txml/test444.txml | 20 - test/samples/w3c/txml/test445.txml | 20 - test/samples/w3c/txml/test448.txml | 35 - test/samples/w3c/txml/test449.txml | 15 - test/samples/w3c/txml/test451.txml | 23 - test/samples/w3c/txml/test452.txml | 27 - test/samples/w3c/txml/test453.txml | 22 - test/samples/w3c/txml/test456.txml | 22 - test/samples/w3c/txml/test457.txml | 62 - test/samples/w3c/txml/test460.txml | 26 - test/samples/w3c/txml/test463.txml | 22 - test/samples/w3c/txml/test464.txml | 21 - test/samples/w3c/txml/test465.txml | 27 - test/samples/w3c/txml/test466.txml | 19 - test/samples/w3c/txml/test467.txml | 17 - test/samples/w3c/txml/test468.txml | 28 - test/samples/w3c/txml/test469.txml | 29 - test/samples/w3c/txml/test470.txml | 28 - test/samples/w3c/txml/test473.txml | 44 - test/samples/w3c/txml/test474.txml | 43 - test/samples/w3c/txml/test475.txml | 43 - test/samples/w3c/txml/test476.txml | 43 - test/samples/w3c/txml/test477.txml | 43 - test/samples/w3c/txml/test478.txml | 40 - test/samples/w3c/txml/test479.txml | 40 - test/samples/w3c/txml/test480.txml | 36 - test/samples/w3c/txml/test481.txml | 41 - test/samples/w3c/txml/test482.txml | 23 - test/samples/w3c/txml/test483.txml | 31 - test/samples/w3c/txml/test487.txml | 21 - test/samples/w3c/txml/test488.txml | 37 - test/samples/w3c/txml/test495.txml | 26 - test/samples/w3c/txml/test500.txml | 19 - test/samples/w3c/txml/test501.txml | 23 - test/samples/w3c/txml/test503.txml | 41 - test/samples/w3c/txml/test504.txml | 79 - test/samples/w3c/txml/test505.txml | 51 - test/samples/w3c/txml/test506.txml | 57 - test/samples/w3c/txml/test509.txml | 21 - test/samples/w3c/txml/test510.txml | 28 - test/samples/w3c/txml/test513.txml | 54 - test/samples/w3c/txml/test518.txml | 25 - test/samples/w3c/txml/test519.txml | 21 - test/samples/w3c/txml/test520.txml | 21 - test/samples/w3c/txml/test521.txml | 27 - test/samples/w3c/txml/test522.txml | 27 - test/samples/w3c/txml/test525.txml | 30 - test/samples/w3c/txml/test527.txml | 28 - test/samples/w3c/txml/test528.txml | 36 - test/samples/w3c/txml/test529.txml | 28 - test/samples/w3c/txml/test530.txml | 30 - test/samples/w3c/txml/test531.txml | 22 - test/samples/w3c/txml/test532.txml | 22 - test/samples/w3c/txml/test533.txml | 66 - test/samples/w3c/txml/test534.txml | 20 - test/samples/w3c/txml/test537.txml | 22 - test/samples/w3c/txml/test539.txml | 30 - test/samples/w3c/txml/test539.txt | 4 - test/samples/w3c/txml/test540.txml | 25 - test/samples/w3c/txml/test540.txt | 3 - test/samples/w3c/txml/test542.txml | 38 - test/samples/w3c/txml/test543.txml | 22 - test/samples/w3c/txml/test544.txml | 21 - test/samples/w3c/txml/test546.txml | 21 - test/samples/w3c/txml/test547.txml | 38 - test/samples/w3c/txml/test550.txml | 24 - test/samples/w3c/txml/test551.txml | 27 - test/samples/w3c/txml/test552.txml | 22 - test/samples/w3c/txml/test552.txt | 1 - test/samples/w3c/txml/test553.txml | 27 - test/samples/w3c/txml/test554.txml | 29 - test/samples/w3c/txml/test555.txml | 31 - test/samples/w3c/txml/test557.txml | 30 - test/samples/w3c/txml/test557.txt | 4 - test/samples/w3c/txml/test558.txml | 28 - test/samples/w3c/txml/test558.txt | 3 - test/samples/w3c/txml/test560.txml | 23 - test/samples/w3c/txml/test561.txml | 29 - test/samples/w3c/txml/test562.txml | 26 - test/samples/w3c/txml/test567.txml | 32 - test/samples/w3c/txml/test568.txml | 19 - test/samples/w3c/txml/test569.txml | 19 - test/samples/w3c/txml/test570.txml | 49 - test/samples/w3c/txml/test576.txml | 41 - test/samples/w3c/txml/test578.txml | 24 - test/samples/w3c/update-txml.sh | 7 - test/samples/w3c/xpath/robots.txt | 96 - test/samples/w3c/xpath/test144.scxml | 23 - test/samples/w3c/xpath/test147.scxml | 30 - test/samples/w3c/xpath/test148.scxml | 31 - test/samples/w3c/xpath/test149.scxml | 25 - test/samples/w3c/xpath/test150.scxml | 41 - test/samples/w3c/xpath/test151.scxml | 41 - test/samples/w3c/xpath/test152.scxml | 48 - test/samples/w3c/xpath/test153.scxml | 35 - test/samples/w3c/xpath/test155.scxml | 26 - test/samples/w3c/xpath/test156.scxml | 28 - test/samples/w3c/xpath/test158.scxml | 23 - test/samples/w3c/xpath/test159.scxml | 20 - test/samples/w3c/xpath/test172.scxml | 20 - test/samples/w3c/xpath/test173.scxml | 21 - test/samples/w3c/xpath/test174.scxml | 21 - test/samples/w3c/xpath/test175.scxml | 27 - test/samples/w3c/xpath/test176.scxml | 30 - test/samples/w3c/xpath/test178.scxml | 27 - test/samples/w3c/xpath/test179.scxml | 18 - test/samples/w3c/xpath/test183.scxml | 21 - test/samples/w3c/xpath/test185.scxml | 23 - test/samples/w3c/xpath/test186.scxml | 31 - test/samples/w3c/xpath/test187.scxml | 33 - test/samples/w3c/xpath/test189.scxml | 22 - test/samples/w3c/xpath/test190.scxml | 35 - test/samples/w3c/xpath/test191.scxml | 31 - test/samples/w3c/xpath/test192.scxml | 55 - test/samples/w3c/xpath/test193.scxml | 19 - test/samples/w3c/xpath/test194.scxml | 22 - test/samples/w3c/xpath/test198.scxml | 19 - test/samples/w3c/xpath/test199.scxml | 18 - test/samples/w3c/xpath/test200.scxml | 18 - test/samples/w3c/xpath/test201.scxml | 19 - test/samples/w3c/xpath/test205.scxml | 30 - test/samples/w3c/xpath/test207.scxml | 56 - test/samples/w3c/xpath/test208.scxml | 21 - test/samples/w3c/xpath/test210.scxml | 24 - test/samples/w3c/xpath/test215.scxml | 29 - test/samples/w3c/xpath/test216.scxml | 22 - test/samples/w3c/xpath/test216sub1.scxml | 5 - test/samples/w3c/xpath/test220.scxml | 21 - test/samples/w3c/xpath/test223.scxml | 29 - test/samples/w3c/xpath/test224.scxml | 31 - test/samples/w3c/xpath/test225.scxml | 38 - test/samples/w3c/xpath/test226.scxml | 23 - test/samples/w3c/xpath/test226sub1.scxml | 16 - test/samples/w3c/xpath/test228.scxml | 33 - test/samples/w3c/xpath/test229.scxml | 42 - test/samples/w3c/xpath/test230.scxml | 62 - test/samples/w3c/xpath/test232.scxml | 40 - test/samples/w3c/xpath/test233.scxml | 35 - test/samples/w3c/xpath/test234.scxml | 66 - test/samples/w3c/xpath/test235.scxml | 23 - test/samples/w3c/xpath/test236.scxml | 39 - test/samples/w3c/xpath/test237.scxml | 41 - test/samples/w3c/xpath/test239.scxml | 32 - test/samples/w3c/xpath/test239sub1.scxml | 5 - test/samples/w3c/xpath/test240.scxml | 67 - test/samples/w3c/xpath/test241.scxml | 98 - test/samples/w3c/xpath/test242.scxml | 53 - test/samples/w3c/xpath/test242sub1.scxml | 5 - test/samples/w3c/xpath/test243.scxml | 36 - test/samples/w3c/xpath/test244.scxml | 39 - test/samples/w3c/xpath/test245.scxml | 34 - test/samples/w3c/xpath/test247.scxml | 22 - test/samples/w3c/xpath/test250.scxml | 42 - test/samples/w3c/xpath/test252.scxml | 47 - test/samples/w3c/xpath/test253.scxml | 79 - test/samples/w3c/xpath/test276.scxml | 17 - test/samples/w3c/xpath/test276sub1.scxml | 21 - test/samples/w3c/xpath/test277.scxml | 28 - test/samples/w3c/xpath/test278.scxml | 21 - test/samples/w3c/xpath/test279.scxml | 21 - test/samples/w3c/xpath/test280.scxml | 28 - test/samples/w3c/xpath/test286.scxml | 18 - test/samples/w3c/xpath/test287.scxml | 19 - test/samples/w3c/xpath/test294.scxml | 46 - test/samples/w3c/xpath/test298.scxml | 23 - test/samples/w3c/xpath/test301.scxml | 13 - test/samples/w3c/xpath/test302.scxml | 15 - test/samples/w3c/xpath/test303.scxml | 20 - test/samples/w3c/xpath/test304.scxml | 13 - test/samples/w3c/xpath/test307.scxml | 42 - test/samples/w3c/xpath/test309.scxml | 12 - test/samples/w3c/xpath/test310.scxml | 18 - test/samples/w3c/xpath/test311.scxml | 16 - test/samples/w3c/xpath/test312.scxml | 20 - test/samples/w3c/xpath/test313.scxml | 21 - test/samples/w3c/xpath/test314.scxml | 34 - test/samples/w3c/xpath/test318.scxml | 27 - test/samples/w3c/xpath/test319.scxml | 20 - test/samples/w3c/xpath/test321.scxml | 15 - test/samples/w3c/xpath/test322.scxml | 33 - test/samples/w3c/xpath/test323.scxml | 15 - test/samples/w3c/xpath/test324.scxml | 21 - test/samples/w3c/xpath/test325.scxml | 18 - test/samples/w3c/xpath/test326.scxml | 35 - test/samples/w3c/xpath/test329.scxml | 53 - test/samples/w3c/xpath/test330.scxml | 23 - test/samples/w3c/xpath/test331.scxml | 60 - test/samples/w3c/xpath/test332.scxml | 29 - test/samples/w3c/xpath/test333.scxml | 16 - test/samples/w3c/xpath/test335.scxml | 16 - test/samples/w3c/xpath/test336.scxml | 25 - test/samples/w3c/xpath/test337.scxml | 16 - test/samples/w3c/xpath/test338.scxml | 39 - test/samples/w3c/xpath/test339.scxml | 16 - test/samples/w3c/xpath/test342.scxml | 25 - test/samples/w3c/xpath/test343.scxml | 34 - test/samples/w3c/xpath/test344.scxml | 23 - test/samples/w3c/xpath/test346.scxml | 53 - test/samples/w3c/xpath/test347.scxml | 40 - test/samples/w3c/xpath/test348.scxml | 18 - test/samples/w3c/xpath/test349.scxml | 29 - test/samples/w3c/xpath/test350.scxml | 22 - test/samples/w3c/xpath/test351.scxml | 48 - test/samples/w3c/xpath/test352.scxml | 29 - test/samples/w3c/xpath/test354.scxml | 52 - test/samples/w3c/xpath/test355.scxml | 14 - test/samples/w3c/xpath/test364.scxml | 73 - test/samples/w3c/xpath/test372.scxml | 28 - test/samples/w3c/xpath/test375.scxml | 26 - test/samples/w3c/xpath/test376.scxml | 22 - test/samples/w3c/xpath/test377.scxml | 31 - test/samples/w3c/xpath/test378.scxml | 25 - test/samples/w3c/xpath/test387.scxml | 97 - test/samples/w3c/xpath/test388.scxml | 76 - test/samples/w3c/xpath/test396.scxml | 16 - test/samples/w3c/xpath/test399.scxml | 66 - test/samples/w3c/xpath/test401.scxml | 21 - test/samples/w3c/xpath/test402.scxml | 40 - test/samples/w3c/xpath/test403a.scxml | 43 - test/samples/w3c/xpath/test403b.scxml | 40 - test/samples/w3c/xpath/test403c.scxml | 54 - test/samples/w3c/xpath/test404.scxml | 60 - test/samples/w3c/xpath/test405.scxml | 67 - test/samples/w3c/xpath/test406.scxml | 64 - test/samples/w3c/xpath/test407.scxml | 20 - test/samples/w3c/xpath/test409.scxml | 32 - test/samples/w3c/xpath/test411.scxml | 32 - test/samples/w3c/xpath/test412.scxml | 52 - test/samples/w3c/xpath/test413.scxml | 45 - test/samples/w3c/xpath/test415.scxml | 12 - test/samples/w3c/xpath/test416.scxml | 22 - test/samples/w3c/xpath/test417.scxml | 34 - test/samples/w3c/xpath/test419.scxml | 17 - test/samples/w3c/xpath/test421.scxml | 28 - test/samples/w3c/xpath/test422.scxml | 75 - test/samples/w3c/xpath/test423.scxml | 25 - test/samples/w3c/xpath/test436.scxml | 21 - test/samples/w3c/xpath/test444.scxml | 16 - test/samples/w3c/xpath/test445.scxml | 16 - test/samples/w3c/xpath/test448.scxml | 31 - test/samples/w3c/xpath/test449.scxml | 11 - test/samples/w3c/xpath/test451.scxml | 18 - test/samples/w3c/xpath/test452.scxml | 24 - test/samples/w3c/xpath/test453.scxml | 19 - test/samples/w3c/xpath/test456.scxml | 19 - test/samples/w3c/xpath/test457.scxml | 59 - test/samples/w3c/xpath/test460.scxml | 24 - test/samples/w3c/xpath/test463.scxml | 17 - test/samples/w3c/xpath/test464.scxml | 16 - test/samples/w3c/xpath/test465.scxml | 22 - test/samples/w3c/xpath/test466.scxml | 14 - test/samples/w3c/xpath/test467.scxml | 12 - test/samples/w3c/xpath/test468.scxml | 23 - test/samples/w3c/xpath/test469.scxml | 25 - test/samples/w3c/xpath/test470.scxml | 24 - test/samples/w3c/xpath/test473.scxml | 37 - test/samples/w3c/xpath/test474.scxml | 36 - test/samples/w3c/xpath/test475.scxml | 36 - test/samples/w3c/xpath/test476.scxml | 36 - test/samples/w3c/xpath/test477.scxml | 36 - test/samples/w3c/xpath/test478.scxml | 36 - test/samples/w3c/xpath/test479.scxml | 36 - test/samples/w3c/xpath/test480.scxml | 32 - test/samples/w3c/xpath/test481.scxml | 37 - test/samples/w3c/xpath/test482.scxml | 16 - test/samples/w3c/xpath/test483.scxml | 27 - test/samples/w3c/xpath/test487.scxml | 17 - test/samples/w3c/xpath/test488.scxml | 34 - test/samples/w3c/xpath/test495.scxml | 23 - test/samples/w3c/xpath/test500.scxml | 15 - test/samples/w3c/xpath/test501.scxml | 19 - test/samples/w3c/xpath/test503.scxml | 37 - test/samples/w3c/xpath/test504.scxml | 75 - test/samples/w3c/xpath/test505.scxml | 47 - test/samples/w3c/xpath/test506.scxml | 53 - test/samples/w3c/xpath/test509.scxml | 17 - test/samples/w3c/xpath/test510.scxml | 24 - test/samples/w3c/xpath/test513.scxml | 50 - test/samples/w3c/xpath/test518.scxml | 20 - test/samples/w3c/xpath/test519.scxml | 19 - test/samples/w3c/xpath/test520.scxml | 19 - test/samples/w3c/xpath/test521.scxml | 23 - test/samples/w3c/xpath/test522.scxml | 22 - test/samples/w3c/xpath/test525.scxml | 26 - test/samples/w3c/xpath/test527.scxml | 25 - test/samples/w3c/xpath/test528.scxml | 33 - test/samples/w3c/xpath/test529.scxml | 25 - test/samples/w3c/xpath/test530.scxml | 26 - test/samples/w3c/xpath/test531.scxml | 20 - test/samples/w3c/xpath/test532.scxml | 20 - test/samples/w3c/xpath/test533.scxml | 62 - test/samples/w3c/xpath/test534.scxml | 18 - test/samples/w3c/xpath/test537.scxml | 17 - test/samples/w3c/xpath/test539.scxml | 26 - test/samples/w3c/xpath/test539.txt | 4 - test/samples/w3c/xpath/test540.scxml | 21 - test/samples/w3c/xpath/test540.txt | 3 - test/samples/w3c/xpath/test542.scxml | 34 - test/samples/w3c/xpath/test543.scxml | 18 - test/samples/w3c/xpath/test544.scxml | 17 - test/samples/w3c/xpath/test546.scxml | 17 - test/samples/w3c/xpath/test547.scxml | 33 - test/samples/w3c/xpath/test550.scxml | 20 - test/samples/w3c/xpath/test551.scxml | 23 - test/samples/w3c/xpath/test552.scxml | 18 - test/samples/w3c/xpath/test552.txt | 1 - test/samples/w3c/xpath/test553.scxml | 23 - test/samples/w3c/xpath/test554.scxml | 25 - test/samples/w3c/xpath/test555.scxml | 27 - test/samples/w3c/xpath/test557.scxml | 26 - test/samples/w3c/xpath/test557.txt | 4 - test/samples/w3c/xpath/test558.scxml | 24 - test/samples/w3c/xpath/test558.txt | 3 - test/samples/w3c/xpath/test560.scxml | 19 - test/samples/w3c/xpath/test561.scxml | 24 - test/samples/w3c/xpath/test562.scxml | 22 - test/samples/w3c/xpath/test567.scxml | 30 - test/samples/w3c/xpath/test568.scxml | 15 - test/samples/w3c/xpath/test569.scxml | 15 - test/samples/w3c/xpath/test570.scxml | 45 - test/samples/w3c/xpath/test576.scxml | 37 - test/samples/w3c/xpath/test578.scxml | 19 - test/schema/scxml-attribs.xsd | 57 - test/schema/scxml-contentmodels.xsd | 35 - test/schema/scxml-datatypes.xsd | 203 - test/schema/scxml-module-core.xsd | 405 - test/schema/scxml-module-data.xsd | 151 - test/schema/scxml-module-external.xsd | 152 - test/schema/scxml.xsd | 88 - test/src/test-arabica-namespaces.cpp | 221 + test/src/test-promela-parser.cpp | 89 +- test/src/test-trie.cpp | 92 + test/src/test-w3c.cpp | 16 +- test/uscxml/applications/SpatialMapTicker.java | 153 + test/uscxml/applications/click.wav | Bin 0 -> 5058 bytes test/uscxml/applications/spoken-map-ticker.scxml | 78 + test/uscxml/applications/spoken-map-ticker.xhtml | 240 + test/uscxml/arabica/test-arabica-events.xml | 10 + test/uscxml/arabica/test-arabica-parsing.xml | 6 + test/uscxml/audio/click.wav | Bin 0 -> 5058 bytes .../chartToFSM/test-event-desc-merging.scxml | 17 + .../chartToFSM/test-event-set-conflict.scxml | 19 + test/uscxml/chartToFSM/test-flattening.scxml | 35 + test/uscxml/prolog/likes.pl | 38 + test/uscxml/promela/test-invokers.scxml | 21 + test/uscxml/promela/test-non-progress.scxml | 17 + test/uscxml/promela/test-progress-label.scxml | 20 + test/uscxml/promela/test-simple.scxml | 15 + test/uscxml/promela/test-syntax.scxml | 122 + test/uscxml/proto/3DViewer/CameraPos.proto | 9 + .../proto/3DViewer/DirectoryListingService.proto | 48 + test/uscxml/proto/3DViewer/LinearAlgebra.proto | 18 + test/uscxml/proto/3DViewer/ModelInfo.proto | 10 + test/uscxml/proto/3DViewer/Pose.proto | 22 + test/uscxml/proto/3DViewer/SceneSetup.proto | 8 + test/uscxml/proto/3DViewer/SceneShotService.proto | 24 + test/uscxml/proto/Dependee.proto | 3 + test/uscxml/proto/Depender.proto | 5 + test/uscxml/proto/JSON.proto | 6 + test/uscxml/proto/Test.proto | 37 + test/uscxml/proto/TestServices.proto | 23 + test/uscxml/scenegraph/HARD_MP_VAL_000.wrl | 33435 +++++++++++++++++++ test/uscxml/scripts/GreatCircle.js | 46 + test/uscxml/scripts/test-simple-ecmascript.scxml | 12 + test/uscxml/scxml-gui-test.scxml | 13 + test/uscxml/templates/mc-html.html | 348 + test/uscxml/templates/xhtml-invoker.html | 228 + test/uscxml/test-calendar.scxml | 93 + test/uscxml/test-communication.scxml | 65 + test/uscxml/test-custom-executable-content.scxml | 19 + test/uscxml/test-dirmon.scxml | 16 + test/uscxml/test-dom.scxml | 19 + test/uscxml/test-donedata.scxml | 37 + test/uscxml/test-ecmascript.scxml | 110 + test/uscxml/test-execution.scxml | 60 + test/uscxml/test-expect.scxml | 64 + test/uscxml/test-ffmpeg.scxml | 5 + test/uscxml/test-file-element.scxml | 17 + test/uscxml/test-http-servlet.scxml | 41 + test/uscxml/test-imap.scxml | 42 + test/uscxml/test-initial-config.scxml | 58 + test/uscxml/test-instant-messaging.scxml | 54 + test/uscxml/test-invoked.scxml | 29 + test/uscxml/test-java-datamodel.scxml | 106 + test/uscxml/test-java-invoker.scxml | 40 + test/uscxml/test-jvoicexml.scxml | 57 + test/uscxml/test-markup-passing.scxml | 54 + test/uscxml/test-markup.xml | 6 + test/uscxml/test-mmi-events.scxml | 88 + test/uscxml/test-mmi-im.scxml | 76 + test/uscxml/test-mmi-mc.scxml | 83 + test/uscxml/test-openal.scxml | 125 + test/uscxml/test-osgconvert.scxml | 40 + test/uscxml/test-performance.scxml | 16 + test/uscxml/test-postpone-element.scxml | 41 + test/uscxml/test-predicates.scxml | 9 + test/uscxml/test-prolog.scxml | 89 + test/uscxml/test-response-element.scxml | 14 + test/uscxml/test-scenegraph.scxml | 70 + test/uscxml/test-simplest.scxml | 3 + test/uscxml/test-smtp.scxml | 52 + test/uscxml/test-spatial-audio.scxml | 75 + test/uscxml/test-startup-time.scxml | 4 + test/uscxml/test-umundo-map-demo.scxml | 71 + test/uscxml/test-umundo-pingpong.scxml | 21 + test/uscxml/test-umundo-rpc.scxml | 60 + test/uscxml/test-umundo-s11n-chat.scxml | 16 + test/uscxml/test-umundo-s11n.scxml | 58 + test/uscxml/test-xhtml-invoker.scxml | 33 + test/w3c/confEcma.xsl | 720 + test/w3c/confXPath.xsl | 630 + test/w3c/convert-tests.sh | 23 + test/w3c/draft/calc.scxml | 158 + test/w3c/ecma/robots.txt | 96 + test/w3c/ecma/test144.scxml | 23 + test/w3c/ecma/test147.scxml | 30 + test/w3c/ecma/test148.scxml | 31 + test/w3c/ecma/test149.scxml | 25 + test/w3c/ecma/test150.scxml | 41 + test/w3c/ecma/test151.scxml | 41 + test/w3c/ecma/test152.scxml | 48 + test/w3c/ecma/test153.scxml | 35 + test/w3c/ecma/test155.scxml | 26 + test/w3c/ecma/test156.scxml | 28 + test/w3c/ecma/test158.scxml | 23 + test/w3c/ecma/test159.scxml | 20 + test/w3c/ecma/test172.scxml | 20 + test/w3c/ecma/test173.scxml | 21 + test/w3c/ecma/test174.scxml | 21 + test/w3c/ecma/test175.scxml | 27 + test/w3c/ecma/test176.scxml | 30 + test/w3c/ecma/test178.scxml | 27 + test/w3c/ecma/test179.scxml | 18 + test/w3c/ecma/test183.scxml | 21 + test/w3c/ecma/test185.scxml | 23 + test/w3c/ecma/test186.scxml | 31 + test/w3c/ecma/test187.scxml | 33 + test/w3c/ecma/test189.scxml | 22 + test/w3c/ecma/test190.scxml | 35 + test/w3c/ecma/test191.scxml | 31 + test/w3c/ecma/test192.scxml | 55 + test/w3c/ecma/test193.scxml | 19 + test/w3c/ecma/test194.scxml | 22 + test/w3c/ecma/test198.scxml | 19 + test/w3c/ecma/test199.scxml | 18 + test/w3c/ecma/test200.scxml | 18 + test/w3c/ecma/test201.scxml | 19 + test/w3c/ecma/test205.scxml | 30 + test/w3c/ecma/test207.scxml | 56 + test/w3c/ecma/test208.scxml | 21 + test/w3c/ecma/test210.scxml | 24 + test/w3c/ecma/test215.scxml | 29 + test/w3c/ecma/test216.scxml | 22 + test/w3c/ecma/test216sub1.scxml | 5 + test/w3c/ecma/test220.scxml | 21 + test/w3c/ecma/test223.scxml | 29 + test/w3c/ecma/test224.scxml | 31 + test/w3c/ecma/test225.scxml | 38 + test/w3c/ecma/test226.scxml | 23 + test/w3c/ecma/test226sub1.scxml | 16 + test/w3c/ecma/test228.scxml | 33 + test/w3c/ecma/test229.scxml | 42 + test/w3c/ecma/test230.scxml | 62 + test/w3c/ecma/test232.scxml | 40 + test/w3c/ecma/test233.scxml | 35 + test/w3c/ecma/test234.scxml | 66 + test/w3c/ecma/test235.scxml | 23 + test/w3c/ecma/test236.scxml | 39 + test/w3c/ecma/test237.scxml | 41 + test/w3c/ecma/test239.scxml | 32 + test/w3c/ecma/test239sub1.scxml | 5 + test/w3c/ecma/test240.scxml | 67 + test/w3c/ecma/test241.scxml | 98 + test/w3c/ecma/test242.scxml | 53 + test/w3c/ecma/test242sub1.scxml | 5 + test/w3c/ecma/test243.scxml | 36 + test/w3c/ecma/test244.scxml | 39 + test/w3c/ecma/test245.scxml | 34 + test/w3c/ecma/test247.scxml | 22 + test/w3c/ecma/test250.scxml | 42 + test/w3c/ecma/test252.scxml | 47 + test/w3c/ecma/test253.scxml | 79 + test/w3c/ecma/test276.scxml | 17 + test/w3c/ecma/test276sub1.scxml | 21 + test/w3c/ecma/test277.scxml | 28 + test/w3c/ecma/test278.scxml | 21 + test/w3c/ecma/test279.scxml | 21 + test/w3c/ecma/test280.scxml | 28 + test/w3c/ecma/test286.scxml | 18 + test/w3c/ecma/test287.scxml | 19 + test/w3c/ecma/test294.scxml | 46 + test/w3c/ecma/test298.scxml | 23 + test/w3c/ecma/test301.scxml | 13 + test/w3c/ecma/test302.scxml | 15 + test/w3c/ecma/test303.scxml | 20 + test/w3c/ecma/test304.scxml | 13 + test/w3c/ecma/test307.scxml | 42 + test/w3c/ecma/test309.scxml | 12 + test/w3c/ecma/test310.scxml | 18 + test/w3c/ecma/test311.scxml | 16 + test/w3c/ecma/test312.scxml | 20 + test/w3c/ecma/test313.scxml | 21 + test/w3c/ecma/test314.scxml | 34 + test/w3c/ecma/test318.scxml | 27 + test/w3c/ecma/test319.scxml | 20 + test/w3c/ecma/test321.scxml | 15 + test/w3c/ecma/test322.scxml | 33 + test/w3c/ecma/test323.scxml | 15 + test/w3c/ecma/test324.scxml | 21 + test/w3c/ecma/test325.scxml | 18 + test/w3c/ecma/test326.scxml | 35 + test/w3c/ecma/test329.scxml | 53 + test/w3c/ecma/test330.scxml | 23 + test/w3c/ecma/test331.scxml | 60 + test/w3c/ecma/test332.scxml | 29 + test/w3c/ecma/test333.scxml | 16 + test/w3c/ecma/test335.scxml | 16 + test/w3c/ecma/test336.scxml | 25 + test/w3c/ecma/test337.scxml | 16 + test/w3c/ecma/test338.scxml | 39 + test/w3c/ecma/test339.scxml | 16 + test/w3c/ecma/test342.scxml | 25 + test/w3c/ecma/test343.scxml | 34 + test/w3c/ecma/test344.scxml | 23 + test/w3c/ecma/test346.scxml | 53 + test/w3c/ecma/test347.scxml | 40 + test/w3c/ecma/test348.scxml | 18 + test/w3c/ecma/test349.scxml | 29 + test/w3c/ecma/test350.scxml | 22 + test/w3c/ecma/test351.scxml | 48 + test/w3c/ecma/test352.scxml | 29 + test/w3c/ecma/test354.scxml | 52 + test/w3c/ecma/test355.scxml | 14 + test/w3c/ecma/test364.scxml | 73 + test/w3c/ecma/test372.scxml | 28 + test/w3c/ecma/test375.scxml | 26 + test/w3c/ecma/test376.scxml | 22 + test/w3c/ecma/test377.scxml | 31 + test/w3c/ecma/test378.scxml | 25 + test/w3c/ecma/test387.scxml | 97 + test/w3c/ecma/test388.scxml | 76 + test/w3c/ecma/test396.scxml | 16 + test/w3c/ecma/test399.scxml | 66 + test/w3c/ecma/test401.scxml | 21 + test/w3c/ecma/test402.scxml | 40 + test/w3c/ecma/test403a.scxml | 43 + test/w3c/ecma/test403b.scxml | 40 + test/w3c/ecma/test403c.scxml | 54 + test/w3c/ecma/test404.scxml | 60 + test/w3c/ecma/test405.scxml | 67 + test/w3c/ecma/test406.scxml | 64 + test/w3c/ecma/test407.scxml | 20 + test/w3c/ecma/test409.scxml | 32 + test/w3c/ecma/test411.scxml | 32 + test/w3c/ecma/test412.scxml | 52 + test/w3c/ecma/test413.scxml | 45 + test/w3c/ecma/test415.scxml | 12 + test/w3c/ecma/test416.scxml | 22 + test/w3c/ecma/test417.scxml | 34 + test/w3c/ecma/test419.scxml | 17 + test/w3c/ecma/test421.scxml | 28 + test/w3c/ecma/test422.scxml | 75 + test/w3c/ecma/test423.scxml | 25 + test/w3c/ecma/test436.scxml | 21 + test/w3c/ecma/test444.scxml | 16 + test/w3c/ecma/test445.scxml | 16 + test/w3c/ecma/test448.scxml | 31 + test/w3c/ecma/test449.scxml | 11 + test/w3c/ecma/test451.scxml | 18 + test/w3c/ecma/test452.scxml | 24 + test/w3c/ecma/test453.scxml | 19 + test/w3c/ecma/test456.scxml | 19 + test/w3c/ecma/test457.scxml | 59 + test/w3c/ecma/test460.scxml | 24 + test/w3c/ecma/test463.scxml | 17 + test/w3c/ecma/test464.scxml | 16 + test/w3c/ecma/test465.scxml | 22 + test/w3c/ecma/test466.scxml | 14 + test/w3c/ecma/test467.scxml | 12 + test/w3c/ecma/test468.scxml | 23 + test/w3c/ecma/test469.scxml | 25 + test/w3c/ecma/test470.scxml | 24 + test/w3c/ecma/test473.scxml | 37 + test/w3c/ecma/test474.scxml | 36 + test/w3c/ecma/test475.scxml | 36 + test/w3c/ecma/test476.scxml | 36 + test/w3c/ecma/test477.scxml | 36 + test/w3c/ecma/test478.scxml | 36 + test/w3c/ecma/test479.scxml | 36 + test/w3c/ecma/test480.scxml | 32 + test/w3c/ecma/test481.scxml | 37 + test/w3c/ecma/test482.scxml | 16 + test/w3c/ecma/test483.scxml | 27 + test/w3c/ecma/test487.scxml | 17 + test/w3c/ecma/test488.scxml | 34 + test/w3c/ecma/test495.scxml | 23 + test/w3c/ecma/test500.scxml | 15 + test/w3c/ecma/test501.scxml | 19 + test/w3c/ecma/test503.scxml | 37 + test/w3c/ecma/test504.scxml | 75 + test/w3c/ecma/test505.scxml | 47 + test/w3c/ecma/test506.scxml | 53 + test/w3c/ecma/test509.scxml | 17 + test/w3c/ecma/test510.scxml | 24 + test/w3c/ecma/test513.scxml | 50 + test/w3c/ecma/test518.scxml | 20 + test/w3c/ecma/test519.scxml | 19 + test/w3c/ecma/test520.scxml | 19 + test/w3c/ecma/test521.scxml | 23 + test/w3c/ecma/test522.scxml | 22 + test/w3c/ecma/test525.scxml | 26 + test/w3c/ecma/test527.scxml | 25 + test/w3c/ecma/test528.scxml | 33 + test/w3c/ecma/test529.scxml | 25 + test/w3c/ecma/test530.scxml | 26 + test/w3c/ecma/test531.scxml | 20 + test/w3c/ecma/test532.scxml | 20 + test/w3c/ecma/test533.scxml | 62 + test/w3c/ecma/test534.scxml | 18 + test/w3c/ecma/test537.scxml | 17 + test/w3c/ecma/test539.scxml | 26 + test/w3c/ecma/test539.txt | 4 + test/w3c/ecma/test540.scxml | 21 + test/w3c/ecma/test540.txt | 3 + test/w3c/ecma/test542.scxml | 34 + test/w3c/ecma/test543.scxml | 18 + test/w3c/ecma/test544.scxml | 17 + test/w3c/ecma/test546.scxml | 17 + test/w3c/ecma/test547.scxml | 33 + test/w3c/ecma/test550.scxml | 20 + test/w3c/ecma/test551.scxml | 23 + test/w3c/ecma/test552.scxml | 18 + test/w3c/ecma/test552.txt | 1 + test/w3c/ecma/test553.scxml | 23 + test/w3c/ecma/test554.scxml | 25 + test/w3c/ecma/test555.scxml | 27 + test/w3c/ecma/test557.scxml | 26 + test/w3c/ecma/test557.txt | 4 + test/w3c/ecma/test558.scxml | 24 + test/w3c/ecma/test558.txt | 3 + test/w3c/ecma/test560.scxml | 19 + test/w3c/ecma/test561.scxml | 24 + test/w3c/ecma/test562.scxml | 22 + test/w3c/ecma/test567.scxml | 30 + test/w3c/ecma/test568.scxml | 15 + test/w3c/ecma/test569.scxml | 15 + test/w3c/ecma/test570.scxml | 45 + test/w3c/ecma/test576.scxml | 37 + test/w3c/ecma/test578.scxml | 19 + test/w3c/txml/robots.txt | 96 + test/w3c/txml/test144.txml | 27 + test/w3c/txml/test147.txml | 34 + test/w3c/txml/test148.txml | 35 + test/w3c/txml/test149.txml | 28 + test/w3c/txml/test150.txml | 45 + test/w3c/txml/test151.txml | 45 + test/w3c/txml/test152.txml | 52 + test/w3c/txml/test153.txml | 39 + test/w3c/txml/test155.txml | 30 + test/w3c/txml/test156.txml | 32 + test/w3c/txml/test158.txml | 27 + test/w3c/txml/test159.txml | 24 + test/w3c/txml/test172.txml | 23 + test/w3c/txml/test173.txml | 24 + test/w3c/txml/test174.txml | 24 + test/w3c/txml/test175.txml | 30 + test/w3c/txml/test176.txml | 33 + test/w3c/txml/test178.txml | 31 + test/w3c/txml/test179.txml | 21 + test/w3c/txml/test183.txml | 24 + test/w3c/txml/test185.txml | 26 + test/w3c/txml/test186.txml | 34 + test/w3c/txml/test187.txml | 36 + test/w3c/txml/test189.txml | 25 + test/w3c/txml/test190.txml | 38 + test/w3c/txml/test191.txml | 34 + test/w3c/txml/test192.txml | 58 + test/w3c/txml/test193.txml | 22 + test/w3c/txml/test194.txml | 26 + test/w3c/txml/test198.txml | 23 + test/w3c/txml/test199.txml | 22 + test/w3c/txml/test200.txml | 22 + test/w3c/txml/test201.txml | 25 + test/w3c/txml/test205.txml | 34 + test/w3c/txml/test207.txml | 60 + test/w3c/txml/test208.txml | 25 + test/w3c/txml/test210.txml | 28 + test/w3c/txml/test215.txml | 33 + test/w3c/txml/test216.txml | 26 + test/w3c/txml/test216sub1.txml | 9 + test/w3c/txml/test220.txml | 25 + test/w3c/txml/test223.txml | 33 + test/w3c/txml/test224.txml | 35 + test/w3c/txml/test225.txml | 42 + test/w3c/txml/test226.txml | 27 + test/w3c/txml/test226sub1.txml | 20 + test/w3c/txml/test228.txml | 37 + test/w3c/txml/test229.txml | 46 + test/w3c/txml/test230.txml | 66 + test/w3c/txml/test232.txml | 44 + test/w3c/txml/test233.txml | 39 + test/w3c/txml/test234.txml | 70 + test/w3c/txml/test235.txml | 27 + test/w3c/txml/test236.txml | 43 + test/w3c/txml/test237.txml | 45 + test/w3c/txml/test239.txml | 36 + test/w3c/txml/test239sub1.txml | 9 + test/w3c/txml/test240.txml | 71 + test/w3c/txml/test241.txml | 102 + test/w3c/txml/test242.txml | 57 + test/w3c/txml/test242sub1.txml | 9 + test/w3c/txml/test243.txml | 40 + test/w3c/txml/test244.txml | 43 + test/w3c/txml/test245.txml | 38 + test/w3c/txml/test247.txml | 26 + test/w3c/txml/test250.txml | 46 + test/w3c/txml/test252.txml | 51 + test/w3c/txml/test253.txml | 83 + test/w3c/txml/test276.txml | 21 + test/w3c/txml/test276sub1.txml | 24 + test/w3c/txml/test277.txml | 32 + test/w3c/txml/test278.txml | 22 + test/w3c/txml/test279.txml | 25 + test/w3c/txml/test280.txml | 34 + test/w3c/txml/test286.txml | 23 + test/w3c/txml/test287.txml | 23 + test/w3c/txml/test294.txml | 49 + test/w3c/txml/test298.txml | 28 + test/w3c/txml/test301.txml | 17 + test/w3c/txml/test302.txml | 20 + test/w3c/txml/test303.txml | 25 + test/w3c/txml/test304.txml | 18 + test/w3c/txml/test307.txml | 43 + test/w3c/txml/test309.txml | 16 + test/w3c/txml/test310.txml | 23 + test/w3c/txml/test311.txml | 21 + test/w3c/txml/test312.txml | 25 + test/w3c/txml/test313.txml | 26 + test/w3c/txml/test314.txml | 39 + test/w3c/txml/test318.txml | 31 + test/w3c/txml/test319.txml | 25 + test/w3c/txml/test321.txml | 19 + test/w3c/txml/test322.txml | 37 + test/w3c/txml/test323.txml | 19 + test/w3c/txml/test324.txml | 25 + test/w3c/txml/test325.txml | 22 + test/w3c/txml/test326.txml | 38 + test/w3c/txml/test329.txml | 55 + test/w3c/txml/test330.txml | 27 + test/w3c/txml/test331.txml | 62 + test/w3c/txml/test332.txml | 33 + test/w3c/txml/test333.txml | 20 + test/w3c/txml/test335.txml | 20 + test/w3c/txml/test336.txml | 29 + test/w3c/txml/test337.txml | 20 + test/w3c/txml/test338.txml | 43 + test/w3c/txml/test339.txml | 20 + test/w3c/txml/test342.txml | 28 + test/w3c/txml/test343.txml | 37 + test/w3c/txml/test344.txml | 27 + test/w3c/txml/test346.txml | 57 + test/w3c/txml/test347.txml | 44 + test/w3c/txml/test348.txml | 20 + test/w3c/txml/test349.txml | 33 + test/w3c/txml/test350.txml | 26 + test/w3c/txml/test351.txml | 52 + test/w3c/txml/test352.txml | 32 + test/w3c/txml/test354.txml | 56 + test/w3c/txml/test355.txml | 18 + test/w3c/txml/test364.txml | 77 + test/w3c/txml/test372.txml | 32 + test/w3c/txml/test375.txml | 30 + test/w3c/txml/test376.txml | 26 + test/w3c/txml/test377.txml | 35 + test/w3c/txml/test378.txml | 29 + test/w3c/txml/test387.txml | 101 + test/w3c/txml/test388.txml | 80 + test/w3c/txml/test396.txml | 20 + test/w3c/txml/test399.txml | 70 + test/w3c/txml/test401.txml | 25 + test/w3c/txml/test402.txml | 44 + test/w3c/txml/test403a.txml | 47 + test/w3c/txml/test403b.txml | 44 + test/w3c/txml/test403c.txml | 58 + test/w3c/txml/test404.txml | 64 + test/w3c/txml/test405.txml | 71 + test/w3c/txml/test406.txml | 68 + test/w3c/txml/test407.txml | 24 + test/w3c/txml/test409.txml | 36 + test/w3c/txml/test411.txml | 36 + test/w3c/txml/test412.txml | 56 + test/w3c/txml/test413.txml | 49 + test/w3c/txml/test415.txml | 15 + test/w3c/txml/test416.txml | 26 + test/w3c/txml/test417.txml | 39 + test/w3c/txml/test419.txml | 22 + test/w3c/txml/test421.txml | 33 + test/w3c/txml/test422.txml | 78 + test/w3c/txml/test423.txml | 28 + test/w3c/txml/test436.txml | 24 + test/w3c/txml/test444.txml | 20 + test/w3c/txml/test445.txml | 20 + test/w3c/txml/test448.txml | 35 + test/w3c/txml/test449.txml | 15 + test/w3c/txml/test451.txml | 23 + test/w3c/txml/test452.txml | 27 + test/w3c/txml/test453.txml | 22 + test/w3c/txml/test456.txml | 22 + test/w3c/txml/test457.txml | 62 + test/w3c/txml/test460.txml | 26 + test/w3c/txml/test463.txml | 22 + test/w3c/txml/test464.txml | 21 + test/w3c/txml/test465.txml | 27 + test/w3c/txml/test466.txml | 19 + test/w3c/txml/test467.txml | 17 + test/w3c/txml/test468.txml | 28 + test/w3c/txml/test469.txml | 29 + test/w3c/txml/test470.txml | 28 + test/w3c/txml/test473.txml | 44 + test/w3c/txml/test474.txml | 43 + test/w3c/txml/test475.txml | 43 + test/w3c/txml/test476.txml | 43 + test/w3c/txml/test477.txml | 43 + test/w3c/txml/test478.txml | 40 + test/w3c/txml/test479.txml | 40 + test/w3c/txml/test480.txml | 36 + test/w3c/txml/test481.txml | 41 + test/w3c/txml/test482.txml | 23 + test/w3c/txml/test483.txml | 31 + test/w3c/txml/test487.txml | 21 + test/w3c/txml/test488.txml | 37 + test/w3c/txml/test495.txml | 26 + test/w3c/txml/test500.txml | 19 + test/w3c/txml/test501.txml | 23 + test/w3c/txml/test503.txml | 41 + test/w3c/txml/test504.txml | 79 + test/w3c/txml/test505.txml | 51 + test/w3c/txml/test506.txml | 57 + test/w3c/txml/test509.txml | 21 + test/w3c/txml/test510.txml | 28 + test/w3c/txml/test513.txml | 54 + test/w3c/txml/test518.txml | 25 + test/w3c/txml/test519.txml | 21 + test/w3c/txml/test520.txml | 21 + test/w3c/txml/test521.txml | 27 + test/w3c/txml/test522.txml | 27 + test/w3c/txml/test525.txml | 30 + test/w3c/txml/test527.txml | 28 + test/w3c/txml/test528.txml | 36 + test/w3c/txml/test529.txml | 28 + test/w3c/txml/test530.txml | 30 + test/w3c/txml/test531.txml | 22 + test/w3c/txml/test532.txml | 22 + test/w3c/txml/test533.txml | 66 + test/w3c/txml/test534.txml | 20 + test/w3c/txml/test537.txml | 22 + test/w3c/txml/test539.txml | 30 + test/w3c/txml/test539.txt | 4 + test/w3c/txml/test540.txml | 25 + test/w3c/txml/test540.txt | 3 + test/w3c/txml/test542.txml | 38 + test/w3c/txml/test543.txml | 22 + test/w3c/txml/test544.txml | 21 + test/w3c/txml/test546.txml | 21 + test/w3c/txml/test547.txml | 38 + test/w3c/txml/test550.txml | 24 + test/w3c/txml/test551.txml | 27 + test/w3c/txml/test552.txml | 22 + test/w3c/txml/test552.txt | 1 + test/w3c/txml/test553.txml | 27 + test/w3c/txml/test554.txml | 29 + test/w3c/txml/test555.txml | 31 + test/w3c/txml/test557.txml | 30 + test/w3c/txml/test557.txt | 4 + test/w3c/txml/test558.txml | 28 + test/w3c/txml/test558.txt | 3 + test/w3c/txml/test560.txml | 23 + test/w3c/txml/test561.txml | 29 + test/w3c/txml/test562.txml | 26 + test/w3c/txml/test567.txml | 32 + test/w3c/txml/test568.txml | 19 + test/w3c/txml/test569.txml | 19 + test/w3c/txml/test570.txml | 49 + test/w3c/txml/test576.txml | 41 + test/w3c/txml/test578.txml | 24 + test/w3c/update-txml.sh | 7 + test/w3c/xpath/robots.txt | 96 + test/w3c/xpath/test144.scxml | 23 + test/w3c/xpath/test147.scxml | 30 + test/w3c/xpath/test148.scxml | 31 + test/w3c/xpath/test149.scxml | 25 + test/w3c/xpath/test150.scxml | 41 + test/w3c/xpath/test151.scxml | 41 + test/w3c/xpath/test152.scxml | 48 + test/w3c/xpath/test153.scxml | 35 + test/w3c/xpath/test155.scxml | 26 + test/w3c/xpath/test156.scxml | 28 + test/w3c/xpath/test158.scxml | 23 + test/w3c/xpath/test159.scxml | 20 + test/w3c/xpath/test172.scxml | 20 + test/w3c/xpath/test173.scxml | 21 + test/w3c/xpath/test174.scxml | 21 + test/w3c/xpath/test175.scxml | 27 + test/w3c/xpath/test176.scxml | 30 + test/w3c/xpath/test178.scxml | 27 + test/w3c/xpath/test179.scxml | 18 + test/w3c/xpath/test183.scxml | 21 + test/w3c/xpath/test185.scxml | 23 + test/w3c/xpath/test186.scxml | 31 + test/w3c/xpath/test187.scxml | 33 + test/w3c/xpath/test189.scxml | 22 + test/w3c/xpath/test190.scxml | 35 + test/w3c/xpath/test191.scxml | 31 + test/w3c/xpath/test192.scxml | 55 + test/w3c/xpath/test193.scxml | 19 + test/w3c/xpath/test194.scxml | 22 + test/w3c/xpath/test198.scxml | 19 + test/w3c/xpath/test199.scxml | 18 + test/w3c/xpath/test200.scxml | 18 + test/w3c/xpath/test201.scxml | 19 + test/w3c/xpath/test205.scxml | 30 + test/w3c/xpath/test207.scxml | 56 + test/w3c/xpath/test208.scxml | 21 + test/w3c/xpath/test210.scxml | 24 + test/w3c/xpath/test215.scxml | 29 + test/w3c/xpath/test216.scxml | 22 + test/w3c/xpath/test216sub1.scxml | 5 + test/w3c/xpath/test220.scxml | 21 + test/w3c/xpath/test223.scxml | 29 + test/w3c/xpath/test224.scxml | 31 + test/w3c/xpath/test225.scxml | 38 + test/w3c/xpath/test226.scxml | 23 + test/w3c/xpath/test226sub1.scxml | 16 + test/w3c/xpath/test228.scxml | 33 + test/w3c/xpath/test229.scxml | 42 + test/w3c/xpath/test230.scxml | 62 + test/w3c/xpath/test232.scxml | 40 + test/w3c/xpath/test233.scxml | 35 + test/w3c/xpath/test234.scxml | 66 + test/w3c/xpath/test235.scxml | 23 + test/w3c/xpath/test236.scxml | 39 + test/w3c/xpath/test237.scxml | 41 + test/w3c/xpath/test239.scxml | 32 + test/w3c/xpath/test239sub1.scxml | 5 + test/w3c/xpath/test240.scxml | 67 + test/w3c/xpath/test241.scxml | 98 + test/w3c/xpath/test242.scxml | 53 + test/w3c/xpath/test242sub1.scxml | 5 + test/w3c/xpath/test243.scxml | 36 + test/w3c/xpath/test244.scxml | 39 + test/w3c/xpath/test245.scxml | 34 + test/w3c/xpath/test247.scxml | 22 + test/w3c/xpath/test250.scxml | 42 + test/w3c/xpath/test252.scxml | 47 + test/w3c/xpath/test253.scxml | 79 + test/w3c/xpath/test276.scxml | 17 + test/w3c/xpath/test276sub1.scxml | 21 + test/w3c/xpath/test277.scxml | 28 + test/w3c/xpath/test278.scxml | 21 + test/w3c/xpath/test279.scxml | 21 + test/w3c/xpath/test280.scxml | 28 + test/w3c/xpath/test286.scxml | 18 + test/w3c/xpath/test287.scxml | 19 + test/w3c/xpath/test294.scxml | 46 + test/w3c/xpath/test298.scxml | 23 + test/w3c/xpath/test301.scxml | 13 + test/w3c/xpath/test302.scxml | 15 + test/w3c/xpath/test303.scxml | 20 + test/w3c/xpath/test304.scxml | 13 + test/w3c/xpath/test307.scxml | 42 + test/w3c/xpath/test309.scxml | 12 + test/w3c/xpath/test310.scxml | 18 + test/w3c/xpath/test311.scxml | 16 + test/w3c/xpath/test312.scxml | 20 + test/w3c/xpath/test313.scxml | 21 + test/w3c/xpath/test314.scxml | 34 + test/w3c/xpath/test318.scxml | 27 + test/w3c/xpath/test319.scxml | 20 + test/w3c/xpath/test321.scxml | 15 + test/w3c/xpath/test322.scxml | 33 + test/w3c/xpath/test323.scxml | 15 + test/w3c/xpath/test324.scxml | 21 + test/w3c/xpath/test325.scxml | 18 + test/w3c/xpath/test326.scxml | 35 + test/w3c/xpath/test329.scxml | 53 + test/w3c/xpath/test330.scxml | 23 + test/w3c/xpath/test331.scxml | 60 + test/w3c/xpath/test332.scxml | 29 + test/w3c/xpath/test333.scxml | 16 + test/w3c/xpath/test335.scxml | 16 + test/w3c/xpath/test336.scxml | 25 + test/w3c/xpath/test337.scxml | 16 + test/w3c/xpath/test338.scxml | 39 + test/w3c/xpath/test339.scxml | 16 + test/w3c/xpath/test342.scxml | 25 + test/w3c/xpath/test343.scxml | 34 + test/w3c/xpath/test344.scxml | 23 + test/w3c/xpath/test346.scxml | 53 + test/w3c/xpath/test347.scxml | 40 + test/w3c/xpath/test348.scxml | 18 + test/w3c/xpath/test349.scxml | 29 + test/w3c/xpath/test350.scxml | 22 + test/w3c/xpath/test351.scxml | 48 + test/w3c/xpath/test352.scxml | 29 + test/w3c/xpath/test354.scxml | 52 + test/w3c/xpath/test355.scxml | 14 + test/w3c/xpath/test364.scxml | 73 + test/w3c/xpath/test372.scxml | 28 + test/w3c/xpath/test375.scxml | 26 + test/w3c/xpath/test376.scxml | 22 + test/w3c/xpath/test377.scxml | 31 + test/w3c/xpath/test378.scxml | 25 + test/w3c/xpath/test387.scxml | 97 + test/w3c/xpath/test388.scxml | 76 + test/w3c/xpath/test396.scxml | 16 + test/w3c/xpath/test399.scxml | 66 + test/w3c/xpath/test401.scxml | 21 + test/w3c/xpath/test402.scxml | 40 + test/w3c/xpath/test403a.scxml | 43 + test/w3c/xpath/test403b.scxml | 40 + test/w3c/xpath/test403c.scxml | 54 + test/w3c/xpath/test404.scxml | 60 + test/w3c/xpath/test405.scxml | 67 + test/w3c/xpath/test406.scxml | 64 + test/w3c/xpath/test407.scxml | 20 + test/w3c/xpath/test409.scxml | 32 + test/w3c/xpath/test411.scxml | 32 + test/w3c/xpath/test412.scxml | 52 + test/w3c/xpath/test413.scxml | 45 + test/w3c/xpath/test415.scxml | 12 + test/w3c/xpath/test416.scxml | 22 + test/w3c/xpath/test417.scxml | 34 + test/w3c/xpath/test419.scxml | 17 + test/w3c/xpath/test421.scxml | 28 + test/w3c/xpath/test422.scxml | 75 + test/w3c/xpath/test423.scxml | 25 + test/w3c/xpath/test436.scxml | 21 + test/w3c/xpath/test444.scxml | 16 + test/w3c/xpath/test445.scxml | 16 + test/w3c/xpath/test448.scxml | 31 + test/w3c/xpath/test449.scxml | 11 + test/w3c/xpath/test451.scxml | 18 + test/w3c/xpath/test452.scxml | 24 + test/w3c/xpath/test453.scxml | 19 + test/w3c/xpath/test456.scxml | 19 + test/w3c/xpath/test457.scxml | 59 + test/w3c/xpath/test460.scxml | 24 + test/w3c/xpath/test463.scxml | 17 + test/w3c/xpath/test464.scxml | 16 + test/w3c/xpath/test465.scxml | 22 + test/w3c/xpath/test466.scxml | 14 + test/w3c/xpath/test467.scxml | 12 + test/w3c/xpath/test468.scxml | 23 + test/w3c/xpath/test469.scxml | 25 + test/w3c/xpath/test470.scxml | 24 + test/w3c/xpath/test473.scxml | 37 + test/w3c/xpath/test474.scxml | 36 + test/w3c/xpath/test475.scxml | 36 + test/w3c/xpath/test476.scxml | 36 + test/w3c/xpath/test477.scxml | 36 + test/w3c/xpath/test478.scxml | 36 + test/w3c/xpath/test479.scxml | 36 + test/w3c/xpath/test480.scxml | 32 + test/w3c/xpath/test481.scxml | 37 + test/w3c/xpath/test482.scxml | 16 + test/w3c/xpath/test483.scxml | 27 + test/w3c/xpath/test487.scxml | 17 + test/w3c/xpath/test488.scxml | 34 + test/w3c/xpath/test495.scxml | 23 + test/w3c/xpath/test500.scxml | 15 + test/w3c/xpath/test501.scxml | 19 + test/w3c/xpath/test503.scxml | 37 + test/w3c/xpath/test504.scxml | 75 + test/w3c/xpath/test505.scxml | 47 + test/w3c/xpath/test506.scxml | 53 + test/w3c/xpath/test509.scxml | 17 + test/w3c/xpath/test510.scxml | 24 + test/w3c/xpath/test513.scxml | 50 + test/w3c/xpath/test518.scxml | 20 + test/w3c/xpath/test519.scxml | 19 + test/w3c/xpath/test520.scxml | 19 + test/w3c/xpath/test521.scxml | 23 + test/w3c/xpath/test522.scxml | 22 + test/w3c/xpath/test525.scxml | 26 + test/w3c/xpath/test527.scxml | 25 + test/w3c/xpath/test528.scxml | 33 + test/w3c/xpath/test529.scxml | 25 + test/w3c/xpath/test530.scxml | 26 + test/w3c/xpath/test531.scxml | 20 + test/w3c/xpath/test532.scxml | 20 + test/w3c/xpath/test533.scxml | 62 + test/w3c/xpath/test534.scxml | 18 + test/w3c/xpath/test537.scxml | 17 + test/w3c/xpath/test539.scxml | 26 + test/w3c/xpath/test539.txt | 4 + test/w3c/xpath/test540.scxml | 21 + test/w3c/xpath/test540.txt | 3 + test/w3c/xpath/test542.scxml | 34 + test/w3c/xpath/test543.scxml | 18 + test/w3c/xpath/test544.scxml | 17 + test/w3c/xpath/test546.scxml | 17 + test/w3c/xpath/test547.scxml | 33 + test/w3c/xpath/test550.scxml | 20 + test/w3c/xpath/test551.scxml | 23 + test/w3c/xpath/test552.scxml | 18 + test/w3c/xpath/test552.txt | 1 + test/w3c/xpath/test553.scxml | 23 + test/w3c/xpath/test554.scxml | 25 + test/w3c/xpath/test555.scxml | 27 + test/w3c/xpath/test557.scxml | 26 + test/w3c/xpath/test557.txt | 4 + test/w3c/xpath/test558.scxml | 24 + test/w3c/xpath/test558.txt | 3 + test/w3c/xpath/test560.scxml | 19 + test/w3c/xpath/test561.scxml | 24 + test/w3c/xpath/test562.scxml | 22 + test/w3c/xpath/test567.scxml | 30 + test/w3c/xpath/test568.scxml | 15 + test/w3c/xpath/test569.scxml | 15 + test/w3c/xpath/test570.scxml | 45 + test/w3c/xpath/test576.scxml | 37 + test/w3c/xpath/test578.scxml | 19 + 1729 files changed, 66157 insertions(+), 70216 deletions(-) create mode 100644 src/uscxml/util/Trie.cpp create mode 100644 src/uscxml/util/Trie.h delete mode 100644 test/samples/apache/actions-initial-test.xml delete mode 100644 test/samples/apache/actions-parallel-test.xml delete mode 100644 test/samples/apache/actions-state-test.xml delete mode 100644 test/samples/apache/assign-test-01.xml delete mode 100644 test/samples/apache/assign-test-02.xml delete mode 100644 test/samples/apache/bar.xml delete mode 100644 test/samples/apache/custom-hello-world-01.xml delete mode 100644 test/samples/apache/custom-hello-world-02.xml delete mode 100644 test/samples/apache/custom-hello-world-03.xml delete mode 100644 test/samples/apache/custom-hello-world-04-el.xml delete mode 100644 test/samples/apache/custom-hello-world-04-jexl.xml delete mode 100644 test/samples/apache/datamodel-01.xml delete mode 100644 test/samples/apache/datamodel-02.xml delete mode 100644 test/samples/apache/datamodel-03.xml delete mode 100644 test/samples/apache/datamodel-04.xml delete mode 100644 test/samples/apache/edit-profile-config.xml delete mode 100644 test/samples/apache/eventdata-01.xml delete mode 100644 test/samples/apache/eventdata-02.xml delete mode 100644 test/samples/apache/eventdata-03.xml delete mode 100644 test/samples/apache/eventdata-04.xml delete mode 100644 test/samples/apache/external-hello-world.xml delete mode 100644 test/samples/apache/foo.xml delete mode 100644 test/samples/apache/hello-world.xml delete mode 100644 test/samples/apache/history-deep-01.xml delete mode 100644 test/samples/apache/history-default-01.xml delete mode 100644 test/samples/apache/history-shallow-01.xml delete mode 100644 test/samples/apache/invoked-01.xml delete mode 100644 test/samples/apache/invoked-02.xml delete mode 100644 test/samples/apache/invoked-03-01.xml delete mode 100644 test/samples/apache/invoked-03.xml delete mode 100644 test/samples/apache/invoker-01.xml delete mode 100644 test/samples/apache/invoker-02.xml delete mode 100644 test/samples/apache/invoker-03.xml delete mode 100644 test/samples/apache/invoker-04.xml delete mode 100644 test/samples/apache/issue62-01-ext.xml delete mode 100644 test/samples/apache/issue62-01.xml delete mode 100644 test/samples/apache/issue62-02-ext.xml delete mode 100644 test/samples/apache/issue62-02.xml delete mode 100644 test/samples/apache/issue62-03-ext.xml delete mode 100644 test/samples/apache/issue62-03.xml delete mode 100644 test/samples/apache/issue64-01.xml delete mode 100644 test/samples/apache/issue64-02.xml delete mode 100644 test/samples/apache/jsp-rootctx-test.xml delete mode 100644 test/samples/apache/log-on-config.xml delete mode 100644 test/samples/apache/microwave-01.xml delete mode 100644 test/samples/apache/microwave-02-legacy.xml delete mode 100644 test/samples/apache/microwave-02.xml delete mode 100644 test/samples/apache/microwave-03.xml delete mode 100644 test/samples/apache/microwave-04.xml delete mode 100644 test/samples/apache/microwave-05.xml delete mode 100644 test/samples/apache/parallel-01.xml delete mode 100644 test/samples/apache/parallel-02.xml delete mode 100644 test/samples/apache/parallel-03.xml delete mode 100644 test/samples/apache/prefix-01.xml delete mode 100644 test/samples/apache/scxml-initial-attr.xml delete mode 100644 test/samples/apache/send-01.xml delete mode 100644 test/samples/apache/send-02.xml delete mode 100644 test/samples/apache/src-test-1.xml delete mode 100644 test/samples/apache/src-test-2.xml delete mode 100644 test/samples/apache/src-test-3.xml delete mode 100644 test/samples/apache/src-test-4.xml delete mode 100644 test/samples/apache/src-test-5.xml delete mode 100644 test/samples/apache/state-01.xml delete mode 100644 test/samples/apache/stateless-01.xml delete mode 100644 test/samples/apache/stateless-parallel-01.xml delete mode 100644 test/samples/apache/static-method.xml delete mode 100644 test/samples/apache/stopwatch.xml delete mode 100644 test/samples/apache/tie-breaker-01.xml delete mode 100644 test/samples/apache/tie-breaker-02.xml delete mode 100644 test/samples/apache/tie-breaker-03.xml delete mode 100644 test/samples/apache/tie-breaker-04.xml delete mode 100644 test/samples/apache/tie-breaker-05.xml delete mode 100644 test/samples/apache/tie-breaker-06.xml delete mode 100644 test/samples/apache/transitions-01-legacy.xml delete mode 100644 test/samples/apache/transitions-01.xml delete mode 100644 test/samples/apache/transitions-02.xml delete mode 100644 test/samples/apache/transitions-03.xml delete mode 100644 test/samples/apache/transitions-04.xml delete mode 100644 test/samples/apache/transitions-05.xml delete mode 100644 test/samples/apache/travel-dialog.xml delete mode 100644 test/samples/apache/wildcard-01.xml delete mode 100644 test/samples/apache/wildcard-02.xml delete mode 100644 test/samples/apache/wizard-01.xml delete mode 100644 test/samples/apache/wizard-02.xml delete mode 100644 test/samples/uscxml/applications/SpatialMapTicker.java delete mode 100644 test/samples/uscxml/applications/click.wav delete mode 100644 test/samples/uscxml/applications/spoken-map-ticker.scxml delete mode 100644 test/samples/uscxml/applications/spoken-map-ticker.xhtml delete mode 100644 test/samples/uscxml/arabica/test-arabica-events.xml delete mode 100644 test/samples/uscxml/arabica/test-arabica-parsing.xml delete mode 100644 test/samples/uscxml/audio/click.wav delete mode 100644 test/samples/uscxml/chartToFSM/test-event-desc-merging.scxml delete mode 100644 test/samples/uscxml/chartToFSM/test-event-set-conflict.scxml delete mode 100644 test/samples/uscxml/chartToFSM/test-flattening.scxml delete mode 100644 test/samples/uscxml/prolog/likes.pl delete mode 100644 test/samples/uscxml/promela/test-simple-promela.scxml delete mode 100644 test/samples/uscxml/proto/3DViewer/CameraPos.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/DirectoryListingService.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/LinearAlgebra.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/ModelInfo.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/Pose.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/SceneSetup.proto delete mode 100644 test/samples/uscxml/proto/3DViewer/SceneShotService.proto delete mode 100644 test/samples/uscxml/proto/Dependee.proto delete mode 100644 test/samples/uscxml/proto/Depender.proto delete mode 100644 test/samples/uscxml/proto/JSON.proto delete mode 100644 test/samples/uscxml/proto/Test.proto delete mode 100644 test/samples/uscxml/proto/TestServices.proto delete mode 100644 test/samples/uscxml/scenegraph/HARD_MP_VAL_000.wrl delete mode 100644 test/samples/uscxml/scripts/GreatCircle.js delete mode 100644 test/samples/uscxml/scripts/test-simple-ecmascript.scxml delete mode 100644 test/samples/uscxml/scxml-gui-test.scxml delete mode 100644 test/samples/uscxml/templates/mc-html.html delete mode 100644 test/samples/uscxml/templates/xhtml-invoker.html delete mode 100644 test/samples/uscxml/test-calendar.scxml delete mode 100644 test/samples/uscxml/test-communication.scxml delete mode 100644 test/samples/uscxml/test-custom-executable-content.scxml delete mode 100644 test/samples/uscxml/test-dirmon.scxml delete mode 100644 test/samples/uscxml/test-dom.scxml delete mode 100644 test/samples/uscxml/test-donedata.scxml delete mode 100644 test/samples/uscxml/test-ecmascript.scxml delete mode 100644 test/samples/uscxml/test-execution.scxml delete mode 100644 test/samples/uscxml/test-expect.scxml delete mode 100644 test/samples/uscxml/test-ffmpeg.scxml delete mode 100644 test/samples/uscxml/test-file-element.scxml delete mode 100644 test/samples/uscxml/test-http-servlet.scxml delete mode 100644 test/samples/uscxml/test-imap.scxml delete mode 100644 test/samples/uscxml/test-initial-config.scxml delete mode 100644 test/samples/uscxml/test-instant-messaging.scxml delete mode 100644 test/samples/uscxml/test-invoked.scxml delete mode 100644 test/samples/uscxml/test-java-datamodel.scxml delete mode 100644 test/samples/uscxml/test-java-invoker.scxml delete mode 100644 test/samples/uscxml/test-jvoicexml.scxml delete mode 100644 test/samples/uscxml/test-markup-passing.scxml delete mode 100644 test/samples/uscxml/test-markup.xml delete mode 100644 test/samples/uscxml/test-mmi-events.scxml delete mode 100644 test/samples/uscxml/test-mmi-im.scxml delete mode 100644 test/samples/uscxml/test-mmi-mc.scxml delete mode 100644 test/samples/uscxml/test-openal.scxml delete mode 100644 test/samples/uscxml/test-osgconvert.scxml delete mode 100644 test/samples/uscxml/test-performance.scxml delete mode 100644 test/samples/uscxml/test-postpone-element.scxml delete mode 100644 test/samples/uscxml/test-predicates.scxml delete mode 100644 test/samples/uscxml/test-prolog.scxml delete mode 100644 test/samples/uscxml/test-response-element.scxml delete mode 100644 test/samples/uscxml/test-scenegraph.scxml delete mode 100644 test/samples/uscxml/test-simplest.scxml delete mode 100644 test/samples/uscxml/test-smtp.scxml delete mode 100644 test/samples/uscxml/test-spatial-audio.scxml delete mode 100644 test/samples/uscxml/test-startup-time.scxml delete mode 100644 test/samples/uscxml/test-umundo-map-demo.scxml delete mode 100644 test/samples/uscxml/test-umundo-pingpong.scxml delete mode 100644 test/samples/uscxml/test-umundo-rpc.scxml delete mode 100644 test/samples/uscxml/test-umundo-s11n-chat.scxml delete mode 100644 test/samples/uscxml/test-umundo-s11n.scxml delete mode 100644 test/samples/uscxml/test-xhtml-invoker.scxml delete mode 100644 test/samples/w3c/confEcma.xsl delete mode 100644 test/samples/w3c/confXPath.xsl delete mode 100755 test/samples/w3c/convert-tests.sh delete mode 100644 test/samples/w3c/draft/calc.scxml delete mode 100644 test/samples/w3c/ecma/robots.txt delete mode 100644 test/samples/w3c/ecma/test144.scxml delete mode 100644 test/samples/w3c/ecma/test147.scxml delete mode 100644 test/samples/w3c/ecma/test148.scxml delete mode 100644 test/samples/w3c/ecma/test149.scxml delete mode 100644 test/samples/w3c/ecma/test150.scxml delete mode 100644 test/samples/w3c/ecma/test151.scxml delete mode 100644 test/samples/w3c/ecma/test152.scxml delete mode 100644 test/samples/w3c/ecma/test153.scxml delete mode 100644 test/samples/w3c/ecma/test155.scxml delete mode 100644 test/samples/w3c/ecma/test156.scxml delete mode 100644 test/samples/w3c/ecma/test158.scxml delete mode 100644 test/samples/w3c/ecma/test159.scxml delete mode 100644 test/samples/w3c/ecma/test172.scxml delete mode 100644 test/samples/w3c/ecma/test173.scxml delete mode 100644 test/samples/w3c/ecma/test174.scxml delete mode 100644 test/samples/w3c/ecma/test175.scxml delete mode 100644 test/samples/w3c/ecma/test176.scxml delete mode 100644 test/samples/w3c/ecma/test178.scxml delete mode 100644 test/samples/w3c/ecma/test179.scxml delete mode 100644 test/samples/w3c/ecma/test183.scxml delete mode 100644 test/samples/w3c/ecma/test185.scxml delete mode 100644 test/samples/w3c/ecma/test186.scxml delete mode 100644 test/samples/w3c/ecma/test187.scxml delete mode 100644 test/samples/w3c/ecma/test189.scxml delete mode 100644 test/samples/w3c/ecma/test190.scxml delete mode 100644 test/samples/w3c/ecma/test191.scxml delete mode 100644 test/samples/w3c/ecma/test192.scxml delete mode 100644 test/samples/w3c/ecma/test193.scxml delete mode 100644 test/samples/w3c/ecma/test194.scxml delete mode 100644 test/samples/w3c/ecma/test198.scxml delete mode 100644 test/samples/w3c/ecma/test199.scxml delete mode 100644 test/samples/w3c/ecma/test200.scxml delete mode 100644 test/samples/w3c/ecma/test201.scxml delete mode 100644 test/samples/w3c/ecma/test205.scxml delete mode 100644 test/samples/w3c/ecma/test207.scxml delete mode 100644 test/samples/w3c/ecma/test208.scxml delete mode 100644 test/samples/w3c/ecma/test210.scxml delete mode 100644 test/samples/w3c/ecma/test215.scxml delete mode 100644 test/samples/w3c/ecma/test216.scxml delete mode 100644 test/samples/w3c/ecma/test216sub1.scxml delete mode 100644 test/samples/w3c/ecma/test220.scxml delete mode 100644 test/samples/w3c/ecma/test223.scxml delete mode 100644 test/samples/w3c/ecma/test224.scxml delete mode 100644 test/samples/w3c/ecma/test225.scxml delete mode 100644 test/samples/w3c/ecma/test226.scxml delete mode 100644 test/samples/w3c/ecma/test226sub1.scxml delete mode 100644 test/samples/w3c/ecma/test228.scxml delete mode 100644 test/samples/w3c/ecma/test229.scxml delete mode 100644 test/samples/w3c/ecma/test230.scxml delete mode 100644 test/samples/w3c/ecma/test232.scxml delete mode 100644 test/samples/w3c/ecma/test233.scxml delete mode 100644 test/samples/w3c/ecma/test234.scxml delete mode 100644 test/samples/w3c/ecma/test235.scxml delete mode 100644 test/samples/w3c/ecma/test236.scxml delete mode 100644 test/samples/w3c/ecma/test237.scxml delete mode 100644 test/samples/w3c/ecma/test239.scxml delete mode 100644 test/samples/w3c/ecma/test239sub1.scxml delete mode 100644 test/samples/w3c/ecma/test240.scxml delete mode 100644 test/samples/w3c/ecma/test241.scxml delete mode 100644 test/samples/w3c/ecma/test242.scxml delete mode 100644 test/samples/w3c/ecma/test242sub1.scxml delete mode 100644 test/samples/w3c/ecma/test243.scxml delete mode 100644 test/samples/w3c/ecma/test244.scxml delete mode 100644 test/samples/w3c/ecma/test245.scxml delete mode 100644 test/samples/w3c/ecma/test247.scxml delete mode 100644 test/samples/w3c/ecma/test250.scxml delete mode 100644 test/samples/w3c/ecma/test252.scxml delete mode 100644 test/samples/w3c/ecma/test253.scxml delete mode 100644 test/samples/w3c/ecma/test276.scxml delete mode 100644 test/samples/w3c/ecma/test276sub1.scxml delete mode 100644 test/samples/w3c/ecma/test277.scxml delete mode 100644 test/samples/w3c/ecma/test278.scxml delete mode 100644 test/samples/w3c/ecma/test279.scxml delete mode 100644 test/samples/w3c/ecma/test280.scxml delete mode 100644 test/samples/w3c/ecma/test286.scxml delete mode 100644 test/samples/w3c/ecma/test287.scxml delete mode 100644 test/samples/w3c/ecma/test294.scxml delete mode 100644 test/samples/w3c/ecma/test298.scxml delete mode 100644 test/samples/w3c/ecma/test301.scxml delete mode 100644 test/samples/w3c/ecma/test302.scxml delete mode 100644 test/samples/w3c/ecma/test303.scxml delete mode 100644 test/samples/w3c/ecma/test304.scxml delete mode 100644 test/samples/w3c/ecma/test307.scxml delete mode 100644 test/samples/w3c/ecma/test309.scxml delete mode 100644 test/samples/w3c/ecma/test310.scxml delete mode 100644 test/samples/w3c/ecma/test311.scxml delete mode 100644 test/samples/w3c/ecma/test312.scxml delete mode 100644 test/samples/w3c/ecma/test313.scxml delete mode 100644 test/samples/w3c/ecma/test314.scxml delete mode 100644 test/samples/w3c/ecma/test318.scxml delete mode 100644 test/samples/w3c/ecma/test319.scxml delete mode 100644 test/samples/w3c/ecma/test321.scxml delete mode 100644 test/samples/w3c/ecma/test322.scxml delete mode 100644 test/samples/w3c/ecma/test323.scxml delete mode 100644 test/samples/w3c/ecma/test324.scxml delete mode 100644 test/samples/w3c/ecma/test325.scxml delete mode 100644 test/samples/w3c/ecma/test326.scxml delete mode 100644 test/samples/w3c/ecma/test329.scxml delete mode 100644 test/samples/w3c/ecma/test330.scxml delete mode 100644 test/samples/w3c/ecma/test331.scxml delete mode 100644 test/samples/w3c/ecma/test332.scxml delete mode 100644 test/samples/w3c/ecma/test333.scxml delete mode 100644 test/samples/w3c/ecma/test335.scxml delete mode 100644 test/samples/w3c/ecma/test336.scxml delete mode 100644 test/samples/w3c/ecma/test337.scxml delete mode 100644 test/samples/w3c/ecma/test338.scxml delete mode 100644 test/samples/w3c/ecma/test339.scxml delete mode 100644 test/samples/w3c/ecma/test342.scxml delete mode 100644 test/samples/w3c/ecma/test343.scxml delete mode 100644 test/samples/w3c/ecma/test344.scxml delete mode 100644 test/samples/w3c/ecma/test346.scxml delete mode 100644 test/samples/w3c/ecma/test347.scxml delete mode 100644 test/samples/w3c/ecma/test348.scxml delete mode 100644 test/samples/w3c/ecma/test349.scxml delete mode 100644 test/samples/w3c/ecma/test350.scxml delete mode 100644 test/samples/w3c/ecma/test351.scxml delete mode 100644 test/samples/w3c/ecma/test352.scxml delete mode 100644 test/samples/w3c/ecma/test354.scxml delete mode 100644 test/samples/w3c/ecma/test355.scxml delete mode 100644 test/samples/w3c/ecma/test364.scxml delete mode 100644 test/samples/w3c/ecma/test372.scxml delete mode 100644 test/samples/w3c/ecma/test375.scxml delete mode 100644 test/samples/w3c/ecma/test376.scxml delete mode 100644 test/samples/w3c/ecma/test377.scxml delete mode 100644 test/samples/w3c/ecma/test378.scxml delete mode 100644 test/samples/w3c/ecma/test387.scxml delete mode 100644 test/samples/w3c/ecma/test388.scxml delete mode 100644 test/samples/w3c/ecma/test396.scxml delete mode 100644 test/samples/w3c/ecma/test399.scxml delete mode 100644 test/samples/w3c/ecma/test401.scxml delete mode 100644 test/samples/w3c/ecma/test402.scxml delete mode 100644 test/samples/w3c/ecma/test403a.scxml delete mode 100644 test/samples/w3c/ecma/test403b.scxml delete mode 100644 test/samples/w3c/ecma/test403c.scxml delete mode 100644 test/samples/w3c/ecma/test404.scxml delete mode 100644 test/samples/w3c/ecma/test405.scxml delete mode 100644 test/samples/w3c/ecma/test406.scxml delete mode 100644 test/samples/w3c/ecma/test407.scxml delete mode 100644 test/samples/w3c/ecma/test409.scxml delete mode 100644 test/samples/w3c/ecma/test411.scxml delete mode 100644 test/samples/w3c/ecma/test412.scxml delete mode 100644 test/samples/w3c/ecma/test413.scxml delete mode 100644 test/samples/w3c/ecma/test415.scxml delete mode 100644 test/samples/w3c/ecma/test416.scxml delete mode 100644 test/samples/w3c/ecma/test417.scxml delete mode 100644 test/samples/w3c/ecma/test419.scxml delete mode 100644 test/samples/w3c/ecma/test421.scxml delete mode 100644 test/samples/w3c/ecma/test422.scxml delete mode 100644 test/samples/w3c/ecma/test423.scxml delete mode 100644 test/samples/w3c/ecma/test436.scxml delete mode 100644 test/samples/w3c/ecma/test444.scxml delete mode 100644 test/samples/w3c/ecma/test445.scxml delete mode 100644 test/samples/w3c/ecma/test448.scxml delete mode 100644 test/samples/w3c/ecma/test449.scxml delete mode 100644 test/samples/w3c/ecma/test451.scxml delete mode 100644 test/samples/w3c/ecma/test452.scxml delete mode 100644 test/samples/w3c/ecma/test453.scxml delete mode 100644 test/samples/w3c/ecma/test456.scxml delete mode 100644 test/samples/w3c/ecma/test457.scxml delete mode 100644 test/samples/w3c/ecma/test460.scxml delete mode 100644 test/samples/w3c/ecma/test463.scxml delete mode 100644 test/samples/w3c/ecma/test464.scxml delete mode 100644 test/samples/w3c/ecma/test465.scxml delete mode 100644 test/samples/w3c/ecma/test466.scxml delete mode 100644 test/samples/w3c/ecma/test467.scxml delete mode 100644 test/samples/w3c/ecma/test468.scxml delete mode 100644 test/samples/w3c/ecma/test469.scxml delete mode 100644 test/samples/w3c/ecma/test470.scxml delete mode 100644 test/samples/w3c/ecma/test473.scxml delete mode 100644 test/samples/w3c/ecma/test474.scxml delete mode 100644 test/samples/w3c/ecma/test475.scxml delete mode 100644 test/samples/w3c/ecma/test476.scxml delete mode 100644 test/samples/w3c/ecma/test477.scxml delete mode 100644 test/samples/w3c/ecma/test478.scxml delete mode 100644 test/samples/w3c/ecma/test479.scxml delete mode 100644 test/samples/w3c/ecma/test480.scxml delete mode 100644 test/samples/w3c/ecma/test481.scxml delete mode 100644 test/samples/w3c/ecma/test482.scxml delete mode 100644 test/samples/w3c/ecma/test483.scxml delete mode 100644 test/samples/w3c/ecma/test487.scxml delete mode 100644 test/samples/w3c/ecma/test488.scxml delete mode 100644 test/samples/w3c/ecma/test495.scxml delete mode 100644 test/samples/w3c/ecma/test500.scxml delete mode 100644 test/samples/w3c/ecma/test501.scxml delete mode 100644 test/samples/w3c/ecma/test503.scxml delete mode 100644 test/samples/w3c/ecma/test504.scxml delete mode 100644 test/samples/w3c/ecma/test505.scxml delete mode 100644 test/samples/w3c/ecma/test506.scxml delete mode 100644 test/samples/w3c/ecma/test509.scxml delete mode 100644 test/samples/w3c/ecma/test510.scxml delete mode 100644 test/samples/w3c/ecma/test513.scxml delete mode 100644 test/samples/w3c/ecma/test518.scxml delete mode 100644 test/samples/w3c/ecma/test519.scxml delete mode 100644 test/samples/w3c/ecma/test520.scxml delete mode 100644 test/samples/w3c/ecma/test521.scxml delete mode 100644 test/samples/w3c/ecma/test522.scxml delete mode 100644 test/samples/w3c/ecma/test525.scxml delete mode 100644 test/samples/w3c/ecma/test527.scxml delete mode 100644 test/samples/w3c/ecma/test528.scxml delete mode 100644 test/samples/w3c/ecma/test529.scxml delete mode 100644 test/samples/w3c/ecma/test530.scxml delete mode 100644 test/samples/w3c/ecma/test531.scxml delete mode 100644 test/samples/w3c/ecma/test532.scxml delete mode 100644 test/samples/w3c/ecma/test533.scxml delete mode 100644 test/samples/w3c/ecma/test534.scxml delete mode 100644 test/samples/w3c/ecma/test537.scxml delete mode 100644 test/samples/w3c/ecma/test539.scxml delete mode 100644 test/samples/w3c/ecma/test539.txt delete mode 100644 test/samples/w3c/ecma/test540.scxml delete mode 100644 test/samples/w3c/ecma/test540.txt delete mode 100644 test/samples/w3c/ecma/test542.scxml delete mode 100644 test/samples/w3c/ecma/test543.scxml delete mode 100644 test/samples/w3c/ecma/test544.scxml delete mode 100644 test/samples/w3c/ecma/test546.scxml delete mode 100644 test/samples/w3c/ecma/test547.scxml delete mode 100644 test/samples/w3c/ecma/test550.scxml delete mode 100644 test/samples/w3c/ecma/test551.scxml delete mode 100644 test/samples/w3c/ecma/test552.scxml delete mode 100644 test/samples/w3c/ecma/test552.txt delete mode 100644 test/samples/w3c/ecma/test553.scxml delete mode 100644 test/samples/w3c/ecma/test554.scxml delete mode 100644 test/samples/w3c/ecma/test555.scxml delete mode 100644 test/samples/w3c/ecma/test557.scxml delete mode 100644 test/samples/w3c/ecma/test557.txt delete mode 100644 test/samples/w3c/ecma/test558.scxml delete mode 100644 test/samples/w3c/ecma/test558.txt delete mode 100644 test/samples/w3c/ecma/test560.scxml delete mode 100644 test/samples/w3c/ecma/test561.scxml delete mode 100644 test/samples/w3c/ecma/test562.scxml delete mode 100644 test/samples/w3c/ecma/test567.scxml delete mode 100644 test/samples/w3c/ecma/test568.scxml delete mode 100644 test/samples/w3c/ecma/test569.scxml delete mode 100644 test/samples/w3c/ecma/test570.scxml delete mode 100644 test/samples/w3c/ecma/test576.scxml delete mode 100644 test/samples/w3c/ecma/test578.scxml delete mode 100644 test/samples/w3c/txml/robots.txt delete mode 100644 test/samples/w3c/txml/test144.txml delete mode 100644 test/samples/w3c/txml/test147.txml delete mode 100644 test/samples/w3c/txml/test148.txml delete mode 100644 test/samples/w3c/txml/test149.txml delete mode 100644 test/samples/w3c/txml/test150.txml delete mode 100644 test/samples/w3c/txml/test151.txml delete mode 100644 test/samples/w3c/txml/test152.txml delete mode 100644 test/samples/w3c/txml/test153.txml delete mode 100644 test/samples/w3c/txml/test155.txml delete mode 100644 test/samples/w3c/txml/test156.txml delete mode 100644 test/samples/w3c/txml/test158.txml delete mode 100644 test/samples/w3c/txml/test159.txml delete mode 100644 test/samples/w3c/txml/test172.txml delete mode 100644 test/samples/w3c/txml/test173.txml delete mode 100644 test/samples/w3c/txml/test174.txml delete mode 100644 test/samples/w3c/txml/test175.txml delete mode 100644 test/samples/w3c/txml/test176.txml delete mode 100644 test/samples/w3c/txml/test178.txml delete mode 100644 test/samples/w3c/txml/test179.txml delete mode 100644 test/samples/w3c/txml/test183.txml delete mode 100644 test/samples/w3c/txml/test185.txml delete mode 100644 test/samples/w3c/txml/test186.txml delete mode 100644 test/samples/w3c/txml/test187.txml delete mode 100644 test/samples/w3c/txml/test189.txml delete mode 100644 test/samples/w3c/txml/test190.txml delete mode 100644 test/samples/w3c/txml/test191.txml delete mode 100644 test/samples/w3c/txml/test192.txml delete mode 100644 test/samples/w3c/txml/test193.txml delete mode 100644 test/samples/w3c/txml/test194.txml delete mode 100644 test/samples/w3c/txml/test198.txml delete mode 100644 test/samples/w3c/txml/test199.txml delete mode 100644 test/samples/w3c/txml/test200.txml delete mode 100644 test/samples/w3c/txml/test201.txml delete mode 100644 test/samples/w3c/txml/test205.txml delete mode 100644 test/samples/w3c/txml/test207.txml delete mode 100644 test/samples/w3c/txml/test208.txml delete mode 100644 test/samples/w3c/txml/test210.txml delete mode 100644 test/samples/w3c/txml/test215.txml delete mode 100644 test/samples/w3c/txml/test216.txml delete mode 100644 test/samples/w3c/txml/test216sub1.txml delete mode 100644 test/samples/w3c/txml/test220.txml delete mode 100644 test/samples/w3c/txml/test223.txml delete mode 100644 test/samples/w3c/txml/test224.txml delete mode 100644 test/samples/w3c/txml/test225.txml delete mode 100644 test/samples/w3c/txml/test226.txml delete mode 100644 test/samples/w3c/txml/test226sub1.txml delete mode 100644 test/samples/w3c/txml/test228.txml delete mode 100644 test/samples/w3c/txml/test229.txml delete mode 100644 test/samples/w3c/txml/test230.txml delete mode 100644 test/samples/w3c/txml/test232.txml delete mode 100644 test/samples/w3c/txml/test233.txml delete mode 100644 test/samples/w3c/txml/test234.txml delete mode 100644 test/samples/w3c/txml/test235.txml delete mode 100644 test/samples/w3c/txml/test236.txml delete mode 100644 test/samples/w3c/txml/test237.txml delete mode 100644 test/samples/w3c/txml/test239.txml delete mode 100644 test/samples/w3c/txml/test239sub1.txml delete mode 100644 test/samples/w3c/txml/test240.txml delete mode 100644 test/samples/w3c/txml/test241.txml delete mode 100644 test/samples/w3c/txml/test242.txml delete mode 100644 test/samples/w3c/txml/test242sub1.txml delete mode 100644 test/samples/w3c/txml/test243.txml delete mode 100644 test/samples/w3c/txml/test244.txml delete mode 100644 test/samples/w3c/txml/test245.txml delete mode 100644 test/samples/w3c/txml/test247.txml delete mode 100644 test/samples/w3c/txml/test250.txml delete mode 100644 test/samples/w3c/txml/test252.txml delete mode 100644 test/samples/w3c/txml/test253.txml delete mode 100644 test/samples/w3c/txml/test276.txml delete mode 100644 test/samples/w3c/txml/test276sub1.txml delete mode 100644 test/samples/w3c/txml/test277.txml delete mode 100644 test/samples/w3c/txml/test278.txml delete mode 100644 test/samples/w3c/txml/test279.txml delete mode 100644 test/samples/w3c/txml/test280.txml delete mode 100644 test/samples/w3c/txml/test286.txml delete mode 100644 test/samples/w3c/txml/test287.txml delete mode 100644 test/samples/w3c/txml/test294.txml delete mode 100644 test/samples/w3c/txml/test298.txml delete mode 100644 test/samples/w3c/txml/test301.txml delete mode 100644 test/samples/w3c/txml/test302.txml delete mode 100644 test/samples/w3c/txml/test303.txml delete mode 100644 test/samples/w3c/txml/test304.txml delete mode 100644 test/samples/w3c/txml/test307.txml delete mode 100644 test/samples/w3c/txml/test309.txml delete mode 100644 test/samples/w3c/txml/test310.txml delete mode 100644 test/samples/w3c/txml/test311.txml delete mode 100644 test/samples/w3c/txml/test312.txml delete mode 100644 test/samples/w3c/txml/test313.txml delete mode 100644 test/samples/w3c/txml/test314.txml delete mode 100644 test/samples/w3c/txml/test318.txml delete mode 100644 test/samples/w3c/txml/test319.txml delete mode 100644 test/samples/w3c/txml/test321.txml delete mode 100644 test/samples/w3c/txml/test322.txml delete mode 100644 test/samples/w3c/txml/test323.txml delete mode 100644 test/samples/w3c/txml/test324.txml delete mode 100644 test/samples/w3c/txml/test325.txml delete mode 100644 test/samples/w3c/txml/test326.txml delete mode 100644 test/samples/w3c/txml/test329.txml delete mode 100644 test/samples/w3c/txml/test330.txml delete mode 100644 test/samples/w3c/txml/test331.txml delete mode 100644 test/samples/w3c/txml/test332.txml delete mode 100644 test/samples/w3c/txml/test333.txml delete mode 100644 test/samples/w3c/txml/test335.txml delete mode 100644 test/samples/w3c/txml/test336.txml delete mode 100644 test/samples/w3c/txml/test337.txml delete mode 100644 test/samples/w3c/txml/test338.txml delete mode 100644 test/samples/w3c/txml/test339.txml delete mode 100644 test/samples/w3c/txml/test342.txml delete mode 100644 test/samples/w3c/txml/test343.txml delete mode 100644 test/samples/w3c/txml/test344.txml delete mode 100644 test/samples/w3c/txml/test346.txml delete mode 100644 test/samples/w3c/txml/test347.txml delete mode 100644 test/samples/w3c/txml/test348.txml delete mode 100644 test/samples/w3c/txml/test349.txml delete mode 100644 test/samples/w3c/txml/test350.txml delete mode 100644 test/samples/w3c/txml/test351.txml delete mode 100644 test/samples/w3c/txml/test352.txml delete mode 100644 test/samples/w3c/txml/test354.txml delete mode 100644 test/samples/w3c/txml/test355.txml delete mode 100644 test/samples/w3c/txml/test364.txml delete mode 100644 test/samples/w3c/txml/test372.txml delete mode 100644 test/samples/w3c/txml/test375.txml delete mode 100644 test/samples/w3c/txml/test376.txml delete mode 100644 test/samples/w3c/txml/test377.txml delete mode 100644 test/samples/w3c/txml/test378.txml delete mode 100644 test/samples/w3c/txml/test387.txml delete mode 100644 test/samples/w3c/txml/test388.txml delete mode 100644 test/samples/w3c/txml/test396.txml delete mode 100644 test/samples/w3c/txml/test399.txml delete mode 100644 test/samples/w3c/txml/test401.txml delete mode 100644 test/samples/w3c/txml/test402.txml delete mode 100644 test/samples/w3c/txml/test403a.txml delete mode 100644 test/samples/w3c/txml/test403b.txml delete mode 100644 test/samples/w3c/txml/test403c.txml delete mode 100644 test/samples/w3c/txml/test404.txml delete mode 100644 test/samples/w3c/txml/test405.txml delete mode 100644 test/samples/w3c/txml/test406.txml delete mode 100644 test/samples/w3c/txml/test407.txml delete mode 100644 test/samples/w3c/txml/test409.txml delete mode 100644 test/samples/w3c/txml/test411.txml delete mode 100644 test/samples/w3c/txml/test412.txml delete mode 100644 test/samples/w3c/txml/test413.txml delete mode 100644 test/samples/w3c/txml/test415.txml delete mode 100644 test/samples/w3c/txml/test416.txml delete mode 100644 test/samples/w3c/txml/test417.txml delete mode 100644 test/samples/w3c/txml/test419.txml delete mode 100644 test/samples/w3c/txml/test421.txml delete mode 100644 test/samples/w3c/txml/test422.txml delete mode 100644 test/samples/w3c/txml/test423.txml delete mode 100644 test/samples/w3c/txml/test436.txml delete mode 100644 test/samples/w3c/txml/test444.txml delete mode 100644 test/samples/w3c/txml/test445.txml delete mode 100644 test/samples/w3c/txml/test448.txml delete mode 100644 test/samples/w3c/txml/test449.txml delete mode 100644 test/samples/w3c/txml/test451.txml delete mode 100644 test/samples/w3c/txml/test452.txml delete mode 100644 test/samples/w3c/txml/test453.txml delete mode 100644 test/samples/w3c/txml/test456.txml delete mode 100644 test/samples/w3c/txml/test457.txml delete mode 100644 test/samples/w3c/txml/test460.txml delete mode 100644 test/samples/w3c/txml/test463.txml delete mode 100644 test/samples/w3c/txml/test464.txml delete mode 100644 test/samples/w3c/txml/test465.txml delete mode 100644 test/samples/w3c/txml/test466.txml delete mode 100644 test/samples/w3c/txml/test467.txml delete mode 100644 test/samples/w3c/txml/test468.txml delete mode 100644 test/samples/w3c/txml/test469.txml delete mode 100644 test/samples/w3c/txml/test470.txml delete mode 100644 test/samples/w3c/txml/test473.txml delete mode 100644 test/samples/w3c/txml/test474.txml delete mode 100644 test/samples/w3c/txml/test475.txml delete mode 100644 test/samples/w3c/txml/test476.txml delete mode 100644 test/samples/w3c/txml/test477.txml delete mode 100644 test/samples/w3c/txml/test478.txml delete mode 100644 test/samples/w3c/txml/test479.txml delete mode 100644 test/samples/w3c/txml/test480.txml delete mode 100644 test/samples/w3c/txml/test481.txml delete mode 100644 test/samples/w3c/txml/test482.txml delete mode 100644 test/samples/w3c/txml/test483.txml delete mode 100644 test/samples/w3c/txml/test487.txml delete mode 100644 test/samples/w3c/txml/test488.txml delete mode 100644 test/samples/w3c/txml/test495.txml delete mode 100644 test/samples/w3c/txml/test500.txml delete mode 100644 test/samples/w3c/txml/test501.txml delete mode 100644 test/samples/w3c/txml/test503.txml delete mode 100644 test/samples/w3c/txml/test504.txml delete mode 100644 test/samples/w3c/txml/test505.txml delete mode 100644 test/samples/w3c/txml/test506.txml delete mode 100644 test/samples/w3c/txml/test509.txml delete mode 100644 test/samples/w3c/txml/test510.txml delete mode 100644 test/samples/w3c/txml/test513.txml delete mode 100644 test/samples/w3c/txml/test518.txml delete mode 100644 test/samples/w3c/txml/test519.txml delete mode 100644 test/samples/w3c/txml/test520.txml delete mode 100644 test/samples/w3c/txml/test521.txml delete mode 100644 test/samples/w3c/txml/test522.txml delete mode 100644 test/samples/w3c/txml/test525.txml delete mode 100644 test/samples/w3c/txml/test527.txml delete mode 100644 test/samples/w3c/txml/test528.txml delete mode 100644 test/samples/w3c/txml/test529.txml delete mode 100644 test/samples/w3c/txml/test530.txml delete mode 100644 test/samples/w3c/txml/test531.txml delete mode 100644 test/samples/w3c/txml/test532.txml delete mode 100644 test/samples/w3c/txml/test533.txml delete mode 100644 test/samples/w3c/txml/test534.txml delete mode 100644 test/samples/w3c/txml/test537.txml delete mode 100644 test/samples/w3c/txml/test539.txml delete mode 100644 test/samples/w3c/txml/test539.txt delete mode 100644 test/samples/w3c/txml/test540.txml delete mode 100644 test/samples/w3c/txml/test540.txt delete mode 100644 test/samples/w3c/txml/test542.txml delete mode 100644 test/samples/w3c/txml/test543.txml delete mode 100644 test/samples/w3c/txml/test544.txml delete mode 100644 test/samples/w3c/txml/test546.txml delete mode 100644 test/samples/w3c/txml/test547.txml delete mode 100644 test/samples/w3c/txml/test550.txml delete mode 100644 test/samples/w3c/txml/test551.txml delete mode 100644 test/samples/w3c/txml/test552.txml delete mode 100644 test/samples/w3c/txml/test552.txt delete mode 100644 test/samples/w3c/txml/test553.txml delete mode 100644 test/samples/w3c/txml/test554.txml delete mode 100644 test/samples/w3c/txml/test555.txml delete mode 100644 test/samples/w3c/txml/test557.txml delete mode 100644 test/samples/w3c/txml/test557.txt delete mode 100644 test/samples/w3c/txml/test558.txml delete mode 100644 test/samples/w3c/txml/test558.txt delete mode 100644 test/samples/w3c/txml/test560.txml delete mode 100644 test/samples/w3c/txml/test561.txml delete mode 100644 test/samples/w3c/txml/test562.txml delete mode 100644 test/samples/w3c/txml/test567.txml delete mode 100644 test/samples/w3c/txml/test568.txml delete mode 100644 test/samples/w3c/txml/test569.txml delete mode 100644 test/samples/w3c/txml/test570.txml delete mode 100644 test/samples/w3c/txml/test576.txml delete mode 100644 test/samples/w3c/txml/test578.txml delete mode 100755 test/samples/w3c/update-txml.sh delete mode 100644 test/samples/w3c/xpath/robots.txt delete mode 100644 test/samples/w3c/xpath/test144.scxml delete mode 100644 test/samples/w3c/xpath/test147.scxml delete mode 100644 test/samples/w3c/xpath/test148.scxml delete mode 100644 test/samples/w3c/xpath/test149.scxml delete mode 100644 test/samples/w3c/xpath/test150.scxml delete mode 100644 test/samples/w3c/xpath/test151.scxml delete mode 100644 test/samples/w3c/xpath/test152.scxml delete mode 100644 test/samples/w3c/xpath/test153.scxml delete mode 100644 test/samples/w3c/xpath/test155.scxml delete mode 100644 test/samples/w3c/xpath/test156.scxml delete mode 100644 test/samples/w3c/xpath/test158.scxml delete mode 100644 test/samples/w3c/xpath/test159.scxml delete mode 100644 test/samples/w3c/xpath/test172.scxml delete mode 100644 test/samples/w3c/xpath/test173.scxml delete mode 100644 test/samples/w3c/xpath/test174.scxml delete mode 100644 test/samples/w3c/xpath/test175.scxml delete mode 100644 test/samples/w3c/xpath/test176.scxml delete mode 100644 test/samples/w3c/xpath/test178.scxml delete mode 100644 test/samples/w3c/xpath/test179.scxml delete mode 100644 test/samples/w3c/xpath/test183.scxml delete mode 100644 test/samples/w3c/xpath/test185.scxml delete mode 100644 test/samples/w3c/xpath/test186.scxml delete mode 100644 test/samples/w3c/xpath/test187.scxml delete mode 100644 test/samples/w3c/xpath/test189.scxml delete mode 100644 test/samples/w3c/xpath/test190.scxml delete mode 100644 test/samples/w3c/xpath/test191.scxml delete mode 100644 test/samples/w3c/xpath/test192.scxml delete mode 100644 test/samples/w3c/xpath/test193.scxml delete mode 100644 test/samples/w3c/xpath/test194.scxml delete mode 100644 test/samples/w3c/xpath/test198.scxml delete mode 100644 test/samples/w3c/xpath/test199.scxml delete mode 100644 test/samples/w3c/xpath/test200.scxml delete mode 100644 test/samples/w3c/xpath/test201.scxml delete mode 100644 test/samples/w3c/xpath/test205.scxml delete mode 100644 test/samples/w3c/xpath/test207.scxml delete mode 100644 test/samples/w3c/xpath/test208.scxml delete mode 100644 test/samples/w3c/xpath/test210.scxml delete mode 100644 test/samples/w3c/xpath/test215.scxml delete mode 100644 test/samples/w3c/xpath/test216.scxml delete mode 100644 test/samples/w3c/xpath/test216sub1.scxml delete mode 100644 test/samples/w3c/xpath/test220.scxml delete mode 100644 test/samples/w3c/xpath/test223.scxml delete mode 100644 test/samples/w3c/xpath/test224.scxml delete mode 100644 test/samples/w3c/xpath/test225.scxml delete mode 100644 test/samples/w3c/xpath/test226.scxml delete mode 100644 test/samples/w3c/xpath/test226sub1.scxml delete mode 100644 test/samples/w3c/xpath/test228.scxml delete mode 100644 test/samples/w3c/xpath/test229.scxml delete mode 100644 test/samples/w3c/xpath/test230.scxml delete mode 100644 test/samples/w3c/xpath/test232.scxml delete mode 100644 test/samples/w3c/xpath/test233.scxml delete mode 100644 test/samples/w3c/xpath/test234.scxml delete mode 100644 test/samples/w3c/xpath/test235.scxml delete mode 100644 test/samples/w3c/xpath/test236.scxml delete mode 100644 test/samples/w3c/xpath/test237.scxml delete mode 100644 test/samples/w3c/xpath/test239.scxml delete mode 100644 test/samples/w3c/xpath/test239sub1.scxml delete mode 100644 test/samples/w3c/xpath/test240.scxml delete mode 100644 test/samples/w3c/xpath/test241.scxml delete mode 100644 test/samples/w3c/xpath/test242.scxml delete mode 100644 test/samples/w3c/xpath/test242sub1.scxml delete mode 100644 test/samples/w3c/xpath/test243.scxml delete mode 100644 test/samples/w3c/xpath/test244.scxml delete mode 100644 test/samples/w3c/xpath/test245.scxml delete mode 100644 test/samples/w3c/xpath/test247.scxml delete mode 100644 test/samples/w3c/xpath/test250.scxml delete mode 100644 test/samples/w3c/xpath/test252.scxml delete mode 100644 test/samples/w3c/xpath/test253.scxml delete mode 100644 test/samples/w3c/xpath/test276.scxml delete mode 100644 test/samples/w3c/xpath/test276sub1.scxml delete mode 100644 test/samples/w3c/xpath/test277.scxml delete mode 100644 test/samples/w3c/xpath/test278.scxml delete mode 100644 test/samples/w3c/xpath/test279.scxml delete mode 100644 test/samples/w3c/xpath/test280.scxml delete mode 100644 test/samples/w3c/xpath/test286.scxml delete mode 100644 test/samples/w3c/xpath/test287.scxml delete mode 100644 test/samples/w3c/xpath/test294.scxml delete mode 100644 test/samples/w3c/xpath/test298.scxml delete mode 100644 test/samples/w3c/xpath/test301.scxml delete mode 100644 test/samples/w3c/xpath/test302.scxml delete mode 100644 test/samples/w3c/xpath/test303.scxml delete mode 100644 test/samples/w3c/xpath/test304.scxml delete mode 100644 test/samples/w3c/xpath/test307.scxml delete mode 100644 test/samples/w3c/xpath/test309.scxml delete mode 100644 test/samples/w3c/xpath/test310.scxml delete mode 100644 test/samples/w3c/xpath/test311.scxml delete mode 100644 test/samples/w3c/xpath/test312.scxml delete mode 100644 test/samples/w3c/xpath/test313.scxml delete mode 100644 test/samples/w3c/xpath/test314.scxml delete mode 100644 test/samples/w3c/xpath/test318.scxml delete mode 100644 test/samples/w3c/xpath/test319.scxml delete mode 100644 test/samples/w3c/xpath/test321.scxml delete mode 100644 test/samples/w3c/xpath/test322.scxml delete mode 100644 test/samples/w3c/xpath/test323.scxml delete mode 100644 test/samples/w3c/xpath/test324.scxml delete mode 100644 test/samples/w3c/xpath/test325.scxml delete mode 100644 test/samples/w3c/xpath/test326.scxml delete mode 100644 test/samples/w3c/xpath/test329.scxml delete mode 100644 test/samples/w3c/xpath/test330.scxml delete mode 100644 test/samples/w3c/xpath/test331.scxml delete mode 100644 test/samples/w3c/xpath/test332.scxml delete mode 100644 test/samples/w3c/xpath/test333.scxml delete mode 100644 test/samples/w3c/xpath/test335.scxml delete mode 100644 test/samples/w3c/xpath/test336.scxml delete mode 100644 test/samples/w3c/xpath/test337.scxml delete mode 100644 test/samples/w3c/xpath/test338.scxml delete mode 100644 test/samples/w3c/xpath/test339.scxml delete mode 100644 test/samples/w3c/xpath/test342.scxml delete mode 100644 test/samples/w3c/xpath/test343.scxml delete mode 100644 test/samples/w3c/xpath/test344.scxml delete mode 100644 test/samples/w3c/xpath/test346.scxml delete mode 100644 test/samples/w3c/xpath/test347.scxml delete mode 100644 test/samples/w3c/xpath/test348.scxml delete mode 100644 test/samples/w3c/xpath/test349.scxml delete mode 100644 test/samples/w3c/xpath/test350.scxml delete mode 100644 test/samples/w3c/xpath/test351.scxml delete mode 100644 test/samples/w3c/xpath/test352.scxml delete mode 100644 test/samples/w3c/xpath/test354.scxml delete mode 100644 test/samples/w3c/xpath/test355.scxml delete mode 100644 test/samples/w3c/xpath/test364.scxml delete mode 100644 test/samples/w3c/xpath/test372.scxml delete mode 100644 test/samples/w3c/xpath/test375.scxml delete mode 100644 test/samples/w3c/xpath/test376.scxml delete mode 100644 test/samples/w3c/xpath/test377.scxml delete mode 100644 test/samples/w3c/xpath/test378.scxml delete mode 100644 test/samples/w3c/xpath/test387.scxml delete mode 100644 test/samples/w3c/xpath/test388.scxml delete mode 100644 test/samples/w3c/xpath/test396.scxml delete mode 100644 test/samples/w3c/xpath/test399.scxml delete mode 100644 test/samples/w3c/xpath/test401.scxml delete mode 100644 test/samples/w3c/xpath/test402.scxml delete mode 100644 test/samples/w3c/xpath/test403a.scxml delete mode 100644 test/samples/w3c/xpath/test403b.scxml delete mode 100644 test/samples/w3c/xpath/test403c.scxml delete mode 100644 test/samples/w3c/xpath/test404.scxml delete mode 100644 test/samples/w3c/xpath/test405.scxml delete mode 100644 test/samples/w3c/xpath/test406.scxml delete mode 100644 test/samples/w3c/xpath/test407.scxml delete mode 100644 test/samples/w3c/xpath/test409.scxml delete mode 100644 test/samples/w3c/xpath/test411.scxml delete mode 100644 test/samples/w3c/xpath/test412.scxml delete mode 100644 test/samples/w3c/xpath/test413.scxml delete mode 100644 test/samples/w3c/xpath/test415.scxml delete mode 100644 test/samples/w3c/xpath/test416.scxml delete mode 100644 test/samples/w3c/xpath/test417.scxml delete mode 100644 test/samples/w3c/xpath/test419.scxml delete mode 100644 test/samples/w3c/xpath/test421.scxml delete mode 100644 test/samples/w3c/xpath/test422.scxml delete mode 100644 test/samples/w3c/xpath/test423.scxml delete mode 100644 test/samples/w3c/xpath/test436.scxml delete mode 100644 test/samples/w3c/xpath/test444.scxml delete mode 100644 test/samples/w3c/xpath/test445.scxml delete mode 100644 test/samples/w3c/xpath/test448.scxml delete mode 100644 test/samples/w3c/xpath/test449.scxml delete mode 100644 test/samples/w3c/xpath/test451.scxml delete mode 100644 test/samples/w3c/xpath/test452.scxml delete mode 100644 test/samples/w3c/xpath/test453.scxml delete mode 100644 test/samples/w3c/xpath/test456.scxml delete mode 100644 test/samples/w3c/xpath/test457.scxml delete mode 100644 test/samples/w3c/xpath/test460.scxml delete mode 100644 test/samples/w3c/xpath/test463.scxml delete mode 100644 test/samples/w3c/xpath/test464.scxml delete mode 100644 test/samples/w3c/xpath/test465.scxml delete mode 100644 test/samples/w3c/xpath/test466.scxml delete mode 100644 test/samples/w3c/xpath/test467.scxml delete mode 100644 test/samples/w3c/xpath/test468.scxml delete mode 100644 test/samples/w3c/xpath/test469.scxml delete mode 100644 test/samples/w3c/xpath/test470.scxml delete mode 100644 test/samples/w3c/xpath/test473.scxml delete mode 100644 test/samples/w3c/xpath/test474.scxml delete mode 100644 test/samples/w3c/xpath/test475.scxml delete mode 100644 test/samples/w3c/xpath/test476.scxml delete mode 100644 test/samples/w3c/xpath/test477.scxml delete mode 100644 test/samples/w3c/xpath/test478.scxml delete mode 100644 test/samples/w3c/xpath/test479.scxml delete mode 100644 test/samples/w3c/xpath/test480.scxml delete mode 100644 test/samples/w3c/xpath/test481.scxml delete mode 100644 test/samples/w3c/xpath/test482.scxml delete mode 100644 test/samples/w3c/xpath/test483.scxml delete mode 100644 test/samples/w3c/xpath/test487.scxml delete mode 100644 test/samples/w3c/xpath/test488.scxml delete mode 100644 test/samples/w3c/xpath/test495.scxml delete mode 100644 test/samples/w3c/xpath/test500.scxml delete mode 100644 test/samples/w3c/xpath/test501.scxml delete mode 100644 test/samples/w3c/xpath/test503.scxml delete mode 100644 test/samples/w3c/xpath/test504.scxml delete mode 100644 test/samples/w3c/xpath/test505.scxml delete mode 100644 test/samples/w3c/xpath/test506.scxml delete mode 100644 test/samples/w3c/xpath/test509.scxml delete mode 100644 test/samples/w3c/xpath/test510.scxml delete mode 100644 test/samples/w3c/xpath/test513.scxml delete mode 100644 test/samples/w3c/xpath/test518.scxml delete mode 100644 test/samples/w3c/xpath/test519.scxml delete mode 100644 test/samples/w3c/xpath/test520.scxml delete mode 100644 test/samples/w3c/xpath/test521.scxml delete mode 100644 test/samples/w3c/xpath/test522.scxml delete mode 100644 test/samples/w3c/xpath/test525.scxml delete mode 100644 test/samples/w3c/xpath/test527.scxml delete mode 100644 test/samples/w3c/xpath/test528.scxml delete mode 100644 test/samples/w3c/xpath/test529.scxml delete mode 100644 test/samples/w3c/xpath/test530.scxml delete mode 100644 test/samples/w3c/xpath/test531.scxml delete mode 100644 test/samples/w3c/xpath/test532.scxml delete mode 100644 test/samples/w3c/xpath/test533.scxml delete mode 100644 test/samples/w3c/xpath/test534.scxml delete mode 100644 test/samples/w3c/xpath/test537.scxml delete mode 100644 test/samples/w3c/xpath/test539.scxml delete mode 100644 test/samples/w3c/xpath/test539.txt delete mode 100644 test/samples/w3c/xpath/test540.scxml delete mode 100644 test/samples/w3c/xpath/test540.txt delete mode 100644 test/samples/w3c/xpath/test542.scxml delete mode 100644 test/samples/w3c/xpath/test543.scxml delete mode 100644 test/samples/w3c/xpath/test544.scxml delete mode 100644 test/samples/w3c/xpath/test546.scxml delete mode 100644 test/samples/w3c/xpath/test547.scxml delete mode 100644 test/samples/w3c/xpath/test550.scxml delete mode 100644 test/samples/w3c/xpath/test551.scxml delete mode 100644 test/samples/w3c/xpath/test552.scxml delete mode 100644 test/samples/w3c/xpath/test552.txt delete mode 100644 test/samples/w3c/xpath/test553.scxml delete mode 100644 test/samples/w3c/xpath/test554.scxml delete mode 100644 test/samples/w3c/xpath/test555.scxml delete mode 100644 test/samples/w3c/xpath/test557.scxml delete mode 100644 test/samples/w3c/xpath/test557.txt delete mode 100644 test/samples/w3c/xpath/test558.scxml delete mode 100644 test/samples/w3c/xpath/test558.txt delete mode 100644 test/samples/w3c/xpath/test560.scxml delete mode 100644 test/samples/w3c/xpath/test561.scxml delete mode 100644 test/samples/w3c/xpath/test562.scxml delete mode 100644 test/samples/w3c/xpath/test567.scxml delete mode 100644 test/samples/w3c/xpath/test568.scxml delete mode 100644 test/samples/w3c/xpath/test569.scxml delete mode 100644 test/samples/w3c/xpath/test570.scxml delete mode 100644 test/samples/w3c/xpath/test576.scxml delete mode 100644 test/samples/w3c/xpath/test578.scxml delete mode 100644 test/schema/scxml-attribs.xsd delete mode 100644 test/schema/scxml-contentmodels.xsd delete mode 100644 test/schema/scxml-datatypes.xsd delete mode 100644 test/schema/scxml-module-core.xsd delete mode 100644 test/schema/scxml-module-data.xsd delete mode 100644 test/schema/scxml-module-external.xsd delete mode 100644 test/schema/scxml.xsd create mode 100644 test/src/test-arabica-namespaces.cpp create mode 100644 test/src/test-trie.cpp create mode 100644 test/uscxml/applications/SpatialMapTicker.java create mode 100644 test/uscxml/applications/click.wav create mode 100644 test/uscxml/applications/spoken-map-ticker.scxml create mode 100644 test/uscxml/applications/spoken-map-ticker.xhtml create mode 100644 test/uscxml/arabica/test-arabica-events.xml create mode 100644 test/uscxml/arabica/test-arabica-parsing.xml create mode 100644 test/uscxml/audio/click.wav create mode 100644 test/uscxml/chartToFSM/test-event-desc-merging.scxml create mode 100644 test/uscxml/chartToFSM/test-event-set-conflict.scxml create mode 100644 test/uscxml/chartToFSM/test-flattening.scxml create mode 100644 test/uscxml/prolog/likes.pl create mode 100644 test/uscxml/promela/test-invokers.scxml create mode 100644 test/uscxml/promela/test-non-progress.scxml create mode 100644 test/uscxml/promela/test-progress-label.scxml create mode 100644 test/uscxml/promela/test-simple.scxml create mode 100644 test/uscxml/promela/test-syntax.scxml create mode 100644 test/uscxml/proto/3DViewer/CameraPos.proto create mode 100644 test/uscxml/proto/3DViewer/DirectoryListingService.proto create mode 100644 test/uscxml/proto/3DViewer/LinearAlgebra.proto create mode 100644 test/uscxml/proto/3DViewer/ModelInfo.proto create mode 100644 test/uscxml/proto/3DViewer/Pose.proto create mode 100644 test/uscxml/proto/3DViewer/SceneSetup.proto create mode 100644 test/uscxml/proto/3DViewer/SceneShotService.proto create mode 100644 test/uscxml/proto/Dependee.proto create mode 100644 test/uscxml/proto/Depender.proto create mode 100644 test/uscxml/proto/JSON.proto create mode 100644 test/uscxml/proto/Test.proto create mode 100644 test/uscxml/proto/TestServices.proto create mode 100644 test/uscxml/scenegraph/HARD_MP_VAL_000.wrl create mode 100644 test/uscxml/scripts/GreatCircle.js create mode 100644 test/uscxml/scripts/test-simple-ecmascript.scxml create mode 100644 test/uscxml/scxml-gui-test.scxml create mode 100644 test/uscxml/templates/mc-html.html create mode 100644 test/uscxml/templates/xhtml-invoker.html create mode 100644 test/uscxml/test-calendar.scxml create mode 100644 test/uscxml/test-communication.scxml create mode 100644 test/uscxml/test-custom-executable-content.scxml create mode 100644 test/uscxml/test-dirmon.scxml create mode 100644 test/uscxml/test-dom.scxml create mode 100644 test/uscxml/test-donedata.scxml create mode 100644 test/uscxml/test-ecmascript.scxml create mode 100644 test/uscxml/test-execution.scxml create mode 100644 test/uscxml/test-expect.scxml create mode 100644 test/uscxml/test-ffmpeg.scxml create mode 100644 test/uscxml/test-file-element.scxml create mode 100644 test/uscxml/test-http-servlet.scxml create mode 100644 test/uscxml/test-imap.scxml create mode 100644 test/uscxml/test-initial-config.scxml create mode 100644 test/uscxml/test-instant-messaging.scxml create mode 100644 test/uscxml/test-invoked.scxml create mode 100644 test/uscxml/test-java-datamodel.scxml create mode 100644 test/uscxml/test-java-invoker.scxml create mode 100644 test/uscxml/test-jvoicexml.scxml create mode 100644 test/uscxml/test-markup-passing.scxml create mode 100644 test/uscxml/test-markup.xml create mode 100644 test/uscxml/test-mmi-events.scxml create mode 100644 test/uscxml/test-mmi-im.scxml create mode 100644 test/uscxml/test-mmi-mc.scxml create mode 100644 test/uscxml/test-openal.scxml create mode 100644 test/uscxml/test-osgconvert.scxml create mode 100644 test/uscxml/test-performance.scxml create mode 100644 test/uscxml/test-postpone-element.scxml create mode 100644 test/uscxml/test-predicates.scxml create mode 100644 test/uscxml/test-prolog.scxml create mode 100644 test/uscxml/test-response-element.scxml create mode 100644 test/uscxml/test-scenegraph.scxml create mode 100644 test/uscxml/test-simplest.scxml create mode 100644 test/uscxml/test-smtp.scxml create mode 100644 test/uscxml/test-spatial-audio.scxml create mode 100644 test/uscxml/test-startup-time.scxml create mode 100644 test/uscxml/test-umundo-map-demo.scxml create mode 100644 test/uscxml/test-umundo-pingpong.scxml create mode 100644 test/uscxml/test-umundo-rpc.scxml create mode 100644 test/uscxml/test-umundo-s11n-chat.scxml create mode 100644 test/uscxml/test-umundo-s11n.scxml create mode 100644 test/uscxml/test-xhtml-invoker.scxml create mode 100644 test/w3c/confEcma.xsl create mode 100644 test/w3c/confXPath.xsl create mode 100755 test/w3c/convert-tests.sh create mode 100644 test/w3c/draft/calc.scxml create mode 100644 test/w3c/ecma/robots.txt create mode 100644 test/w3c/ecma/test144.scxml create mode 100644 test/w3c/ecma/test147.scxml create mode 100644 test/w3c/ecma/test148.scxml create mode 100644 test/w3c/ecma/test149.scxml create mode 100644 test/w3c/ecma/test150.scxml create mode 100644 test/w3c/ecma/test151.scxml create mode 100644 test/w3c/ecma/test152.scxml create mode 100644 test/w3c/ecma/test153.scxml create mode 100644 test/w3c/ecma/test155.scxml create mode 100644 test/w3c/ecma/test156.scxml create mode 100644 test/w3c/ecma/test158.scxml create mode 100644 test/w3c/ecma/test159.scxml create mode 100644 test/w3c/ecma/test172.scxml create mode 100644 test/w3c/ecma/test173.scxml create mode 100644 test/w3c/ecma/test174.scxml create mode 100644 test/w3c/ecma/test175.scxml create mode 100644 test/w3c/ecma/test176.scxml create mode 100644 test/w3c/ecma/test178.scxml create mode 100644 test/w3c/ecma/test179.scxml create mode 100644 test/w3c/ecma/test183.scxml create mode 100644 test/w3c/ecma/test185.scxml create mode 100644 test/w3c/ecma/test186.scxml create mode 100644 test/w3c/ecma/test187.scxml create mode 100644 test/w3c/ecma/test189.scxml create mode 100644 test/w3c/ecma/test190.scxml create mode 100644 test/w3c/ecma/test191.scxml create mode 100644 test/w3c/ecma/test192.scxml create mode 100644 test/w3c/ecma/test193.scxml create mode 100644 test/w3c/ecma/test194.scxml create mode 100644 test/w3c/ecma/test198.scxml create mode 100644 test/w3c/ecma/test199.scxml create mode 100644 test/w3c/ecma/test200.scxml create mode 100644 test/w3c/ecma/test201.scxml create mode 100644 test/w3c/ecma/test205.scxml create mode 100644 test/w3c/ecma/test207.scxml create mode 100644 test/w3c/ecma/test208.scxml create mode 100644 test/w3c/ecma/test210.scxml create mode 100644 test/w3c/ecma/test215.scxml create mode 100644 test/w3c/ecma/test216.scxml create mode 100644 test/w3c/ecma/test216sub1.scxml create mode 100644 test/w3c/ecma/test220.scxml create mode 100644 test/w3c/ecma/test223.scxml create mode 100644 test/w3c/ecma/test224.scxml create mode 100644 test/w3c/ecma/test225.scxml create mode 100644 test/w3c/ecma/test226.scxml create mode 100644 test/w3c/ecma/test226sub1.scxml create mode 100644 test/w3c/ecma/test228.scxml create mode 100644 test/w3c/ecma/test229.scxml create mode 100644 test/w3c/ecma/test230.scxml create mode 100644 test/w3c/ecma/test232.scxml create mode 100644 test/w3c/ecma/test233.scxml create mode 100644 test/w3c/ecma/test234.scxml create mode 100644 test/w3c/ecma/test235.scxml create mode 100644 test/w3c/ecma/test236.scxml create mode 100644 test/w3c/ecma/test237.scxml create mode 100644 test/w3c/ecma/test239.scxml create mode 100644 test/w3c/ecma/test239sub1.scxml create mode 100644 test/w3c/ecma/test240.scxml create mode 100644 test/w3c/ecma/test241.scxml create mode 100644 test/w3c/ecma/test242.scxml create mode 100644 test/w3c/ecma/test242sub1.scxml create mode 100644 test/w3c/ecma/test243.scxml create mode 100644 test/w3c/ecma/test244.scxml create mode 100644 test/w3c/ecma/test245.scxml create mode 100644 test/w3c/ecma/test247.scxml create mode 100644 test/w3c/ecma/test250.scxml create mode 100644 test/w3c/ecma/test252.scxml create mode 100644 test/w3c/ecma/test253.scxml create mode 100644 test/w3c/ecma/test276.scxml create mode 100644 test/w3c/ecma/test276sub1.scxml create mode 100644 test/w3c/ecma/test277.scxml create mode 100644 test/w3c/ecma/test278.scxml create mode 100644 test/w3c/ecma/test279.scxml create mode 100644 test/w3c/ecma/test280.scxml create mode 100644 test/w3c/ecma/test286.scxml create mode 100644 test/w3c/ecma/test287.scxml create mode 100644 test/w3c/ecma/test294.scxml create mode 100644 test/w3c/ecma/test298.scxml create mode 100644 test/w3c/ecma/test301.scxml create mode 100644 test/w3c/ecma/test302.scxml create mode 100644 test/w3c/ecma/test303.scxml create mode 100644 test/w3c/ecma/test304.scxml create mode 100644 test/w3c/ecma/test307.scxml create mode 100644 test/w3c/ecma/test309.scxml create mode 100644 test/w3c/ecma/test310.scxml create mode 100644 test/w3c/ecma/test311.scxml create mode 100644 test/w3c/ecma/test312.scxml create mode 100644 test/w3c/ecma/test313.scxml create mode 100644 test/w3c/ecma/test314.scxml create mode 100644 test/w3c/ecma/test318.scxml create mode 100644 test/w3c/ecma/test319.scxml create mode 100644 test/w3c/ecma/test321.scxml create mode 100644 test/w3c/ecma/test322.scxml create mode 100644 test/w3c/ecma/test323.scxml create mode 100644 test/w3c/ecma/test324.scxml create mode 100644 test/w3c/ecma/test325.scxml create mode 100644 test/w3c/ecma/test326.scxml create mode 100644 test/w3c/ecma/test329.scxml create mode 100644 test/w3c/ecma/test330.scxml create mode 100644 test/w3c/ecma/test331.scxml create mode 100644 test/w3c/ecma/test332.scxml create mode 100644 test/w3c/ecma/test333.scxml create mode 100644 test/w3c/ecma/test335.scxml create mode 100644 test/w3c/ecma/test336.scxml create mode 100644 test/w3c/ecma/test337.scxml create mode 100644 test/w3c/ecma/test338.scxml create mode 100644 test/w3c/ecma/test339.scxml create mode 100644 test/w3c/ecma/test342.scxml create mode 100644 test/w3c/ecma/test343.scxml create mode 100644 test/w3c/ecma/test344.scxml create mode 100644 test/w3c/ecma/test346.scxml create mode 100644 test/w3c/ecma/test347.scxml create mode 100644 test/w3c/ecma/test348.scxml create mode 100644 test/w3c/ecma/test349.scxml create mode 100644 test/w3c/ecma/test350.scxml create mode 100644 test/w3c/ecma/test351.scxml create mode 100644 test/w3c/ecma/test352.scxml create mode 100644 test/w3c/ecma/test354.scxml create mode 100644 test/w3c/ecma/test355.scxml create mode 100644 test/w3c/ecma/test364.scxml create mode 100644 test/w3c/ecma/test372.scxml create mode 100644 test/w3c/ecma/test375.scxml create mode 100644 test/w3c/ecma/test376.scxml create mode 100644 test/w3c/ecma/test377.scxml create mode 100644 test/w3c/ecma/test378.scxml create mode 100644 test/w3c/ecma/test387.scxml create mode 100644 test/w3c/ecma/test388.scxml create mode 100644 test/w3c/ecma/test396.scxml create mode 100644 test/w3c/ecma/test399.scxml create mode 100644 test/w3c/ecma/test401.scxml create mode 100644 test/w3c/ecma/test402.scxml create mode 100644 test/w3c/ecma/test403a.scxml create mode 100644 test/w3c/ecma/test403b.scxml create mode 100644 test/w3c/ecma/test403c.scxml create mode 100644 test/w3c/ecma/test404.scxml create mode 100644 test/w3c/ecma/test405.scxml create mode 100644 test/w3c/ecma/test406.scxml create mode 100644 test/w3c/ecma/test407.scxml create mode 100644 test/w3c/ecma/test409.scxml create mode 100644 test/w3c/ecma/test411.scxml create mode 100644 test/w3c/ecma/test412.scxml create mode 100644 test/w3c/ecma/test413.scxml create mode 100644 test/w3c/ecma/test415.scxml create mode 100644 test/w3c/ecma/test416.scxml create mode 100644 test/w3c/ecma/test417.scxml create mode 100644 test/w3c/ecma/test419.scxml create mode 100644 test/w3c/ecma/test421.scxml create mode 100644 test/w3c/ecma/test422.scxml create mode 100644 test/w3c/ecma/test423.scxml create mode 100644 test/w3c/ecma/test436.scxml create mode 100644 test/w3c/ecma/test444.scxml create mode 100644 test/w3c/ecma/test445.scxml create mode 100644 test/w3c/ecma/test448.scxml create mode 100644 test/w3c/ecma/test449.scxml create mode 100644 test/w3c/ecma/test451.scxml create mode 100644 test/w3c/ecma/test452.scxml create mode 100644 test/w3c/ecma/test453.scxml create mode 100644 test/w3c/ecma/test456.scxml create mode 100644 test/w3c/ecma/test457.scxml create mode 100644 test/w3c/ecma/test460.scxml create mode 100644 test/w3c/ecma/test463.scxml create mode 100644 test/w3c/ecma/test464.scxml create mode 100644 test/w3c/ecma/test465.scxml create mode 100644 test/w3c/ecma/test466.scxml create mode 100644 test/w3c/ecma/test467.scxml create mode 100644 test/w3c/ecma/test468.scxml create mode 100644 test/w3c/ecma/test469.scxml create mode 100644 test/w3c/ecma/test470.scxml create mode 100644 test/w3c/ecma/test473.scxml create mode 100644 test/w3c/ecma/test474.scxml create mode 100644 test/w3c/ecma/test475.scxml create mode 100644 test/w3c/ecma/test476.scxml create mode 100644 test/w3c/ecma/test477.scxml create mode 100644 test/w3c/ecma/test478.scxml create mode 100644 test/w3c/ecma/test479.scxml create mode 100644 test/w3c/ecma/test480.scxml create mode 100644 test/w3c/ecma/test481.scxml create mode 100644 test/w3c/ecma/test482.scxml create mode 100644 test/w3c/ecma/test483.scxml create mode 100644 test/w3c/ecma/test487.scxml create mode 100644 test/w3c/ecma/test488.scxml create mode 100644 test/w3c/ecma/test495.scxml create mode 100644 test/w3c/ecma/test500.scxml create mode 100644 test/w3c/ecma/test501.scxml create mode 100644 test/w3c/ecma/test503.scxml create mode 100644 test/w3c/ecma/test504.scxml create mode 100644 test/w3c/ecma/test505.scxml create mode 100644 test/w3c/ecma/test506.scxml create mode 100644 test/w3c/ecma/test509.scxml create mode 100644 test/w3c/ecma/test510.scxml create mode 100644 test/w3c/ecma/test513.scxml create mode 100644 test/w3c/ecma/test518.scxml create mode 100644 test/w3c/ecma/test519.scxml create mode 100644 test/w3c/ecma/test520.scxml create mode 100644 test/w3c/ecma/test521.scxml create mode 100644 test/w3c/ecma/test522.scxml create mode 100644 test/w3c/ecma/test525.scxml create mode 100644 test/w3c/ecma/test527.scxml create mode 100644 test/w3c/ecma/test528.scxml create mode 100644 test/w3c/ecma/test529.scxml create mode 100644 test/w3c/ecma/test530.scxml create mode 100644 test/w3c/ecma/test531.scxml create mode 100644 test/w3c/ecma/test532.scxml create mode 100644 test/w3c/ecma/test533.scxml create mode 100644 test/w3c/ecma/test534.scxml create mode 100644 test/w3c/ecma/test537.scxml create mode 100644 test/w3c/ecma/test539.scxml create mode 100644 test/w3c/ecma/test539.txt create mode 100644 test/w3c/ecma/test540.scxml create mode 100644 test/w3c/ecma/test540.txt create mode 100644 test/w3c/ecma/test542.scxml create mode 100644 test/w3c/ecma/test543.scxml create mode 100644 test/w3c/ecma/test544.scxml create mode 100644 test/w3c/ecma/test546.scxml create mode 100644 test/w3c/ecma/test547.scxml create mode 100644 test/w3c/ecma/test550.scxml create mode 100644 test/w3c/ecma/test551.scxml create mode 100644 test/w3c/ecma/test552.scxml create mode 100644 test/w3c/ecma/test552.txt create mode 100644 test/w3c/ecma/test553.scxml create mode 100644 test/w3c/ecma/test554.scxml create mode 100644 test/w3c/ecma/test555.scxml create mode 100644 test/w3c/ecma/test557.scxml create mode 100644 test/w3c/ecma/test557.txt create mode 100644 test/w3c/ecma/test558.scxml create mode 100644 test/w3c/ecma/test558.txt create mode 100644 test/w3c/ecma/test560.scxml create mode 100644 test/w3c/ecma/test561.scxml create mode 100644 test/w3c/ecma/test562.scxml create mode 100644 test/w3c/ecma/test567.scxml create mode 100644 test/w3c/ecma/test568.scxml create mode 100644 test/w3c/ecma/test569.scxml create mode 100644 test/w3c/ecma/test570.scxml create mode 100644 test/w3c/ecma/test576.scxml create mode 100644 test/w3c/ecma/test578.scxml create mode 100644 test/w3c/txml/robots.txt create mode 100644 test/w3c/txml/test144.txml create mode 100644 test/w3c/txml/test147.txml create mode 100644 test/w3c/txml/test148.txml create mode 100644 test/w3c/txml/test149.txml create mode 100644 test/w3c/txml/test150.txml create mode 100644 test/w3c/txml/test151.txml create mode 100644 test/w3c/txml/test152.txml create mode 100644 test/w3c/txml/test153.txml create mode 100644 test/w3c/txml/test155.txml create mode 100644 test/w3c/txml/test156.txml create mode 100644 test/w3c/txml/test158.txml create mode 100644 test/w3c/txml/test159.txml create mode 100644 test/w3c/txml/test172.txml create mode 100644 test/w3c/txml/test173.txml create mode 100644 test/w3c/txml/test174.txml create mode 100644 test/w3c/txml/test175.txml create mode 100644 test/w3c/txml/test176.txml create mode 100644 test/w3c/txml/test178.txml create mode 100644 test/w3c/txml/test179.txml create mode 100644 test/w3c/txml/test183.txml create mode 100644 test/w3c/txml/test185.txml create mode 100644 test/w3c/txml/test186.txml create mode 100644 test/w3c/txml/test187.txml create mode 100644 test/w3c/txml/test189.txml create mode 100644 test/w3c/txml/test190.txml create mode 100644 test/w3c/txml/test191.txml create mode 100644 test/w3c/txml/test192.txml create mode 100644 test/w3c/txml/test193.txml create mode 100644 test/w3c/txml/test194.txml create mode 100644 test/w3c/txml/test198.txml create mode 100644 test/w3c/txml/test199.txml create mode 100644 test/w3c/txml/test200.txml create mode 100644 test/w3c/txml/test201.txml create mode 100644 test/w3c/txml/test205.txml create mode 100644 test/w3c/txml/test207.txml create mode 100644 test/w3c/txml/test208.txml create mode 100644 test/w3c/txml/test210.txml create mode 100644 test/w3c/txml/test215.txml create mode 100644 test/w3c/txml/test216.txml create mode 100644 test/w3c/txml/test216sub1.txml create mode 100644 test/w3c/txml/test220.txml create mode 100644 test/w3c/txml/test223.txml create mode 100644 test/w3c/txml/test224.txml create mode 100644 test/w3c/txml/test225.txml create mode 100644 test/w3c/txml/test226.txml create mode 100644 test/w3c/txml/test226sub1.txml create mode 100644 test/w3c/txml/test228.txml create mode 100644 test/w3c/txml/test229.txml create mode 100644 test/w3c/txml/test230.txml create mode 100644 test/w3c/txml/test232.txml create mode 100644 test/w3c/txml/test233.txml create mode 100644 test/w3c/txml/test234.txml create mode 100644 test/w3c/txml/test235.txml create mode 100644 test/w3c/txml/test236.txml create mode 100644 test/w3c/txml/test237.txml create mode 100644 test/w3c/txml/test239.txml create mode 100644 test/w3c/txml/test239sub1.txml create mode 100644 test/w3c/txml/test240.txml create mode 100644 test/w3c/txml/test241.txml create mode 100644 test/w3c/txml/test242.txml create mode 100644 test/w3c/txml/test242sub1.txml create mode 100644 test/w3c/txml/test243.txml create mode 100644 test/w3c/txml/test244.txml create mode 100644 test/w3c/txml/test245.txml create mode 100644 test/w3c/txml/test247.txml create mode 100644 test/w3c/txml/test250.txml create mode 100644 test/w3c/txml/test252.txml create mode 100644 test/w3c/txml/test253.txml create mode 100644 test/w3c/txml/test276.txml create mode 100644 test/w3c/txml/test276sub1.txml create mode 100644 test/w3c/txml/test277.txml create mode 100644 test/w3c/txml/test278.txml create mode 100644 test/w3c/txml/test279.txml create mode 100644 test/w3c/txml/test280.txml create mode 100644 test/w3c/txml/test286.txml create mode 100644 test/w3c/txml/test287.txml create mode 100644 test/w3c/txml/test294.txml create mode 100644 test/w3c/txml/test298.txml create mode 100644 test/w3c/txml/test301.txml create mode 100644 test/w3c/txml/test302.txml create mode 100644 test/w3c/txml/test303.txml create mode 100644 test/w3c/txml/test304.txml create mode 100644 test/w3c/txml/test307.txml create mode 100644 test/w3c/txml/test309.txml create mode 100644 test/w3c/txml/test310.txml create mode 100644 test/w3c/txml/test311.txml create mode 100644 test/w3c/txml/test312.txml create mode 100644 test/w3c/txml/test313.txml create mode 100644 test/w3c/txml/test314.txml create mode 100644 test/w3c/txml/test318.txml create mode 100644 test/w3c/txml/test319.txml create mode 100644 test/w3c/txml/test321.txml create mode 100644 test/w3c/txml/test322.txml create mode 100644 test/w3c/txml/test323.txml create mode 100644 test/w3c/txml/test324.txml create mode 100644 test/w3c/txml/test325.txml create mode 100644 test/w3c/txml/test326.txml create mode 100644 test/w3c/txml/test329.txml create mode 100644 test/w3c/txml/test330.txml create mode 100644 test/w3c/txml/test331.txml create mode 100644 test/w3c/txml/test332.txml create mode 100644 test/w3c/txml/test333.txml create mode 100644 test/w3c/txml/test335.txml create mode 100644 test/w3c/txml/test336.txml create mode 100644 test/w3c/txml/test337.txml create mode 100644 test/w3c/txml/test338.txml create mode 100644 test/w3c/txml/test339.txml create mode 100644 test/w3c/txml/test342.txml create mode 100644 test/w3c/txml/test343.txml create mode 100644 test/w3c/txml/test344.txml create mode 100644 test/w3c/txml/test346.txml create mode 100644 test/w3c/txml/test347.txml create mode 100644 test/w3c/txml/test348.txml create mode 100644 test/w3c/txml/test349.txml create mode 100644 test/w3c/txml/test350.txml create mode 100644 test/w3c/txml/test351.txml create mode 100644 test/w3c/txml/test352.txml create mode 100644 test/w3c/txml/test354.txml create mode 100644 test/w3c/txml/test355.txml create mode 100644 test/w3c/txml/test364.txml create mode 100644 test/w3c/txml/test372.txml create mode 100644 test/w3c/txml/test375.txml create mode 100644 test/w3c/txml/test376.txml create mode 100644 test/w3c/txml/test377.txml create mode 100644 test/w3c/txml/test378.txml create mode 100644 test/w3c/txml/test387.txml create mode 100644 test/w3c/txml/test388.txml create mode 100644 test/w3c/txml/test396.txml create mode 100644 test/w3c/txml/test399.txml create mode 100644 test/w3c/txml/test401.txml create mode 100644 test/w3c/txml/test402.txml create mode 100644 test/w3c/txml/test403a.txml create mode 100644 test/w3c/txml/test403b.txml create mode 100644 test/w3c/txml/test403c.txml create mode 100644 test/w3c/txml/test404.txml create mode 100644 test/w3c/txml/test405.txml create mode 100644 test/w3c/txml/test406.txml create mode 100644 test/w3c/txml/test407.txml create mode 100644 test/w3c/txml/test409.txml create mode 100644 test/w3c/txml/test411.txml create mode 100644 test/w3c/txml/test412.txml create mode 100644 test/w3c/txml/test413.txml create mode 100644 test/w3c/txml/test415.txml create mode 100644 test/w3c/txml/test416.txml create mode 100644 test/w3c/txml/test417.txml create mode 100644 test/w3c/txml/test419.txml create mode 100644 test/w3c/txml/test421.txml create mode 100644 test/w3c/txml/test422.txml create mode 100644 test/w3c/txml/test423.txml create mode 100644 test/w3c/txml/test436.txml create mode 100644 test/w3c/txml/test444.txml create mode 100644 test/w3c/txml/test445.txml create mode 100644 test/w3c/txml/test448.txml create mode 100644 test/w3c/txml/test449.txml create mode 100644 test/w3c/txml/test451.txml create mode 100644 test/w3c/txml/test452.txml create mode 100644 test/w3c/txml/test453.txml create mode 100644 test/w3c/txml/test456.txml create mode 100644 test/w3c/txml/test457.txml create mode 100644 test/w3c/txml/test460.txml create mode 100644 test/w3c/txml/test463.txml create mode 100644 test/w3c/txml/test464.txml create mode 100644 test/w3c/txml/test465.txml create mode 100644 test/w3c/txml/test466.txml create mode 100644 test/w3c/txml/test467.txml create mode 100644 test/w3c/txml/test468.txml create mode 100644 test/w3c/txml/test469.txml create mode 100644 test/w3c/txml/test470.txml create mode 100644 test/w3c/txml/test473.txml create mode 100644 test/w3c/txml/test474.txml create mode 100644 test/w3c/txml/test475.txml create mode 100644 test/w3c/txml/test476.txml create mode 100644 test/w3c/txml/test477.txml create mode 100644 test/w3c/txml/test478.txml create mode 100644 test/w3c/txml/test479.txml create mode 100644 test/w3c/txml/test480.txml create mode 100644 test/w3c/txml/test481.txml create mode 100644 test/w3c/txml/test482.txml create mode 100644 test/w3c/txml/test483.txml create mode 100644 test/w3c/txml/test487.txml create mode 100644 test/w3c/txml/test488.txml create mode 100644 test/w3c/txml/test495.txml create mode 100644 test/w3c/txml/test500.txml create mode 100644 test/w3c/txml/test501.txml create mode 100644 test/w3c/txml/test503.txml create mode 100644 test/w3c/txml/test504.txml create mode 100644 test/w3c/txml/test505.txml create mode 100644 test/w3c/txml/test506.txml create mode 100644 test/w3c/txml/test509.txml create mode 100644 test/w3c/txml/test510.txml create mode 100644 test/w3c/txml/test513.txml create mode 100644 test/w3c/txml/test518.txml create mode 100644 test/w3c/txml/test519.txml create mode 100644 test/w3c/txml/test520.txml create mode 100644 test/w3c/txml/test521.txml create mode 100644 test/w3c/txml/test522.txml create mode 100644 test/w3c/txml/test525.txml create mode 100644 test/w3c/txml/test527.txml create mode 100644 test/w3c/txml/test528.txml create mode 100644 test/w3c/txml/test529.txml create mode 100644 test/w3c/txml/test530.txml create mode 100644 test/w3c/txml/test531.txml create mode 100644 test/w3c/txml/test532.txml create mode 100644 test/w3c/txml/test533.txml create mode 100644 test/w3c/txml/test534.txml create mode 100644 test/w3c/txml/test537.txml create mode 100644 test/w3c/txml/test539.txml create mode 100644 test/w3c/txml/test539.txt create mode 100644 test/w3c/txml/test540.txml create mode 100644 test/w3c/txml/test540.txt create mode 100644 test/w3c/txml/test542.txml create mode 100644 test/w3c/txml/test543.txml create mode 100644 test/w3c/txml/test544.txml create mode 100644 test/w3c/txml/test546.txml create mode 100644 test/w3c/txml/test547.txml create mode 100644 test/w3c/txml/test550.txml create mode 100644 test/w3c/txml/test551.txml create mode 100644 test/w3c/txml/test552.txml create mode 100644 test/w3c/txml/test552.txt create mode 100644 test/w3c/txml/test553.txml create mode 100644 test/w3c/txml/test554.txml create mode 100644 test/w3c/txml/test555.txml create mode 100644 test/w3c/txml/test557.txml create mode 100644 test/w3c/txml/test557.txt create mode 100644 test/w3c/txml/test558.txml create mode 100644 test/w3c/txml/test558.txt create mode 100644 test/w3c/txml/test560.txml create mode 100644 test/w3c/txml/test561.txml create mode 100644 test/w3c/txml/test562.txml create mode 100644 test/w3c/txml/test567.txml create mode 100644 test/w3c/txml/test568.txml create mode 100644 test/w3c/txml/test569.txml create mode 100644 test/w3c/txml/test570.txml create mode 100644 test/w3c/txml/test576.txml create mode 100644 test/w3c/txml/test578.txml create mode 100755 test/w3c/update-txml.sh create mode 100644 test/w3c/xpath/robots.txt create mode 100644 test/w3c/xpath/test144.scxml create mode 100644 test/w3c/xpath/test147.scxml create mode 100644 test/w3c/xpath/test148.scxml create mode 100644 test/w3c/xpath/test149.scxml create mode 100644 test/w3c/xpath/test150.scxml create mode 100644 test/w3c/xpath/test151.scxml create mode 100644 test/w3c/xpath/test152.scxml create mode 100644 test/w3c/xpath/test153.scxml create mode 100644 test/w3c/xpath/test155.scxml create mode 100644 test/w3c/xpath/test156.scxml create mode 100644 test/w3c/xpath/test158.scxml create mode 100644 test/w3c/xpath/test159.scxml create mode 100644 test/w3c/xpath/test172.scxml create mode 100644 test/w3c/xpath/test173.scxml create mode 100644 test/w3c/xpath/test174.scxml create mode 100644 test/w3c/xpath/test175.scxml create mode 100644 test/w3c/xpath/test176.scxml create mode 100644 test/w3c/xpath/test178.scxml create mode 100644 test/w3c/xpath/test179.scxml create mode 100644 test/w3c/xpath/test183.scxml create mode 100644 test/w3c/xpath/test185.scxml create mode 100644 test/w3c/xpath/test186.scxml create mode 100644 test/w3c/xpath/test187.scxml create mode 100644 test/w3c/xpath/test189.scxml create mode 100644 test/w3c/xpath/test190.scxml create mode 100644 test/w3c/xpath/test191.scxml create mode 100644 test/w3c/xpath/test192.scxml create mode 100644 test/w3c/xpath/test193.scxml create mode 100644 test/w3c/xpath/test194.scxml create mode 100644 test/w3c/xpath/test198.scxml create mode 100644 test/w3c/xpath/test199.scxml create mode 100644 test/w3c/xpath/test200.scxml create mode 100644 test/w3c/xpath/test201.scxml create mode 100644 test/w3c/xpath/test205.scxml create mode 100644 test/w3c/xpath/test207.scxml create mode 100644 test/w3c/xpath/test208.scxml create mode 100644 test/w3c/xpath/test210.scxml create mode 100644 test/w3c/xpath/test215.scxml create mode 100644 test/w3c/xpath/test216.scxml create mode 100644 test/w3c/xpath/test216sub1.scxml create mode 100644 test/w3c/xpath/test220.scxml create mode 100644 test/w3c/xpath/test223.scxml create mode 100644 test/w3c/xpath/test224.scxml create mode 100644 test/w3c/xpath/test225.scxml create mode 100644 test/w3c/xpath/test226.scxml create mode 100644 test/w3c/xpath/test226sub1.scxml create mode 100644 test/w3c/xpath/test228.scxml create mode 100644 test/w3c/xpath/test229.scxml create mode 100644 test/w3c/xpath/test230.scxml create mode 100644 test/w3c/xpath/test232.scxml create mode 100644 test/w3c/xpath/test233.scxml create mode 100644 test/w3c/xpath/test234.scxml create mode 100644 test/w3c/xpath/test235.scxml create mode 100644 test/w3c/xpath/test236.scxml create mode 100644 test/w3c/xpath/test237.scxml create mode 100644 test/w3c/xpath/test239.scxml create mode 100644 test/w3c/xpath/test239sub1.scxml create mode 100644 test/w3c/xpath/test240.scxml create mode 100644 test/w3c/xpath/test241.scxml create mode 100644 test/w3c/xpath/test242.scxml create mode 100644 test/w3c/xpath/test242sub1.scxml create mode 100644 test/w3c/xpath/test243.scxml create mode 100644 test/w3c/xpath/test244.scxml create mode 100644 test/w3c/xpath/test245.scxml create mode 100644 test/w3c/xpath/test247.scxml create mode 100644 test/w3c/xpath/test250.scxml create mode 100644 test/w3c/xpath/test252.scxml create mode 100644 test/w3c/xpath/test253.scxml create mode 100644 test/w3c/xpath/test276.scxml create mode 100644 test/w3c/xpath/test276sub1.scxml create mode 100644 test/w3c/xpath/test277.scxml create mode 100644 test/w3c/xpath/test278.scxml create mode 100644 test/w3c/xpath/test279.scxml create mode 100644 test/w3c/xpath/test280.scxml create mode 100644 test/w3c/xpath/test286.scxml create mode 100644 test/w3c/xpath/test287.scxml create mode 100644 test/w3c/xpath/test294.scxml create mode 100644 test/w3c/xpath/test298.scxml create mode 100644 test/w3c/xpath/test301.scxml create mode 100644 test/w3c/xpath/test302.scxml create mode 100644 test/w3c/xpath/test303.scxml create mode 100644 test/w3c/xpath/test304.scxml create mode 100644 test/w3c/xpath/test307.scxml create mode 100644 test/w3c/xpath/test309.scxml create mode 100644 test/w3c/xpath/test310.scxml create mode 100644 test/w3c/xpath/test311.scxml create mode 100644 test/w3c/xpath/test312.scxml create mode 100644 test/w3c/xpath/test313.scxml create mode 100644 test/w3c/xpath/test314.scxml create mode 100644 test/w3c/xpath/test318.scxml create mode 100644 test/w3c/xpath/test319.scxml create mode 100644 test/w3c/xpath/test321.scxml create mode 100644 test/w3c/xpath/test322.scxml create mode 100644 test/w3c/xpath/test323.scxml create mode 100644 test/w3c/xpath/test324.scxml create mode 100644 test/w3c/xpath/test325.scxml create mode 100644 test/w3c/xpath/test326.scxml create mode 100644 test/w3c/xpath/test329.scxml create mode 100644 test/w3c/xpath/test330.scxml create mode 100644 test/w3c/xpath/test331.scxml create mode 100644 test/w3c/xpath/test332.scxml create mode 100644 test/w3c/xpath/test333.scxml create mode 100644 test/w3c/xpath/test335.scxml create mode 100644 test/w3c/xpath/test336.scxml create mode 100644 test/w3c/xpath/test337.scxml create mode 100644 test/w3c/xpath/test338.scxml create mode 100644 test/w3c/xpath/test339.scxml create mode 100644 test/w3c/xpath/test342.scxml create mode 100644 test/w3c/xpath/test343.scxml create mode 100644 test/w3c/xpath/test344.scxml create mode 100644 test/w3c/xpath/test346.scxml create mode 100644 test/w3c/xpath/test347.scxml create mode 100644 test/w3c/xpath/test348.scxml create mode 100644 test/w3c/xpath/test349.scxml create mode 100644 test/w3c/xpath/test350.scxml create mode 100644 test/w3c/xpath/test351.scxml create mode 100644 test/w3c/xpath/test352.scxml create mode 100644 test/w3c/xpath/test354.scxml create mode 100644 test/w3c/xpath/test355.scxml create mode 100644 test/w3c/xpath/test364.scxml create mode 100644 test/w3c/xpath/test372.scxml create mode 100644 test/w3c/xpath/test375.scxml create mode 100644 test/w3c/xpath/test376.scxml create mode 100644 test/w3c/xpath/test377.scxml create mode 100644 test/w3c/xpath/test378.scxml create mode 100644 test/w3c/xpath/test387.scxml create mode 100644 test/w3c/xpath/test388.scxml create mode 100644 test/w3c/xpath/test396.scxml create mode 100644 test/w3c/xpath/test399.scxml create mode 100644 test/w3c/xpath/test401.scxml create mode 100644 test/w3c/xpath/test402.scxml create mode 100644 test/w3c/xpath/test403a.scxml create mode 100644 test/w3c/xpath/test403b.scxml create mode 100644 test/w3c/xpath/test403c.scxml create mode 100644 test/w3c/xpath/test404.scxml create mode 100644 test/w3c/xpath/test405.scxml create mode 100644 test/w3c/xpath/test406.scxml create mode 100644 test/w3c/xpath/test407.scxml create mode 100644 test/w3c/xpath/test409.scxml create mode 100644 test/w3c/xpath/test411.scxml create mode 100644 test/w3c/xpath/test412.scxml create mode 100644 test/w3c/xpath/test413.scxml create mode 100644 test/w3c/xpath/test415.scxml create mode 100644 test/w3c/xpath/test416.scxml create mode 100644 test/w3c/xpath/test417.scxml create mode 100644 test/w3c/xpath/test419.scxml create mode 100644 test/w3c/xpath/test421.scxml create mode 100644 test/w3c/xpath/test422.scxml create mode 100644 test/w3c/xpath/test423.scxml create mode 100644 test/w3c/xpath/test436.scxml create mode 100644 test/w3c/xpath/test444.scxml create mode 100644 test/w3c/xpath/test445.scxml create mode 100644 test/w3c/xpath/test448.scxml create mode 100644 test/w3c/xpath/test449.scxml create mode 100644 test/w3c/xpath/test451.scxml create mode 100644 test/w3c/xpath/test452.scxml create mode 100644 test/w3c/xpath/test453.scxml create mode 100644 test/w3c/xpath/test456.scxml create mode 100644 test/w3c/xpath/test457.scxml create mode 100644 test/w3c/xpath/test460.scxml create mode 100644 test/w3c/xpath/test463.scxml create mode 100644 test/w3c/xpath/test464.scxml create mode 100644 test/w3c/xpath/test465.scxml create mode 100644 test/w3c/xpath/test466.scxml create mode 100644 test/w3c/xpath/test467.scxml create mode 100644 test/w3c/xpath/test468.scxml create mode 100644 test/w3c/xpath/test469.scxml create mode 100644 test/w3c/xpath/test470.scxml create mode 100644 test/w3c/xpath/test473.scxml create mode 100644 test/w3c/xpath/test474.scxml create mode 100644 test/w3c/xpath/test475.scxml create mode 100644 test/w3c/xpath/test476.scxml create mode 100644 test/w3c/xpath/test477.scxml create mode 100644 test/w3c/xpath/test478.scxml create mode 100644 test/w3c/xpath/test479.scxml create mode 100644 test/w3c/xpath/test480.scxml create mode 100644 test/w3c/xpath/test481.scxml create mode 100644 test/w3c/xpath/test482.scxml create mode 100644 test/w3c/xpath/test483.scxml create mode 100644 test/w3c/xpath/test487.scxml create mode 100644 test/w3c/xpath/test488.scxml create mode 100644 test/w3c/xpath/test495.scxml create mode 100644 test/w3c/xpath/test500.scxml create mode 100644 test/w3c/xpath/test501.scxml create mode 100644 test/w3c/xpath/test503.scxml create mode 100644 test/w3c/xpath/test504.scxml create mode 100644 test/w3c/xpath/test505.scxml create mode 100644 test/w3c/xpath/test506.scxml create mode 100644 test/w3c/xpath/test509.scxml create mode 100644 test/w3c/xpath/test510.scxml create mode 100644 test/w3c/xpath/test513.scxml create mode 100644 test/w3c/xpath/test518.scxml create mode 100644 test/w3c/xpath/test519.scxml create mode 100644 test/w3c/xpath/test520.scxml create mode 100644 test/w3c/xpath/test521.scxml create mode 100644 test/w3c/xpath/test522.scxml create mode 100644 test/w3c/xpath/test525.scxml create mode 100644 test/w3c/xpath/test527.scxml create mode 100644 test/w3c/xpath/test528.scxml create mode 100644 test/w3c/xpath/test529.scxml create mode 100644 test/w3c/xpath/test530.scxml create mode 100644 test/w3c/xpath/test531.scxml create mode 100644 test/w3c/xpath/test532.scxml create mode 100644 test/w3c/xpath/test533.scxml create mode 100644 test/w3c/xpath/test534.scxml create mode 100644 test/w3c/xpath/test537.scxml create mode 100644 test/w3c/xpath/test539.scxml create mode 100644 test/w3c/xpath/test539.txt create mode 100644 test/w3c/xpath/test540.scxml create mode 100644 test/w3c/xpath/test540.txt create mode 100644 test/w3c/xpath/test542.scxml create mode 100644 test/w3c/xpath/test543.scxml create mode 100644 test/w3c/xpath/test544.scxml create mode 100644 test/w3c/xpath/test546.scxml create mode 100644 test/w3c/xpath/test547.scxml create mode 100644 test/w3c/xpath/test550.scxml create mode 100644 test/w3c/xpath/test551.scxml create mode 100644 test/w3c/xpath/test552.scxml create mode 100644 test/w3c/xpath/test552.txt create mode 100644 test/w3c/xpath/test553.scxml create mode 100644 test/w3c/xpath/test554.scxml create mode 100644 test/w3c/xpath/test555.scxml create mode 100644 test/w3c/xpath/test557.scxml create mode 100644 test/w3c/xpath/test557.txt create mode 100644 test/w3c/xpath/test558.scxml create mode 100644 test/w3c/xpath/test558.txt create mode 100644 test/w3c/xpath/test560.scxml create mode 100644 test/w3c/xpath/test561.scxml create mode 100644 test/w3c/xpath/test562.scxml create mode 100644 test/w3c/xpath/test567.scxml create mode 100644 test/w3c/xpath/test568.scxml create mode 100644 test/w3c/xpath/test569.scxml create mode 100644 test/w3c/xpath/test570.scxml create mode 100644 test/w3c/xpath/test576.scxml create mode 100644 test/w3c/xpath/test578.scxml diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index d485b3a..037f9a1 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -132,7 +132,7 @@ int main(int argc, char** argv) { if (options.pluginPath.length() > 0) { Factory::pluginPath = options.pluginPath; } - + // setup HTTP server HTTPServer::SSLConfig* sslConf = NULL; if (options.certificate.length() > 0) { @@ -155,7 +155,7 @@ int main(int argc, char** argv) { debugger = new DebuggerServlet(); HTTPServer::getInstance()->registerServlet("/debug", debugger); } - + // instantiate and configure interpreters std::list interpreters; std::map::iterator confIter = options.interpreters.begin(); @@ -212,6 +212,6 @@ int main(int argc, char** argv) { while(true) tthread::this_thread::sleep_for(tthread::chrono::seconds(1)); } - + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp index 15079d6..09da679 100644 --- a/apps/uscxml-transform.cpp +++ b/apps/uscxml-transform.cpp @@ -1,8 +1,10 @@ #include "uscxml/config.h" #include "uscxml/Interpreter.h" #include "uscxml/transform/ChartToFSM.h" +#include "uscxml/transform/FSMToPromela.h" #include "uscxml/DOMUtils.h" #include +#include #ifdef HAS_SIGNAL_H #include @@ -22,7 +24,7 @@ class VerboseMonitor : public uscxml::InterpreterMonitor { } void beforeProcessingEvent(uscxml::Interpreter interpreter, const uscxml::Event& event) { - std::cout << "Event: " << event.name << std::endl; + std::cerr << "Event: " << event.name << std::endl; } void beforeCompletion(uscxml::Interpreter interpreter) { @@ -31,12 +33,12 @@ class VerboseMonitor : public uscxml::InterpreterMonitor { void printConfig(const Arabica::XPath::NodeSet& config) { std::string seperator; - std::cout << "Config: {"; + std::cerr << "Config: {"; for (int i = 0; i < config.size(); i++) { - std::cout << seperator << ATTR(config[i], "id"); + std::cerr << seperator << ATTR(config[i], "id"); seperator = ", "; } - std::cout << "}" << std::endl; + std::cerr << "}" << std::endl; } }; @@ -109,6 +111,33 @@ void customTerminate() { } #endif +void printUsageAndExit(const char* progName) { + // remove path from program name + std::string progStr(progName); + if (progStr.find_last_of(PATH_SEPERATOR) != std::string::npos) { + progStr = progStr.substr(progStr.find_last_of(PATH_SEPERATOR) + 1, progStr.length() - (progStr.find_last_of(PATH_SEPERATOR) + 1)); + } + + printf("%s version " USCXML_VERSION " (" CMAKE_BUILD_TYPE " build - " CMAKE_COMPILER_STRING ")\n", progStr.c_str()); + printf("Usage\n"); + printf("\t%s", progStr.c_str()); + printf(" [-fs] [-v] [-lN]"); +#ifdef BUILD_AS_PLUGINS + printf(" [-p pluginPath]"); +#endif + printf(" [-i URL] [-o FILE]"); + printf("\n"); + printf("Options\n"); + printf("\t-f : flatten to state-machine\n"); + printf("\t-s : convert to spin/promela program\n"); + printf("\t-v : be verbose\n"); + printf("\t-lN : Set loglevel to N\n"); + printf("\t-i URL : Input file (defaults to STDIN)\n"); + printf("\t-o FILE : Output file (defaults to STDOUT)\n"); + printf("\n"); + exit(1); +} + int main(int argc, char** argv) { using namespace uscxml; @@ -118,7 +147,7 @@ int main(int argc, char** argv) { std::string pluginPath; std::string inputFile; std::string outputFile; - + #if defined(HAS_SIGNAL_H) && !defined(WIN32) signal(SIGPIPE, SIG_IGN); #endif @@ -149,42 +178,46 @@ int main(int argc, char** argv) { int optionInd = 0; int option; for (;;) { - option = getopt_long_only(argc, argv, "+vfs:p:i:o:l:", longOptions, &optionInd); + option = getopt_long_only(argc, argv, "+vfsp:i:o:l:", longOptions, &optionInd); if (option == -1) { break; } switch(option) { - // cases without short option - case 0: { - break; - } - // cases with short-hand options - case 'v': - verbose = true; - break; - case 'f': - toFlat = true; - break; - case 's': - toPromela = true; - break; - case 'p': - pluginPath = optarg; - break; - case 'i': - inputFile = optarg; - break; - case 'o': - outputFile = optarg; - break; - case 'l': - break; - case '?': { - break; - } - default: - break; + // cases without short option + case 0: { + break; + } + // cases with short-hand options + case 'v': + verbose = true; + break; + case 'f': + toFlat = true; + break; + case 's': + toPromela = true; + break; + case 'p': + pluginPath = optarg; + break; + case 'i': + inputFile = optarg; + break; + case 'o': + outputFile = optarg; + break; + case 'l': + break; + case '?': { + break; } + default: + break; + } + } + + if (!toPromela && !toFlat) { + printUsageAndExit(argv[0]); } // register plugins @@ -194,7 +227,7 @@ int main(int argc, char** argv) { // start HTTP server HTTPServer::getInstance(30444, 30445, NULL); - + Interpreter interpreter; if (inputFile.size() == 0 || inputFile == "-") { LOG(INFO) << "Reading SCXML from STDIN"; @@ -211,17 +244,26 @@ int main(int argc, char** argv) { LOG(ERROR) << "Cannot create interpreter from " << inputFile; exit(EXIT_FAILURE); } - - if (toFlat) { - std::cout << ChartToFSM::flatten(interpreter.getDocument(), interpreter.getNameSpaceInfo()); + + if (toPromela) { + Interpreter flatInterpreter = ChartToFSM::flatten(interpreter); + + if (outputFile.size() == 0 || outputFile == "-") { + FSMToPromela::writeProgram(std::cout, flatInterpreter); + } else { + std::ofstream outStream; + outStream.open(outputFile.c_str()); + FSMToPromela::writeProgram(outStream, flatInterpreter); + outStream.close(); + } exit(EXIT_SUCCESS); } - if (toPromela) { - std::cout << ChartToFSM::flatten(interpreter.getDocument(), interpreter.getNameSpaceInfo()); + if (toFlat) { + std::cout << ChartToFSM::flatten(interpreter).getDocument(); exit(EXIT_SUCCESS); } - - + + return EXIT_SUCCESS; } \ No newline at end of file diff --git a/contrib/dom/idl/Document.idl b/contrib/dom/idl/Document.idl index 56035b0..e80087a 100644 --- a/contrib/dom/idl/Document.idl +++ b/contrib/dom/idl/Document.idl @@ -22,11 +22,11 @@ interface Document : Node { in boolean deep) raises(DOMException); // Introduced in DOM Level 2: - Element createElementNS(in DOMString namespaceURI, + [Custom] Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); // Introduced in DOM Level 2: - Attr createAttributeNS(in DOMString namespaceURI, + [Custom] Attr createAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); // Introduced in DOM Level 2: diff --git a/src/uscxml/DOMUtils.cpp b/src/uscxml/DOMUtils.cpp index 1115c1d..0a6e350 100644 --- a/src/uscxml/DOMUtils.cpp +++ b/src/uscxml/DOMUtils.cpp @@ -25,22 +25,22 @@ namespace uscxml { - + bool DOMUtils::attributeIsTrue(const::std::string& value) { return (iequals(value, "on") || - iequals(value, "true") || - iequals(value, "1") || - iequals(value, "yes")); + iequals(value, "true") || + iequals(value, "1") || + iequals(value, "yes")); } std::string DOMUtils::xPathForNode(const Arabica::DOM::Node& node, const std::string& ns) { std::string xPath; std::string nsPrefix; - + if (ns.size() > 0) { nsPrefix = ns + ":"; } - + if (!node || node.getNodeType() != Arabica::DOM::Node_base::ELEMENT_NODE) return xPath; diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp index 5f3d172..289c2bb 100644 --- a/src/uscxml/Factory.cpp +++ b/src/uscxml/Factory.cpp @@ -623,7 +623,7 @@ void DataModelImpl::throwErrorPlatform(const std::string& cause) { throw exc; } - + Factory* Factory::_instance = NULL; std::string Factory::pluginPath; } \ No newline at end of file diff --git a/src/uscxml/Factory.h b/src/uscxml/Factory.h index 14325f1..02ce6b8 100644 --- a/src/uscxml/Factory.h +++ b/src/uscxml/Factory.h @@ -126,7 +126,7 @@ public: void setElement(const Arabica::DOM::Element& element) { _element = element; } - + Arabica::DOM::Element getElement() { return _element; } @@ -181,7 +181,7 @@ public: void setElement(const Arabica::DOM::Element& element) { _impl->setElement(element); } - + Arabica::DOM::Element getElement() { return _impl->getElement(); } @@ -316,11 +316,13 @@ public: _interpreter = interpreter; } - virtual std::string andExpressions(std::list) { return ""; } - + virtual std::string andExpressions(std::list) { + return ""; + } + static void throwErrorExecution(const std::string& cause); static void throwErrorPlatform(const std::string& cause); - + // we need it public for various static functions InterpreterImpl* _interpreter; }; diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index ee8c7d0..b7de262 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -236,6 +236,35 @@ DONE_PARSING_CMD: return options; } + +void NameSpaceInfo::init(const std::map& namespaceInfo) { + nsInfo = namespaceInfo; + nsURL = ""; + nsContext = new Arabica::XPath::StandardNamespaceContext(); + + std::map::const_iterator nsIter = namespaceInfo.begin(); + while(nsIter != namespaceInfo.end()) { + std::string uri = nsIter->first; + std::string prefix = nsIter->second; + if (iequals(uri, "http://www.w3.org/2005/07/scxml")) { + nsURL = uri; + if (prefix.size() == 0) { + xpathPrefix = "scxml:"; + nsContext->addNamespaceDeclaration(uri, "scxml"); + } else { + xpathPrefix = prefix + ":"; + xmlNSPrefix = xpathPrefix; + nsContext->addNamespaceDeclaration(uri, prefix); + nsToPrefix[uri] = prefix; + } + } else { + nsContext->addNamespaceDeclaration(uri, prefix); + nsToPrefix[uri] = prefix; + } + nsIter++; + } +} + std::map > Interpreter::_instances; tthread::recursive_mutex Interpreter::_instanceMutex; @@ -255,7 +284,6 @@ std::map > Interpreter::getInstanc InterpreterImpl::InterpreterImpl() { _lastRunOnMainThread = 0; - _nsURL = "*"; _thread = NULL; _sendQueue = NULL; _parentQueue = NULL; @@ -274,7 +302,7 @@ InterpreterImpl::InterpreterImpl() { #endif } -Interpreter Interpreter::fromDOM(const Arabica::DOM::Document& dom, const std::map& nameSpaceInfo) { +Interpreter Interpreter::fromDOM(const Arabica::DOM::Document& dom, const NameSpaceInfo& nameSpaceInfo) { tthread::lock_guard lock(_instanceMutex); boost::shared_ptr interpreterImpl = boost::shared_ptr(new INTERPRETER_IMPL); Interpreter interpreter(interpreterImpl); @@ -343,6 +371,7 @@ Interpreter Interpreter::fromURI(const std::string& uri) { Interpreter Interpreter::fromInputSource(Arabica::SAX::InputSource& source) { tthread::lock_guard lock(_instanceMutex); + // remove old instances std::map >::iterator instIter = _instances.begin(); while(instIter != _instances.end()) { if (!instIter->second.lock()) { @@ -370,34 +399,60 @@ Interpreter Interpreter::fromInputSource(Arabica::SAX::InputSource& return interpreter; } -void InterpreterImpl::setNameSpaceInfo(const std::map namespaceInfo) { - _nameSpaceInfo = namespaceInfo; - std::map::const_iterator nsIter = namespaceInfo.begin(); - while(nsIter != namespaceInfo.end()) { - std::string uri = nsIter->first; - std::string prefix = nsIter->second; - if (iequals(uri, "http://www.w3.org/2005/07/scxml")) { - _nsURL = uri; - if (prefix.size() == 0) { -// LOG(INFO) << "Mapped default namespace to 'scxml:'"; - _xpathPrefix = "scxml:"; - _nsContext.addNamespaceDeclaration(uri, "scxml"); - _nsToPrefix[uri] = "scxml"; - } else { - _xpathPrefix = prefix + ":"; - _xmlNSPrefix = _xpathPrefix; - _nsContext.addNamespaceDeclaration(uri, prefix); - _nsToPrefix[uri] = prefix; - } +Interpreter Interpreter::fromClone(const Interpreter& other) { + boost::shared_ptr interpreterImpl = boost::shared_ptr(new INTERPRETER_IMPL); + + other.getImpl()->copyTo(interpreterImpl); + Interpreter interpreter(interpreterImpl); + return interpreter; +} + +void InterpreterImpl::copyTo(InterpreterImpl* other) { + if (getDocument()) { +#if 0 + std::stringstream* ss = new std::stringstream(); + (*ss) << getDocument(); + // we need an auto_ptr for arabica to assume ownership + std::auto_ptr ssPtr(ss); + Arabica::SAX::InputSource inputSource; + inputSource.setByteStream(ssPtr); + + NameSpacingParser parser; + if (parser.parse(inputSource) && parser.getDocument() && parser.getDocument().hasChildNodes()) { + other->setNameSpaceInfo(parser.nameSpace); + other->_document = parser.getDocument(); + other->init(); } else { - _nsContext.addNamespaceDeclaration(uri, prefix); - _nsToPrefix[uri] = prefix; + if (parser.errorsReported()) { + LOG(ERROR) << parser.errors(); + } } - nsIter++; + +#else + Arabica::DOM::Document clonedDocument; + DOMImplementation domFactory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); + clonedDocument = domFactory.createDocument(getDocument().getNamespaceURI(), "", 0); + + Node child = getDocument().getFirstChild(); + while (child) { + Node newNode = clonedDocument.importNode(child, true); + clonedDocument.appendChild(newNode); + child = child.getNextSibling(); + } + + other->_document = clonedDocument; + + other->setNameSpaceInfo(_nsInfo); + other->init(); +#endif } +} +void InterpreterImpl::copyTo(boost::shared_ptr other) { + copyTo(other.get()); } + void InterpreterImpl::setName(const std::string& name) { if (!_running) { _name = name; @@ -415,7 +470,7 @@ InterpreterImpl::~InterpreterImpl() { Event event; event.name = "unblock.and.die"; receive(event); - + _thread->join(); delete(_thread); } else { @@ -439,7 +494,7 @@ void InterpreterImpl::stop() { _running = false; } - + void InterpreterImpl::run(void* instance) { try { ((InterpreterImpl*)instance)->interpret(); @@ -489,12 +544,18 @@ bool InterpreterImpl::runOnMainThread(int fps, bool blocking) { void InterpreterImpl::init() { if (_document) { - NodeList scxmls = _document.getElementsByTagNameNS(_nsURL, "scxml"); + NodeList scxmls; + if (_nsInfo.nsURL.size() == 0) { + scxmls = _document.getElementsByTagName("scxml"); + } else { + scxmls = _document.getElementsByTagNameNS(_nsInfo.nsURL, "scxml"); + } if (scxmls.getLength() > 0) { _scxml = (Arabica::DOM::Element)scxmls.item(0); // setup xpath and check that it works - _xpath.setNamespaceContext(_nsContext); + if (_nsInfo.nsContext != NULL) + _xpath.setNamespaceContext(*_nsInfo.nsContext); if (_name.length() == 0) _name = (HAS_ATTR(_scxml, "name") ? ATTR(_scxml, "name") : UUID::getUUID()); @@ -574,7 +635,7 @@ void InterpreterImpl::normalize(Arabica::DOM::Element& scxml) { // TODO: Resolve XML includes // make sure every state has an id and set isFirstEntry to true (replaced by _alreadyEntered NodeSet) - Arabica::XPath::NodeSet states = _xpath.evaluate("//" + _xpathPrefix + "state", _scxml).asNodeSet(); + Arabica::XPath::NodeSet states = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "state", _scxml).asNodeSet(); for (int i = 0; i < states.size(); i++) { Arabica::DOM::Element stateElem = Arabica::DOM::Element(states[i]); // stateElem.setAttribute("isFirstEntry", "true"); @@ -584,7 +645,7 @@ void InterpreterImpl::normalize(Arabica::DOM::Element& scxml) { } // make sure every invoke has an idlocation or id - Arabica::XPath::NodeSet invokes = _xpath.evaluate("//" + _xpathPrefix + "invoke", _scxml).asNodeSet(); + Arabica::XPath::NodeSet invokes = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "invoke", _scxml).asNodeSet(); for (int i = 0; i < invokes.size(); i++) { Arabica::DOM::Element invokeElem = Arabica::DOM::Element(invokes[i]); if (!invokeElem.hasAttribute("id") && !invokeElem.hasAttribute("idlocation")) { @@ -598,7 +659,7 @@ void InterpreterImpl::normalize(Arabica::DOM::Element& scxml) { // } } - Arabica::XPath::NodeSet finals = _xpath.evaluate("//" + _xpathPrefix + "final", _scxml).asNodeSet(); + Arabica::XPath::NodeSet finals = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "final", _scxml).asNodeSet(); for (int i = 0; i < finals.size(); i++) { Arabica::DOM::Element finalElem = Arabica::DOM::Element(finals[i]); // finalElem.setAttribute("isFirstEntry", "true"); @@ -607,7 +668,7 @@ void InterpreterImpl::normalize(Arabica::DOM::Element& scxml) { } } - Arabica::XPath::NodeSet histories = _xpath.evaluate("//" + _xpathPrefix + "history", _scxml).asNodeSet(); + Arabica::XPath::NodeSet histories = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "history", _scxml).asNodeSet(); for (int i = 0; i < histories.size(); i++) { Arabica::DOM::Element historyElem = Arabica::DOM::Element(histories[i]); if (!historyElem.hasAttribute("id")) { @@ -619,16 +680,6 @@ void InterpreterImpl::normalize(Arabica::DOM::Element& scxml) { scxml.setAttribute("id", UUID::getUUID()); } - // create a pseudo initial and transition element -#if 0 - Arabica::DOM::Element initialState = (Arabica::DOM::Element)getInitialState(); - Arabica::DOM::Element initialElem = _document.createElement("initial"); - Arabica::DOM::Element transitionElem = _document.createElement("transition"); - transitionElem.setAttribute("target", initialState.getAttribute("id")); - initialElem.appendChild(transitionElem); - _scxml.appendChild(initialElem); - std::cout << _scxml <& st Arabica::DOM::Element parent = (Arabica::DOM::Element)stateElem.getParentNode(); Event event; - Arabica::XPath::NodeSet doneDatas = filterChildElements(_xmlNSPrefix + "donedata", stateElem); + Arabica::XPath::NodeSet doneDatas = filterChildElements(_nsInfo.xmlNSPrefix + "donedata", stateElem); if (doneDatas.size() > 0) { // only process first donedata element Arabica::DOM::Node doneData = doneDatas[0]; processParamChilds(doneData, event.params); - Arabica::XPath::NodeSet contents = filterChildElements(_xmlNSPrefix + "content", doneDatas[0]); + Arabica::XPath::NodeSet contents = filterChildElements(_nsInfo.xmlNSPrefix + "content", doneDatas[0]); if (contents.size() > 1) LOG(ERROR) << "Only a single content element is allowed for send elements - using first one"; if (contents.size() > 0) { @@ -793,7 +844,7 @@ void InterpreterImpl::processDOMorText(const Arabica::DOM::Node& el } void InterpreterImpl::processParamChilds(const Arabica::DOM::Node& element, std::multimap& params) { - NodeSet paramElems = filterChildElements(_xmlNSPrefix + "param", element); + NodeSet paramElems = filterChildElements(_nsInfo.xmlNSPrefix + "param", element); for (int i = 0; i < paramElems.size(); i++) { try { if (!HAS_ATTR(paramElems[i], "name")) { @@ -953,7 +1004,7 @@ void InterpreterImpl::send(const Arabica::DOM::Node& element) { } try { // content - NodeSet contents = filterChildElements(_xmlNSPrefix + "content", element); + NodeSet contents = filterChildElements(_nsInfo.xmlNSPrefix + "content", element); if (contents.size() > 1) LOG(ERROR) << "Only a single content element is allowed for send elements " << DOMUtils::xPathForNode(element) << " - using first one"; if (contents.size() > 0) { @@ -1095,7 +1146,7 @@ void InterpreterImpl::invoke(const Arabica::DOM::Node& element) { // content try { - NodeSet contents = filterChildElements(_xmlNSPrefix + "content", element); + NodeSet contents = filterChildElements(_nsInfo.xmlNSPrefix + "content", element); if (contents.size() > 1) LOG(ERROR) << "Only a single content element is allowed for send elements - using first one"; if (contents.size() > 0) { @@ -1140,12 +1191,13 @@ void InterpreterImpl::invoke(const Arabica::DOM::Node& element) { invoker.setElement(Element(element)); _invokers[invokeReq.invokeid] = invoker; try { - + // --- MONITOR: beforeInvoking ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeInvoking(shared_from_this(), Element(element), invokeReq.invokeid); - } USCXML_MONITOR_CATCH_BLOCK(beforeInvoking) + } + USCXML_MONITOR_CATCH_BLOCK(beforeInvoking) } invoker.invoke(invokeReq); @@ -1155,7 +1207,8 @@ void InterpreterImpl::invoke(const Arabica::DOM::Node& element) { for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterInvoking(shared_from_this(), Element(element), invokeReq.invokeid); - } USCXML_MONITOR_CATCH_BLOCK(afterInvoking) + } + USCXML_MONITOR_CATCH_BLOCK(afterInvoking) } // this is out of draft but so useful to know when an invoker started @@ -1205,12 +1258,13 @@ void InterpreterImpl::cancelInvoke(const Arabica::DOM::Node& elemen LOG(ERROR) << "Syntax when removing invoker:" << std::endl << e << std::endl; } } - + // --- MONITOR: beforeUninvoking ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeUninvoking(shared_from_this(), Element(element), invokeId); - } USCXML_MONITOR_CATCH_BLOCK(beforeUninvoking) + } + USCXML_MONITOR_CATCH_BLOCK(beforeUninvoking) } _invokers.erase(invokeId); @@ -1219,7 +1273,8 @@ void InterpreterImpl::cancelInvoke(const Arabica::DOM::Node& elemen for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterUninvoking(shared_from_this(), Element(element), invokeId); - } USCXML_MONITOR_CATCH_BLOCK(beforeUninvoking) + } + USCXML_MONITOR_CATCH_BLOCK(beforeUninvoking) } } else { @@ -1321,10 +1376,10 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont if (content.getNodeType() != Node_base::ELEMENT_NODE) return; - if (iequals(TAGNAME(content), _xmlNSPrefix + "onentry") || - iequals(TAGNAME(content), _xmlNSPrefix + "onexit") || - iequals(TAGNAME(content), _xmlNSPrefix + "finalize") || - iequals(TAGNAME(content), _xmlNSPrefix + "transition")) { + if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "onentry") || + iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "onexit") || + iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "finalize") || + iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "transition")) { // --- CONVENIENCE LOOP -------------------------- NodeList executable = content.getChildNodes(); for (int i = 0; i < executable.getLength(); i++) { @@ -1337,11 +1392,12 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeExecutingContent(shared_from_this(), Element(content)); - } USCXML_MONITOR_CATCH_BLOCK(beforeExecutingContent) + } + USCXML_MONITOR_CATCH_BLOCK(beforeExecutingContent) } if (false) { - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "raise")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "raise")) { // --- RAISE -------------------------- #if 0 if (HAS_ATTR(content, "event")) { @@ -1354,7 +1410,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont try { // content processParamChilds(content, raised.params); - NodeSet contents = filterChildElements(_xmlNSPrefix + "content", content); + NodeSet contents = filterChildElements(_nsInfo.xmlNSPrefix + "content", content); if (contents.size() > 1) LOG(ERROR) << "Only a single content element is allowed for raise elements " << DOMUtils::xPathForNode(content) << " - using first one"; if (contents.size() > 0) { @@ -1379,7 +1435,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont LOG(ERROR) << "Syntax error in send element " << DOMUtils::xPathForNode(content) << " content:" << std::endl << raised << std::endl; return; } - + if (raised.dom) { std::stringstream ss; ss << raised.dom; @@ -1389,7 +1445,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont receiveInternal(raised); } #endif - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "if")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "if")) { // --- IF / ELSEIF / ELSE -------------- Arabica::DOM::Element ifElem = (Arabica::DOM::Element)content; #if 0 @@ -1406,8 +1462,8 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont for (unsigned int i = 0; i < childs.getLength(); i++) { if (childs.item(i).getNodeType() != Node_base::ELEMENT_NODE) continue; - if (iequals(TAGNAME(childs.item(i)), _xmlNSPrefix + "elseif") || - iequals(TAGNAME(childs.item(i)), _xmlNSPrefix + "else")) { + if (iequals(TAGNAME(childs.item(i)), _nsInfo.xmlNSPrefix + "elseif") || + iequals(TAGNAME(childs.item(i)), _nsInfo.xmlNSPrefix + "else")) { if (blockIsTrue) { // last block was true, break here break; @@ -1422,11 +1478,11 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont } } } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "elseif")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "elseif")) { std::cerr << "Found single elsif to evaluate!" << std::endl; - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "else")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "else")) { std::cerr << "Found single else to evaluate!" << std::endl; - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "foreach")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "foreach")) { // --- FOREACH -------------------------- if (_dataModel) { if (HAS_ATTR(content, "array") && HAS_ATTR(content, "item")) { @@ -1456,7 +1512,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont LOG(ERROR) << "Expected array and item attributes with foreach element!" << std::endl; } } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "log")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "log")) { // --- LOG -------------------------- Arabica::DOM::Element logElem = (Arabica::DOM::Element)content; if (logElem.hasAttribute("label")) @@ -1470,7 +1526,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont if (logElem.hasAttribute("label")) std::cout << std::endl; } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "assign")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "assign")) { // --- ASSIGN -------------------------- if (_dataModel && HAS_ATTR(content, "location")) { try { @@ -1487,14 +1543,14 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont } CATCH_AND_DISTRIBUTE2("Syntax error in attributes of assign element", content) } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "validate")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "validate")) { // --- VALIDATE -------------------------- if (_dataModel) { std::string location = (HAS_ATTR(content, "location") ? ATTR(content, "location") : ""); std::string schema = (HAS_ATTR(content, "schema") ? ATTR(content, "schema") : ""); _dataModel.validate(location, schema); } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "script")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "script")) { // --- SCRIPT -------------------------- if (_dataModel) { if (HAS_ATTR(content, "src")) { @@ -1545,13 +1601,13 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont } } } - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "send")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "send")) { // --- SEND -------------------------- try { send(content); } CATCH_AND_DISTRIBUTE2("Error while sending content", content) - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "cancel")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "cancel")) { // --- CANCEL -------------------------- std::string sendId; try { @@ -1567,7 +1623,7 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont } CATCH_AND_DISTRIBUTE2("Syntax error while executing cancel element", content) - } else if (iequals(TAGNAME(content), _xmlNSPrefix + "invoke")) { + } else if (iequals(TAGNAME(content), _nsInfo.xmlNSPrefix + "invoke")) { // --- INVOKE -------------------------- } else { // --- Custom Executable Content @@ -1593,12 +1649,13 @@ void InterpreterImpl::executeContent(const Arabica::DOM::Node& cont } execContent.exitElement(content); } - + // --- MONITOR: afterExecutingContent ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterExecutingContent(shared_from_this(), Element(content)); - } USCXML_MONITOR_CATCH_BLOCK(afterExecutingContent) + } + USCXML_MONITOR_CATCH_BLOCK(afterExecutingContent) } } @@ -1615,7 +1672,7 @@ void InterpreterImpl::returnDoneEvent(const Arabica::DOM::Node& sta bool InterpreterImpl::parentIsScxmlState(const Arabica::DOM::Node& state) { Arabica::DOM::Element stateElem = (Arabica::DOM::Element)state; Arabica::DOM::Element parentElem = (Arabica::DOM::Element)state.getParentNode(); - if (iequals(TAGNAME(parentElem), _xmlNSPrefix + "scxml")) + if (iequals(TAGNAME(parentElem), _nsInfo.xmlNSPrefix + "scxml")) return true; return false; } @@ -1665,7 +1722,7 @@ Arabica::XPath::NodeSet InterpreterImpl::getChildStates(const Arabi } return childs; } - + Arabica::DOM::Node InterpreterImpl::getParentState(const Arabica::DOM::Node& element) { Arabica::DOM::Node parent = element.getParentNode(); while(parent && !isState(parent)) { @@ -1749,22 +1806,22 @@ Arabica::DOM::Node InterpreterImpl::getState(const std::string& sta } // first try atomic and compound states - NodeSet target = _xpath.evaluate("//" + _xpathPrefix + "state[@id='" + stateId + "']", _scxml).asNodeSet(); + NodeSet target = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "state[@id='" + stateId + "']", _scxml).asNodeSet(); if (target.size() > 0) goto FOUND; // now parallel states - target = _xpath.evaluate("//" + _xpathPrefix + "parallel[@id='" + stateId + "']", _scxml).asNodeSet(); + target = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "parallel[@id='" + stateId + "']", _scxml).asNodeSet(); if (target.size() > 0) goto FOUND; // now final states - target = _xpath.evaluate("//" + _xpathPrefix + "final[@id='" + stateId + "']", _scxml).asNodeSet(); + target = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "final[@id='" + stateId + "']", _scxml).asNodeSet(); if (target.size() > 0) goto FOUND; // now history states - target = _xpath.evaluate("//" + _xpathPrefix + "history[@id='" + stateId + "']", _scxml).asNodeSet(); + target = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "history[@id='" + stateId + "']", _scxml).asNodeSet(); if (target.size() > 0) goto FOUND; @@ -1791,15 +1848,15 @@ FOUND: Arabica::XPath::NodeSet InterpreterImpl::getAllStates() { NodeSet states; - states.push_back(_xpath.evaluate("//" + _xpathPrefix + "state", _scxml).asNodeSet()); - states.push_back(_xpath.evaluate("//" + _xpathPrefix + "parallel", _scxml).asNodeSet()); - states.push_back(_xpath.evaluate("//" + _xpathPrefix + "final", _scxml).asNodeSet()); - states.push_back(_xpath.evaluate("//" + _xpathPrefix + "history", _scxml).asNodeSet()); + states.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "state", _scxml).asNodeSet()); + states.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "parallel", _scxml).asNodeSet()); + states.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "final", _scxml).asNodeSet()); + states.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "history", _scxml).asNodeSet()); return states; } - + Arabica::DOM::Node InterpreterImpl::getSourceState(const Arabica::DOM::Node& transition) { - if (iequals(TAGNAME(transition.getParentNode()), _xmlNSPrefix + "initial")) + if (iequals(TAGNAME(transition.getParentNode()), _nsInfo.xmlNSPrefix + "initial")) return transition.getParentNode().getParentNode(); return transition.getParentNode(); } @@ -1829,9 +1886,9 @@ Arabica::XPath::NodeSet InterpreterImpl::getInitialStates(Arabica:: } // initial element as child - but not the implicit generated one - NodeSet initElems = filterChildElements(_xmlNSPrefix + "initial", state); + NodeSet initElems = filterChildElements(_nsInfo.xmlNSPrefix + "initial", state); if(initElems.size() == 1 && !iequals(ATTR(initElems[0], "generated"), "true")) { - NodeSet initTrans = filterChildElements(_xmlNSPrefix + "transition", initElems[0]); + NodeSet initTrans = filterChildElements(_nsInfo.xmlNSPrefix + "transition", initElems[0]); return getTargetStates(initTrans[0]); } @@ -1855,10 +1912,10 @@ NodeSet InterpreterImpl::getTargetStates(const Arabica::DOM::Node childs = transition.getChildNodes(); for (int i = 0; i < childs.getLength(); i++) { - if (childs.item(i).getNodeType() == Node_base::ELEMENT_NODE && iequals(TAGNAME(childs.item(i)), _xmlNSPrefix + "transition")) { + if (childs.item(i).getNodeType() == Node_base::ELEMENT_NODE && iequals(TAGNAME(childs.item(i)), _nsInfo.xmlNSPrefix + "transition")) { targetStates.push_back(getTargetStates(childs.item(i))); } } @@ -1884,7 +1941,7 @@ NodeSet InterpreterImpl::getTargetStates(const Arabica::XPath::Node } return targets; } - + std::list InterpreterImpl::tokenizeIdRefs(const std::string& idRefs) { std::list ids; @@ -1940,28 +1997,61 @@ std::string InterpreterImpl::spaceNormalize(const std::string& text) { } -NodeSet InterpreterImpl::filterChildElements(const std::string& tagName, const NodeSet& nodeSet) { +NodeSet InterpreterImpl::filterChildElements(const std::string& tagName, const NodeSet& nodeSet, bool recurse) { NodeSet filteredChildElems; for (unsigned int i = 0; i < nodeSet.size(); i++) { - filteredChildElems.push_back(filterChildElements(tagName, nodeSet[i])); + filteredChildElems.push_back(filterChildElements(tagName, nodeSet[i], recurse)); } return filteredChildElems; } -NodeSet InterpreterImpl::filterChildElements(const std::string& tagName, const Node& node) { +NodeSet InterpreterImpl::filterChildElements(const std::string& tagName, const Node& node, bool recurse) { NodeSet filteredChildElems; + + if (!node) + return filteredChildElems; + NodeList childs = node.getChildNodes(); for (unsigned int i = 0; i < childs.getLength(); i++) { - if (childs.item(i).getNodeType() != Node_base::ELEMENT_NODE) - continue; -// std::cout << tagName << " vs " << TAGNAME(childs.item(i)) << std::endl; - if (!iequals(TAGNAME(childs.item(i)), tagName)) - continue; - filteredChildElems.push_back(childs.item(i)); + if (childs.item(i).getNodeType() == Node_base::ELEMENT_NODE) { +// std::cout << TAGNAME(childs.item(i)) << std::endl; + if(iequals(TAGNAME(childs.item(i)), tagName)) { + filteredChildElems.push_back(childs.item(i)); + } + } + if (recurse) { + filteredChildElems.push_back(filterChildElements(tagName, childs.item(i), recurse)); + } } return filteredChildElems; } +NodeSet InterpreterImpl::filterChildType(const Node_base::Type type, const NodeSet& nodeSet, bool recurse) { + NodeSet filteredChildType; + for (unsigned int i = 0; i < nodeSet.size(); i++) { + filteredChildType.push_back(filterChildType(type, nodeSet[i], recurse)); + } + return filteredChildType; +} + +NodeSet InterpreterImpl::filterChildType(const Node_base::Type type, const Node& node, bool recurse) { + NodeSet filteredChildTypes; + + if (!node) + return filteredChildTypes; + + NodeList childs = node.getChildNodes(); + for (unsigned int i = 0; i < childs.getLength(); i++) { + if (childs.item(i).getNodeType() == type) + filteredChildTypes.push_back(childs.item(i)); + if (recurse) { + filteredChildTypes.push_back(filterChildType(type, childs.item(i), recurse)); + } + } + return filteredChildTypes; +} + + NodeSet InterpreterImpl::getProperAncestors(const Arabica::DOM::Node& s1, const Arabica::DOM::Node& s2) { NodeSet ancestors; @@ -1970,9 +2060,11 @@ NodeSet InterpreterImpl::getProperAncestors(const Arabica::DOM::Nod while((node = node.getParentNode())) { if (!isState(node)) break; - if (iequals(TAGNAME(node), _xmlNSPrefix + "scxml")) // do not return scxml root itself - this is somewhat ill-defined + if (iequals(TAGNAME(node), _nsInfo.xmlNSPrefix + "scxml")) // do not return scxml root itself - this is somewhat ill-defined break; - if (!iequals(TAGNAME(node), _xmlNSPrefix + "parallel") && !iequals(TAGNAME(node), _xmlNSPrefix + "state") && !iequals(TAGNAME(node), _xmlNSPrefix + "scxml")) + if (!iequals(TAGNAME(node), _nsInfo.xmlNSPrefix + "parallel") && + !iequals(TAGNAME(node), _nsInfo.xmlNSPrefix + "state") && + !iequals(TAGNAME(node), _nsInfo.xmlNSPrefix + "scxml")) break; if (node == s2) break; @@ -2319,10 +2411,10 @@ bool InterpreterImpl::isInState(const std::string& stateId) { } return false; } else { - + for (int i = 0; i < _configuration.size(); i++) { if (HAS_ATTR(_configuration[i], "id") && - iequals(ATTR(_configuration[i], "id"), stateId)) { + iequals(ATTR(_configuration[i], "id"), stateId)) { return true; } } @@ -2335,7 +2427,7 @@ void InterpreterImpl::DOMEventListener::handleEvent(Arabica::DOM::Events::Event< if (event.getType().compare("DOMAttrModified") == 0) // we do not care about attributes return; Node target = Arabica::DOM::Node(event.getTarget()); - NodeSet childs = Interpreter::filterChildElements(_interpreter->_xmlNSPrefix + "state", target); + NodeSet childs = Interpreter::filterChildElements(_interpreter->_nsInfo.xmlNSPrefix + "state", target); for (int i = 0; i < childs.size(); i++) { if (HAS_ATTR(childs[i], "id")) { _interpreter->_cachedStates.erase(ATTR(childs[i], "id")); diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h index ca0b3a2..a18bc28 100644 --- a/src/uscxml/Interpreter.h +++ b/src/uscxml/Interpreter.h @@ -138,6 +138,51 @@ protected: {} }; +class NameSpaceInfo { +public: + NameSpaceInfo() { + init(std::map()); + } + + NameSpaceInfo(const std::map& nsInfo) { + init(nsInfo); + } + + NameSpaceInfo(const NameSpaceInfo& other) { + init(other.nsInfo); + } + + virtual ~NameSpaceInfo() { + if (nsContext) + delete nsContext; + } + + NameSpaceInfo& operator=( const NameSpaceInfo& other ) { + init(other.nsInfo); + return *this; + } + + void setPrefix(Arabica::DOM::Element element) { + if (nsURL.size() > 0) + element.setPrefix(nsToPrefix[nsURL]); + } + + void setPrefix(Arabica::DOM::Attr attribute) { + if (nsURL.size() > 0) + attribute.setPrefix(nsToPrefix[nsURL]); + } + + std::string nsURL; // ough to be "http://www.w3.org/2005/07/scxml" but maybe empty + std::string xpathPrefix; // prefix mapped for xpath, "scxml" is _xmlNSPrefix is empty but _nsURL set + std::string xmlNSPrefix; // the actual prefix for elements in the xml file + Arabica::XPath::StandardNamespaceContext* nsContext; + std::map nsToPrefix; // prefixes for a given namespace + std::map nsInfo; // all xmlns mappings + +private: + void init(const std::map& nsInfo); +}; + class USCXML_API InterpreterImpl : public boost::enable_shared_from_this { public: @@ -150,6 +195,9 @@ public: virtual ~InterpreterImpl(); + void copyTo(InterpreterImpl* other); + void copyTo(boost::shared_ptr other); + void start(); void stop(); static void run(void*); @@ -206,28 +254,23 @@ public: Factory* getFactory() { return _factory; } - std::string getXPathPrefix() { - return _xpathPrefix; - } - std::string getXMLPrefix() { - return _xmlNSPrefix; - } - Arabica::XPath::StandardNamespaceContext& getNSContext() { - return _nsContext; + + Arabica::XPath::NodeSet getNodeSetForXPath(const std::string& xpathExpr) { + return _xpath.evaluate(xpathExpr, _scxml).asNodeSet(); } - std::string getXMLPrefixForNS(const std::string& ns) { - if (_nameSpaceInfo.find(ns) != _nameSpaceInfo.end() && _nameSpaceInfo[ns].size()) - return _nameSpaceInfo[ns] + ":"; + + std::string getXMLPrefixForNS(const std::string& ns) const { + if (_nsInfo.nsToPrefix.find(ns) != _nsInfo.nsToPrefix.end() && _nsInfo.nsToPrefix.at(ns).size()) + return _nsInfo.nsToPrefix.at(ns) + ":"; return ""; } - - Arabica::XPath::NodeSet getNodeSetForXPath(const std::string& xpathExpr) { - return _xpath.evaluate(xpathExpr, _scxml).asNodeSet(); + + void setNameSpaceInfo(const NameSpaceInfo& nsInfo) { + _nsInfo = nsInfo; + _xpath.setNamespaceContext(*_nsInfo.nsContext); } - - void setNameSpaceInfo(const std::map nameSpaceInfo); - std::map getNameSpaceInfo() { - return _nameSpaceInfo; + NameSpaceInfo getNameSpaceInfo() const { + return _nsInfo; } void receiveInternal(const Event& event); @@ -266,7 +309,7 @@ public: Arabica::XPath::NodeSet getStates(const std::list& stateIds); Arabica::XPath::NodeSet getAllStates(); - virtual Arabica::DOM::Document& getDocument() { + virtual Arabica::DOM::Document getDocument() const { return _document; } @@ -329,8 +372,10 @@ public: virtual Arabica::XPath::NodeSet getTargetStates(const Arabica::XPath::NodeSet& transitions); virtual Arabica::DOM::Node getSourceState(const Arabica::DOM::Node& transition); - static Arabica::XPath::NodeSet filterChildElements(const std::string& tagname, const Arabica::DOM::Node& node); - static Arabica::XPath::NodeSet filterChildElements(const std::string& tagName, const Arabica::XPath::NodeSet& nodeSet); + static Arabica::XPath::NodeSet filterChildElements(const std::string& tagname, const Arabica::DOM::Node& node, bool recurse = false); + static Arabica::XPath::NodeSet filterChildElements(const std::string& tagName, const Arabica::XPath::NodeSet& nodeSet, bool recurse = false); + static Arabica::XPath::NodeSet filterChildType(const Arabica::DOM::Node_base::Type type, const Arabica::DOM::Node& node, bool recurse = false); + static Arabica::XPath::NodeSet filterChildType(const Arabica::DOM::Node_base::Type type, const Arabica::XPath::NodeSet& nodeSet, bool recurse = false); Arabica::DOM::Node findLCCA(const Arabica::XPath::NodeSet& states); virtual Arabica::XPath::NodeSet getProperAncestors(const Arabica::DOM::Node& s1, const Arabica::DOM::Node& s2); @@ -360,12 +405,7 @@ protected: Arabica::DOM::Document _document; Arabica::DOM::Element _scxml; Arabica::XPath::XPath _xpath; - Arabica::XPath::StandardNamespaceContext _nsContext; - std::string _xmlNSPrefix; // the actual prefix for elements in the xml file - std::string _xpathPrefix; // prefix mapped for xpath, "scxml" is _xmlNSPrefix is empty but _nsURL set - std::string _nsURL; // ough to be "http://www.w3.org/2005/07/scxml" - std::map _nsToPrefix; - std::map _nameSpaceInfo; + NameSpaceInfo _nsInfo; bool _running; bool _done; @@ -445,10 +485,11 @@ protected: class USCXML_API Interpreter { public: static Interpreter fromDOM(const Arabica::DOM::Document& dom, - const std::map& nameSpaceInfo); + const NameSpaceInfo& nameSpaceInfo); static Interpreter fromXML(const std::string& xml); static Interpreter fromURI(const std::string& uri); static Interpreter fromInputSource(Arabica::SAX::InputSource& source); + static Interpreter fromClone(const Interpreter& other); Interpreter() : _impl() {} // the empty, invalid interpreter Interpreter(boost::shared_ptr const impl) : _impl(impl) { } @@ -489,28 +530,32 @@ public: _impl->interpret(); }; - void addMonitor(InterpreterMonitor* monitor) { + void addMonitor(InterpreterMonitor* monitor) { return _impl->addMonitor(monitor); } - void removeMonitor(InterpreterMonitor* monitor) { + void removeMonitor(InterpreterMonitor* monitor) { return _impl->removeMonitor(monitor); } - void setSourceURI(std::string sourceURI) { + void setSourceURI(std::string sourceURI) { return _impl->setSourceURI(sourceURI); } - URL getSourceURI() { + URL getSourceURI() { return _impl->getSourceURI(); } - URL getBaseURI() { + URL getBaseURI() { return _impl->getBaseURI(); } - void setNameSpaceInfo(const std::map namespaceInfo) { - _impl->setNameSpaceInfo(namespaceInfo); + std::string getXMLPrefixForNS(const std::string& ns) const { + return _impl->getXMLPrefixForNS(ns); + } + + void setNameSpaceInfo(const NameSpaceInfo& nsInfo) { + _impl->setNameSpaceInfo(nsInfo); } - std::map getNameSpaceInfo() { + NameSpaceInfo getNameSpaceInfo() const { return _impl->getNameSpaceInfo(); } @@ -525,7 +570,7 @@ public: return _impl->getHTTPServlet(); } - DataModel getDataModel() { + DataModel getDataModel() { return _impl->getDataModel(); } void setParentQueue(uscxml::concurrency::BlockingQueue* parentQueue) { @@ -537,26 +582,14 @@ public: Factory* getFactory() { return _impl->getFactory(); } - std::string getXPathPrefix() { - return _impl->getXPathPrefix(); - } - std::string getXMLPrefix() { - return _impl->getXMLPrefix(); - } - Arabica::XPath::StandardNamespaceContext& getNSContext() { - return _impl->getNSContext(); - } - std::string getXMLPrefixForNS(const std::string& ns) { - return _impl->getXMLPrefixForNS(ns); - } Arabica::XPath::NodeSet getNodeSetForXPath(const std::string& xpathExpr) { return _impl->getNodeSetForXPath(xpathExpr); } - + void inline receiveInternal(const Event& event) { return _impl->receiveInternal(event); } - void receive(const Event& event, bool toFront = false) { + void receive(const Event& event, bool toFront = false) { return _impl->receive(event, toFront); } @@ -567,12 +600,12 @@ public: bool isInState(const std::string& stateId) { return _impl->isInState(stateId); } - - Arabica::XPath::NodeSet getConfiguration() { + + Arabica::XPath::NodeSet getConfiguration() { return _impl->getConfiguration(); } - Arabica::XPath::NodeSet getBasicConfiguration() { + Arabica::XPath::NodeSet getBasicConfiguration() { return _impl->getBasicConfiguration(); } @@ -593,11 +626,11 @@ public: return _impl->getAllStates(); } - Arabica::DOM::Document& getDocument() { + Arabica::DOM::Document getDocument() const { return _impl->getDocument(); } - void setCapabilities(unsigned int capabilities) { + void setCapabilities(unsigned int capabilities) { return _impl->setCapabilities(capabilities); } @@ -605,13 +638,13 @@ public: return _impl->setName(name); } - const std::string& getName() { + const std::string& getName() { return _impl->getName(); } - const std::string& getSessionId() { + const std::string& getSessionId() { return _impl->getSessionId(); } - DelayedEventQueue* getDelayQueue() { + DelayedEventQueue* getDelayQueue() { return _impl->getDelayQueue(); } @@ -716,12 +749,19 @@ public: return _impl->getSourceState(transition); } - static Arabica::XPath::NodeSet filterChildElements(const std::string& tagname, const Arabica::DOM::Node& node) { - return InterpreterImpl::filterChildElements(tagname, node); + static Arabica::XPath::NodeSet filterChildElements(const std::string& tagname, const Arabica::DOM::Node& node, bool recurse = false) { + return InterpreterImpl::filterChildElements(tagname, node, recurse); } - static Arabica::XPath::NodeSet filterChildElements(const std::string& tagName, const Arabica::XPath::NodeSet& nodeSet) { - return InterpreterImpl::filterChildElements(tagName, nodeSet); + static Arabica::XPath::NodeSet filterChildElements(const std::string& tagName, const Arabica::XPath::NodeSet& nodeSet, bool recurse = false) { + return InterpreterImpl::filterChildElements(tagName, nodeSet, recurse); } + static Arabica::XPath::NodeSet filterChildType(const Arabica::DOM::Node_base::Type type, const Arabica::DOM::Node& node, bool recurse = false) { + return InterpreterImpl::filterChildType(type, node, recurse); + } + static Arabica::XPath::NodeSet filterChildType(const Arabica::DOM::Node_base::Type type, const Arabica::XPath::NodeSet& nodeSet, bool recurse = false) { + return InterpreterImpl::filterChildType(type, nodeSet, recurse); + } + Arabica::DOM::Node findLCCA(const Arabica::XPath::NodeSet& states) { return _impl->findLCCA(states); } @@ -729,7 +769,7 @@ public: return _impl->getProperAncestors(s1, s2); } - boost::shared_ptr getImpl() { + boost::shared_ptr getImpl() const { return _impl; } @@ -747,10 +787,10 @@ public: virtual void beforeProcessingEvent(Interpreter interpreter, const Event& event) {} virtual void beforeMicroStep(Interpreter interpreter) {} - + virtual void beforeExitingState(Interpreter interpreter, const Arabica::DOM::Element& state, bool moreComing) {} virtual void afterExitingState(Interpreter interpreter, const Arabica::DOM::Element& state, bool moreComing) {} - + virtual void beforeExecutingContent(Interpreter interpreter, const Arabica::DOM::Element& element) {} virtual void afterExecutingContent(Interpreter interpreter, const Arabica::DOM::Element& element) {} @@ -762,14 +802,14 @@ public: virtual void beforeEnteringState(Interpreter interpreter, const Arabica::DOM::Element& state, bool moreComing) {} virtual void afterEnteringState(Interpreter interpreter, const Arabica::DOM::Element& state, bool moreComing) {} - + virtual void beforeInvoking(Interpreter interpreter, const Arabica::DOM::Element& invokeElem, const std::string& invokeid) {} virtual void afterInvoking(Interpreter interpreter, const Arabica::DOM::Element& invokeElem, const std::string& invokeid) {} virtual void afterMicroStep(Interpreter interpreter) {} virtual void onStableConfiguration(Interpreter interpreter) {} - + virtual void beforeCompletion(Interpreter interpreter) {} virtual void afterCompletion(Interpreter interpreter) {} diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp index 33dca84..55be0e4 100644 --- a/src/uscxml/Message.cpp +++ b/src/uscxml/Message.cpp @@ -225,7 +225,9 @@ Arabica::DOM::Document Data::toDocument() { scxmlMsg.setAttribute("version", "1.0"); if (compound.size() > 0 || array.size() > 0) { - Arabica::DOM::Element payloadElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "scxml:payload"); + Arabica::DOM::Element payloadElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "payload"); + payloadElem.setPrefix("scxml"); + scxmlMsg.appendChild(payloadElem); // we do not support nested attibutes @@ -233,7 +235,9 @@ Arabica::DOM::Document Data::toDocument() { std::map::iterator compoundIter = compound.begin(); while(compoundIter != compound.end()) { if (compoundIter->second.atom.size() > 0) { - Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "scxml:property"); + Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "property"); + propertyElem.setPrefix("scxml"); + propertyElem.setAttribute("name", compoundIter->first); Arabica::DOM::Text textElem = document.createTextNode(compoundIter->second.atom); propertyElem.appendChild(textElem); @@ -299,7 +303,9 @@ Arabica::DOM::Document SendRequest::toDocument() { if (params.size() > 0 || namelist.size() > 0) { Arabica::DOM::NodeList payload = scxmlMsg.getElementsByTagName("scxml:payload"); if (payload.getLength() == 0) { - Arabica::DOM::Element payloadElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "scxml:payload"); + Arabica::DOM::Element payloadElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "payload"); + payloadElem.setPrefix("scxml"); + scxmlMsg.appendChild(payloadElem); } Arabica::DOM::Node payloadElem = scxmlMsg.getElementsByTagName("scxml:payload").item(0); @@ -307,7 +313,9 @@ Arabica::DOM::Document SendRequest::toDocument() { // add parameters std::multimap::iterator paramIter = params.begin(); while(paramIter != params.end()) { - Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "scxml:property"); + Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "property"); + propertyElem.setPrefix("scxml"); + propertyElem.setAttribute("name", paramIter->first); // this is simplified - Data might be more elaborate than a simple string atom Arabica::DOM::Text textElem = document.createTextNode(paramIter->second.atom); @@ -319,7 +327,9 @@ Arabica::DOM::Document SendRequest::toDocument() { // add namelist elements std::map::iterator namelistIter = namelist.begin(); while(namelistIter != namelist.end()) { - Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "scxml:property"); + Arabica::DOM::Element propertyElem = document.createElementNS("http://www.w3.org/2005/07/scxml", "property"); + propertyElem.setPrefix("scxml"); + propertyElem.setAttribute("name", namelistIter->first); // this is simplified - Data might be more elaborate than a simple string atom Arabica::DOM::Text textElem = document.createTextNode(namelistIter->second.atom); diff --git a/src/uscxml/Message.h b/src/uscxml/Message.h index afc30ad..57e8680 100644 --- a/src/uscxml/Message.h +++ b/src/uscxml/Message.h @@ -71,7 +71,7 @@ public: }; Data() : type(INTERPRETED) {} - + // TODO: default INTERPRETED is unfortunate Data(const std::string& atom_, Type type_ = INTERPRETED) : atom(atom_), type(type_) {} Data(const char* data, size_t size, const std::string& mimeType, bool adopt = false); @@ -99,9 +99,9 @@ public: // we will have to drop this constructor as it interferes with operator Data() and entails C++11 template Data(T value, typename std::enable_if::value>::type* = nullptr) - : atom(toStr(value)), type(INTERPRETED) {} + : atom(toStr(value)), type(INTERPRETED) {} #endif - + explicit Data(const Arabica::DOM::Node& dom); virtual ~Data() {} @@ -119,7 +119,7 @@ public: Data& operator[](const std::string& key) { return operator[](key.c_str()); } - + Data& operator[](const char* key) { return compound[key]; } @@ -143,7 +143,7 @@ public: Data data; return data; } - + const Data item(const size_t index) const { if (array.size() < index) { std::list::const_iterator arrayIter; @@ -153,7 +153,7 @@ public: Data data; return data; } - + bool operator==(const Data &other) const { if (other.atom.size() != atom.size()) return false; diff --git a/src/uscxml/concurrency/BlockingQueue.h b/src/uscxml/concurrency/BlockingQueue.h index fc62fce..e53de25 100644 --- a/src/uscxml/concurrency/BlockingQueue.h +++ b/src/uscxml/concurrency/BlockingQueue.h @@ -61,7 +61,7 @@ public: tthread::lock_guard lock(_mutex); _queue.clear(); } - + virtual bool isEmpty() { tthread::lock_guard lock(_mutex); return _queue.empty(); diff --git a/src/uscxml/debug/Breakpoint.cpp b/src/uscxml/debug/Breakpoint.cpp index 0001127..54f5d75 100644 --- a/src/uscxml/debug/Breakpoint.cpp +++ b/src/uscxml/debug/Breakpoint.cpp @@ -24,7 +24,7 @@ namespace uscxml { Breakpoint::Breakpoint(const Data& data) { - enabled = true; + enabled = true; subject = UNDEF_SUBJECT; when = UNDEF_WHEN; action = UNDEF_ACTION; @@ -105,60 +105,60 @@ Data Breakpoint::toData() const { Data data; switch (subject) { - case STATE: - data.compound["subject"] = Data("state", Data::VERBATIM); - break; - case TRANSITION: - data.compound["subject"] = Data("transition", Data::VERBATIM); - break; - case STABLE: - data.compound["subject"] = Data("stable", Data::VERBATIM); - break; - case MICROSTEP: - data.compound["subject"] = Data("microstep", Data::VERBATIM); - break; - case EVENT: - data.compound["subject"] = Data("event", Data::VERBATIM); - break; - case INVOKER: - data.compound["subject"] = Data("invoker", Data::VERBATIM); - break; - case EXECUTABLE: - data.compound["subject"] = Data("executable", Data::VERBATIM); - break; - default: - break; + case STATE: + data.compound["subject"] = Data("state", Data::VERBATIM); + break; + case TRANSITION: + data.compound["subject"] = Data("transition", Data::VERBATIM); + break; + case STABLE: + data.compound["subject"] = Data("stable", Data::VERBATIM); + break; + case MICROSTEP: + data.compound["subject"] = Data("microstep", Data::VERBATIM); + break; + case EVENT: + data.compound["subject"] = Data("event", Data::VERBATIM); + break; + case INVOKER: + data.compound["subject"] = Data("invoker", Data::VERBATIM); + break; + case EXECUTABLE: + data.compound["subject"] = Data("executable", Data::VERBATIM); + break; + default: + break; } - + switch (when) { - case AFTER: - data.compound["when"] = Data("after", Data::VERBATIM); - break; - case BEFORE: - data.compound["when"] = Data("before", Data::VERBATIM); - break; - case ON: - data.compound["when"] = Data("on", Data::VERBATIM); - break; - default: - break; + case AFTER: + data.compound["when"] = Data("after", Data::VERBATIM); + break; + case BEFORE: + data.compound["when"] = Data("before", Data::VERBATIM); + break; + case ON: + data.compound["when"] = Data("on", Data::VERBATIM); + break; + default: + break; } switch (action) { - case ENTER: - data.compound["action"] = Data("enter", Data::VERBATIM); - break; - case EXIT: - data.compound["action"] = Data("exit", Data::VERBATIM); - break; - case INVOKE: - data.compound["action"] = Data("invoke", Data::VERBATIM); - break; - case UNINVOKE: - data.compound["action"] = Data("cancel", Data::VERBATIM); - break; - default: - break; + case ENTER: + data.compound["action"] = Data("enter", Data::VERBATIM); + break; + case EXIT: + data.compound["action"] = Data("exit", Data::VERBATIM); + break; + case INVOKE: + data.compound["action"] = Data("invoke", Data::VERBATIM); + break; + case UNINVOKE: + data.compound["action"] = Data("cancel", Data::VERBATIM); + break; + default: + break; } if (invokeId.length() > 0) @@ -176,7 +176,7 @@ Data Breakpoint::toData() const { if (executableXPath.length() > 0) { data.compound["executableXPath"] = Data(executableXPath, Data::VERBATIM); } - + if (element) data.compound["xpath"] = Data(DOMUtils::xPathForNode(element, "*"), Data::VERBATIM); @@ -194,20 +194,20 @@ Data Breakpoint::toData() const { return data; } - + bool Breakpoint::matches(Interpreter interpreter, const Breakpoint& other) const { // would we match the given breakpoint? if (subject != UNDEF_SUBJECT && - other.subject != subject) + other.subject != subject) return false; // subject does not match - + if (when != UNDEF_WHEN && - other.when != when) + other.when != when) return false; // time does not match - + if (action != UNDEF_ACTION && - other.action != action) + other.action != action) return false; // action does not match // when we have a qualifier it has to match @@ -248,7 +248,7 @@ bool Breakpoint::matches(Interpreter interpreter, const Breakpoint& other) const if(transTargetId.length() > 0 && transTargetId != other.transTargetId) { return false; } - + if (condition.length() > 0) { try { DataModel dm = interpreter.getDataModel(); diff --git a/src/uscxml/debug/Breakpoint.h b/src/uscxml/debug/Breakpoint.h index 157a56d..c48b841 100644 --- a/src/uscxml/debug/Breakpoint.h +++ b/src/uscxml/debug/Breakpoint.h @@ -27,61 +27,61 @@ namespace uscxml { class USCXML_API Breakpoint { public: - + enum When { - UNDEF_WHEN, AFTER, BEFORE, ON + UNDEF_WHEN, AFTER, BEFORE, ON }; - + enum Subject { - UNDEF_SUBJECT, STATE, TRANSITION, STABLE, MICROSTEP, EVENT, INVOKER, EXECUTABLE + UNDEF_SUBJECT, STATE, TRANSITION, STABLE, MICROSTEP, EVENT, INVOKER, EXECUTABLE }; - + enum Action { - UNDEF_ACTION, ENTER, EXIT, INVOKE, UNINVOKE + UNDEF_ACTION, ENTER, EXIT, INVOKE, UNINVOKE }; - + Breakpoint() { subject = UNDEF_SUBJECT; when = UNDEF_WHEN; action = UNDEF_ACTION; } Breakpoint(const Data& data); - + // would we match the given breakpoint as well? bool matches(Interpreter interpreter, const Breakpoint& other) const; - + Data toData() const; - + bool operator<(const Breakpoint& other) const { return (toData() < other.toData()); } - + operator bool() { return (subject != UNDEF_SUBJECT || - when != UNDEF_WHEN || - action != UNDEF_ACTION); + when != UNDEF_WHEN || + action != UNDEF_ACTION); } - + mutable bool enabled; - + When when; Subject subject; Action action; Arabica::DOM::Element element; - + std::string invokeId; std::string invokeType; std::string eventName; - + std::string executableName; std::string executableXPath; - + std::string stateId; std::string transSourceId; std::string transTargetId; - + std::string condition; }; diff --git a/src/uscxml/debug/DebugSession.cpp b/src/uscxml/debug/DebugSession.cpp index e785c84..c73f53e 100644 --- a/src/uscxml/debug/DebugSession.cpp +++ b/src/uscxml/debug/DebugSession.cpp @@ -21,16 +21,16 @@ #include "uscxml/debug/Debugger.h" namespace uscxml { - + void DebugSession::checkBreakpoints(const std::list qualifiedBreakpoints) { std::list::const_iterator qualifiedBreakpointIter = qualifiedBreakpoints.begin(); if (!_breakpointsEnabled) return; - + while(qualifiedBreakpointIter != qualifiedBreakpoints.end()) { const Breakpoint& qualifiedBreakpoint = *qualifiedBreakpointIter++; - + // check if one of the user-supplied breakpoints match bool userBreakpointMatched = false; Data replyData; @@ -44,7 +44,7 @@ void DebugSession::checkBreakpoints(const std::list qualifiedBreakpo } continue; } - + std::set::const_iterator breakpointIter = _breakPoints.begin(); while(breakpointIter != _breakPoints.end()) { const Breakpoint& breakpoint = *breakpointIter++; @@ -52,10 +52,10 @@ void DebugSession::checkBreakpoints(const std::list qualifiedBreakpo continue; if (breakpoint.matches(_interpreter, qualifiedBreakpoint)) { // do we have a condition? - + replyData.compound["breakpoint"] = breakpoint.toData(); replyData.compound["qualified"] = qualifiedBreakpoint.toData(); - + userBreakpointMatched = true; breakExecution(replyData); } @@ -70,7 +70,7 @@ void DebugSession::checkBreakpoints(const std::list qualifiedBreakpo void DebugSession::breakExecution(Data replyData) { tthread::lock_guard lock(_mutex); - + Arabica::XPath::NodeSet basicConf = _interpreter.getBasicConfiguration(); for (int i = 0; i < basicConf.size(); i++) { Arabica::DOM::Element element = Arabica::DOM::Element(basicConf[i]); @@ -94,7 +94,7 @@ void DebugSession::breakExecution(Data replyData) { Data DebugSession::debugPrepare(const Data& data) { Data replyData; - + if (!data.hasKey("xml") && !data.hasKey("url")) { replyData.compound["status"] = Data("failure", Data::VERBATIM); replyData.compound["reason"] = Data("No XML or URL given", Data::VERBATIM); @@ -102,7 +102,7 @@ Data DebugSession::debugPrepare(const Data& data) { } debugStop(data); - + _isAttached = false; if (data.hasKey("xml")) { @@ -112,7 +112,7 @@ Data DebugSession::debugPrepare(const Data& data) { } else { _interpreter = Interpreter(); } - + if (_interpreter) { // register ourself as a monitor _interpreter.addMonitor(_debugger); @@ -132,22 +132,22 @@ Data DebugSession::debugPrepare(const Data& data) { Data DebugSession::debugAttach(const Data& data) { Data replyData; _isAttached = true; - + if (!data.hasKey("attach")) { replyData.compound["status"] = Data("failure", Data::VERBATIM); replyData.compound["reason"] = Data("No id to attach to given", Data::VERBATIM); return replyData; } - + std::string interpreterId = data.at("attach").atom; bool interpreterFound = false; - + // find interpreter for sessionid std::map > instances = Interpreter::getInstances(); for (std::map >::iterator instIter = instances.begin(); - instIter != instances.end(); - instIter++) { - + instIter != instances.end(); + instIter++) { + boost::shared_ptr instance = instIter->second.lock(); if (instance && instance->getSessionId() == interpreterId) { _interpreter = instance; @@ -156,7 +156,7 @@ Data DebugSession::debugAttach(const Data& data) { break; } } - + if (!interpreterFound) { replyData.compound["status"] = Data("failure", Data::VERBATIM); replyData.compound["reason"] = Data("No interpreter with given id found", Data::VERBATIM); @@ -179,7 +179,7 @@ Data DebugSession::debugDetach(const Data& data) { Data DebugSession::debugStart(const Data& data) { Data replyData; - + if (_isAttached) { replyData.compound["reason"] = Data("Already started when attached", Data::VERBATIM); replyData.compound["status"] = Data("failure", Data::VERBATIM); @@ -201,7 +201,7 @@ Data DebugSession::debugStop(const Data& data) { // detach from old intepreter _debugger->detachSession(_interpreter); } - + if (_interpreter && !_isAttached) _interpreter.stop(); // unblock @@ -212,16 +212,16 @@ Data DebugSession::debugStop(const Data& data) { // calls destructor _interpreter = Interpreter(); - + return replyData; } - + Data DebugSession::debugStep(const Data& data) { tthread::lock_guard lock(_mutex); - + stepping(true); _resumeCond.notify_one(); - + Data replyData; if (_interpreter) { // register ourself as a monitor @@ -233,19 +233,19 @@ Data DebugSession::debugStep(const Data& data) { } return replyData; } - + Data DebugSession::debugResume(const Data& data) { tthread::lock_guard lock(_mutex); - + stepping(false); - + Data replyData; replyData.compound["status"] = Data("success", Data::VERBATIM); - + _resumeCond.notify_one(); return replyData; } - + Data DebugSession::debugPause(const Data& data) { tthread::lock_guard lock(_mutex); @@ -261,12 +261,12 @@ Data DebugSession::debugPause(const Data& data) { Data DebugSession::skipToBreakPoint(const Data& data) { tthread::lock_guard lock(_mutex); - + _skipTo = Breakpoint(data); - + Data replyData; replyData.compound["status"] = Data("success", Data::VERBATIM); - + _resumeCond.notify_one(); return replyData; } @@ -278,7 +278,7 @@ Data DebugSession::addBreakPoint(const Data& data) { if (_breakPoints.find(breakpoint) == _breakPoints.end()) { _breakPoints.insert(breakpoint); replyData.compound["status"] = Data("success", Data::VERBATIM); - + } else { replyData.compound["reason"] = Data("Breakpoint already exists", Data::VERBATIM); replyData.compound["status"] = Data("failure", Data::VERBATIM); @@ -316,7 +316,7 @@ Data DebugSession::enableBreakPoint(const Data& data) { } Data DebugSession::disableBreakPoint(const Data& data) { Breakpoint breakpoint(data); - + Data replyData; if (_breakPoints.find(breakpoint) != _breakPoints.end()) { _breakPoints.find(breakpoint)->enabled = false; @@ -325,7 +325,7 @@ Data DebugSession::disableBreakPoint(const Data& data) { replyData.compound["reason"] = Data("No such breakpoint", Data::VERBATIM); replyData.compound["status"] = Data("failure", Data::VERBATIM); } - + return replyData; } Data DebugSession::enableAllBreakPoints() { @@ -338,16 +338,16 @@ Data DebugSession::enableAllBreakPoints() { } Data DebugSession::disableAllBreakPoints() { Data replyData; - + _breakpointsEnabled = false; replyData.compound["status"] = Data("success", Data::VERBATIM); - + return replyData; } Data DebugSession::debugEval(const Data& data) { Data replyData; - + if (!data.hasKey("expression")) { replyData.compound["status"] = Data("failure", Data::VERBATIM); replyData.compound["reason"] = Data("No expression given", Data::VERBATIM); @@ -355,7 +355,7 @@ Data DebugSession::debugEval(const Data& data) { } std::string expr = data.at("expression").atom; - + if (!_interpreter) { replyData.compound["status"] = Data("failure", Data::VERBATIM); replyData.compound["reason"] = Data("No interpreter running", Data::VERBATIM); @@ -374,5 +374,5 @@ Data DebugSession::debugEval(const Data& data) { return replyData; } - + } \ No newline at end of file diff --git a/src/uscxml/debug/DebugSession.h b/src/uscxml/debug/DebugSession.h index 12f1d93..1fb4f4d 100644 --- a/src/uscxml/debug/DebugSession.h +++ b/src/uscxml/debug/DebugSession.h @@ -27,7 +27,7 @@ namespace uscxml { class Debugger; - + class USCXML_API DebugSession : public boost::enable_shared_from_this { public: DebugSession() { @@ -37,13 +37,13 @@ public: _markedForDeletion = false; _debugger = NULL; } - + void stepping(bool enable) { _isStepping = enable; } - + void checkBreakpoints(const std::list qualifiedBreakpoints); - + Data debugPrepare(const Data& data); Data debugAttach(const Data& data); Data debugDetach(const Data& data); @@ -60,26 +60,26 @@ public: Data enableAllBreakPoints(); Data disableAllBreakPoints(); Data debugEval(const Data& data); - + void setDebugger(Debugger* debugger) { _debugger = debugger; } - + Interpreter getInterpreter() { return _interpreter; } - + void markForDeletion(bool mark) { _markedForDeletion = mark; } - + protected: void breakExecution(Data replyData); bool _isStepping; bool _isAttached; bool _breakpointsEnabled; - + tthread::condition_variable _resumeCond; tthread::recursive_mutex _runMutex; tthread::recursive_mutex _mutex; @@ -89,7 +89,7 @@ protected: Interpreter _interpreter; std::set _breakPoints; Breakpoint _skipTo; - + }; diff --git a/src/uscxml/debug/Debugger.cpp b/src/uscxml/debug/Debugger.cpp index f611d09..d1a8068 100644 --- a/src/uscxml/debug/Debugger.cpp +++ b/src/uscxml/debug/Debugger.cpp @@ -21,7 +21,7 @@ #include "uscxml/DOMUtils.h" namespace uscxml { - + void Debugger::afterCompletion(Interpreter interpreter) { boost::shared_ptr session = getSession(interpreter); if (!session) @@ -34,44 +34,44 @@ void Debugger::afterCompletion(Interpreter interpreter) { std::list getQualifiedStateBreakpoints(Interpreter interpreter, const Arabica::DOM::Element& state, Breakpoint breakpointTemplate) { std::list breakpoints; - + Breakpoint bp = breakpointTemplate; // copy base as template bp.stateId = ATTR(state, "id"); bp.element = state; bp.subject = Breakpoint::STATE; breakpoints.push_back(bp); - + return breakpoints; } std::list getQualifiedInvokeBreakpoints(Interpreter interpreter, const Arabica::DOM::Element& invokeElem, const std::string invokeId, Breakpoint breakpointTemplate) { std::list breakpoints; - + Breakpoint bp = breakpointTemplate; // copy base as template bp.subject = Breakpoint::INVOKER; bp.element = invokeElem; bp.invokeId = invokeId; - + if (HAS_ATTR(invokeElem, "type")) { bp.invokeType = ATTR(invokeElem, "type"); } else if (HAS_ATTR(invokeElem, "typeexpr")) { bp.invokeType = interpreter.getDataModel().evalAsString(ATTR(invokeElem, "typeexpr")); } - + breakpoints.push_back(bp); - + return breakpoints; } std::list getQualifiedTransBreakpoints(Interpreter interpreter, const Arabica::DOM::Element& transition, Breakpoint breakpointTemplate) { std::list breakpoints; - + Arabica::DOM::Element source(interpreter.getSourceState(transition)); Arabica::XPath::NodeSet targets = interpreter.getTargetStates(transition); for (int j = 0; j < targets.size(); j++) { Arabica::DOM::Element target(targets[j]); - + Breakpoint bp = breakpointTemplate; // copy base as template bp.element = transition; bp.transSourceId = ATTR(source, "id"); @@ -134,14 +134,14 @@ void Debugger::beforeProcessingEvent(Interpreter interpreter, const Event& event } void Debugger::handleExecutable(Interpreter interpreter, - const Arabica::DOM::Element& execContentElem, - Breakpoint::When when) { + const Arabica::DOM::Element& execContentElem, + Breakpoint::When when) { if (!interpreter.isRunning()) return; boost::shared_ptr session = getSession(interpreter); if (!session) return; - + std::list breakpoints; Breakpoint breakpoint; @@ -150,7 +150,7 @@ void Debugger::handleExecutable(Interpreter interpreter, breakpoint.executableName = execContentElem.getLocalName(); breakpoint.subject = Breakpoint::EXECUTABLE; breakpoints.push_back(breakpoint); - + session->checkBreakpoints(breakpoints); } @@ -161,19 +161,19 @@ void Debugger::handleEvent(Interpreter interpreter, const Event& event, Breakpoi boost::shared_ptr session = getSession(interpreter); if (!session) return; - + std::list breakpoints; - + Breakpoint breakpoint; breakpoint.when = when; breakpoint.eventName = event.name; breakpoint.subject = Breakpoint::EVENT; breakpoints.push_back(breakpoint); - + session->checkBreakpoints(breakpoints); } - + void Debugger::handleStable(Interpreter interpreter, Breakpoint::When when) { if (!interpreter.isRunning()) return; @@ -187,7 +187,7 @@ void Debugger::handleStable(Interpreter interpreter, Breakpoint::When when) { breakpoint.when = when; breakpoint.subject = Breakpoint::STABLE; breakpoints.push_back(breakpoint); - + session->checkBreakpoints(breakpoints); } @@ -199,12 +199,12 @@ void Debugger::handleMicrostep(Interpreter interpreter, Breakpoint::When when) { return; std::list breakpoints; - + Breakpoint breakpoint; breakpoint.when = when; breakpoint.subject = Breakpoint::MICROSTEP; breakpoints.push_back(breakpoint); - + session->checkBreakpoints(breakpoints); } diff --git a/src/uscxml/debug/Debugger.h b/src/uscxml/debug/Debugger.h index 8f840b0..9adbae6 100644 --- a/src/uscxml/debug/Debugger.h +++ b/src/uscxml/debug/Debugger.h @@ -24,15 +24,15 @@ #include "uscxml/Interpreter.h" #include "uscxml/debug/Breakpoint.h" #include "uscxml/debug/DebugSession.h" - + namespace uscxml { - + class USCXML_API Debugger : public InterpreterMonitor { public: Debugger() { } virtual ~Debugger() {} - + virtual void attachSession(Interpreter interpreter, boost::shared_ptr session) { tthread::lock_guard lock(_sessionMutex); _sessionForInterpreter[interpreter] = session; @@ -42,16 +42,16 @@ public: tthread::lock_guard lock(_sessionMutex); _sessionForInterpreter.erase(interpreter); } - + virtual boost::shared_ptr getSession(Interpreter interpreter) { tthread::lock_guard lock(_sessionMutex); if (_sessionForInterpreter.find(interpreter) != _sessionForInterpreter.end()) return _sessionForInterpreter[interpreter]; return boost::shared_ptr(); } - + virtual void pushData(boost::shared_ptr session, Data pushData) = 0; - + // InterpreterMonitor virtual void beforeProcessingEvent(Interpreter interpreter, const Event& event); virtual void beforeMicroStep(Interpreter interpreter); @@ -73,28 +73,28 @@ public: virtual void afterCompletion(Interpreter interpreter); protected: - + void handleTransition(Interpreter interpreter, - const Arabica::DOM::Element& transition, - Breakpoint::When when); + const Arabica::DOM::Element& transition, + Breakpoint::When when); void handleState(Interpreter interpreter, - const Arabica::DOM::Element& state, - Breakpoint::When when, - Breakpoint::Action action); + const Arabica::DOM::Element& state, + Breakpoint::When when, + Breakpoint::Action action); void handleInvoke(Interpreter interpreter, - const Arabica::DOM::Element& invokeElem, - const std::string& invokeId, - Breakpoint::When when, - Breakpoint::Action action); + const Arabica::DOM::Element& invokeElem, + const std::string& invokeId, + Breakpoint::When when, + Breakpoint::Action action); void handleExecutable(Interpreter interpreter, - const Arabica::DOM::Element& execContentElem, - Breakpoint::When when); + const Arabica::DOM::Element& execContentElem, + Breakpoint::When when); void handleStable(Interpreter interpreter, Breakpoint::When when); void handleMicrostep(Interpreter interpreter, Breakpoint::When when); void handleEvent(Interpreter interpreter, const Event& event, Breakpoint::When when); tthread::recursive_mutex _sessionMutex; - std::map > _sessionForInterpreter; + std::map > _sessionForInterpreter; }; } diff --git a/src/uscxml/debug/DebuggerServlet.cpp b/src/uscxml/debug/DebuggerServlet.cpp index a570263..a99aaf8 100644 --- a/src/uscxml/debug/DebuggerServlet.cpp +++ b/src/uscxml/debug/DebuggerServlet.cpp @@ -25,24 +25,24 @@ namespace uscxml { void DebuggerServlet::pushData(boost::shared_ptr session, Data pushData) { std::cout << "trying to push " << pushData["replyType"].atom << std::endl; - + if (!session) { if (_sendQueues.size() > 0) // logging is not aware of its interpreter _sendQueues.begin()->second.push(pushData); } else { _sendQueues[session].push(pushData); } - + serverPushData(session); } void DebuggerServlet::serverPushData(boost::shared_ptr session) { if (_sendQueues[session].isEmpty()) return; - + if (!_clientConns[session]) return; - + Data reply = _sendQueues[session].pop(); std::cout << "pushing " << reply["replyType"].atom << std::endl; returnData(_clientConns[session], reply); @@ -51,13 +51,13 @@ void DebuggerServlet::serverPushData(boost::shared_ptr session) { void DebuggerServlet::returnData(const HTTPServer::Request& request, Data replyData) { HTTPServer::Reply reply(request); - + if (!replyData.hasKey("status")) { replyData.compound["status"] = Data("success", Data::VERBATIM); } - + std::cout << "<- " << replyData << std::endl; - + reply.content = Data::toJSON(replyData); reply.headers["Access-Control-Allow-Origin"] = "*"; reply.headers["Content-Type"] = "application/json"; @@ -66,8 +66,8 @@ void DebuggerServlet::returnData(const HTTPServer::Request& request, Data replyD bool DebuggerServlet::isCORS(const HTTPServer::Request& request) { return (request.data.at("type").atom == "options" && - request.data.at("header").hasKey("Origin") && - request.data.at("header").hasKey("Access-Control-Request-Method")); + request.data.at("header").hasKey("Origin") && + request.data.at("header").hasKey("Access-Control-Request-Method")); } void DebuggerServlet::handleCORS(const HTTPServer::Request& request) { @@ -81,7 +81,7 @@ void DebuggerServlet::handleCORS(const HTTPServer::Request& request) { corsReply.headers["Access-Control-Allow-Methods"] = request.data.at("header").at("Access-Control-Request-Method").atom; if (request.data.at("header").hasKey("Access-Control-Request-Headers")) corsReply.headers["Access-Control-Allow-Headers"] = request.data.at("header").at("Access-Control-Request-Headers").atom; - + // std::cout << "CORS!" << std::endl << request << std::endl; HTTPServer::reply(corsReply); } @@ -89,14 +89,14 @@ void DebuggerServlet::handleCORS(const HTTPServer::Request& request) { bool DebuggerServlet::httpRecvRequest(const HTTPServer::Request& request) { if (!request.data.hasKey("path")) return false; // returnError(request); - + if (isCORS(request)) { handleCORS(request); return true; } - + std::cout << request.data["path"] << ": " << request.data["content"] << std::endl; - + Data replyData; // process request that don't need a session if (false) { @@ -107,7 +107,7 @@ bool DebuggerServlet::httpRecvRequest(const HTTPServer::Request& request) { processListSessions(request); return true; } - + // get session or return error if (false) { } else if (!request.data.at("content").hasKey("session")) { @@ -121,9 +121,9 @@ bool DebuggerServlet::httpRecvRequest(const HTTPServer::Request& request) { returnData(request, replyData); return true; } - + boost::shared_ptr session = _sessionForId[request.data.at("content").at("session").atom]; - + if (false) { } else if (boost::starts_with(request.data.at("path").atom, "/debug/poll")) { // save long-standing client poll @@ -164,7 +164,7 @@ bool DebuggerServlet::httpRecvRequest(const HTTPServer::Request& request) { } else if (boost::starts_with(request.data.at("path").atom, "/debug/eval")) { replyData = session->debugEval(request.data["content"]); } - + if (replyData) { returnData(request, replyData); return true; @@ -177,10 +177,10 @@ bool DebuggerServlet::httpRecvRequest(const HTTPServer::Request& request) { void DebuggerServlet::processConnect(const HTTPServer::Request& request) { tthread::lock_guard lock(_mutex); std::string sessionId = UUID::getUUID(); - + _sessionForId[sessionId] = boost::shared_ptr(new DebugSession()); _sessionForId[sessionId]->setDebugger(this); - + Data replyData; replyData.compound["session"] = Data(sessionId, Data::VERBATIM); replyData.compound["status"] = Data("success", Data::VERBATIM); @@ -211,18 +211,18 @@ void DebuggerServlet::processDisconnect(const HTTPServer::Request& request) { _sendQueues.erase(_sessionForId[sessionId]); _sessionForId.erase(sessionId); } - + returnData(request, replyData); } void DebuggerServlet::processListSessions(const HTTPServer::Request& request) { Data replyData; - + std::map > instances = Interpreter::getInstances(); for (std::map >::iterator instIter = instances.begin(); - instIter != instances.end(); - instIter++) { - + instIter != instances.end(); + instIter++) { + boost::shared_ptr instance = instIter->second.lock(); if (instance) { Data sessionData; @@ -234,25 +234,25 @@ void DebuggerServlet::processListSessions(const HTTPServer::Request& request) { replyData.compound["sessions"].array.push_back(sessionData); } } - + replyData.compound["status"] = Data("success", Data::VERBATIM); returnData(request, replyData); } void DebuggerServlet::send(google::LogSeverity severity, const char* full_filename, - const char* base_filename, int line, - const struct ::tm* tm_time, - const char* message, size_t message_len) { - + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) { + // _sendQueue is thread-safe, not sure about ToString though LogMessage msg(severity, - full_filename, - base_filename, - line, - tm_time, - std::string(message, message_len), - ToString(severity, base_filename, line, tm_time, message, message_len)); + full_filename, + base_filename, + line, + tm_time, + std::string(message, message_len), + ToString(severity, base_filename, line, tm_time, message, message_len)); msg.compound["replyType"] = Data("log", Data::VERBATIM); pushData(boost::shared_ptr(), msg); } diff --git a/src/uscxml/debug/DebuggerServlet.h b/src/uscxml/debug/DebuggerServlet.h index ae5178f..ce6f082 100644 --- a/src/uscxml/debug/DebuggerServlet.h +++ b/src/uscxml/debug/DebuggerServlet.h @@ -37,10 +37,10 @@ public: class LogMessage : public Data { public: LogMessage(google::LogSeverity severity, const char* full_filename, - const char* base_filename, int line, - const struct ::tm* tm_time, - std::string message, std::string formatted) { - + const char* base_filename, int line, + const struct ::tm* tm_time, + std::string message, std::string formatted) { + compound["severity"] = severity; compound["fullFilename"] = Data(full_filename, Data::VERBATIM); compound["baseFilename"] = Data(base_filename, Data::VERBATIM); @@ -50,9 +50,9 @@ public: compound["formatted"] = Data(formatted, Data::VERBATIM); } }; - + virtual ~DebuggerServlet() {} - + // from Debugger virtual void addBreakpoint(const Breakpoint& breakpoint) {}; @@ -85,20 +85,20 @@ public: // void processAddBreakPoint(const HTTPServer::Request& request); // void processRemoveBreakPoint(const HTTPServer::Request& request); // void processPoll(const HTTPServer::Request& request); - + // Logsink virtual void send(google::LogSeverity severity, const char* full_filename, - const char* base_filename, int line, - const struct ::tm* tm_time, - const char* message, size_t message_len); + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len); protected: void serverPushData(boost::shared_ptr); std::string _url; std::map, HTTPServer::Request> _clientConns; - std::map, concurrency::BlockingQueue > _sendQueues; - std::map > _sessionForId; + std::map, concurrency::BlockingQueue > _sendQueues; + std::map > _sessionForId; tthread::recursive_mutex _mutex; }; diff --git a/src/uscxml/interpreter/InterpreterDraft6.cpp b/src/uscxml/interpreter/InterpreterDraft6.cpp index d286856..02dcff5 100644 --- a/src/uscxml/interpreter/InterpreterDraft6.cpp +++ b/src/uscxml/interpreter/InterpreterDraft6.cpp @@ -38,7 +38,7 @@ void InterpreterDraft6::interpret() { if (!_scxml) { return; } - // dump(); + // dump(); // just make sure we have a session id assert(_sessionId.length() > 0); @@ -75,17 +75,17 @@ void InterpreterDraft6::interpret() { if (_dataModel && _binding == EARLY) { // initialize all data elements - NodeSet dataElems = _xpath.evaluate("//" + _xpathPrefix + "data", _scxml).asNodeSet(); + NodeSet dataElems = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "data", _scxml).asNodeSet(); for (unsigned int i = 0; i < dataElems.size(); i++) { // do not process data elements of nested documents from invokers - if (!getAncestorElement(dataElems[i], _xmlNSPrefix + "invoke")) + if (!getAncestorElement(dataElems[i], _nsInfo.xmlNSPrefix + "invoke")) if (dataElems[i].getNodeType() == Node_base::ELEMENT_NODE) { initializeData(Element(dataElems[i])); } } } else if(_dataModel) { // initialize current data elements - NodeSet topDataElems = filterChildElements(_xmlNSPrefix + "data", filterChildElements(_xmlNSPrefix + "datamodel", _scxml)); + NodeSet topDataElems = filterChildElements(_nsInfo.xmlNSPrefix + "data", filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", _scxml)); for (unsigned int i = 0; i < topDataElems.size(); i++) { if (topDataElems[i].getNodeType() == Node_base::ELEMENT_NODE) initializeData(Element(topDataElems[i])); @@ -93,7 +93,7 @@ void InterpreterDraft6::interpret() { } // executeGlobalScriptElements - NodeSet globalScriptElems = filterChildElements(_xmlNSPrefix + "script", _scxml); + NodeSet globalScriptElems = filterChildElements(_nsInfo.xmlNSPrefix + "script", _scxml); for (unsigned int i = 0; i < globalScriptElems.size(); i++) { if (_dataModel) { executeContent(globalScriptElems[i]); @@ -104,7 +104,9 @@ void InterpreterDraft6::interpret() { if (_userDefinedStartConfiguration.size() > 0) { // we emulate entering a given configuration by creating a pseudo deep history - Element initHistory = _document.createElementNS(_nsURL, "history"); + Element initHistory = _document.createElementNS(_nsInfo.nsURL, "history"); + _nsInfo.setPrefix(initHistory); + initHistory.setAttribute("id", UUID::getUUID()); initHistory.setAttribute("type", "deep"); _scxml.insertBefore(initHistory, _scxml.getFirstChild()); @@ -116,9 +118,13 @@ void InterpreterDraft6::interpret() { } _historyValue[histId] = histStates; - Element initialElem = _document.createElementNS(_nsURL, "initial"); + Element initialElem = _document.createElementNS(_nsInfo.nsURL, "initial"); + _nsInfo.setPrefix(initialElem); + initialElem.setAttribute("generated", "true"); - Element transitionElem = _document.createElementNS(_nsURL, "transition"); + Element transitionElem = _document.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transitionElem); + transitionElem.setAttribute("target", histId); initialElem.appendChild(transitionElem); _scxml.appendChild(initialElem); @@ -126,16 +132,20 @@ void InterpreterDraft6::interpret() { } else { // try to get initial transition from initial element - initialTransitions = _xpath.evaluate("/" + _xpathPrefix + "initial/" + _xpathPrefix + "transition", _scxml).asNodeSet(); + initialTransitions = _xpath.evaluate("/" + _nsInfo.xpathPrefix + "initial/" + _nsInfo.xpathPrefix + "transition", _scxml).asNodeSet(); if (initialTransitions.size() == 0) { Arabica::XPath::NodeSet initialStates; // fetch per draft initialStates = getInitialStates(); assert(initialStates.size() > 0); for (int i = 0; i < initialStates.size(); i++) { - Element initialElem = _document.createElementNS(_nsURL, "initial"); + Element initialElem = _document.createElementNS(_nsInfo.nsURL, "initial"); + _nsInfo.setPrefix(initialElem); + initialElem.setAttribute("generated", "true"); - Element transitionElem = _document.createElementNS(_nsURL, "transition"); + Element transitionElem = _document.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transitionElem); + transitionElem.setAttribute("target", ATTR(initialStates[i], "id")); initialElem.appendChild(transitionElem); _scxml.appendChild(initialElem); @@ -147,9 +157,9 @@ void InterpreterDraft6::interpret() { assert(initialTransitions.size() > 0); enterStates(initialTransitions); - // _mutex.unlock(); + // _mutex.unlock(); - // assert(hasLegalConfiguration()); + // assert(hasLegalConfiguration()); mainEventLoop(); } catch (boost::bad_weak_ptr e) { LOG(ERROR) << "Unclean shutdown " << std::endl << std::endl; @@ -178,7 +188,7 @@ void InterpreterDraft6::mainEventLoop() { } std::cout << std::endl; #endif - + enabledTransitions = selectEventlessTransitions(); if (enabledTransitions.size() == 0) { if (_internalQueue.size() == 0) { @@ -189,12 +199,13 @@ void InterpreterDraft6::mainEventLoop() { #if VERBOSE std::cout << "Received internal event " << _currEvent.name << std::endl; #endif - + // --- MONITOR: beforeProcessingEvent ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeProcessingEvent(shared_from_this(), _currEvent); - } USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) + } + USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) } if (_dataModel) @@ -210,7 +221,7 @@ void InterpreterDraft6::mainEventLoop() { } for (unsigned int i = 0; i < _statesToInvoke.size(); i++) { - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", _statesToInvoke[i]); + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", _statesToInvoke[i]); for (unsigned int j = 0; j < invokes.size(); j++) { if (!HAS_ATTR(invokes[j], "persist") || !DOMUtils::attributeIsTrue(ATTR(invokes[j], "persist"))) { invoke(invokes[j]); @@ -240,9 +251,10 @@ void InterpreterDraft6::mainEventLoop() { for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->onStableConfiguration(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(onStableConfiguration) + } + USCXML_MONITOR_CATCH_BLOCK(onStableConfiguration) } - + // } _mutex.unlock(); @@ -267,7 +279,8 @@ void InterpreterDraft6::mainEventLoop() { for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeProcessingEvent(shared_from_this(), _currEvent); - } USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) + } + USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) } if (_dataModel && iequals(_currEvent.name, "cancel.invoke." + _sessionId)) @@ -321,10 +334,10 @@ void InterpreterDraft6::mainEventLoop() { } #else for (std::map::iterator invokeIter = _invokers.begin(); - invokeIter != _invokers.end(); - invokeIter++) { + invokeIter != _invokers.end(); + invokeIter++) { if (iequals(invokeIter->first, _currEvent.invokeid)) { - Arabica::XPath::NodeSet finalizes = filterChildElements(_xmlNSPrefix + "finalize", invokeIter->second.getElement()); + Arabica::XPath::NodeSet finalizes = filterChildElements(_nsInfo.xmlNSPrefix + "finalize", invokeIter->second.getElement()); for (int k = 0; k < finalizes.size(); k++) { Element finalizeElem = Element(finalizes[k]); executeContent(finalizeElem); @@ -355,7 +368,8 @@ EXIT_INTERPRETER: for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeCompletion(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(beforeCompletion) + } + USCXML_MONITOR_CATCH_BLOCK(beforeCompletion) } exitInterpreter(); @@ -371,7 +385,8 @@ EXIT_INTERPRETER: for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterCompletion(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(afterCompletion) + } + USCXML_MONITOR_CATCH_BLOCK(afterCompletion) } } @@ -397,7 +412,7 @@ Arabica::XPath::NodeSet InterpreterDraft6::selectTransitions(const unsigned int index = 0; while(states.size() > index) { bool foundTransition = false; - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", states[index]); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", states[index]); for (unsigned int k = 0; k < transitions.size(); k++) { if (isEnabledTransition(transitions[k], event)) { enabledTransitions.push_back(transitions[k]); @@ -475,7 +490,7 @@ Arabica::XPath::NodeSet InterpreterDraft6::selectEventlessTransitio unsigned int index = 0; while(states.size() > index) { bool foundTransition = false; - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", states[index]); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", states[index]); for (unsigned int k = 0; k < transitions.size(); k++) { if (!HAS_ATTR(transitions[k], "event") && hasConditionMatch(transitions[k])) { enabledTransitions.push_back(transitions[k]); @@ -535,7 +550,7 @@ LOOP: } - + /** * Is t1 preempting t2? */ @@ -617,11 +632,12 @@ void InterpreterDraft6::microstep(const Arabica::XPath::NodeSet& en for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeMicroStep(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(beforeMicroStep) + } + USCXML_MONITOR_CATCH_BLOCK(beforeMicroStep) } exitStates(enabledTransitions); - + monIter_t monIter; for (int i = 0; i < enabledTransitions.size(); i++) { Element transition(enabledTransitions[i]); @@ -630,26 +646,29 @@ void InterpreterDraft6::microstep(const Arabica::XPath::NodeSet& en for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeTakingTransition(shared_from_this(), transition, (i + 1 < enabledTransitions.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeTakingTransitions) + } + USCXML_MONITOR_CATCH_BLOCK(beforeTakingTransitions) } - + executeContent(transition); - + // --- MONITOR: afterTakingTransitions ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterTakingTransition(shared_from_this(), transition, (i + 1 < enabledTransitions.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterTakingTransitions) + } + USCXML_MONITOR_CATCH_BLOCK(afterTakingTransitions) } } enterStates(enabledTransitions); - + // --- MONITOR: afterMicroStep ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterMicroStep(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(afterMicroStep) + } + USCXML_MONITOR_CATCH_BLOCK(afterMicroStep) } } @@ -660,11 +679,11 @@ void InterpreterDraft6::exitInterpreter() { statesToExit.sort(); for (int i = 0; i < statesToExit.size(); i++) { - Arabica::XPath::NodeSet onExitElems = filterChildElements(_xmlNSPrefix + "onexit", statesToExit[i]); + Arabica::XPath::NodeSet onExitElems = filterChildElements(_nsInfo.xmlNSPrefix + "onexit", statesToExit[i]); for (int j = 0; j < onExitElems.size(); j++) { executeContent(onExitElems[j]); } - Arabica::XPath::NodeSet invokeElems = filterChildElements(_xmlNSPrefix + "invoke", statesToExit[i]); + Arabica::XPath::NodeSet invokeElems = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", statesToExit[i]); // TODO: we ought to cancel all remaining invokers just to be sure with the persist extension for (int j = 0; j < invokeElems.size(); j++) { cancelInvoke(invokeElems[j]); @@ -750,7 +769,7 @@ void InterpreterDraft6::exitStates(const Arabica::XPath::NodeSet& e #endif for (int i = 0; i < statesToExit.size(); i++) { - NodeSet histories = filterChildElements(_xmlNSPrefix + "history", statesToExit[i]); + NodeSet histories = filterChildElements(_nsInfo.xmlNSPrefix + "history", statesToExit[i]); for (int j = 0; j < histories.size(); j++) { Element historyElem = (Element)histories[j]; std::string historyType = (historyElem.hasAttribute("type") ? historyElem.getAttribute("type") : "shallow"); @@ -781,23 +800,25 @@ void InterpreterDraft6::exitStates(const Arabica::XPath::NodeSet& e for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeExitingState(shared_from_this(), Element(statesToExit[i]), (i + 1 < statesToExit.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeExitingState) + } + USCXML_MONITOR_CATCH_BLOCK(beforeExitingState) } - NodeSet onExits = filterChildElements(_xmlNSPrefix + "onExit", statesToExit[i]); + NodeSet onExits = filterChildElements(_nsInfo.xmlNSPrefix + "onExit", statesToExit[i]); for (int j = 0; j < onExits.size(); j++) { Element onExitElem = (Element)onExits[j]; executeContent(onExitElem); } - + // --- MONITOR: afterExitingState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterExitingState(shared_from_this(), Element(statesToExit[i]), (i + 1 < statesToExit.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterExitingState) + } + USCXML_MONITOR_CATCH_BLOCK(afterExitingState) } - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", statesToExit[i]); + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", statesToExit[i]); for (int j = 0; j < invokes.size(); j++) { Element invokeElem = (Element)invokes[j]; if (HAS_ATTR(invokeElem, "persist") && DOMUtils::attributeIsTrue(ATTR(invokeElem, "persist"))) { @@ -806,7 +827,7 @@ void InterpreterDraft6::exitStates(const Arabica::XPath::NodeSet& e cancelInvoke(invokeElem); } } - + // remove statesToExit[i] from _configuration - test409 tmp.clear(); for (int j = 0; j < _configuration.size(); j++) { @@ -932,10 +953,10 @@ void InterpreterDraft6::enterStates(const Arabica::XPath::NodeSet& for (int i = 0; i < statesToEnter.size(); i++) { Element stateElem = (Element)statesToEnter[i]; - + // extension for flattened interpreters for (unsigned int k = 0; k < statesToEnter.size(); k++) { - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", statesToEnter[k]); + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", statesToEnter[k]); for (unsigned int j = 0; j < invokes.size(); j++) { if (HAS_ATTR(invokes[j], "persist") && DOMUtils::attributeIsTrue(ATTR(invokes[j], "persist"))) { invoke(invokes[j]); @@ -947,11 +968,12 @@ void InterpreterDraft6::enterStates(const Arabica::XPath::NodeSet& for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeEnteringState(shared_from_this(), stateElem, (i + 1 < statesToEnter.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeEnteringState) + } + USCXML_MONITOR_CATCH_BLOCK(beforeEnteringState) } // extension for flattened SCXML documents, we will need an explicit uninvoke element - NodeSet uninvokes = filterChildElements(_xmlNSPrefix + "uninvoke", statesToEnter[i]); + NodeSet uninvokes = filterChildElements(_nsInfo.xmlNSPrefix + "uninvoke", statesToEnter[i]); for (int j = 0; j < uninvokes.size(); j++) { Element uninvokeElem = (Element)uninvokes[j]; cancelInvoke(uninvokeElem); @@ -962,9 +984,9 @@ void InterpreterDraft6::enterStates(const Arabica::XPath::NodeSet& // if (_binding == LATE && stateElem.getAttribute("isFirstEntry").size() > 0) { if (_binding == LATE && !isMember(stateElem, _alreadyEntered)) { - NodeSet dataModelElems = filterChildElements(_xmlNSPrefix + "datamodel", stateElem); + NodeSet dataModelElems = filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", stateElem); if(dataModelElems.size() > 0 && _dataModel) { - Arabica::XPath::NodeSet dataElems = filterChildElements(_xmlNSPrefix + "data", dataModelElems[0]); + Arabica::XPath::NodeSet dataElems = filterChildElements(_nsInfo.xmlNSPrefix + "data", dataModelElems[0]); for (int j = 0; j < dataElems.size(); j++) { if (dataElems[j].getNodeType() == Node_base::ELEMENT_NODE) initializeData(Element(dataElems[j])); @@ -974,24 +996,25 @@ void InterpreterDraft6::enterStates(const Arabica::XPath::NodeSet& // stateElem.setAttribute("isFirstEntry", ""); } // execute onentry executable content - NodeSet onEntryElems = filterChildElements(_xmlNSPrefix + "onEntry", stateElem); + NodeSet onEntryElems = filterChildElements(_nsInfo.xmlNSPrefix + "onEntry", stateElem); executeContent(onEntryElems, false); // --- MONITOR: afterEnteringState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterEnteringState(shared_from_this(), stateElem, (i + 1 < statesToEnter.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterEnteringState) + } + USCXML_MONITOR_CATCH_BLOCK(afterEnteringState) } if (isMember(stateElem, statesForDefaultEntry)) { // execute initial transition content for compound states - Arabica::XPath::NodeSet transitions = _xpath.evaluate("" + _xpathPrefix + "initial/" + _xpathPrefix + "transition", stateElem).asNodeSet(); + Arabica::XPath::NodeSet transitions = _xpath.evaluate("" + _nsInfo.xpathPrefix + "initial/" + _nsInfo.xpathPrefix + "transition", stateElem).asNodeSet(); for (int j = 0; j < transitions.size(); j++) { executeContent(transitions[j]); } } - + if (isFinal(stateElem)) { internalDoneSend(stateElem); Element parent = (Element)stateElem.getParentNode(); @@ -1059,7 +1082,7 @@ void InterpreterDraft6::addStatesToEnter(const Node& state, } } } else { - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", state); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", state); for (int i = 0; i < transitions.size(); i++) { NodeSet targets = getTargetStates(transitions[i]); for (int j = 0; j < targets.size(); j++) { diff --git a/src/uscxml/interpreter/InterpreterRC.cpp b/src/uscxml/interpreter/InterpreterRC.cpp index 52b36e0..10c41d0 100644 --- a/src/uscxml/interpreter/InterpreterRC.cpp +++ b/src/uscxml/interpreter/InterpreterRC.cpp @@ -50,17 +50,17 @@ void InterpreterRC::interpret() { tthread::lock_guard lock(_mutex); if (!_isInitialized) init(); - + if (!_scxml) { return; } // dump(); - + // just make sure we have a session id assert(_sessionId.length() > 0); - + setupIOProcessors(); - + std::string datamodelName; if (datamodelName.length() == 0 && HAS_ATTR(_scxml, "datamodel")) datamodelName = ATTR(_scxml, "datamodel"); @@ -79,79 +79,89 @@ void InterpreterRC::interpret() { if(datamodelName.length() > 0 && !_dataModel) { LOG(ERROR) << "No datamodel for " << datamodelName << " registered"; } - + if (_dataModel) { _dataModel.assign("_x.args", _cmdLineOptions); } - + _running = true; _binding = (HAS_ATTR(_scxml, "binding") && iequals(ATTR(_scxml, "binding"), "late") ? LATE : EARLY); - + // @TODO: Reread http://www.w3.org/TR/scxml/#DataBinding - + if (_dataModel && _binding == EARLY) { // initialize all data elements - NodeSet dataElems = _xpath.evaluate("//" + _xpathPrefix + "data", _scxml).asNodeSet(); + NodeSet dataElems = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "data", _scxml).asNodeSet(); for (unsigned int i = 0; i < dataElems.size(); i++) { // do not process data elements of nested documents from invokers - if (!getAncestorElement(dataElems[i], _xmlNSPrefix + "invoke")) + if (!getAncestorElement(dataElems[i], _nsInfo.xmlNSPrefix + "invoke")) if (dataElems[i].getNodeType() == Node_base::ELEMENT_NODE) { initializeData(Element(dataElems[i])); } } } else if(_dataModel) { // initialize current data elements - NodeSet topDataElems = filterChildElements(_xmlNSPrefix + "data", filterChildElements(_xmlNSPrefix + "datamodel", _scxml)); + NodeSet topDataElems = filterChildElements(_nsInfo.xmlNSPrefix + "data", filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", _scxml)); for (unsigned int i = 0; i < topDataElems.size(); i++) { if (topDataElems[i].getNodeType() == Node_base::ELEMENT_NODE) initializeData(Element(topDataElems[i])); } } - + // executeGlobalScriptElements - NodeSet globalScriptElems = filterChildElements(_xmlNSPrefix + "script", _scxml); + NodeSet globalScriptElems = filterChildElements(_nsInfo.xmlNSPrefix + "script", _scxml); for (unsigned int i = 0; i < globalScriptElems.size(); i++) { if (_dataModel) { executeContent(globalScriptElems[i]); } } - + NodeSet initialTransitions; - + if (_userDefinedStartConfiguration.size() > 0) { // we emulate entering a given configuration by creating a pseudo deep history - Element initHistory = _document.createElementNS(_nsURL, "history"); + Element initHistory = _document.createElementNS(_nsInfo.nsURL, "history"); + _nsInfo.setPrefix(initHistory); + initHistory.setAttribute("id", UUID::getUUID()); initHistory.setAttribute("type", "deep"); _scxml.insertBefore(initHistory, _scxml.getFirstChild()); - + std::string histId = ATTR(initHistory, "id"); NodeSet histStates; for (int i = 0; i < _userDefinedStartConfiguration.size(); i++) { histStates.push_back(getState(_userDefinedStartConfiguration[i])); } _historyValue[histId] = histStates; - - Element initialElem = _document.createElementNS(_nsURL, "initial"); + + Element initialElem = _document.createElementNS(_nsInfo.nsURL, "initial"); + _nsInfo.setPrefix(initialElem); + initialElem.setAttribute("generated", "true"); - Element transitionElem = _document.createElementNS(_nsURL, "transition"); + Element transitionElem = _document.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transitionElem); + transitionElem.setAttribute("target", histId); initialElem.appendChild(transitionElem); _scxml.appendChild(initialElem); initialTransitions.push_back(transitionElem); - + } else { // try to get initial transition from initial element - initialTransitions = _xpath.evaluate("/" + _xpathPrefix + "initial/" + _xpathPrefix + "transition", _scxml).asNodeSet(); + initialTransitions = _xpath.evaluate("/" + _nsInfo.xpathPrefix + "initial/" + _nsInfo.xpathPrefix + "transition", _scxml).asNodeSet(); if (initialTransitions.size() == 0) { Arabica::XPath::NodeSet initialStates; // fetch per draft initialStates = getInitialStates(); assert(initialStates.size() > 0); for (int i = 0; i < initialStates.size(); i++) { - Element initialElem = _document.createElementNS(_nsURL, "initial"); + Element initialElem = _document.createElementNS(_nsInfo.nsURL, "initial"); + _nsInfo.setPrefix(initialElem); + initialElem.setAttribute("generated", "true"); - Element transitionElem = _document.createElementNS(_nsURL, "transition"); + Element transitionElem = _document.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transitionElem); + transitionElem.setAttribute("target", ATTR(initialStates[i], "id")); initialElem.appendChild(transitionElem); _scxml.appendChild(initialElem); @@ -159,12 +169,12 @@ void InterpreterRC::interpret() { } } } - + assert(initialTransitions.size() > 0); - + enterStates(initialTransitions); // _mutex.unlock(); - + // assert(hasLegalConfiguration()); mainEventLoop(); } catch (boost::bad_weak_ptr e) { @@ -173,7 +183,7 @@ void InterpreterRC::interpret() { // set datamodel to null from this thread if(_dataModel) _dataModel = DataModel(); - + } /** @@ -181,12 +191,12 @@ procedure mainEventLoop(): while running: enabledTransitions = null macrostepDone = false - # Here we handle eventless transitions and transitions + # Here we handle eventless transitions and transitions # triggered by internal events until macrostep is complete while running and not macrostepDone: enabledTransitions = selectEventlessTransitions() if enabledTransitions.isEmpty(): - if internalQueue.isEmpty(): + if internalQueue.isEmpty(): macrostepDone = true else: internalEvent = internalQueue.dequeue() @@ -194,7 +204,7 @@ procedure mainEventLoop(): enabledTransitions = selectTransitions(internalEvent) if not enabledTransitions.isEmpty(): microstep(enabledTransitions.toList()) - # either we're in a final state, and we break out of the loop + # either we're in a final state, and we break out of the loop if not running: break; # or we've completed a macrostep, so we start a new macrostep by waiting for an external event @@ -203,7 +213,7 @@ procedure mainEventLoop(): for inv in state.invoke: invoke(inv) statesToInvoke.clear() - # Invoking may have raised internal error events and we iterate to handle them + # Invoking may have raised internal error events and we iterate to handle them if not internalQueue.isEmpty(): continue # A blocking wait for an external event. Alternatively, if we have been invoked @@ -219,24 +229,24 @@ procedure mainEventLoop(): if inv.invokeid == externalEvent.invokeid: applyFinalize(inv, externalEvent) if inv.autoforward: - send(inv.id, externalEvent) + send(inv.id, externalEvent) enabledTransitions = selectTransitions(externalEvent) if not enabledTransitions.isEmpty(): - microstep(enabledTransitions.toList()) - # End of outer while running loop. If we get here, we have reached a top-level final state or have been cancelled - exitInterpreter() + microstep(enabledTransitions.toList()) + # End of outer while running loop. If we get here, we have reached a top-level final state or have been cancelled + exitInterpreter() */ void InterpreterRC::mainEventLoop() { monIter_t monIter; - + while(_running) { NodeSet enabledTransitions; _stable = false; - + // Here we handle eventless transitions and transitions // triggered by internal events until machine is stable while(_running && !_stable) { - + enabledTransitions = selectEventlessTransitions(); if (enabledTransitions.size() == 0) { if (_internalQueue.size() == 0) { @@ -244,14 +254,15 @@ void InterpreterRC::mainEventLoop() { } else { _currEvent = _internalQueue.front(); _internalQueue.pop_front(); - + // --- MONITOR: beforeProcessingEvent ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeProcessingEvent(shared_from_this(), _currEvent); - } USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) + } + USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) } - + if (_dataModel) _dataModel.setEvent(_currEvent); enabledTransitions = selectTransitions(_currEvent.name); @@ -263,12 +274,12 @@ void InterpreterRC::mainEventLoop() { microstep(enabledTransitions); } } - + if (!_running) goto EXIT_INTERPRETER; for (unsigned int i = 0; i < _statesToInvoke.size(); i++) { - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", _statesToInvoke[i]); + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", _statesToInvoke[i]); for (unsigned int j = 0; j < invokes.size(); j++) { invoke(invokes[j]); } @@ -277,7 +288,7 @@ void InterpreterRC::mainEventLoop() { if (!_internalQueue.empty()) continue; - + // assume that we have a legal configuration as soon as the internal queue is empty if (!hasLegalConfiguration()) { std::cout << "Illegal configuration!" << std::endl; @@ -287,26 +298,27 @@ void InterpreterRC::mainEventLoop() { std::cout << std::endl; } assert(hasLegalConfiguration()); - + monIter = _monitors.begin(); // if (!_sendQueue || _sendQueue->isEmpty()) { - + // --- MONITOR: onStableConfiguration ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->onStableConfiguration(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(onStableConfiguration) + } + USCXML_MONITOR_CATCH_BLOCK(onStableConfiguration) } - + // } - + _mutex.unlock(); // whenever we have a stable configuration, run the mainThread hooks with 200fps while(_externalQueue.isEmpty() && _thread == NULL) { runOnMainThread(200); } _mutex.lock(); - + // A blocking wait for an external event. Alternatively, if we have been invoked // our parent session also might cancel us. The mechanism for this is platform specific, // but here we assume it's a special event we receive @@ -321,17 +333,18 @@ void InterpreterRC::mainEventLoop() { _currEvent.eventType = Event::EXTERNAL; // make sure it is set to external if (!_running) goto EXIT_INTERPRETER; - + // --- MONITOR: beforeProcessingEvent ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeProcessingEvent(shared_from_this(), _currEvent); - } USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) + } + USCXML_MONITOR_CATCH_BLOCK(beforeProcessingEvent) } - + if (_dataModel && iequals(_currEvent.name, "cancel.invoke." + _sessionId)) break; - + if (_dataModel) { try { _dataModel.setEvent(_currEvent); @@ -340,7 +353,7 @@ void InterpreterRC::mainEventLoop() { } } for (unsigned int i = 0; i < _configuration.size(); i++) { - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", _configuration[i]); + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", _configuration[i]); for (unsigned int j = 0; j < invokes.size(); j++) { Element invokeElem = (Element)invokes[j]; std::string invokeId; @@ -357,13 +370,13 @@ void InterpreterRC::mainEventLoop() { } std::string autoForward = invokeElem.getAttribute("autoforward"); if (iequals(invokeId, _currEvent.invokeid)) { - - Arabica::XPath::NodeSet finalizes = filterChildElements(_xmlNSPrefix + "finalize", invokeElem); + + Arabica::XPath::NodeSet finalizes = filterChildElements(_nsInfo.xmlNSPrefix + "finalize", invokeElem); for (int k = 0; k < finalizes.size(); k++) { Element finalizeElem = Element(finalizes[k]); executeContent(finalizeElem); } - + } if (iequals(autoForward, "true")) { try { @@ -384,15 +397,16 @@ void InterpreterRC::mainEventLoop() { microstep(enabledTransitions); } } - + EXIT_INTERPRETER: // --- MONITOR: beforeCompletion ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeCompletion(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(beforeCompletion) + } + USCXML_MONITOR_CATCH_BLOCK(beforeCompletion) } - + exitInterpreter(); if (_sendQueue) { std::map >::iterator sendIter = _sendIds.begin(); @@ -401,14 +415,15 @@ EXIT_INTERPRETER: sendIter++; } } - + // --- MONITOR: afterCompletion ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterCompletion(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(afterCompletion) + } + USCXML_MONITOR_CATCH_BLOCK(afterCompletion) } - + } /** @@ -420,7 +435,7 @@ procedure exitInterpreter(): for inv in s.invoke: cancelInvoke(inv) configuration.delete(s) - if isFinalState(s) and isScxmlState(s.parent): + if isFinalState(s) and isScxmlState(s.parent): returnDoneEvent(s.donedata) */ void InterpreterRC::exitInterpreter() { @@ -429,11 +444,11 @@ void InterpreterRC::exitInterpreter() { statesToExit.sort(); for (int i = 0; i < statesToExit.size(); i++) { - Arabica::XPath::NodeSet onExitElems = filterChildElements(_xmlNSPrefix + "onexit", statesToExit[i]); + Arabica::XPath::NodeSet onExitElems = filterChildElements(_nsInfo.xmlNSPrefix + "onexit", statesToExit[i]); for (int j = 0; j < onExitElems.size(); j++) { executeContent(onExitElems[j]); } - Arabica::XPath::NodeSet invokeElems = filterChildElements(_xmlNSPrefix + "invoke", statesToExit[i]); + Arabica::XPath::NodeSet invokeElems = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", statesToExit[i]); for (int j = 0; j < invokeElems.size(); j++) { cancelInvoke(invokeElems[j]); } @@ -451,7 +466,7 @@ function selectEventlessTransitions(): for state in atomicStates: loop: for s in [state].append(getProperAncestors(state, null)): for t in s.transition: - if not t.event and conditionMatch(t): + if not t.event and conditionMatch(t): enabledTransitions.add(t) break loop enabledTransitions = removeConflictingTransitions(enabledTransitions) @@ -459,7 +474,7 @@ function selectEventlessTransitions(): */ Arabica::XPath::NodeSet InterpreterRC::selectEventlessTransitions() { Arabica::XPath::NodeSet enabledTransitions; - + NodeSet atomicStates; for (unsigned int i = 0; i < _configuration.size(); i++) { if (isAtomic(_configuration[i])) @@ -474,7 +489,7 @@ Arabica::XPath::NodeSet InterpreterRC::selectEventlessTransitions() withAncestors.push_back(getProperAncestors(state, Node())); for (unsigned int j = 0; j < withAncestors.size(); j++) { const Node& ancestor = withAncestors[i]; - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", ancestor); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", ancestor); for (unsigned int k = 0; k < transitions.size(); k++) { if (!HAS_ATTR(transitions[k], "event") && hasConditionMatch(transitions[k])) { enabledTransitions.push_back(transitions[k]); @@ -482,9 +497,10 @@ Arabica::XPath::NodeSet InterpreterRC::selectEventlessTransitions() } } } - BREAK_LOOP:; +BREAK_LOOP: + ; } - + enabledTransitions = removeConflictingTransitions(enabledTransitions); return enabledTransitions; } @@ -504,14 +520,14 @@ function selectTransitions(event): */ Arabica::XPath::NodeSet InterpreterRC::selectTransitions(const std::string& event) { Arabica::XPath::NodeSet enabledTransitions; - + NodeSet atomicStates; for (unsigned int i = 0; i < _configuration.size(); i++) { if (isAtomic(_configuration[i])) atomicStates.push_back(_configuration[i]); } atomicStates.to_document_order(); - + #if 0 std::cout << "selectTransitions for " << event << "========" << std::endl; #endif @@ -520,13 +536,13 @@ Arabica::XPath::NodeSet InterpreterRC::selectTransitions(const std: #if 0 std::cout << " == from " << ATTR(state, "id") << std::endl; #endif - + NodeSet withAncestors; withAncestors.push_back(state); withAncestors.push_back(getProperAncestors(state, Node())); for (unsigned int j = 0; j < withAncestors.size(); j++) { const Node& ancestor = withAncestors[j]; - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", ancestor); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", ancestor); for (unsigned int k = 0; k < transitions.size(); k++) { if (isEnabledTransition(transitions[k], event)) { enabledTransitions.push_back(transitions[k]); @@ -534,9 +550,10 @@ Arabica::XPath::NodeSet InterpreterRC::selectTransitions(const std: } } } - BREAK_LOOP:; +BREAK_LOOP: + ; } - + enabledTransitions = removeConflictingTransitions(enabledTransitions); #if 0 @@ -564,7 +581,7 @@ bool InterpreterRC::isEnabledTransition(const Node& transition, con } else { return false; } - + std::list eventNames = tokenizeIdRefs(eventName); std::list::iterator eventIter = eventNames.begin(); while(eventIter != eventNames.end()) { @@ -588,19 +605,19 @@ function removeConflictingTransitions(enabledTransitions): if computeExitSet([t1]).hasIntersection(computeExitSet([t2])): if isDescendant(t1.source, t2.source): transitionsToRemove.add(t2) - else: + else: t1Preempted = true break if not t1Preempted: for t3 in transitionsToRemove.toList(): filteredTransitions.delete(t3) filteredTransitions.add(t1) - + return filteredTransitions */ Arabica::XPath::NodeSet InterpreterRC::removeConflictingTransitions(const Arabica::XPath::NodeSet& enabledTransitions) { Arabica::XPath::NodeSet filteredTransitions; - + for (unsigned int i = 0; i < enabledTransitions.size(); i++) { const Node& t1 = enabledTransitions[i]; bool t1Preempted = false; @@ -617,7 +634,7 @@ Arabica::XPath::NodeSet InterpreterRC::removeConflictingTransitions } } } - + if (!t1Preempted) { // remove transitionsToRemove from filteredTransitions std::list > tmp; @@ -652,58 +669,62 @@ procedure microstep(enabledTransitions): enterStates(enabledTransitions) */ void InterpreterRC::microstep(const Arabica::XPath::NodeSet& enabledTransitions) { - + // --- MONITOR: beforeMicroStep ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeMicroStep(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(beforeMicroStep) + } + USCXML_MONITOR_CATCH_BLOCK(beforeMicroStep) } - + exitStates(enabledTransitions); - + monIter_t monIter; for (int i = 0; i < enabledTransitions.size(); i++) { Element transition(enabledTransitions[i]); - + // --- MONITOR: beforeTakingTransitions ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeTakingTransition(shared_from_this(), transition, (i + 1 < enabledTransitions.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeTakingTransitions) + } + USCXML_MONITOR_CATCH_BLOCK(beforeTakingTransitions) } - + executeContent(transition); - + // --- MONITOR: afterTakingTransitions ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterTakingTransition(shared_from_this(), transition, (i + 1 < enabledTransitions.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterTakingTransitions) + } + USCXML_MONITOR_CATCH_BLOCK(afterTakingTransitions) } } - + enterStates(enabledTransitions); - + // --- MONITOR: afterMicroStep ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterMicroStep(shared_from_this()); - } USCXML_MONITOR_CATCH_BLOCK(afterMicroStep) + } + USCXML_MONITOR_CATCH_BLOCK(afterMicroStep) } } /** procedure exitStates(enabledTransitions): - statesToExit = computeExitSet(enabledTransitions) + statesToExit = computeExitSet(enabledTransitions) for s in statesToExit: statesToInvoke.delete(s) statesToExit = statesToExit.toList().sort(exitOrder) for s in statesToExit: for h in s.history: if h.type == "deep": - f = lambda s0: isAtomicState(s0) and isDescendant(s0,s) + f = lambda s0: isAtomicState(s0) and isDescendant(s0,s) else: f = lambda s0: s0.parent == s historyValue[h.id] = configuration.toList().filter(f) @@ -730,9 +751,9 @@ void InterpreterRC::exitStates(const Arabica::XPath::NodeSet& enabl statesToExit.forward(false); statesToExit.sort(); - + for (int i = 0; i < statesToExit.size(); i++) { - NodeSet histories = filterChildElements(_xmlNSPrefix + "history", statesToExit[i]); + NodeSet histories = filterChildElements(_nsInfo.xmlNSPrefix + "history", statesToExit[i]); for (int j = 0; j < histories.size(); j++) { Element historyElem = (Element)histories[j]; std::string historyType = (historyElem.hasAttribute("type") ? historyElem.getAttribute("type") : "shallow"); @@ -749,34 +770,36 @@ void InterpreterRC::exitStates(const Arabica::XPath::NodeSet& enabl _historyValue[historyElem.getAttribute("id")] = historyNodes; } } - + for (int i = 0; i < statesToExit.size(); i++) { // --- MONITOR: beforeExitingState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeExitingState(shared_from_this(), Element(statesToExit[i]), (i + 1 < statesToExit.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeExitingState) + } + USCXML_MONITOR_CATCH_BLOCK(beforeExitingState) } - - NodeSet onExits = filterChildElements(_xmlNSPrefix + "onExit", statesToExit[i]); + + NodeSet onExits = filterChildElements(_nsInfo.xmlNSPrefix + "onExit", statesToExit[i]); for (int j = 0; j < onExits.size(); j++) { Element onExitElem = (Element)onExits[j]; executeContent(onExitElem); } - + // --- MONITOR: afterExitingState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterExitingState(shared_from_this(), Element(statesToExit[i]), (i + 1 < statesToExit.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterExitingState) + } + USCXML_MONITOR_CATCH_BLOCK(afterExitingState) } - - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", statesToExit[i]); + + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", statesToExit[i]); for (int j = 0; j < invokes.size(); j++) { Element invokeElem = (Element)invokes[j]; cancelInvoke(invokeElem); } - + // remove statesToExit[i] from _configuration - test409 tmp.clear(); for (int j = 0; j < _configuration.size(); j++) { @@ -799,7 +822,7 @@ function computeExitSet(transitions) for s in configuration: if isDescendant(s,domain): statesToExit.add(s) - return statesToExit + return statesToExit */ Arabica::XPath::NodeSet InterpreterRC::computeExitSet(const Arabica::XPath::NodeSet& transitions) { NodeSet statesToExit; @@ -832,13 +855,13 @@ Arabica::XPath::NodeSet InterpreterRC::computeExitSet(const Arabica transitions.push_back(transition); return computeExitSet(transitions); } - + /** procedure enterStates(enabledTransitions): statesToEnter = new OrderedSet() statesForDefaultEntry = new OrderedSet() - computeEntrySet(enabledTransitions, statesToEnter, statesForDefaultEntry) + computeEntrySet(enabledTransitions, statesToEnter, statesForDefaultEntry) for s in statesToEnter.toList().sort(entryOrder): configuration.add(s) statesToInvoke.add(s) @@ -866,28 +889,29 @@ void InterpreterRC::enterStates(const Arabica::XPath::NodeSet& enab // initialize the temporary table for default content in history states std::map > defaultHistoryContent; monIter_t monIter; - + computeEntrySet(enabledTransitions, statesToEnter, statesForDefaultEntry, defaultHistoryContent); statesToEnter.to_document_order(); - + for (int i = 0; i < statesToEnter.size(); i++) { Element s = (Element)statesToEnter[i]; - + // --- MONITOR: beforeEnteringState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->beforeEnteringState(shared_from_this(), s, (i + 1 < statesToEnter.size())); - } USCXML_MONITOR_CATCH_BLOCK(beforeEnteringState) + } + USCXML_MONITOR_CATCH_BLOCK(beforeEnteringState) } - + _configuration.push_back(s); _statesToInvoke.push_back(s); - + // if (_binding == LATE && stateElem.getAttribute("isFirstEntry").size() > 0) { if (_binding == LATE && !isMember(s, _alreadyEntered)) { - NodeSet dataModelElems = filterChildElements(_xmlNSPrefix + "datamodel", s); + NodeSet dataModelElems = filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", s); if(dataModelElems.size() > 0 && _dataModel) { - Arabica::XPath::NodeSet dataElems = filterChildElements(_xmlNSPrefix + "data", dataModelElems[0]); + Arabica::XPath::NodeSet dataElems = filterChildElements(_nsInfo.xmlNSPrefix + "data", dataModelElems[0]); for (int j = 0; j < dataElems.size(); j++) { if (dataElems[j].getNodeType() == Node_base::ELEMENT_NODE) initializeData(Element(dataElems[j])); @@ -897,19 +921,20 @@ void InterpreterRC::enterStates(const Arabica::XPath::NodeSet& enab // stateElem.setAttribute("isFirstEntry", ""); } // execute onentry executable content - NodeSet onEntryElems = filterChildElements(_xmlNSPrefix + "onEntry", s); + NodeSet onEntryElems = filterChildElements(_nsInfo.xmlNSPrefix + "onEntry", s); executeContent(onEntryElems, false); - + // --- MONITOR: afterEnteringState ------------------------------ for(monIter_t monIter = _monitors.begin(); monIter != _monitors.end(); monIter++) { try { (*monIter)->afterEnteringState(shared_from_this(), s, (i + 1 < statesToEnter.size())); - } USCXML_MONITOR_CATCH_BLOCK(afterEnteringState) + } + USCXML_MONITOR_CATCH_BLOCK(afterEnteringState) } - + if (isMember(s, statesForDefaultEntry)) { // execute initial transition content for compound states - Arabica::XPath::NodeSet transitions = _xpath.evaluate("" + _xpathPrefix + "initial/" + _xpathPrefix + "transition", s).asNodeSet(); + Arabica::XPath::NodeSet transitions = _xpath.evaluate("" + _nsInfo.xpathPrefix + "initial/" + _nsInfo.xpathPrefix + "transition", s).asNodeSet(); for (int j = 0; j < transitions.size(); j++) { executeContent(transitions[j]); } @@ -917,18 +942,18 @@ void InterpreterRC::enterStates(const Arabica::XPath::NodeSet& enab if (defaultHistoryContent.find(ATTR(s, "id")) != defaultHistoryContent.end()) { executeContent(defaultHistoryContent[ATTR(s, "id")]); } - + /** - if isFinalState(s): - if isSCXMLElement(s.parent): - running = false - else: - parent = s.parent - grandparent = parent.parent - internalQueue.enqueue(new Event("done.state." + parent.id, s.donedata)) - if isParallelState(grandparent): - if getChildStates(grandparent).every(isInFinalState): - internalQueue.enqueue(new Event("done.state." + grandparent.id)) + if isFinalState(s): + if isSCXMLElement(s.parent): + running = false + else: + parent = s.parent + grandparent = parent.parent + internalQueue.enqueue(new Event("done.state." + parent.id, s.donedata)) + if isParallelState(grandparent): + if getChildStates(grandparent).every(isInFinalState): + internalQueue.enqueue(new Event("done.state." + grandparent.id)) */ //std::cout << _name << ": " << s << std::endl; @@ -940,9 +965,9 @@ void InterpreterRC::enterStates(const Arabica::XPath::NodeSet& enab } else { Element parent = (Element)s.getParentNode(); Element grandParent = (Element)parent.getParentNode(); - + internalDoneSend(parent); - + if (isParallel(grandParent)) { Arabica::XPath::NodeSet childs = getChildStates(grandParent); bool inFinalState = true; @@ -965,18 +990,18 @@ void InterpreterRC::enterStates(const Arabica::XPath::NodeSet& enab /** procedure computeEntrySet(transitions, statesToEnter, statesForDefaultEntry) for t in transitions: - statesToEnter.union(getTargetStates(t.target)) + statesToEnter.union(getTargetStates(t.target)) for s in statesToEnter: - addDescendantStatesToEnter(s,statesToEnter,statesForDefaultEntry) - for t in transitions: - ancestor = getTransitionDomain(t) - for s in getTargetStates(t.target)): + addDescendantStatesToEnter(s,statesToEnter,statesForDefaultEntry) + for t in transitions: + ancestor = getTransitionDomain(t) + for s in getTargetStates(t.target)): addAncestorStatesToEnter(s, ancestor, statesToEnter, statesForDefaultEntry) */ void InterpreterRC::computeEntrySet(const Arabica::XPath::NodeSet& transitions, - NodeSet& statesToEnter, - NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent) { + NodeSet& statesToEnter, + NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent) { for (int i = 0; i < transitions.size(); i++) { const Node& t = transitions[i]; @@ -1001,7 +1026,7 @@ void InterpreterRC::computeEntrySet(const Arabica::XPath::NodeSet& assert(tmp[i]); addDescendantStatesToEnter(tmp[i],statesToEnter,statesForDefaultEntry, defaultHistoryContent); } - + #if 1 std::cout << "after addDescendantStatesToEnter: "; for (int i = 0; i < statesToEnter.size(); i++) { @@ -1009,7 +1034,7 @@ void InterpreterRC::computeEntrySet(const Arabica::XPath::NodeSet& } std::cout << std::endl; #endif - + for (int i = 0; i < transitions.size(); i++) { Element t = (Element)transitions[i]; Node ancestor = getTransitionDomain(t); @@ -1030,9 +1055,9 @@ void InterpreterRC::computeEntrySet(const Arabica::XPath::NodeSet& } void InterpreterRC::computeEntrySet(const Arabica::DOM::Node& transition, - NodeSet& statesToEnter, - NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent) { + NodeSet& statesToEnter, + NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent) { Arabica::XPath::NodeSet transitions; transitions.push_back(transition); computeEntrySet(transitions, statesToEnter, statesForDefaultEntry, defaultHistoryContent); @@ -1062,12 +1087,12 @@ procedure addDescendantStatesToEnter(state,statesToEnter,statesForDefaultEntry): if isParallelState(state): for child in getChildStates(state): if not statesToEnter.some(lambda s: isDescendant(s,child)): - addDescendantStatesToEnter(child,statesToEnter,statesForDefaultEntry) + addDescendantStatesToEnter(child,statesToEnter,statesForDefaultEntry) */ void InterpreterRC::addDescendantStatesToEnter(const Arabica::DOM::Node& state, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent) { + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent) { if (isHistory(state)) { std::string stateId = ATTR(state, "id"); if (_historyValue.find(stateId) != _historyValue.end()) { @@ -1078,7 +1103,7 @@ void InterpreterRC::addDescendantStatesToEnter(const Arabica::DOM::Node transitions = filterChildElements(_xmlNSPrefix + "transition", state); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", state); if (transitions.size() > 0) { defaultHistoryContent[ATTR(state, "id")] = transitions[0]; } @@ -1097,7 +1122,7 @@ void InterpreterRC::addDescendantStatesToEnter(const Arabica::DOM::Node targets = getInitialStates(state); @@ -1119,7 +1144,8 @@ void InterpreterRC::addDescendantStatesToEnter(const Arabica::DOM::Node& state, - const Arabica::DOM::Node& ancestor, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent) { + const Arabica::DOM::Node& ancestor, + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent) { NodeSet ancestors = getProperAncestors(state,ancestor); for (int i = 0; i < ancestors.size(); i++) { const Node& anc = ancestors[i]; @@ -1155,7 +1181,8 @@ void InterpreterRC::addAncestorStatesToEnter(const Arabica::DOM::Node InterpreterRC::getTransitionDomain(const Arabica::DOM::Node& transition) { NodeSet tStates = getTargetStates(transition); Node source = getSourceState(transition); - + #if 0 std::cout << "getTransitionDomain: " << std::endl << transition << std::endl; #endif - + if (tStates.size() == 0) { return Arabica::DOM::Node(); // null } std::string transitionType = (HAS_ATTR(transition, "type") ? ATTR(transition, "type") : "external"); - + if (iequals(transitionType, "internal") && isCompound(source)) { for (int i = 0; i < tStates.size(); i++) { const Node& s = tStates[i]; @@ -1220,7 +1247,8 @@ Arabica::DOM::Node InterpreterRC::getTransitionDomain(const Arabica } return source; } -BREAK_LOOP:; +BREAK_LOOP: + ; Arabica::XPath::NodeSet states; states.push_back(source); states.push_back(tStates); @@ -1247,10 +1275,10 @@ Arabica::DOM::Node InterpreterRC::findLCCA(const Arabica::XPath::No } ancestor = ancestors[i]; break; - NEXT_ANCESTOR: +NEXT_ANCESTOR: ; } - + // take uppermost root as ancestor if (!ancestor) ancestor = _scxml; @@ -1261,22 +1289,22 @@ Arabica::DOM::Node InterpreterRC::findLCCA(const Arabica::XPath::No /** If state2 is null, returns the set of all ancestors of state1 in ancestry order (state1's parent followed by the parent's parent, etc. up to an including the - element). If state2 is non-null, returns inancestry order the set of all - ancestors of state1, up to but not including state2. (A "proper ancestor" of a - state is its parent, or the parent's parent, or the parent's parent's parent, - etc.)) If state2 is state1's parent, or equal to state1, or a descendant of + element). If state2 is non-null, returns inancestry order the set of all + ancestors of state1, up to but not including state2. (A "proper ancestor" of a + state is its parent, or the parent's parent, or the parent's parent's parent, + etc.)) If state2 is state1's parent, or equal to state1, or a descendant of state1, this returns the empty set. */ Arabica::XPath::NodeSet InterpreterRC::getProperAncestors(const Arabica::DOM::Node& state1, const Arabica::DOM::Node& state2) { NodeSet ancestors; - + if (!state1 || !isState(state1)) return ancestors; if (!state2) { /** - If state2 is null, returns the set of all ancestors of state1 in ancestry - order (state1's parent followed by the parent's parent, etc. up to an + If state2 is null, returns the set of all ancestors of state1 in ancestry + order (state1's parent followed by the parent's parent, etc. up to an including the element). */ Arabica::DOM::Node parent = state1.getParentNode(); @@ -1287,16 +1315,16 @@ Arabica::XPath::NodeSet InterpreterRC::getProperAncestors(const Ara return ancestors; } - /** + /** If state2 is state1's parent, or equal to state1, or a descendant of - state1, this returns the empty set + state1, this returns the empty set */ if (state1.getParentNode() == state2 || state1 == state2 || isDescendant(state2, state1)) { return ancestors; } - + /** - If state2 is non-null, returns in ancestry order the set of all ancestors + If state2 is non-null, returns in ancestry order the set of all ancestors of state1, up to but not including state2. */ Arabica::DOM::Node parent = state1.getParentNode(); @@ -1309,7 +1337,7 @@ Arabica::XPath::NodeSet InterpreterRC::getProperAncestors(const Ara NodeSet InterpreterRC::getTargetStates(const Arabica::DOM::Node& transition) { NodeSet targetStates; - + std::string targetId = ((Arabica::DOM::Element)transition).getAttribute("target"); std::list targetIds = InterpreterImpl::tokenizeIdRefs(ATTR(transition, "target")); if (targetIds.size() > 0) { @@ -1332,14 +1360,14 @@ NodeSet InterpreterRC::getTargetStates(const Arabica::DOM::Node& state1, const Arabica::DOM::Node& state2) { - return false; + return false; } /** Returns a list containing all , , and children of state1. */ Arabica::XPath::NodeSet InterpreterRC::getChildStates(const Arabica::DOM::Node& state) { - return Arabica::XPath::NodeSet(); + return Arabica::XPath::NodeSet(); } #endif diff --git a/src/uscxml/interpreter/InterpreterRC.h b/src/uscxml/interpreter/InterpreterRC.h index bff07b7..0a09c36 100644 --- a/src/uscxml/interpreter/InterpreterRC.h +++ b/src/uscxml/interpreter/InterpreterRC.h @@ -43,33 +43,33 @@ class InterpreterRC : public InterpreterImpl { Arabica::XPath::NodeSet computeExitSet(const Arabica::DOM::Node& transition); void computeEntrySet(const Arabica::XPath::NodeSet& transitions, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent); + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent); void computeEntrySet(const Arabica::DOM::Node& transition, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent); + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent); Arabica::XPath::NodeSet removeConflictingTransitions(const Arabica::XPath::NodeSet& enabledTransitions); Arabica::DOM::Node getTransitionDomain(const Arabica::DOM::Node& transition); void addDescendantStatesToEnter(const Arabica::DOM::Node& state, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent); + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent); void addAncestorStatesToEnter(const Arabica::DOM::Node& state, - const Arabica::DOM::Node& ancestor, - Arabica::XPath::NodeSet& statesToEnter, - Arabica::XPath::NodeSet& statesForDefaultEntry, - std::map > defaultHistoryContent); + const Arabica::DOM::Node& ancestor, + Arabica::XPath::NodeSet& statesToEnter, + Arabica::XPath::NodeSet& statesForDefaultEntry, + std::map > defaultHistoryContent); bool isInFinalState(const Arabica::DOM::Node& state); Arabica::DOM::Node findLCCA(const Arabica::XPath::NodeSet& states); Arabica::XPath::NodeSet getProperAncestors(const Arabica::DOM::Node& s1, - const Arabica::DOM::Node& s2); + const Arabica::DOM::Node& s2); Arabica::XPath::NodeSet getTargetStates(const Arabica::DOM::Node& transition); diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp index 2a84c24..40bd464 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp @@ -23,6 +23,7 @@ namespace Arabica { namespace DOM { JSCDOM::JSCDOM() { + nsInfo = NULL; xpath = NULL; storage = NULL; } diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h index 5a6bfea..cb196ff 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h @@ -49,6 +49,7 @@ public: JSCDOM(); virtual ~JSCDOM(); uscxml::Storage* storage; + uscxml::NameSpaceInfo* nsInfo; Arabica::XPath::XPath* xpath; }; diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index dece4f2..2e8e6d2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -125,8 +125,9 @@ boost::shared_ptr JSCDataModel::create(InterpreterImpl* interpret dm->_dom = new JSCDOM(); dm->_dom->xpath = new XPath(); - dm->_dom->xpath->setNamespaceContext(interpreter->getNSContext()); + dm->_dom->xpath->setNamespaceContext(*interpreter->getNameSpaceInfo().nsContext); dm->_dom->storage = new Storage(URL::getResourceDir() + PATH_SEPERATOR + interpreter->getName() + ".storage"); + dm->_dom->nsInfo = new NameSpaceInfo(interpreter->getNameSpaceInfo()); // introduce global functions as objects for private data JSClassRef jsInClassRef = JSClassCreate(&jsInClassDef); @@ -632,16 +633,16 @@ std::string JSCDataModel::andExpressions(std::list expressions) { if (expressions.size() == 0) return ""; - + if (expressions.size() == 1) return *(expressions.begin()); - + std::ostringstream exprSS; exprSS << "("; std::string conjunction = ""; for (std::list::const_iterator exprIter = expressions.begin(); - exprIter != expressions.end(); - exprIter++) { + exprIter != expressions.end(); + exprIter++) { exprSS << conjunction << "(" << *exprIter << ")"; conjunction = " && "; } diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp index 1527884..795ad70 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp @@ -55,8 +55,8 @@ JSStaticFunction JSCDocument::staticFunctions[] = { { "createEntityReference", createEntityReferenceCallback, kJSPropertyAttributeDontDelete }, { "getElementsByTagName", getElementsByTagNameCallback, kJSPropertyAttributeDontDelete }, { "importNode", importNodeCallback, kJSPropertyAttributeDontDelete }, - { "createElementNS", createElementNSCallback, kJSPropertyAttributeDontDelete }, - { "createAttributeNS", createAttributeNSCallback, kJSPropertyAttributeDontDelete }, + { "createElementNS", createElementNSCustomCallback, kJSPropertyAttributeDontDelete }, + { "createAttributeNS", createAttributeNSCustomCallback, kJSPropertyAttributeDontDelete }, { "getElementsByTagNameNS", getElementsByTagNameNSCallback, kJSPropertyAttributeDontDelete }, { "getElementById", getElementByIdCallback, kJSPropertyAttributeDontDelete }, { "evaluate", evaluateCustomCallback, kJSPropertyAttributeDontDelete }, @@ -459,94 +459,6 @@ JSValueRef JSCDocument::importNodeCallback(JSContextRef ctx, JSObjectRef functio return JSValueMakeUndefined(ctx); } -JSValueRef JSCDocument::createElementNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - - Arabica::DOM::Element* retVal = new Arabica::DOM::Element(privData->nativeObj->createElementNS(localNamespaceURI, localQualifiedName)); - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createElementNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - - Arabica::DOM::Attr* retVal = new Arabica::DOM::Attr(privData->nativeObj->createAttributeNS(localNamespaceURI, localQualifiedName)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - JSValueRef JSCDocument::getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h index f6b167e..1b300fb 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h @@ -48,8 +48,8 @@ public: static JSValueRef createEntityReferenceCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); static JSValueRef getElementsByTagNameCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); static JSValueRef importNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createElementNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); + static JSValueRef createElementNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); + static JSValueRef createAttributeNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); static JSValueRef getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); static JSValueRef getElementByIdCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); static JSValueRef evaluateCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp index 6f15c72..c6ee022 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp @@ -18,6 +18,8 @@ */ #include "JSCDocument.h" +#include "JSCElement.h" +#include "JSCAttr.h" #include "JSCStorage.h" #include "JSCXPathResult.h" #include "JSCNode.h" @@ -141,5 +143,99 @@ JSValueRef JSCDocument::evaluateCustomCallback(JSContextRef ctx, JSObjectRef fun #endif } +JSValueRef JSCDocument::createElementNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { + + struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); + + if (false) { + } else if (argumentCount == 2 && + JSValueIsString(ctx, arguments[0]) && + JSValueIsString(ctx, arguments[1])) { + JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); + size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); + char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; + JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); + std::string localNamespaceURI(localNamespaceURIBuffer); + JSStringRelease(stringReflocalNamespaceURI); + free(localNamespaceURIBuffer); + + JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); + size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); + char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; + JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); + std::string localQualifiedName(localQualifiedNameBuffer); + JSStringRelease(stringReflocalQualifiedName); + free(localQualifiedNameBuffer); + + + Arabica::DOM::Element* retVal = new Arabica::DOM::Element(privData->nativeObj->createElementNS(localNamespaceURI, localQualifiedName)); + if (privData->dom->nsInfo->nsToPrefix.find(localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) + retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[localNamespaceURI]); + + JSClassRef retClass = JSCElement::getTmpl(); + + struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); + retPrivData->dom = privData->dom; + retPrivData->nativeObj = retVal; + + JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); + + return retObj; + + } + + JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createElementNS"); + *exception = JSValueMakeString(ctx, exceptionString); + JSStringRelease(exceptionString); + return JSValueMakeUndefined(ctx); +} + +JSValueRef JSCDocument::createAttributeNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { + + struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); + + if (false) { + } else if (argumentCount == 2 && + JSValueIsString(ctx, arguments[0]) && + JSValueIsString(ctx, arguments[1])) { + JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); + size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); + char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; + JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); + std::string localNamespaceURI(localNamespaceURIBuffer); + JSStringRelease(stringReflocalNamespaceURI); + free(localNamespaceURIBuffer); + + JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); + size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); + char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; + JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); + std::string localQualifiedName(localQualifiedNameBuffer); + JSStringRelease(stringReflocalQualifiedName); + free(localQualifiedNameBuffer); + + + Arabica::DOM::Attr* retVal = new Arabica::DOM::Attr(privData->nativeObj->createAttributeNS(localNamespaceURI, localQualifiedName)); + if (privData->dom->nsInfo->nsToPrefix.find(localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) + retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[localNamespaceURI]); + + JSClassRef retClass = JSCAttr::getTmpl(); + + struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); + retPrivData->dom = privData->dom; + retPrivData->nativeObj = retVal; + + JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); + + return retObj; + + } + + JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createAttributeNS"); + *exception = JSValueMakeString(ctx, exceptionString); + JSStringRelease(exceptionString); + return JSValueMakeUndefined(ctx); +} + } } \ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp index b09d670..87e7966 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp @@ -23,9 +23,14 @@ namespace Arabica { namespace DOM { V8DOM::V8DOM() { + nsInfo = NULL; + xpath = NULL; + storage = NULL; } V8DOM::~V8DOM() { + if (nsInfo) + delete(nsInfo); if (xpath) delete(xpath); if (storage) diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h index a10b980..dd0c18a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h @@ -70,6 +70,7 @@ public: // return v8::External::New(pointer); } + uscxml::NameSpaceInfo* nsInfo; Arabica::XPath::XPath* xpath; uscxml::Storage* storage; }; diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index 1341d09..b18e039 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -94,9 +94,9 @@ boost::shared_ptr V8DataModel::create(InterpreterImpl* interprete dm->_dom = new V8DOM(); // dom->interpreter = interpreter; dm->_dom->xpath = new XPath(); - dm->_dom->xpath->setNamespaceContext(interpreter->getNSContext()); + dm->_dom->xpath->setNamespaceContext(*interpreter->getNameSpaceInfo().nsContext); dm->_dom->storage = new Storage(URL::getResourceDir() + PATH_SEPERATOR + interpreter->getName() + ".storage"); - + dm->_dom->nsInfo = new NameSpaceInfo(interpreter->getNameSpaceInfo()); // see http://stackoverflow.com/questions/3171418/v8-functiontemplate-class-instance // some free functions @@ -661,7 +661,7 @@ void V8DataModel::init(const std::string& location, std::string V8DataModel::andExpressions(std::list expressions) { if (expressions.size() == 0) return ""; - + if (expressions.size() == 1) return *(expressions.begin()); @@ -669,8 +669,8 @@ std::string V8DataModel::andExpressions(std::list expressions) { exprSS << "("; std::string conjunction = ""; for (std::list::const_iterator exprIter = expressions.begin(); - exprIter != expressions.end(); - exprIter++) { + exprIter != expressions.end(); + exprIter++) { exprSS << conjunction << "(" << *exprIter << ")"; conjunction = " && "; } diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp index 1e4a2dc..226cd26 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp @@ -368,64 +368,6 @@ v8::Handle V8Document::importNodeCallback(const v8::Arguments& args) return v8::Undefined(); } -v8::Handle V8Document::createElementNSCallback(const v8::Arguments& args) { - - v8::Local self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - - Arabica::DOM::Element* retVal = new Arabica::DOM::Element(privData->nativeObj->createElementNS(*localNamespaceURI, *localQualifiedName)); - v8::Handle retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent retObj = v8::Persistent::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createElementNS"); - return v8::Undefined(); -} - -v8::Handle V8Document::createAttributeNSCallback(const v8::Arguments& args) { - - v8::Local self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - - Arabica::DOM::Attr* retVal = new Arabica::DOM::Attr(privData->nativeObj->createAttributeNS(*localNamespaceURI, *localQualifiedName)); - v8::Handle retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent retObj = v8::Persistent::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createAttributeNS"); - return v8::Undefined(); -} - v8::Handle V8Document::getElementsByTagNameNSCallback(const v8::Arguments& args) { v8::Local self = args.Holder(); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h index cebc5d1..373d18a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h @@ -51,8 +51,8 @@ public: static v8::Handle createEntityReferenceCallback(const v8::Arguments&); static v8::Handle getElementsByTagNameCallback(const v8::Arguments&); static v8::Handle importNodeCallback(const v8::Arguments&); - static v8::Handle createElementNSCallback(const v8::Arguments&); - static v8::Handle createAttributeNSCallback(const v8::Arguments&); + static v8::Handle createElementNSCustomCallback(const v8::Arguments&); + static v8::Handle createAttributeNSCustomCallback(const v8::Arguments&); static v8::Handle getElementsByTagNameNSCallback(const v8::Arguments&); static v8::Handle getElementByIdCallback(const v8::Arguments&); static v8::Handle evaluateCustomCallback(const v8::Arguments&); @@ -105,9 +105,9 @@ public: prototype->Set(v8::String::NewSymbol("importNode"), v8::FunctionTemplate::New(V8Document::importNodeCallback, v8::Undefined()), static_cast(v8::DontDelete)); prototype->Set(v8::String::NewSymbol("createElementNS"), - v8::FunctionTemplate::New(V8Document::createElementNSCallback, v8::Undefined()), static_cast(v8::DontDelete)); + v8::FunctionTemplate::New(V8Document::createElementNSCustomCallback, v8::Undefined()), static_cast(v8::DontDelete)); prototype->Set(v8::String::NewSymbol("createAttributeNS"), - v8::FunctionTemplate::New(V8Document::createAttributeNSCallback, v8::Undefined()), static_cast(v8::DontDelete)); + v8::FunctionTemplate::New(V8Document::createAttributeNSCustomCallback, v8::Undefined()), static_cast(v8::DontDelete)); prototype->Set(v8::String::NewSymbol("getElementsByTagNameNS"), v8::FunctionTemplate::New(V8Document::getElementsByTagNameNSCallback, v8::Undefined()), static_cast(v8::DontDelete)); prototype->Set(v8::String::NewSymbol("getElementById"), diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp index 2e4d7c4..8659ccd 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp @@ -20,6 +20,8 @@ #include "V8Document.h" #include "V8XPathResult.h" #include "V8Storage.h" +#include "V8Attr.h" +#include "V8Element.h" namespace Arabica { namespace DOM { @@ -81,5 +83,69 @@ v8::Handle V8Document::evaluateCustomCallback(const v8::Arguments& ar } +v8::Handle V8Document::createElementNSCustomCallback(const v8::Arguments& args) { + + v8::Local self = args.Holder(); + struct V8DocumentPrivate* privData = V8DOM::toClassPtr(self->GetInternalField(0)); + if (false) { + } else if (args.Length() == 2 && + args[0]->IsString() && + args[1]->IsString()) { + v8::String::AsciiValue localNamespaceURI(args[0]); + v8::String::AsciiValue localQualifiedName(args[1]); + + Arabica::DOM::Element* retVal = new Arabica::DOM::Element(privData->nativeObj->createElementNS(*localNamespaceURI, *localQualifiedName)); + if (privData->dom->nsInfo->nsToPrefix.find(*localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) + retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[*localNamespaceURI]); + + v8::Handle retCtor = V8Element::getTmpl()->GetFunction(); + v8::Persistent retObj = v8::Persistent::New(retCtor->NewInstance()); + + struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); + retPrivData->dom = privData->dom; + retPrivData->nativeObj = retVal; + + retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); + + retObj.MakeWeak(0, V8Element::jsDestructor); + return retObj; + + } + throw V8Exception("Parameter mismatch while calling createElementNS"); + return v8::Undefined(); +} + +v8::Handle V8Document::createAttributeNSCustomCallback(const v8::Arguments& args) { + + v8::Local self = args.Holder(); + struct V8DocumentPrivate* privData = V8DOM::toClassPtr(self->GetInternalField(0)); + if (false) { + } else if (args.Length() == 2 && + args[0]->IsString() && + args[1]->IsString()) { + v8::String::AsciiValue localNamespaceURI(args[0]); + v8::String::AsciiValue localQualifiedName(args[1]); + + Arabica::DOM::Attr* retVal = new Arabica::DOM::Attr(privData->nativeObj->createAttributeNS(*localNamespaceURI, *localQualifiedName)); + if (privData->dom->nsInfo->nsToPrefix.find(*localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) + retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[*localNamespaceURI]); + + v8::Handle retCtor = V8Attr::getTmpl()->GetFunction(); + v8::Persistent retObj = v8::Persistent::New(retCtor->NewInstance()); + + struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); + retPrivData->dom = privData->dom; + retPrivData->nativeObj = retVal; + + retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); + + retObj.MakeWeak(0, V8Attr::jsDestructor); + return retObj; + + } + throw V8Exception("Parameter mismatch while calling createAttributeNS"); + return v8::Undefined(); +} + } } \ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 133925e..0ad6030 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -42,10 +42,10 @@ catch (PlException plex) { \ e.data.compound["cause"] = (char*)plex; \ throw e; \ } \ - + #define PL_MODULE \ _interpreter.getSessionId().c_str() \ - + #define SET_PL_ENGINE(dm) \ assert(_swiEngines.find(dm) != _swiEngines.end()); \ int rc = PL_set_engine(_swiEngines[dm], NULL); \ @@ -197,7 +197,7 @@ foreign_t SWIDataModel::inPredicate(term_t a0, int arity, void* context) { char *s; if ( PL_get_atom_chars(a0, &s) ) { if (_dmPtr->_interpreter->isInState(s)) { - return true; + return true; } } return FALSE; @@ -233,7 +233,7 @@ void SWIDataModel::initialize() { void SWIDataModel::setEvent(const Event& event) { SWIEngineLock engineLock; - + // remove old event try { PlCall("retractall(event(_))"); @@ -331,7 +331,7 @@ void SWIDataModel::setEvent(const Event& event) { void SWIDataModel::assertFromData(const Data& data, const std::string& expr, size_t nesting) { if (data.atom.size() > 0) { // terminal branch, this is where we assert - + std::stringstream ss; ss << expr; // nesting++; @@ -345,7 +345,7 @@ void SWIDataModel::assertFromData(const Data& data, const std::string& expr, siz for (size_t i = 0; i < nesting; i++) { ss << ")"; } - + // std::cout << ss.str() << std::endl; PlCall("assert", PlCompound(ss.str().c_str())); return; @@ -402,20 +402,20 @@ void SWIDataModel::assertFromData(const Data& data, const std::string& expr, siz } #if 0 - std::list SWIDataModel::getSolutions(PlCompound compound) { - std::list solutions; - - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - while(query.next_solution()) { +std::list SWIDataModel::getSolutions(PlCompound compound) { + std::list solutions; + + PlTermv termv(compound.arity()); + for (int i = 0; i < compound.arity(); i++) { + termv[i] = compound[i + 1]; + } + PlQuery query(compound.name(), termv); + while(query.next_solution()) { // std::cout << (char*)compound << std::endl; - solutions.push_back(compound); - } - return solutions; + solutions.push_back(compound); } + return solutions; +} #endif Data SWIDataModel::getStringAsData(const std::string& content) { @@ -424,17 +424,17 @@ Data SWIDataModel::getStringAsData(const std::string& content) { PlCompound compound(content.c_str()); PlCompound orig(content.c_str()); Data data; - + PlTermv termv(compound.arity()); for (int i = 0; i < compound.arity(); i++) { termv[i] = compound[i + 1]; } PlQuery query(compound.name(), termv); - + while(query.next_solution()) { std::map vars = resolveAtoms(compound, orig); std::map::const_iterator varIter = vars.begin(); - + while(varIter != vars.end()) { data.merge(termAsData(varIter->second)); varIter++; @@ -455,7 +455,7 @@ Data SWIDataModel::getStringAsData(const std::string& content) { } Data SWIDataModel::termAsData(PlTerm term) { - + Data data; // std::cout << term.name() << (char*)term << std::endl; @@ -692,13 +692,13 @@ bool SWIDataModel::evalAsBool(const Arabica::DOM::Node& node, const return false; } } - + std::string SWIDataModel::evalAsString(const std::string& expr) { SWIEngineLock engineLock; try { PlCompound compound(expr.c_str()); - + if (strlen(compound.name())) { PlCompound orig(expr.c_str()); @@ -741,32 +741,32 @@ std::string SWIDataModel::evalAsString(const std::string& expr) { } } - + // this is similar to http://etalis.googlecode.com/svn/eEtalis/src/term.c std::map SWIDataModel::resolveAtoms(PlTerm& term, PlTerm& orig) { try { std::map atoms; switch (orig.type()) { - case PL_VARIABLE: { - atoms[(char *)orig] = term; - break; + case PL_VARIABLE: { + atoms[(char *)orig] = term; + break; + } + case PL_ATOM: + break; + case PL_STRING: + break; + case PL_INTEGER: + break; + case PL_TERM: + for (int i = 1; i <= orig.arity(); i++) { + PlTerm newTerm = term[i]; + PlTerm newOrig = orig[i]; + std::map result = resolveAtoms(newTerm, newOrig); + atoms.insert(result.begin(), result.end()); } - case PL_ATOM: - break; - case PL_STRING: - break; - case PL_INTEGER: - break; - case PL_TERM: - for (int i = 1; i <= orig.arity(); i++) { - PlTerm newTerm = term[i]; - PlTerm newOrig = orig[i]; - std::map result = resolveAtoms(newTerm, newOrig); - atoms.insert(result.begin(), result.end()); - } - break; - default: - LOG(ERROR) << "Resolving variable of unknown type in query solution"; + break; + default: + LOG(ERROR) << "Resolving variable of unknown type in query solution"; } return atoms; } diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h index d52dd24..0e17f4b 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h @@ -49,7 +49,7 @@ public: } bool isLocked; }; - + SWIDataModel(); virtual ~SWIDataModel(); virtual boost::shared_ptr create(InterpreterImpl* interpreter); @@ -94,7 +94,7 @@ public: virtual bool isDeclared(const std::string& expr); virtual Data getStringAsData(const std::string& content); - + virtual std::string evalAsString(const std::string& expr); virtual bool evalAsBool(const Arabica::DOM::Node& node, const std::string& expr); virtual bool evalAsBool(const std::string& expr); @@ -108,7 +108,7 @@ protected: // virtual std::list getSolutions(PlCompound compound); virtual std::map resolveAtoms(PlTerm& term, PlTerm& orig); - + static int dictCallBack(term_t key, term_t value, int last, void *closure); static PL_blob_t blobType; diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp index a7d7755..aa32806 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp @@ -61,16 +61,13 @@ boost::shared_ptr PromelaDataModel::create(InterpreterImpl* inter } void PromelaDataModel::registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor) { -// std::cout << "PromelaDataModel::registerIOProcessor" << std::endl; } void PromelaDataModel::setSessionId(const std::string& sessionId) { -// std::cout << "PromelaDataModel::setSessionId" << std::endl; _sessionId = sessionId; } void PromelaDataModel::setName(const std::string& name) { -// std::cout << "PromelaDataModel::setName" << std::endl; _name = name; } @@ -102,13 +99,35 @@ bool PromelaDataModel::validate(const std::string& location, const std::string& } uint32_t PromelaDataModel::getLength(const std::string& expr) { - return 0; + if (!isDeclared(expr)) { + throwErrorExecution("Variable " + expr + " was not declared"); + } + + if (!_variables[expr].hasKey("size")) { + throwErrorExecution("Variable " + expr + " is no array"); + } + + return strTo(_variables[expr]["size"].atom); } void PromelaDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { + const std::string& array, + const std::string& index, + uint32_t iteration) { + // assign array element to item + std::stringstream ss; + ss << array << "[" << iteration << "]"; + + PromelaParser itemParser(item, PromelaParser::PROMELA_EXPR); + PromelaParser arrayParser(ss.str(), PromelaParser::PROMELA_EXPR); + + setVariable(itemParser.ast, getVariable(arrayParser.ast)); + + if (index.length() > 0) { + PromelaParser indexParser(index, PromelaParser::PROMELA_EXPR); + setVariable(indexParser.ast, iteration); + } + } void PromelaDataModel::eval(const Element& scriptElem, const std::string& expr) { @@ -126,7 +145,7 @@ bool PromelaDataModel::evalAsBool(const Arabica::DOM::Node& node, c // parser.dump(); return evaluateExpr(parser.ast) > 0; } - + std::string PromelaDataModel::evalAsString(const std::string& expr) { if (isDeclared(expr)) { return Data::toJSON(_variables[expr]); @@ -135,8 +154,8 @@ std::string PromelaDataModel::evalAsString(const std::string& expr) { } void PromelaDataModel::assign(const Element& assignElem, - const Node& node, - const std::string& content) { + const Node& node, + const std::string& content) { PromelaParser parser(content, PromelaParser::PROMELA_DECL); evaluateDecl(parser.ast); // parser.dump(); @@ -151,10 +170,10 @@ void PromelaDataModel::evaluateDecl(void* ast) { PromelaParserNode* vis = *opIter++; PromelaParserNode* type = *opIter++; PromelaParserNode* varlist = *opIter++; - + for (std::list::iterator nameIter = varlist->operands.begin(); - nameIter != varlist->operands.end(); - nameIter++) { + nameIter != varlist->operands.end(); + nameIter++) { Data variable; variable.compound["vis"] = Data(vis->value, Data::VERBATIM); variable.compound["type"] = Data(type->value, Data::VERBATIM); @@ -162,7 +181,7 @@ void PromelaDataModel::evaluateDecl(void* ast) { if (false) { } else if ((*nameIter)->type == NAME) { // plain variables without initial assignment - + if (type->value == "mtype") { variable.compound["value"] = Data(_lastMType++, Data::INTERPRETED); } else { @@ -172,7 +191,7 @@ void PromelaDataModel::evaluateDecl(void* ast) { } else if ((*nameIter)->type == ASGN) { // initially assigned variables - + std::list::iterator opIterAsgn = (*nameIter)->operands.begin(); PromelaParserNode* name = *opIterAsgn++; PromelaParserNode* expr = *opIterAsgn++; @@ -183,16 +202,16 @@ void PromelaDataModel::evaluateDecl(void* ast) { _variables.compound[name->value] = variable; } else if ((*nameIter)->type == VAR_ARRAY) { // variable arrays - + std::list::iterator opIterAsgn = (*nameIter)->operands.begin(); PromelaParserNode* name = *opIterAsgn++; int size = evaluateExpr(*opIterAsgn++); - + variable.compound["size"] = size; for (int i = 0; i < size; i++) { variable.compound["value"].array.push_back(Data(0, Data::INTERPRETED)); } - + assert(opIterAsgn == (*nameIter)->operands.end()); _variables.compound[name->value] = variable; @@ -203,8 +222,8 @@ void PromelaDataModel::evaluateDecl(void* ast) { assert(opIter == node->operands.end()); } else if (node->type == DECLLIST) { for (std::list::iterator declIter = node->operands.begin(); - declIter != node->operands.end(); - declIter++) { + declIter != node->operands.end(); + declIter++) { evaluateDecl(*declIter); } } else { @@ -216,41 +235,41 @@ int PromelaDataModel::evaluateExpr(void* ast) { PromelaParserNode* node = (PromelaParserNode*)ast; std::list::iterator opIter = node->operands.begin(); switch (node->type) { - case CONST: - return strTo(node->value); - case NAME: - case VAR_ARRAY: - return getVariable(node); - case PLUS: - return evaluateExpr(*opIter++) + evaluateExpr(*opIter++); - case MINUS: - return evaluateExpr(*opIter++) - evaluateExpr(*opIter++); - case DIVIDE: - return evaluateExpr(*opIter++) / evaluateExpr(*opIter++); - case MODULO: - return evaluateExpr(*opIter++) % evaluateExpr(*opIter++); - case EQ: - return evaluateExpr(*opIter++) == evaluateExpr(*opIter++); - case LT: - return evaluateExpr(*opIter++) < evaluateExpr(*opIter++); - case LE: - return evaluateExpr(*opIter++) <= evaluateExpr(*opIter++); - case GT: - return evaluateExpr(*opIter++) > evaluateExpr(*opIter++); - case GE: - return evaluateExpr(*opIter++) >= evaluateExpr(*opIter++); - case TIMES: - return evaluateExpr(*opIter++) * evaluateExpr(*opIter++); - case LSHIFT: - return evaluateExpr(*opIter++) << evaluateExpr(*opIter++); - case RSHIFT: - return evaluateExpr(*opIter++) >> evaluateExpr(*opIter++); - case AND: - return evaluateExpr(*opIter++) != 0 && evaluateExpr(*opIter++) != 0; - case OR: - return evaluateExpr(*opIter++) != 0 || evaluateExpr(*opIter++) != 0; - default: - throwErrorExecution("Support for " + PromelaParserNode::typeToDesc(node->type) + " expressions not implemented"); + case CONST: + return strTo(node->value); + case NAME: + case VAR_ARRAY: + return getVariable(node); + case PLUS: + return evaluateExpr(*opIter++) + evaluateExpr(*opIter++); + case MINUS: + return evaluateExpr(*opIter++) - evaluateExpr(*opIter++); + case DIVIDE: + return evaluateExpr(*opIter++) / evaluateExpr(*opIter++); + case MODULO: + return evaluateExpr(*opIter++) % evaluateExpr(*opIter++); + case EQ: + return evaluateExpr(*opIter++) == evaluateExpr(*opIter++); + case LT: + return evaluateExpr(*opIter++) < evaluateExpr(*opIter++); + case LE: + return evaluateExpr(*opIter++) <= evaluateExpr(*opIter++); + case GT: + return evaluateExpr(*opIter++) > evaluateExpr(*opIter++); + case GE: + return evaluateExpr(*opIter++) >= evaluateExpr(*opIter++); + case TIMES: + return evaluateExpr(*opIter++) * evaluateExpr(*opIter++); + case LSHIFT: + return evaluateExpr(*opIter++) << evaluateExpr(*opIter++); + case RSHIFT: + return evaluateExpr(*opIter++) >> evaluateExpr(*opIter++); + case AND: + return evaluateExpr(*opIter++) != 0 && evaluateExpr(*opIter++) != 0; + case OR: + return evaluateExpr(*opIter++) != 0 || evaluateExpr(*opIter++) != 0; + default: + throwErrorExecution("Support for " + PromelaParserNode::typeToDesc(node->type) + " expressions not implemented"); } return 0; } @@ -259,20 +278,20 @@ void PromelaDataModel::evaluateStmnt(void* ast) { PromelaParserNode* node = (PromelaParserNode*)ast; std::list::iterator opIter = node->operands.begin(); switch (node->type) { - case ASGN: { - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - setVariable(name, evaluateExpr(expr)); - break; - } - case STMNT: { - while(opIter != node->operands.end()) { - evaluateStmnt(*opIter++); - } - break; + case ASGN: { + PromelaParserNode* name = *opIter++; + PromelaParserNode* expr = *opIter++; + setVariable(name, evaluateExpr(expr)); + break; + } + case STMNT: { + while(opIter != node->operands.end()) { + evaluateStmnt(*opIter++); } - default: - throwErrorExecution("No support for " + PromelaParserNode::typeToDesc(node->type) + " statement implemented"); + break; + } + default: + throwErrorExecution("No support for " + PromelaParserNode::typeToDesc(node->type) + " statement implemented"); } } @@ -281,80 +300,104 @@ void PromelaDataModel::setVariable(void* ast, int value) { std::list::iterator opIter = node->operands.begin(); switch (node->type) { - case VAR_ARRAY: { - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - int index = evaluateExpr(expr); - - if (_variables.compound.find(name->value) == _variables.compound.end()) { - throwErrorExecution("No variable " + name->value + " was declared"); - } - - if (!_variables[name->value].hasKey("size")) { - throwErrorExecution("Variable " + name->value + " is no array"); - } + case VAR_ARRAY: { + PromelaParserNode* name = *opIter++; + PromelaParserNode* expr = *opIter++; + int index = evaluateExpr(expr); - if (strTo(_variables[name->value]["size"].atom) <= index) { - throwErrorExecution("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); - } + if (_variables.compound.find(name->value) == _variables.compound.end()) { + throwErrorExecution("No variable " + name->value + " was declared"); + } - _variables.compound[name->value].compound["value"][index] = Data(value, Data::VERBATIM); - - break; + if (!_variables[name->value].hasKey("size")) { + throwErrorExecution("Variable " + name->value + " is no array"); } - case NAME: - _variables.compound[node->value].compound["value"] = Data(value, Data::VERBATIM); - break; - default: - break; + + if (strTo(_variables[name->value]["size"].atom) <= index) { + throwErrorExecution("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); + } + + _variables.compound[name->value].compound["value"][index] = Data(value, Data::VERBATIM); + + break; } - + case NAME: + _variables.compound[node->value].compound["value"] = Data(value, Data::VERBATIM); + break; + default: + break; + } + // std::cout << Data::toJSON(_variables) << std::endl; } int PromelaDataModel::getVariable(void* ast) { PromelaParserNode* node = (PromelaParserNode*)ast; // node->dump(); - + std::list::iterator opIter = node->operands.begin(); switch(node->type) { - case NAME: - if (_variables.compound.find(node->value) == _variables.compound.end()) { - throwErrorExecution("No variable " + node->value + " was declared"); - } - return strTo(_variables[node->value]["value"]); - case VAR_ARRAY: { - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - int index = evaluateExpr(expr); - - if (_variables.compound.find(name->value) == _variables.compound.end()) { - throwErrorExecution("No variable " + name->value + " was declared"); - } - - if (!_variables[name->value].hasKey("size")) { - throwErrorExecution("Variable " + name->value + " is no array"); - } - - if (strTo(_variables[name->value]["size"].atom) <= index) { - throwErrorExecution("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); - } - return _variables.compound[name->value].compound["value"][index]; + case NAME: + if (_variables.compound.find(node->value) == _variables.compound.end()) { + throwErrorExecution("No variable " + node->value + " was declared"); } - default: - throwErrorExecution("Retrieving value of " + PromelaParserNode::typeToDesc(node->type) + " variable not implemented"); + if (_variables[node->value].compound.find("size") != _variables[node->value].compound.end()) { + throwErrorExecution("Type error: Variable " + node->value + " is an array"); + } + return strTo(_variables[node->value]["value"].atom); + case VAR_ARRAY: { + PromelaParserNode* name = *opIter++; + PromelaParserNode* expr = *opIter++; + int index = evaluateExpr(expr); + + if (_variables.compound.find(name->value) == _variables.compound.end()) { + throwErrorExecution("No variable " + name->value + " was declared"); + } + + if (!_variables[name->value].hasKey("size")) { + throwErrorExecution("Variable " + name->value + " is no array"); + } + + if (strTo(_variables[name->value]["size"].atom) <= index) { + throwErrorExecution("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); + } + return strTo(_variables.compound[name->value].compound["value"][index].atom); + } + default: + throwErrorExecution("Retrieving value of " + PromelaParserNode::typeToDesc(node->type) + " variable not implemented"); } return 0; } +std::string PromelaDataModel::andExpressions(std::list expressions) { + + if (expressions.size() == 0) + return ""; + + if (expressions.size() == 1) + return *(expressions.begin()); + + std::ostringstream exprSS; + exprSS << "("; + std::string conjunction = ""; + for (std::list::const_iterator exprIter = expressions.begin(); + exprIter != expressions.end(); + exprIter++) { + exprSS << conjunction << "(" << *exprIter << ")"; + conjunction = " && "; + } + exprSS << ")"; + return exprSS.str(); +} + void PromelaDataModel::assign(const std::string& location, const Data& data) { // used for e.g. to assign command line parameters std::cout << "Ignoring " << location << " = " << Data::toJSON(data) << std::endl; } void PromelaDataModel::init(const Element& dataElem, - const Node& node, - const std::string& content) { + const Node& node, + const std::string& content) { // from assign(dataElem, node, content); } diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h index e6a7894..6d7d505 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h +++ b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h @@ -75,22 +75,24 @@ public: virtual bool isDeclared(const std::string& expr); virtual Data getStringAsData(const std::string& content); - + virtual std::string evalAsString(const std::string& expr); virtual bool evalAsBool(const Arabica::DOM::Node& node, const std::string& expr); virtual bool evalAsBool(const std::string& expr); + virtual std::string andExpressions(std::list expressions); + protected: void evaluateDecl(void* ast); int evaluateExpr(void* ast); void evaluateStmnt(void* ast); - + void setVariable(void* ast, int value); int getVariable(void* ast); - + int _lastMType; - + Event _event; std::string _name; std::string _sessionId; diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp index a27d2df..0966396 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp @@ -1,19 +1,43 @@ +/** + * @file + * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see . + * @endcond + */ + #include "PromelaParser.h" #include "parser/promela.tab.hpp" -struct yy_buffer_state; \ -typedef yy_buffer_state *YY_BUFFER_STATE; \ -extern YY_BUFFER_STATE promela__scan_buffer(char *, size_t, void*); \ -extern int promela_lex (PROMELA_STYPE* yylval_param, void* yyscanner); \ -int promela_lex_init (void**); \ -int promela_lex_destroy (void*); \ +struct yy_buffer_state; +typedef yy_buffer_state *YY_BUFFER_STATE; +extern YY_BUFFER_STATE promela__scan_buffer(char *, size_t, void*); +void promela__delete_buffer(YY_BUFFER_STATE, void*); +YY_BUFFER_STATE promela__scan_string (const char * yystr , void*); + + +extern int promela_lex (PROMELA_STYPE* yylval_param, void* yyscanner); +int promela_lex_init (void**); +int promela_lex_destroy (void*); void promela_error (uscxml::PromelaParser* ctx, void* yyscanner, const char* err) { + // mark as pending exception as we cannot throw from constructor and have the destructor called uscxml::Event excEvent; excEvent.data.compound["exception"] = uscxml::Data(err, uscxml::Data::VERBATIM); excEvent.name = "error.execution"; excEvent.eventType = uscxml::Event::PLATFORM; - throw excEvent; + ctx->pendingException = excEvent; } namespace uscxml { @@ -37,71 +61,187 @@ PromelaParser::PromelaParser(const std::string& expr, Type expectedType) { } void PromelaParser::init(const std::string& expr) { - input_length = expr.length() + 5; // plus some zero terminators + ast = NULL; + input_length = expr.length() + 2; // plus some zero terminators input = (char*) calloc(1, input_length); memcpy(input, expr.c_str(), expr.length()); - + promela_lex_init(&scanner); // promela_assign_set_extra(ast, &scanner); - promela__scan_buffer(input, input_length, scanner); + buffer = promela__scan_string(input, scanner); + // buffer = promela__scan_buffer(input, input_length, scanner); promela_parse(this, scanner); + if (pendingException.name.size() > 0) { + // parsing failed in promela_error + destroy(); + throw pendingException; + } } - -PromelaParser::~PromelaParser() { + +void PromelaParser::destroy() { + if (ast) + delete(ast); free(input); + promela__delete_buffer((YY_BUFFER_STATE)buffer, scanner); promela_lex_destroy(scanner); } +PromelaParser::~PromelaParser() { + destroy(); +} + std::string PromelaParser::typeToDesc(int type) { switch (type) { - case PROMELA_EXPR: return "expression"; - case PROMELA_DECL: return "declarations"; - case PROMELA_STMNT: return "statements"; - default: - break; + case PROMELA_EXPR: + return "expression"; + case PROMELA_DECL: + return "declarations"; + case PROMELA_STMNT: + return "statements"; + default: + break; } return ""; } +PromelaParserNode::~PromelaParserNode() { + while(operands.size() > 0) { + delete operands.front(); + operands.pop_front(); + } +} + +PromelaParserNode* PromelaParser::node(int type, int nrArgs, ...) { + PromelaParserNode* newNode = new PromelaParserNode(); + newNode->type = type; + va_list ap; + va_start(ap, nrArgs); + for(int i = 1; i <= nrArgs; i++) { + newNode->operands.push_back(va_arg(ap, PromelaParserNode*)); + } + return newNode; +} + +PromelaParserNode* PromelaParser::value(int type, const char* value) { + PromelaParserNode* newNode = new PromelaParserNode(); + newNode->value = value; + newNode->type = type; + return newNode; +} + +void PromelaParser::dump() { + switch (type) { + case PROMELA_EXPR: + std::cout << "Promela Expression" << std::endl; + break; + case PROMELA_DECL: + std::cout << "Promela Declarations" << std::endl; + break; + case PROMELA_STMNT: + std::cout << "Promela Statement" << std::endl; + break; + } + ast->dump(); +} + + +void PromelaParserNode::merge(PromelaParserNode* node) { + for (std::list::iterator iter = node->operands.begin(); + iter != node->operands.end(); iter++) { + operands.push_back(*iter); + } + node->operands.clear(); +} + +void PromelaParserNode::push(PromelaParserNode* node) { + operands.push_back(node); +} + +void PromelaParserNode::dump(int indent) { + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + std::cout << padding << typeToDesc(type) << ": " << value << std::endl; + for (std::list::iterator iter = operands.begin(); + iter != operands.end(); iter++) { + (*iter)->dump(indent + 1); + } +} + std::string PromelaParserNode::typeToDesc(int type) { switch(type) { - case PLUS: return "PLUS"; - case MINUS: return "MINUS"; - case TIMES: return "TIMES"; - case DIVIDE: return "DIVIDE"; - case MODULO: return "MODULO"; - case BITAND: return "BITAND"; - case BITXOR: return "BITXOR"; - case BITOR: return "BITOR"; - case GT: return "GT"; - case LT: return "LT"; - case GE: return "GE"; - case LE: return "LE"; - case EQ: return "EQ"; - case NE: return "NE"; - case AND: return "AND"; - case OR: return "OR"; - case LSHIFT: return "LSHIFT"; - case RSHIFT: return "RSHIFT"; - case NEG: return "NEG"; - case ASGN: return "ASGN"; - case INCR: return "INCR"; - case DECR: return "DECR"; - case VAR_ARRAY: return "VAR_ARRAY"; - case DECL: return "DECL"; - case STMNT: return "STMNT"; - case TYPE: return "TYPE"; - case NAME: return "NAME"; - case CONST: return "CONST"; - case PRINT: return "PRINT"; - case SHOW: return "SHOW"; - case EXPR: return "EXPR"; - case VARLIST: return "VARLIST"; - case DECLLIST: return "DECLLIST"; - case NAMELIST: return "NAMELIST"; - - default: - return std::string("UNK(") + toStr(type) + ")"; + case PLUS: + return "PLUS"; + case MINUS: + return "MINUS"; + case TIMES: + return "TIMES"; + case DIVIDE: + return "DIVIDE"; + case MODULO: + return "MODULO"; + case BITAND: + return "BITAND"; + case BITXOR: + return "BITXOR"; + case BITOR: + return "BITOR"; + case GT: + return "GT"; + case LT: + return "LT"; + case GE: + return "GE"; + case LE: + return "LE"; + case EQ: + return "EQ"; + case NE: + return "NE"; + case AND: + return "AND"; + case OR: + return "OR"; + case LSHIFT: + return "LSHIFT"; + case RSHIFT: + return "RSHIFT"; + case NEG: + return "NEG"; + case ASGN: + return "ASGN"; + case INCR: + return "INCR"; + case DECR: + return "DECR"; + case VAR_ARRAY: + return "VAR_ARRAY"; + case DECL: + return "DECL"; + case STMNT: + return "STMNT"; + case TYPE: + return "TYPE"; + case NAME: + return "NAME"; + case CONST: + return "CONST"; + case PRINT: + return "PRINT"; + case SHOW: + return "SHOW"; + case EXPR: + return "EXPR"; + case VARLIST: + return "VARLIST"; + case DECLLIST: + return "DECLLIST"; + case NAMELIST: + return "NAMELIST"; + + default: + return std::string("UNK(") + toStr(type) + ")"; } } diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.h b/src/uscxml/plugins/datamodel/promela/PromelaParser.h index 0cca365..9fd0e9a 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.h +++ b/src/uscxml/plugins/datamodel/promela/PromelaParser.h @@ -1,3 +1,22 @@ +/** + * @file + * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see . + * @endcond + */ + // bison -v -d promela-expr.ypp && flex promela-expr.l // bison promela-expr.ypp && flex promela-expr.l @@ -9,105 +28,56 @@ #include "uscxml/Message.h" -#define GRAMMAR_COMMON(name, uc_name) \ -struct yy_buffer_state; \ -typedef yy_buffer_state *YY_BUFFER_STATE; \ -extern YY_BUFFER_STATE promela_##name##__scan_buffer(char *, size_t, void*); \ -extern int promela_##name##_lex (PROMELA_##uc_name##_STYPE* yylval_param, void* yyscanner); \ -int promela_##name##_lex_init (void**); \ -int promela_##name##_lex_destroy (void*); \ - namespace uscxml { class PromelaParser; - + struct PromelaParserNode { PromelaParserNode() : type(0) {} + virtual ~PromelaParserNode(); + + void merge(PromelaParserNode* node); + void push(PromelaParserNode* node); + void dump(int indent = 0); + + static std::string typeToDesc(int type); + int type; std::string value; std::list operands; - - void merge(PromelaParserNode* node) { - for (std::list::iterator iter = node->operands.begin(); - iter != node->operands.end(); iter++) { - operands.push_back(*iter); - } - } - - void push(PromelaParserNode* node) { - operands.push_back(node); - } - - void dump(int indent = 0) { - std::string padding; - for (int i = 0; i < indent; i++) { - padding += " "; - } - std::cout << padding << typeToDesc(type) << ": " << value << std::endl; - for (std::list::iterator iter = operands.begin(); - iter != operands.end(); iter++) { - (*iter)->dump(indent + 1); - } - } - - static std::string typeToDesc(int type); }; class PromelaParser { public: enum Type { - PROMELA_EXPR, - PROMELA_DECL, - PROMELA_STMNT + PROMELA_EXPR, + PROMELA_DECL, + PROMELA_STMNT }; - + static std::string typeToDesc(int type); PromelaParser(const std::string& expr); PromelaParser(const std::string& expr, Type expectedType); virtual ~PromelaParser(); - - virtual PromelaParserNode* node(int type, int nrArgs, ...) { - PromelaParserNode* newNode = new PromelaParserNode(); - newNode->type = type; - va_list ap; - va_start(ap, nrArgs); - for(int i = 1; i <= nrArgs; i++) { - newNode->operands.push_back(va_arg(ap, PromelaParserNode*)); - } - return newNode; - } - - virtual PromelaParserNode* value(int type, const char* value) { - PromelaParserNode* newNode = new PromelaParserNode(); - newNode->value = value; - newNode->type = type; - return newNode; - } - - void dump() { - switch (type) { - case PROMELA_EXPR: - std::cout << "Promela Expression" << std::endl; - break; - case PROMELA_DECL: - std::cout << "Promela Declarations" << std::endl; - break; - case PROMELA_STMNT: - std::cout << "Promela Statement" << std::endl; - break; - } - ast->dump(); - } + + virtual PromelaParserNode* node(int type, int nrArgs, ...); + virtual PromelaParserNode* value(int type, const char* value); + void dump(); + PromelaParserNode* ast; Type type; + Event pendingException; + protected: - + void init(const std::string& expr); - + void destroy(); + + void* buffer; void* scanner; char* input; size_t input_length; diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp b/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp index f4f9f83..a170089 100644 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp +++ b/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp @@ -26,7 +26,7 @@ /* %endif */ /* %if-c-only */ - + /* %endif */ /* %if-c-only */ @@ -58,7 +58,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -76,7 +76,7 @@ typedef uint64_t flex_uint64_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ @@ -230,8 +230,8 @@ typedef size_t yy_size_t; #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - #define YY_LESS_LINENO(n) - +#define YY_LESS_LINENO(n) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -250,14 +250,13 @@ typedef size_t yy_size_t; #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { -/* %if-c-only */ +struct yy_buffer_state { + /* %if-c-only */ FILE *yy_input_file; -/* %endif */ + /* %endif */ -/* %if-c++-only */ -/* %endif */ + /* %if-c++-only */ + /* %endif */ char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ @@ -291,9 +290,9 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -315,7 +314,7 @@ struct yy_buffer_state */ #define YY_BUFFER_EOF_PENDING 2 - }; +}; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -438,160 +437,159 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); #define YY_END_OF_BUFFER 45 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info - { +struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[102] = - { 0, - 0, 0, 45, 43, 42, 42, 6, 43, 12, 23, - 43, 31, 32, 10, 13, 29, 14, 28, 11, 39, - 30, 19, 37, 20, 40, 40, 33, 34, 24, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 35, 25, - 36, 7, 42, 21, 0, 38, 0, 26, 0, 41, - 0, 8, 9, 39, 15, 17, 22, 18, 16, 40, - 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 27, 0, 41, 0, 1, 40, 40, - 40, 2, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 3, 40, 40, 40, 4, 5, 40, 40, - - 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 1, 1, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 1, 18, 19, - 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 24, 25, 26, 27, 22, 1, 28, 29, 22, 30, - - 31, 32, 33, 34, 35, 22, 36, 37, 38, 39, - 40, 41, 22, 42, 43, 44, 45, 22, 22, 22, - 46, 22, 47, 48, 49, 50, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[51] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 1, 1, 1 - } ; - -static yyconst flex_int16_t yy_base[106] = - { 0, - 0, 0, 141, 142, 49, 51, 120, 50, 142, 132, - 48, 142, 142, 142, 126, 142, 123, 142, 142, 119, - 142, 38, 115, 39, 0, 129, 142, 142, 142, 26, - 105, 93, 100, 86, 87, 28, 86, 88, 142, 78, - 142, 142, 65, 142, 58, 142, 122, 142, 57, 142, - 66, 142, 142, 107, 142, 142, 142, 142, 142, 0, - 65, 79, 82, 77, 83, 75, 79, 71, 81, 75, - 79, 68, 69, 142, 63, 68, 76, 0, 74, 79, - 66, 0, 67, 61, 57, 57, 66, 61, 64, 63, - 48, 45, 0, 54, 48, 46, 0, 0, 50, 48, - - 142, 101, 103, 75, 105 - } ; - -static yyconst flex_int16_t yy_def[106] = - { 0, - 101, 1, 101, 101, 101, 101, 101, 102, 101, 101, - 103, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 104, 104, 101, 101, 101, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 101, 101, - 101, 101, 101, 101, 102, 101, 102, 101, 103, 101, - 105, 101, 101, 101, 101, 101, 101, 101, 101, 104, - 102, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 101, 103, 103, 105, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - - 0, 101, 101, 101, 101 - } ; - -static yyconst flex_int16_t yy_nxt[193] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 4, 28, 29, 25, 30, 25, - 25, 31, 25, 25, 32, 25, 33, 34, 25, 25, - 35, 25, 36, 37, 38, 25, 39, 40, 41, 42, - 43, 43, 43, 43, 46, 50, 55, 56, 58, 59, - 62, 70, 46, 71, 50, 63, 43, 43, 49, 46, - 50, 64, 51, 76, 47, 50, 60, 78, 49, 97, - 100, 51, 47, 76, 99, 98, 96, 51, 78, 47, - 77, 95, 51, 78, 93, 94, 93, 93, 92, 91, - - 77, 45, 45, 49, 49, 75, 75, 90, 89, 78, - 78, 88, 87, 86, 85, 84, 83, 82, 78, 81, - 80, 79, 78, 54, 101, 74, 73, 72, 69, 68, - 67, 66, 65, 61, 57, 54, 53, 52, 48, 44, - 101, 3, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101 - - } ; - -static yyconst flex_int16_t yy_chk[193] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 5, 5, 6, 6, 8, 11, 22, 22, 24, 24, - 30, 36, 45, 36, 49, 30, 43, 43, 51, 61, - 75, 30, 11, 51, 8, 76, 104, 100, 77, 95, - 99, 49, 45, 77, 96, 95, 94, 75, 92, 61, - 51, 91, 76, 90, 89, 88, 87, 86, 85, 84, - - 77, 102, 102, 103, 103, 105, 105, 83, 81, 80, - 79, 73, 72, 71, 70, 69, 68, 67, 66, 65, - 64, 63, 62, 54, 47, 40, 38, 37, 35, 34, - 33, 32, 31, 26, 23, 20, 17, 15, 10, 7, - 3, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101 - - } ; - -static yyconst flex_int16_t yy_rule_linenum[44] = - { 0, - 27, 32, 33, 34, 35, 37, 38, 39, 40, 42, - 43, 44, 46, 47, 49, 50, 52, 53, 54, 55, - 57, 58, 60, 61, 62, 65, 66, 68, 69, 70, - 72, 73, 75, 76, 78, 79, 81, 83, 85, 86, - 88, 90, 92 - } ; +}; +static yyconst flex_int16_t yy_accept[102] = { + 0, + 0, 0, 45, 43, 42, 42, 6, 43, 12, 23, + 43, 31, 32, 10, 13, 29, 14, 28, 11, 39, + 30, 19, 37, 20, 40, 40, 33, 34, 24, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 35, 25, + 36, 7, 42, 21, 0, 38, 0, 26, 0, 41, + 0, 8, 9, 39, 15, 17, 22, 18, 16, 40, + 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 27, 0, 41, 0, 1, 40, 40, + 40, 2, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 3, 40, 40, 40, 4, 5, 40, 40, + + 0 +} ; + +static yyconst flex_int32_t yy_ec[256] = { + 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 1, 1, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 1, 18, 19, + 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 24, 25, 26, 27, 22, 1, 28, 29, 22, 30, + + 31, 32, 33, 34, 35, 22, 36, 37, 38, 39, + 40, 41, 22, 42, 43, 44, 45, 22, 22, 22, + 46, 22, 47, 48, 49, 50, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 +} ; + +static yyconst flex_int32_t yy_meta[51] = { + 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, + 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 1, 1, 1 +} ; + +static yyconst flex_int16_t yy_base[106] = { + 0, + 0, 0, 141, 142, 49, 51, 120, 50, 142, 132, + 48, 142, 142, 142, 126, 142, 123, 142, 142, 119, + 142, 38, 115, 39, 0, 129, 142, 142, 142, 26, + 105, 93, 100, 86, 87, 28, 86, 88, 142, 78, + 142, 142, 65, 142, 58, 142, 122, 142, 57, 142, + 66, 142, 142, 107, 142, 142, 142, 142, 142, 0, + 65, 79, 82, 77, 83, 75, 79, 71, 81, 75, + 79, 68, 69, 142, 63, 68, 76, 0, 74, 79, + 66, 0, 67, 61, 57, 57, 66, 61, 64, 63, + 48, 45, 0, 54, 48, 46, 0, 0, 50, 48, + + 142, 101, 103, 75, 105 +} ; + +static yyconst flex_int16_t yy_def[106] = { + 0, + 101, 1, 101, 101, 101, 101, 101, 102, 101, 101, + 103, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 104, 104, 101, 101, 101, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 101, 101, + 101, 101, 101, 101, 102, 101, 102, 101, 103, 101, + 105, 101, 101, 101, 101, 101, 101, 101, 101, 104, + 102, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 101, 103, 103, 105, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + + 0, 101, 101, 101, 101 +} ; + +static yyconst flex_int16_t yy_nxt[193] = { + 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 4, 28, 29, 25, 30, 25, + 25, 31, 25, 25, 32, 25, 33, 34, 25, 25, + 35, 25, 36, 37, 38, 25, 39, 40, 41, 42, + 43, 43, 43, 43, 46, 50, 55, 56, 58, 59, + 62, 70, 46, 71, 50, 63, 43, 43, 49, 46, + 50, 64, 51, 76, 47, 50, 60, 78, 49, 97, + 100, 51, 47, 76, 99, 98, 96, 51, 78, 47, + 77, 95, 51, 78, 93, 94, 93, 93, 92, 91, + + 77, 45, 45, 49, 49, 75, 75, 90, 89, 78, + 78, 88, 87, 86, 85, 84, 83, 82, 78, 81, + 80, 79, 78, 54, 101, 74, 73, 72, 69, 68, + 67, 66, 65, 61, 57, 54, 53, 52, 48, 44, + 101, 3, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101 + +} ; + +static yyconst flex_int16_t yy_chk[193] = { + 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 5, 6, 6, 8, 11, 22, 22, 24, 24, + 30, 36, 45, 36, 49, 30, 43, 43, 51, 61, + 75, 30, 11, 51, 8, 76, 104, 100, 77, 95, + 99, 49, 45, 77, 96, 95, 94, 75, 92, 61, + 51, 91, 76, 90, 89, 88, 87, 86, 85, 84, + + 77, 102, 102, 103, 103, 105, 105, 83, 81, 80, + 79, 73, 72, 71, 70, 69, 68, 67, 66, 65, + 64, 63, 62, 54, 47, 40, 38, 37, 35, 34, + 33, 32, 31, 26, 23, 20, 17, 15, 10, 7, + 3, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, + 101, 101 + +} ; + +static yyconst flex_int16_t yy_rule_linenum[44] = { + 0, + 27, 32, 33, 34, 35, 37, 38, 39, 40, 42, + 43, 44, 46, 47, 49, 50, 52, 53, 54, 55, + 57, 58, 60, 61, 62, 65, 66, 68, 69, 70, + 72, 73, 75, 76, 78, 79, 81, 83, 85, 86, + 88, 90, 92 +} ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -605,7 +603,7 @@ static yyconst flex_int16_t yy_rule_linenum[44] = /* see: http://spinroot.com/spin/Man/operators.html */ #define YY_NO_UNISTD_H 1 #line 14 "promela.l" - + #include "../PromelaParser.h" #include "promela.tab.hpp" #define YYSTYPE PROMELA_STYPE @@ -634,40 +632,39 @@ static yyconst flex_int16_t yy_rule_linenum[44] = /* %if-reentrant */ /* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - }; /* end struct yyguts_t */ +struct yyguts_t { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + +}; /* end struct yyguts_t */ /* %if-c-only */ @@ -677,10 +674,10 @@ static int yy_init_globals (yyscan_t yyscanner ); /* %if-reentrant */ - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - +/* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ +# define yylval yyg->yylval_r + int promela_lex_init (yyscan_t* scanner); int promela_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -740,8 +737,8 @@ extern int promela_wrap (yyscan_t yyscanner ); /* %not-for-header */ - static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - +static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); + /* %ok-for-header */ /* %endif */ @@ -871,7 +868,7 @@ static int input (yyscan_t yyscanner ); /* %if-c-only Standard (non-C++) definition */ extern int promela_lex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); +(YYSTYPE * yylval_param ,yyscan_t yyscanner); #define YY_DECL int promela_lex \ (YYSTYPE * yylval_param , yyscan_t yyscanner) @@ -900,23 +897,21 @@ extern int promela_lex \ /** The main scanner function which does all the work. */ -YY_DECL -{ +YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -/* %% [7.0] user's declarations go here */ + /* %% [7.0] user's declarations go here */ #line 25 "promela.l" #line 915 "promela.lex.yy.cpp" - yylval = yylval_param; + yylval = yylval_param; - if ( !yyg->yy_init ) - { + if ( !yyg->yy_init ) { yyg->yy_init = 1; #ifdef YY_USER_INIT @@ -927,31 +922,30 @@ YY_DECL yyg->yy_start = 1; /* first start state */ if ( ! yyin ) -/* %if-c-only */ + /* %if-c-only */ yyin = stdin; -/* %endif */ -/* %if-c++-only */ -/* %endif */ + /* %endif */ + /* %if-c++-only */ + /* %endif */ if ( ! yyout ) -/* %if-c-only */ + /* %if-c-only */ yyout = stdout; -/* %endif */ -/* %if-c++-only */ -/* %endif */ + /* %endif */ + /* %if-c++-only */ + /* %endif */ if ( ! YY_CURRENT_BUFFER ) { promela_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } promela__load_buffer_state(yyscanner ); - } + } - while ( 1 ) /* loops until end-of-file is reached */ - { -/* %% [8.0] yymore()-related code goes here */ + while ( 1 ) { /* loops until end-of-file is reached */ + /* %% [8.0] yymore()-related code goes here */ yy_cp = yyg->yy_c_buf_p; /* Support of yytext. */ @@ -962,43 +956,38 @@ YY_DECL */ yy_bp = yy_cp; -/* %% [9.0] code to set up and find next match goes here */ + /* %% [9.0] code to set up and find next match goes here */ yy_current_state = yyg->yy_start; yy_match: - do - { + do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { + if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 102 ) yy_c = yy_meta[(unsigned int) yy_c]; - } + } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; - } - while ( yy_current_state != 101 ); + } while ( yy_current_state != 101 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; yy_find_action: -/* %% [10.0] code to find the action number goes here */ + /* %% [10.0] code to find the action number goes here */ yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; -/* %% [11.0] code for yylineno update goes here */ + /* %% [11.0] code for yylineno update goes here */ do_action: /* This label is used only to access EOF actions. */ -/* %% [12.0] debug code goes here */ - if ( yy_flex_debug ) - { + /* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); else if ( yy_act < 44 ) @@ -1011,377 +1000,369 @@ do_action: /* This label is used only to access EOF actions. */ fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); - } + } - switch ( yy_act ) - { /* beginning of action switch */ -/* %% [13.0] actions go here */ - case 0: /* must back up */ + switch ( yy_act ) { + /* beginning of action switch */ + /* %% [13.0] actions go here */ + case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yyg->yy_hold_char; yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; goto yy_find_action; -case 1: -YY_RULE_SETUP + case 1: + YY_RULE_SETUP #line 27 "promela.l" -{ - yylval->value = strdup(yytext); - return TYPE; -} - YY_BREAK -case 2: -YY_RULE_SETUP + { + yylval->value = strdup(yytext); + return TYPE; + } + YY_BREAK + case 2: + YY_RULE_SETUP #line 32 "promela.l" -{ return LEN; } - YY_BREAK -case 3: -YY_RULE_SETUP + { return LEN; } + YY_BREAK + case 3: + YY_RULE_SETUP #line 33 "promela.l" -{ yylval->value = strdup(yytext); return CONST; } - YY_BREAK -case 4: -YY_RULE_SETUP + { yylval->value = strdup(yytext); return CONST; } + YY_BREAK + case 4: + YY_RULE_SETUP #line 34 "promela.l" -{ return PRINT; } - YY_BREAK -case 5: -YY_RULE_SETUP + { return PRINT; } + YY_BREAK + case 5: + YY_RULE_SETUP #line 35 "promela.l" -{ return PRINTM; } - YY_BREAK -case 6: -YY_RULE_SETUP + { return PRINTM; } + YY_BREAK + case 6: + YY_RULE_SETUP #line 37 "promela.l" -{ return NEG; } - YY_BREAK -case 7: -YY_RULE_SETUP + { return NEG; } + YY_BREAK + case 7: + YY_RULE_SETUP #line 38 "promela.l" -{ return COMPL; } - YY_BREAK -case 8: -YY_RULE_SETUP + { return COMPL; } + YY_BREAK + case 8: + YY_RULE_SETUP #line 39 "promela.l" -{ return INCR; } - YY_BREAK -case 9: -YY_RULE_SETUP + { return INCR; } + YY_BREAK + case 9: + YY_RULE_SETUP #line 40 "promela.l" -{ return DECR; } - YY_BREAK -case 10: -YY_RULE_SETUP + { return DECR; } + YY_BREAK + case 10: + YY_RULE_SETUP #line 42 "promela.l" -{ return TIMES; } - YY_BREAK -case 11: -YY_RULE_SETUP + { return TIMES; } + YY_BREAK + case 11: + YY_RULE_SETUP #line 43 "promela.l" -{ return DIVIDE; } - YY_BREAK -case 12: -YY_RULE_SETUP + { return DIVIDE; } + YY_BREAK + case 12: + YY_RULE_SETUP #line 44 "promela.l" -{ return MODULO; } - YY_BREAK -case 13: -YY_RULE_SETUP + { return MODULO; } + YY_BREAK + case 13: + YY_RULE_SETUP #line 46 "promela.l" -{ return PLUS; } - YY_BREAK -case 14: -YY_RULE_SETUP + { return PLUS; } + YY_BREAK + case 14: + YY_RULE_SETUP #line 47 "promela.l" -{ return MINUS; } - YY_BREAK -case 15: -YY_RULE_SETUP + { return MINUS; } + YY_BREAK + case 15: + YY_RULE_SETUP #line 49 "promela.l" -{ return LSHIFT; } - YY_BREAK -case 16: -YY_RULE_SETUP + { return LSHIFT; } + YY_BREAK + case 16: + YY_RULE_SETUP #line 50 "promela.l" -{ return RSHIFT; } - YY_BREAK -case 17: -YY_RULE_SETUP + { return RSHIFT; } + YY_BREAK + case 17: + YY_RULE_SETUP #line 52 "promela.l" -{ return LE; } - YY_BREAK -case 18: -YY_RULE_SETUP + { return LE; } + YY_BREAK + case 18: + YY_RULE_SETUP #line 53 "promela.l" -{ return GE; } - YY_BREAK -case 19: -YY_RULE_SETUP + { return GE; } + YY_BREAK + case 19: + YY_RULE_SETUP #line 54 "promela.l" -{ return LT; } - YY_BREAK -case 20: -YY_RULE_SETUP + { return LT; } + YY_BREAK + case 20: + YY_RULE_SETUP #line 55 "promela.l" -{ return GT; } - YY_BREAK -case 21: -YY_RULE_SETUP + { return GT; } + YY_BREAK + case 21: + YY_RULE_SETUP #line 57 "promela.l" -{ return NE; } - YY_BREAK -case 22: -YY_RULE_SETUP + { return NE; } + YY_BREAK + case 22: + YY_RULE_SETUP #line 58 "promela.l" -{ return EQ; } - YY_BREAK -case 23: -YY_RULE_SETUP + { return EQ; } + YY_BREAK + case 23: + YY_RULE_SETUP #line 60 "promela.l" -{ return BITAND; } - YY_BREAK -case 24: -YY_RULE_SETUP + { return BITAND; } + YY_BREAK + case 24: + YY_RULE_SETUP #line 61 "promela.l" -{ return BITXOR; } - YY_BREAK -case 25: -YY_RULE_SETUP + { return BITXOR; } + YY_BREAK + case 25: + YY_RULE_SETUP #line 62 "promela.l" -{ return BITOR; } - YY_BREAK -case 26: -YY_RULE_SETUP + { return BITOR; } + YY_BREAK + case 26: + YY_RULE_SETUP #line 65 "promela.l" -{ return AND; } - YY_BREAK -case 27: -YY_RULE_SETUP + { return AND; } + YY_BREAK + case 27: + YY_RULE_SETUP #line 66 "promela.l" -{ return OR; } - YY_BREAK -case 28: -YY_RULE_SETUP + { return OR; } + YY_BREAK + case 28: + YY_RULE_SETUP #line 68 "promela.l" -{ return DOT; } - YY_BREAK -case 29: -YY_RULE_SETUP + { return DOT; } + YY_BREAK + case 29: + YY_RULE_SETUP #line 69 "promela.l" -{ return COMMA; } - YY_BREAK -case 30: -YY_RULE_SETUP + { return COMMA; } + YY_BREAK + case 30: + YY_RULE_SETUP #line 70 "promela.l" -{ return SEMI; } - YY_BREAK -case 31: -YY_RULE_SETUP + { return SEMI; } + YY_BREAK + case 31: + YY_RULE_SETUP #line 72 "promela.l" -{ return '('; } - YY_BREAK -case 32: -YY_RULE_SETUP + { return '('; } + YY_BREAK + case 32: + YY_RULE_SETUP #line 73 "promela.l" -{ return ')'; } - YY_BREAK -case 33: -YY_RULE_SETUP + { return ')'; } + YY_BREAK + case 33: + YY_RULE_SETUP #line 75 "promela.l" -{ return '['; } - YY_BREAK -case 34: -YY_RULE_SETUP + { return '['; } + YY_BREAK + case 34: + YY_RULE_SETUP #line 76 "promela.l" -{ return ']'; } - YY_BREAK -case 35: -YY_RULE_SETUP + { return ']'; } + YY_BREAK + case 35: + YY_RULE_SETUP #line 78 "promela.l" -{ return '{'; } - YY_BREAK -case 36: -YY_RULE_SETUP + { return '{'; } + YY_BREAK + case 36: + YY_RULE_SETUP #line 79 "promela.l" -{ return '}'; } - YY_BREAK -case 37: -YY_RULE_SETUP + { return '}'; } + YY_BREAK + case 37: + YY_RULE_SETUP #line 81 "promela.l" -{ return ASGN; } - YY_BREAK -case 38: -/* rule 38 can match eol */ -YY_RULE_SETUP + { return ASGN; } + YY_BREAK + case 38: + /* rule 38 can match eol */ + YY_RULE_SETUP #line 83 "promela.l" -{ yylval->value = strdup(yytext); return(STRING); } - YY_BREAK -case 39: -YY_RULE_SETUP + { yylval->value = strdup(yytext); return(STRING); } + YY_BREAK + case 39: + YY_RULE_SETUP #line 85 "promela.l" -{ yylval->value = strdup(yytext); return CONST; } - YY_BREAK -case 40: -YY_RULE_SETUP + { yylval->value = strdup(yytext); return CONST; } + YY_BREAK + case 40: + YY_RULE_SETUP #line 86 "promela.l" -{ yylval->value = strdup(yytext); return NAME; } - YY_BREAK -case 41: -/* rule 41 can match eol */ -YY_RULE_SETUP + { yylval->value = strdup(yytext); return NAME; } + YY_BREAK + case 41: + /* rule 41 can match eol */ + YY_RULE_SETUP #line 88 "promela.l" -{ } - YY_BREAK -case 42: -/* rule 42 can match eol */ -YY_RULE_SETUP + { } + YY_BREAK + case 42: + /* rule 42 can match eol */ + YY_RULE_SETUP #line 90 "promela.l" -/* eat up whitespace */ - YY_BREAK -case 43: -YY_RULE_SETUP + /* eat up whitespace */ + YY_BREAK + case 43: + YY_RULE_SETUP #line 92 "promela.l" -{ /*printf( "Unrecognized character: %s\n", yytext ); */ } - YY_BREAK -case 44: -YY_RULE_SETUP + { /*printf( "Unrecognized character: %s\n", yytext ); */ } + YY_BREAK + case 44: + YY_RULE_SETUP #line 93 "promela.l" -ECHO; - YY_BREAK + ECHO; + YY_BREAK #line 1253 "promela.lex.yy.cpp" -case YY_STATE_EOF(INITIAL): - yyterminate(); + case YY_STATE_EOF(INITIAL): + yyterminate(); - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + case YY_END_OF_BUFFER: { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * promela_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * promela_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { + /* This was really a NUL. */ + yy_state_type yy_next_state; - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( yyscanner ); + yy_current_state = yy_get_previous_state( yyscanner ); - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; + if ( yy_next_state ) { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; } - else - { -/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; + else { + /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; } } - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( promela_wrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; + else switch ( yy_get_next_buffer( yyscanner ) ) { + case EOB_ACT_END_OF_FILE: { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( promela_wrap(yyscanner ) ) { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; } - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; + else { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; } - break; + break; } - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( yyscanner ); + yy_current_state = yy_get_previous_state( yyscanner ); - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - yy_current_state = yy_get_previous_state( yyscanner ); + yy_current_state = yy_get_previous_state( yyscanner ); - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; } - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ } /* end of promela_lex */ /* %ok-for-header */ @@ -1405,7 +1386,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = yyg->yytext_ptr; register int number_to_move, i; @@ -1413,26 +1394,24 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); + "fatal flex scanner internal error--end of buffer missed" ); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { + /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } + } - else - { + else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ @@ -1448,22 +1427,20 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + else { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + while ( num_to_read <= 0 ) { + /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - if ( b->yy_is_our_buffer ) - { + if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) @@ -1472,49 +1449,45 @@ static int yy_get_next_buffer (yyscan_t yyscanner) b->yy_buf_size *= 2; b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - promela_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else + /* Include room in for 2 EOB chars. */ + promela_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + "fatal error - scanner input buffer overflow" ); yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; + number_to_move - 1; - } + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } + } - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { + if ( yyg->yy_n_chars == 0 ) { + if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; promela_restart(yyin ,yyscanner); - } + } - else - { + else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } + YY_BUFFER_EOF_PENDING; } + } else ret_val = EOB_ACT_CONTINUE_SCAN; @@ -1541,35 +1514,32 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* %if-c-only */ /* %not-for-header */ - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +static yy_state_type yy_get_previous_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { register yy_state_type yy_current_state; register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -/* %% [15.0] code to get the start state into yy_current_state goes here */ + /* %% [15.0] code to get the start state into yy_current_state goes here */ yy_current_state = yyg->yy_start; - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { -/* %% [16.0] code to find the next state goes here */ + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { + /* %% [16.0] code to find the next state goes here */ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { + if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 102 ) yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } return yy_current_state; } @@ -1580,28 +1550,26 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ -/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ register char *yy_cp = yyg->yy_c_buf_p; register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { + if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 102 ) yy_c = yy_meta[(unsigned int) yy_c]; - } + } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 101); @@ -1610,27 +1578,27 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* %if-c-only */ - static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) +static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_cp = yyg->yy_c_buf_p; + yy_cp = yyg->yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yyg->yy_hold_char; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { + /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = yyg->yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; @@ -1638,15 +1606,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } + } *--yy_cp = (char) c; -/* %% [18.0] update yylineno here */ + /* %% [18.0] update yylineno here */ yyg->yytext_ptr = yy_bp; yyg->yy_hold_char = *yy_cp; @@ -1659,9 +1627,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) +static int yyinput (yyscan_t yyscanner) #else - static int input (yyscan_t yyscanner) +static int input (yyscan_t yyscanner) #endif /* %endif */ @@ -1669,12 +1637,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* %endif */ { int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. @@ -1683,55 +1650,53 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* This was really a NUL. */ *yyg->yy_c_buf_p = '\0'; - else - { /* need more input */ + else { + /* need more input */ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - promela_restart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( promela_wrap(yyscanner ) ) - return 0; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; + switch ( yy_get_next_buffer( yyscanner ) ) { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + promela_restart(yyin ,yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: { + if ( promela_wrap(yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(yyscanner); + return yyinput(yyscanner); #else - return input(yyscanner); + return input(yyscanner); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; } } + } c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ yyg->yy_hold_char = *++yyg->yy_c_buf_p; -/* %% [19.0] update BOL and yylineno */ + /* %% [19.0] update BOL and yylineno */ return c; } @@ -1745,17 +1710,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ - void promela_restart (FILE * input_file , yyscan_t yyscanner) +void promela_restart (FILE * input_file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! YY_CURRENT_BUFFER ){ - promela_ensure_buffer_stack (yyscanner); + if ( ! YY_CURRENT_BUFFER ) { + promela_ensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); } promela__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); @@ -1767,29 +1732,28 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ - void promela__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +void promela__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * promela_pop_buffer_state(); * promela_push_buffer_state(new_buffer); - */ + */ promela_ensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( YY_CURRENT_BUFFER ) - { + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } + } YY_CURRENT_BUFFER_LVALUE = new_buffer; promela__load_buffer_state(yyscanner ); @@ -1808,7 +1772,7 @@ static void promela__load_buffer_state (yyscan_t yyscanner) /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; @@ -1822,13 +1786,13 @@ static void promela__load_buffer_state (yyscan_t yyscanner) * @return the allocated buffer state. */ /* %if-c-only */ - YY_BUFFER_STATE promela__create_buffer (FILE * file, int size , yyscan_t yyscanner) +YY_BUFFER_STATE promela__create_buffer (FILE * file, int size , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) promela_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in promela__create_buffer()" ); @@ -1854,12 +1818,12 @@ static void promela__load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ - void promela__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +void promela__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1885,36 +1849,36 @@ static void promela__load_buffer_state (yyscan_t yyscanner) * such as during a promela_restart() or at EOF. */ /* %if-c-only */ - static void promela__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) +static void promela__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; promela__flush_buffer(b ,yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then promela__init_buffer was _probably_ - * called from promela_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } + /* If b is the current buffer, then promela__init_buffer was _probably_ + * called from promela_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER) { + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } -/* %if-c-only */ + /* %if-c-only */ - b->yy_is_interactive = 0; - -/* %endif */ -/* %if-c++-only */ -/* %endif */ + b->yy_is_interactive = 0; + + /* %endif */ + /* %if-c++-only */ + /* %endif */ errno = oerrno; } @@ -1923,12 +1887,12 @@ static void promela__load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ - void promela__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +void promela__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -1963,20 +1927,19 @@ void promela_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; promela_ensure_buffer_stack(yyscanner); /* This block is copied from promela__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *yyg->yy_c_buf_p = yyg->yy_hold_char; YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } + } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) @@ -2000,7 +1963,7 @@ void promela_pop_buffer_state (yyscan_t yyscanner) /* %if-c++-only */ /* %endif */ { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; @@ -2027,38 +1990,38 @@ static void promela_ensure_buffer_stack (yyscan_t yyscanner) /* %endif */ { yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ + */ num_to_alloc = 1; yyg->yy_buffer_stack = (struct yy_buffer_state**)promela_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in promela_ensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; } - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1) { /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)promela_realloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in promela_ensure_buffer_stack()" ); @@ -2074,15 +2037,14 @@ static void promela_ensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE promela__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ +YY_BUFFER_STATE promela__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; @@ -2115,9 +2077,8 @@ YY_BUFFER_STATE promela__scan_buffer (char * base, yy_size_t size , yyscan_t y * @note If you want to scan bytes that may contain NUL values, then use * promela__scan_bytes() instead. */ -YY_BUFFER_STATE promela__scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - +YY_BUFFER_STATE promela__scan_string (yyconst char * yystr , yyscan_t yyscanner) { + return promela__scan_bytes(yystr,strlen(yystr) ,yyscanner); } /* %endif */ @@ -2130,12 +2091,11 @@ YY_BUFFER_STATE promela__scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE promela__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) -{ +YY_BUFFER_STATE promela__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n, i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) promela_alloc(n ,yyscanner ); @@ -2165,9 +2125,8 @@ YY_BUFFER_STATE promela__scan_bytes (yyconst char * yybytes, yy_size_t _yybyte #endif /* %if-c-only */ -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* %endif */ @@ -2199,10 +2158,9 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE promela_get_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; +YY_EXTRA_TYPE promela_get_extra (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; } /* %endif */ @@ -2210,64 +2168,58 @@ YY_EXTRA_TYPE promela_get_extra (yyscan_t yyscanner) /** Get the current line number. * @param yyscanner The scanner object. */ -int promela_get_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; +int promela_get_lineno (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int promela_get_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; +int promela_get_column (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *promela_get_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; +FILE *promela_get_in (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *promela_get_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; +FILE *promela_get_out (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ -yy_size_t promela_get_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; +yy_size_t promela_get_leng (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; } /** Get the current token. * @param yyscanner The scanner object. */ -char *promela_get_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; +char *promela_get_text (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; } /* %if-reentrant */ @@ -2276,10 +2228,9 @@ char *promela_get_text (yyscan_t yyscanner) * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void promela_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; +void promela_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /* %endif */ @@ -2288,30 +2239,28 @@ void promela_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) * @param line_number * @param yyscanner The scanner object. */ -void promela_set_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; +void promela_set_lineno (int line_number , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "promela_set_lineno called with no buffer" , yyscanner); - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "promela_set_lineno called with no buffer" , yyscanner); - - yylineno = line_number; + yylineno = line_number; } /** Set the current column. * @param line_number * @param yyscanner The scanner object. */ -void promela_set_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; +void promela_set_column (int column_no , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "promela_set_column called with no buffer" , yyscanner); - - yycolumn = column_no; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "promela_set_column called with no buffer" , yyscanner); + + yycolumn = column_no; } /** Set the input stream. This does not discard the current @@ -2320,28 +2269,24 @@ void promela_set_column (int column_no , yyscan_t yyscanner) * @param yyscanner The scanner object. * @see promela__switch_to_buffer */ -void promela_set_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; +void promela_set_in (FILE * in_str , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = in_str ; } -void promela_set_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; +void promela_set_out (FILE * out_str , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = out_str ; } -int promela_get_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; +int promela_get_debug (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; } -void promela_set_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; +void promela_set_debug (int bdebug , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = bdebug ; } /* %endif */ @@ -2351,16 +2296,14 @@ void promela_set_debug (int bdebug , yyscan_t yyscanner) /* %if-bison-bridge */ -YYSTYPE * promela_get_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; +YYSTYPE * promela_get_lval (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; } -void promela_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; +void promela_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; } /* %endif */ @@ -2375,22 +2318,22 @@ void promela_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) int promela_lex_init(yyscan_t* ptr_yy_globals) { - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL) { + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL) { + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } /* promela_lex_init_extra has the same functionality as promela_lex_init, but follows the @@ -2404,76 +2347,74 @@ int promela_lex_init(yyscan_t* ptr_yy_globals) int promela_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) { - struct yyguts_t dummy_yyguts; - - promela_set_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - promela_set_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); + struct yyguts_t dummy_yyguts; + + promela_set_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL) { + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL) { + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + promela_set_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); } /* %endif if-c-only */ /* %if-c-only */ -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from promela_lex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ +static int yy_init_globals (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from promela_lex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = (char *) 0; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + + /* Defined in main.c */ #ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; + yyin = stdin; + yyout = stdout; #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; + yyin = (FILE *) 0; + yyout = (FILE *) 0; #endif - /* For future reference: Set errno on error, since we are called by - * promela_lex_init() - */ - return 0; + /* For future reference: Set errno on error, since we are called by + * promela_lex_init() + */ + return 0; } /* %endif */ /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* promela_lex_destroy is for both reentrant and non-reentrant scanners. */ -int promela_lex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; +int promela_lex_destroy (yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER) { promela__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; promela_pop_buffer_state(yyscanner); @@ -2483,20 +2424,20 @@ int promela_lex_destroy (yyscan_t yyscanner) promela_free(yyg->yy_buffer_stack ,yyscanner); yyg->yy_buffer_stack = NULL; - /* Destroy the start condition stack. */ - promela_free(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; + /* Destroy the start condition stack. */ + promela_free(yyg->yy_start_stack ,yyscanner ); + yyg->yy_start_stack = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * promela_lex() is called, initialization will occur. */ - yy_init_globals( yyscanner); + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * promela_lex() is called, initialization will occur. */ + yy_init_globals( yyscanner); -/* %if-reentrant */ - /* Destroy the main struct (reentrant only). */ - promela_free ( yyscanner , yyscanner ); - yyscanner = NULL; -/* %endif */ - return 0; + /* %if-reentrant */ + /* Destroy the main struct (reentrant only). */ + promela_free ( yyscanner , yyscanner ); + yyscanner = NULL; + /* %endif */ + return 0; } /* %endif */ @@ -2505,8 +2446,7 @@ int promela_lex_destroy (yyscan_t yyscanner) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; @@ -2514,8 +2454,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { register int n; for ( n = 0; s[n]; ++n ) ; @@ -2524,13 +2463,11 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) } #endif -void *promela_alloc (yy_size_t size , yyscan_t yyscanner) -{ +void *promela_alloc (yy_size_t size , yyscan_t yyscanner) { return (void *) malloc( size ); } -void *promela_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ +void *promela_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2541,8 +2478,7 @@ void *promela_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) return (void *) realloc( (char *) ptr, size ); } -void promela_free (void * ptr , yyscan_t yyscanner) -{ +void promela_free (void * ptr , yyscan_t yyscanner) { free( (char *) ptr ); /* see promela_realloc() for (char *) cast */ } diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp b/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp index 5cdcec1..6e786cd 100644 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp +++ b/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp @@ -1,19 +1,19 @@ /* A Bison parser, made by GNU Bison 2.7.12-4996. */ /* Bison implementation for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -128,96 +128,95 @@ extern int promela_debug; /* Tokens. */ #ifndef PROMELA_TOKENTYPE # define PROMELA_TOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum promela_tokentype { - VAR_ARRAY = 258, - VARLIST = 259, - DECL = 260, - DECLLIST = 261, - STMNT = 262, - COLON = 263, - EXPR = 264, - NAMELIST = 265, - ASSERT = 266, - PRINT = 267, - PRINTM = 268, - LEN = 269, - STRING = 270, - TYPEDEF = 271, - MTYPE = 272, - INLINE = 273, - RETURN = 274, - LABEL = 275, - OF = 276, - GOTO = 277, - BREAK = 278, - ELSE = 279, - SEMI = 280, - ARROW = 281, - IF = 282, - FI = 283, - DO = 284, - OD = 285, - FOR = 286, - SELECT = 287, - IN = 288, - SEP = 289, - DOTDOT = 290, - HIDDEN = 291, - SHOW = 292, - ISLOCAL = 293, - CONST = 294, - TYPE = 295, - XU = 296, - NAME = 297, - UNAME = 298, - PNAME = 299, - INAME = 300, - CLAIM = 301, - TRACE = 302, - INIT = 303, - LTL = 304, - COMMA = 305, - ASGN = 306, - AND = 307, - OR = 308, - BITAND = 309, - BITXOR = 310, - BITOR = 311, - NE = 312, - EQ = 313, - LE = 314, - GE = 315, - LT = 316, - GT = 317, - RSHIFT = 318, - LSHIFT = 319, - MINUS = 320, - PLUS = 321, - MODULO = 322, - DIVIDE = 323, - TIMES = 324, - DECR = 325, - INCR = 326, - COMPL = 327, - NEG = 328, - DOT = 329 - }; +/* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ +enum promela_tokentype { + VAR_ARRAY = 258, + VARLIST = 259, + DECL = 260, + DECLLIST = 261, + STMNT = 262, + COLON = 263, + EXPR = 264, + NAMELIST = 265, + ASSERT = 266, + PRINT = 267, + PRINTM = 268, + LEN = 269, + STRING = 270, + TYPEDEF = 271, + MTYPE = 272, + INLINE = 273, + RETURN = 274, + LABEL = 275, + OF = 276, + GOTO = 277, + BREAK = 278, + ELSE = 279, + SEMI = 280, + ARROW = 281, + IF = 282, + FI = 283, + DO = 284, + OD = 285, + FOR = 286, + SELECT = 287, + IN = 288, + SEP = 289, + DOTDOT = 290, + HIDDEN = 291, + SHOW = 292, + ISLOCAL = 293, + CONST = 294, + TYPE = 295, + XU = 296, + NAME = 297, + UNAME = 298, + PNAME = 299, + INAME = 300, + CLAIM = 301, + TRACE = 302, + INIT = 303, + LTL = 304, + COMMA = 305, + ASGN = 306, + AND = 307, + OR = 308, + BITAND = 309, + BITXOR = 310, + BITOR = 311, + NE = 312, + EQ = 313, + LE = 314, + GE = 315, + LT = 316, + GT = 317, + RSHIFT = 318, + LSHIFT = 319, + MINUS = 320, + PLUS = 321, + MODULO = 322, + DIVIDE = 323, + TIMES = 324, + DECR = 325, + INCR = 326, + COMPL = 327, + NEG = 328, + DOT = 329 +}; #endif #if ! defined PROMELA_STYPE && ! defined PROMELA_STYPE_IS_DECLARED -typedef union PROMELA_STYPE -{ -/* Line 387 of yacc.c */ +typedef union PROMELA_STYPE { + /* Line 387 of yacc.c */ #line 38 "promela.ypp" - uscxml::PromelaParserNode* node; + uscxml::PromelaParserNode* node; char* value; -/* Line 387 of yacc.c */ + /* Line 387 of yacc.c */ #line 222 "promela.tab.cpp" } PROMELA_STYPE; # define PROMELA_STYPE_IS_TRIVIAL 1 @@ -333,10 +332,10 @@ YYID (int yyi) #else static int YYID (yyi) - int yyi; +int yyi; #endif { - return yyi; + return yyi; } #endif @@ -360,7 +359,7 @@ YYID (yyi) # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +/* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -370,13 +369,13 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ +/* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ +/* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else @@ -416,10 +415,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ || (defined PROMELA_STYPE_IS_TRIVIAL && PROMELA_STYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; +union yyalloc { + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ @@ -493,270 +491,257 @@ union yyalloc ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 11, 12, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 13, 2, 14, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 15, 2, 16, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 +static const yytype_uint8 yytranslate[] = { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 11, 12, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 13, 2, 14, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 15, 2, 16, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 }; #if PROMELA_DEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 18, 19, - 23, 24, 27, 31, 35, 39, 43, 47, 51, 55, - 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, - 99, 103, 106, 109, 114, 116, 118, 119, 121, 123, - 125, 129, 133, 140, 142, 145, 149, 151, 155, 157, - 161, 163, 167, 172, 174, 177, 181, 185, 189, 193, - 197, 201, 203, 206, 209, 211, 214, 218, 220, 224, - 227, 230, 236, 241, 246, 249, 251, 252, 261, 262, - 264, 265, 268, 270 +static const yytype_uint16 yyprhs[] = { + 0, 0, 3, 5, 7, 9, 11, 13, 18, 19, + 23, 24, 27, 31, 35, 39, 43, 47, 51, 55, + 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, + 99, 103, 106, 109, 114, 116, 118, 119, 121, 123, + 125, 129, 133, 140, 142, 145, 149, 151, 155, 157, + 161, 163, 167, 172, 174, 177, 181, 185, 189, 193, + 197, 201, 203, 206, 209, 211, 214, 218, 220, 224, + 227, 230, 236, 241, 246, 249, 251, 252, 261, 262, + 264, 265, 268, 270 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 82, 0, -1, 91, -1, 88, -1, 97, -1, 85, - -1, 48, -1, 48, 13, 88, 14, -1, -1, 84, - 86, 87, -1, -1, 80, 85, -1, 11, 88, 12, - -1, 88, 72, 88, -1, 88, 71, 88, -1, 88, - 75, 88, -1, 88, 74, 88, -1, 88, 73, 88, - -1, 88, 60, 88, -1, 88, 61, 88, -1, 88, - 62, 88, -1, 88, 68, 88, -1, 88, 67, 88, - -1, 88, 66, 88, -1, 88, 65, 88, -1, 88, - 64, 88, -1, 88, 63, 88, -1, 88, 58, 88, - -1, 88, 59, 88, -1, 88, 70, 88, -1, 88, - 69, 88, -1, 79, 88, -1, 71, 88, -1, 20, - 11, 83, 12, -1, 83, -1, 45, -1, -1, 42, - -1, 43, -1, 44, -1, 89, 46, 92, -1, 89, - 49, 92, -1, 89, 46, 57, 15, 96, 16, -1, - 90, -1, 90, 31, -1, 90, 31, 91, -1, 93, - -1, 93, 56, 92, -1, 94, -1, 94, 57, 88, - -1, 48, -1, 48, 8, 45, -1, 48, 13, 95, - 14, -1, 45, -1, 71, 95, -1, 11, 95, 12, - -1, 95, 72, 95, -1, 95, 71, 95, -1, 95, - 75, 95, -1, 95, 74, 95, -1, 95, 73, 95, - -1, 48, -1, 96, 48, -1, 96, 56, -1, 98, - -1, 98, 31, -1, 98, 31, 97, -1, 99, -1, - 83, 57, 88, -1, 83, 77, -1, 83, 76, -1, - 18, 11, 21, 102, 12, -1, 19, 11, 83, 12, - -1, 19, 11, 45, 12, -1, 17, 88, -1, 88, - -1, -1, 83, 57, 51, 100, 11, 101, 12, 99, - -1, -1, 103, -1, -1, 56, 103, -1, 88, -1, - 88, 56, 103, -1 +static const yytype_int8 yyrhs[] = { + 82, 0, -1, 91, -1, 88, -1, 97, -1, 85, + -1, 48, -1, 48, 13, 88, 14, -1, -1, 84, + 86, 87, -1, -1, 80, 85, -1, 11, 88, 12, + -1, 88, 72, 88, -1, 88, 71, 88, -1, 88, + 75, 88, -1, 88, 74, 88, -1, 88, 73, 88, + -1, 88, 60, 88, -1, 88, 61, 88, -1, 88, + 62, 88, -1, 88, 68, 88, -1, 88, 67, 88, + -1, 88, 66, 88, -1, 88, 65, 88, -1, 88, + 64, 88, -1, 88, 63, 88, -1, 88, 58, 88, + -1, 88, 59, 88, -1, 88, 70, 88, -1, 88, + 69, 88, -1, 79, 88, -1, 71, 88, -1, 20, + 11, 83, 12, -1, 83, -1, 45, -1, -1, 42, + -1, 43, -1, 44, -1, 89, 46, 92, -1, 89, + 49, 92, -1, 89, 46, 57, 15, 96, 16, -1, + 90, -1, 90, 31, -1, 90, 31, 91, -1, 93, + -1, 93, 56, 92, -1, 94, -1, 94, 57, 88, + -1, 48, -1, 48, 8, 45, -1, 48, 13, 95, + 14, -1, 45, -1, 71, 95, -1, 11, 95, 12, + -1, 95, 72, 95, -1, 95, 71, 95, -1, 95, + 75, 95, -1, 95, 74, 95, -1, 95, 73, 95, + -1, 48, -1, 96, 48, -1, 96, 56, -1, 98, + -1, 98, 31, -1, 98, 31, 97, -1, 99, -1, + 83, 57, 88, -1, 83, 77, -1, 83, 76, -1, + 18, 11, 21, 102, 12, -1, 19, 11, 83, 12, + -1, 19, 11, 45, 12, -1, 17, 88, -1, 88, + -1, -1, 83, 57, 51, 100, 11, 101, 12, 99, + -1, -1, 103, -1, -1, 56, 103, -1, 88, -1, + 88, 56, 103, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 84, 84, 88, 92, 98, 101, 102, 105, 105, - 109, 110, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 142, 143, 144, 148, 149, 150, 151, - 154, 155, 156, 159, 160, 161, 171, 172, 175, 176, - 179, 180, 181, 184, 185, 186, 187, 188, 189, 190, - 191, 194, 195, 203, 206, 207, 208, 211, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 222, 225, 226, - 229, 230, 233, 234 +static const yytype_uint8 yyrline[] = { + 0, 84, 84, 88, 92, 98, 101, 102, 105, 105, + 109, 110, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 142, 143, 144, 148, 149, 150, 151, + 154, 155, 156, 159, 160, 161, 171, 172, 175, 176, + 179, 180, 181, 184, 185, 186, 187, 188, 189, 190, + 191, 194, 195, 204, 207, 208, 209, 212, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 223, 226, 227, + 230, 231, 234, 235 }; #endif #if PROMELA_DEBUG || YYERROR_VERBOSE || 1 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "VAR_ARRAY", "VARLIST", "DECL", - "DECLLIST", "STMNT", "COLON", "EXPR", "NAMELIST", "'('", "')'", "'['", - "']'", "'{'", "'}'", "ASSERT", "PRINT", "PRINTM", "LEN", "STRING", - "TYPEDEF", "MTYPE", "INLINE", "RETURN", "LABEL", "OF", "GOTO", "BREAK", - "ELSE", "SEMI", "ARROW", "IF", "FI", "DO", "OD", "FOR", "SELECT", "IN", - "SEP", "DOTDOT", "HIDDEN", "SHOW", "ISLOCAL", "CONST", "TYPE", "XU", - "NAME", "UNAME", "PNAME", "INAME", "CLAIM", "TRACE", "INIT", "LTL", - "COMMA", "ASGN", "AND", "OR", "BITAND", "BITXOR", "BITOR", "NE", "EQ", - "LE", "GE", "LT", "GT", "RSHIFT", "LSHIFT", "MINUS", "PLUS", "MODULO", - "DIVIDE", "TIMES", "DECR", "INCR", "COMPL", "NEG", "DOT", "$accept", - "program", "varref", "pfld", "cmpnd", "$@1", "sfld", "expr", "vis", - "one_decl", "decl_lst", "var_list", "ivar", "vardcl", "const_expr", - "nlst", "stmnt_lst", "stmnt", "Stmnt", "$@2", "args", "prargs", "arg", YY_NULL +static const char *const yytname[] = { + "$end", "error", "$undefined", "VAR_ARRAY", "VARLIST", "DECL", + "DECLLIST", "STMNT", "COLON", "EXPR", "NAMELIST", "'('", "')'", "'['", + "']'", "'{'", "'}'", "ASSERT", "PRINT", "PRINTM", "LEN", "STRING", + "TYPEDEF", "MTYPE", "INLINE", "RETURN", "LABEL", "OF", "GOTO", "BREAK", + "ELSE", "SEMI", "ARROW", "IF", "FI", "DO", "OD", "FOR", "SELECT", "IN", + "SEP", "DOTDOT", "HIDDEN", "SHOW", "ISLOCAL", "CONST", "TYPE", "XU", + "NAME", "UNAME", "PNAME", "INAME", "CLAIM", "TRACE", "INIT", "LTL", + "COMMA", "ASGN", "AND", "OR", "BITAND", "BITXOR", "BITOR", "NE", "EQ", + "LE", "GE", "LT", "GT", "RSHIFT", "LSHIFT", "MINUS", "PLUS", "MODULO", + "DIVIDE", "TIMES", "DECR", "INCR", "COMPL", "NEG", "DOT", "$accept", + "program", "varref", "pfld", "cmpnd", "$@1", "sfld", "expr", "vis", + "one_decl", "decl_lst", "var_list", "ivar", "vardcl", "const_expr", + "nlst", "stmnt_lst", "stmnt", "Stmnt", "$@2", "args", "prargs", "arg", YY_NULL }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 40, 41, 91, 93, 123, 125, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329 +static const yytype_uint16 yytoknum[] = { + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 40, 41, 91, 93, 123, 125, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 81, 82, 82, 82, 83, 84, 84, 86, 85, - 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, - 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, - 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, - 95, 96, 96, 96, 97, 97, 97, 98, 99, 99, - 99, 99, 99, 99, 99, 99, 100, 99, 101, 101, - 102, 102, 103, 103 +static const yytype_uint8 yyr1[] = { + 0, 81, 82, 82, 82, 83, 84, 84, 86, 85, + 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, + 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, + 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, + 95, 96, 96, 96, 97, 97, 97, 98, 99, 99, + 99, 99, 99, 99, 99, 99, 100, 99, 101, 101, + 102, 102, 103, 103 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 4, 0, 3, - 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 4, 1, 1, 0, 1, 1, 1, - 3, 3, 6, 1, 2, 3, 1, 3, 1, 3, - 1, 3, 4, 1, 2, 3, 3, 3, 3, 3, - 3, 1, 2, 2, 1, 2, 3, 1, 3, 2, - 2, 5, 4, 4, 2, 1, 0, 8, 0, 1, - 0, 2, 1, 3 +static const yytype_uint8 yyr2[] = { + 0, 2, 1, 1, 1, 1, 1, 4, 0, 3, + 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 2, 4, 1, 1, 0, 1, 1, 1, + 3, 3, 6, 1, 2, 3, 1, 3, 1, 3, + 1, 3, 4, 1, 2, 3, 3, 3, 3, 3, + 3, 1, 2, 2, 1, 2, 3, 1, 3, 2, + 2, 5, 4, 4, 2, 1, 0, 8, 0, 1, + 0, 2, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 36, 0, 0, 0, 0, 0, 37, 38, 39, 35, - 6, 0, 0, 0, 34, 8, 5, 3, 0, 43, - 2, 4, 64, 67, 34, 0, 74, 0, 0, 0, - 0, 32, 31, 1, 0, 70, 69, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 36, 65, - 12, 80, 0, 0, 0, 0, 76, 68, 0, 9, - 27, 28, 18, 19, 20, 26, 25, 24, 23, 22, - 21, 30, 29, 14, 13, 17, 16, 15, 50, 0, - 40, 46, 48, 41, 45, 75, 66, 0, 0, 73, - 72, 33, 7, 0, 11, 0, 0, 0, 0, 0, - 82, 81, 71, 78, 51, 0, 53, 0, 0, 61, - 0, 47, 49, 0, 0, 79, 0, 54, 52, 0, - 0, 0, 0, 0, 42, 62, 63, 83, 0, 55, - 57, 56, 60, 59, 58, 77 +static const yytype_uint8 yydefact[] = { + 36, 0, 0, 0, 0, 0, 37, 38, 39, 35, + 6, 0, 0, 0, 34, 8, 5, 3, 0, 43, + 2, 4, 64, 67, 34, 0, 74, 0, 0, 0, + 0, 32, 31, 1, 0, 70, 69, 10, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 65, + 12, 80, 0, 0, 0, 0, 76, 68, 0, 9, + 27, 28, 18, 19, 20, 26, 25, 24, 23, 22, + 21, 30, 29, 14, 13, 17, 16, 15, 50, 0, + 40, 46, 48, 41, 45, 75, 66, 0, 0, 73, + 72, 33, 7, 0, 11, 0, 0, 0, 0, 0, + 82, 81, 71, 78, 51, 0, 53, 0, 0, 61, + 0, 47, 49, 0, 0, 79, 0, 54, 52, 0, + 0, 0, 0, 0, 42, 62, 63, 83, 0, 55, + 57, 56, 60, 59, 58, 77 }; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 13, 24, 15, 16, 37, 69, 110, 18, 19, - 20, 90, 91, 92, 118, 120, 21, 22, 23, 103, - 124, 98, 111 +static const yytype_int8 yydefgoto[] = { + -1, 13, 24, 15, 16, 37, 69, 110, 18, 19, + 20, 90, 91, 92, 118, 120, 21, 22, 23, 103, + 124, 98, 111 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -109 -static const yytype_int16 yypact[] = -{ - 46, 65, 65, -5, 7, 9, -109, -109, -109, -109, - 8, 65, 65, 33, -53, -109, -109, 155, -36, 5, - -109, -109, 6, -109, -109, 87, 193, 54, -29, 36, - 65, -1, -109, -109, 60, -109, -109, 13, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, -40, 38, 35, 50, - -109, 25, 71, 75, 84, 110, -109, 193, 36, -109, - 209, 209, 222, 222, 222, 170, 170, 229, 229, 229, - 229, -46, -46, -1, -1, -109, -109, -109, 1, 82, - -109, 51, 49, -109, -109, 193, -109, 65, 100, -109, - -109, -109, -109, 103, -109, 70, 11, 68, 38, 65, - 136, -109, -109, 65, -109, 11, -109, 11, 116, -109, - 44, -109, 193, 65, 106, -109, 92, 28, -109, 11, - 11, 11, 11, 11, -109, -109, -109, -109, 50, -109, - 28, 28, -109, -109, -109, -109 +static const yytype_int16 yypact[] = { + 46, 65, 65, -5, 7, 9, -109, -109, -109, -109, + 8, 65, 65, 33, -53, -109, -109, 155, -36, 5, + -109, -109, 6, -109, -109, 87, 193, 54, -29, 36, + 65, -1, -109, -109, 60, -109, -109, 13, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, -40, 38, 35, 50, + -109, 25, 71, 75, 84, 110, -109, 193, 36, -109, + 209, 209, 222, 222, 222, 170, 170, 229, 229, 229, + 229, -46, -46, -1, -1, -109, -109, -109, 1, 82, + -109, 51, 49, -109, -109, 193, -109, 65, 100, -109, + -109, -109, -109, 103, -109, 70, 11, 68, 38, 65, + 136, -109, -109, 65, -109, 11, -109, 11, 116, -109, + 44, -109, 193, 65, 106, -109, 92, 28, -109, 11, + 11, 11, 11, 11, -109, -109, -109, -109, 50, -109, + 28, 28, -109, -109, -109, -109 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -109, -109, 3, -109, 52, -109, -109, 0, -109, -109, - 61, -50, -109, -109, 117, -109, 63, -109, -15, -109, - -109, -109, -108 +static const yytype_int8 yypgoto[] = { + -109, -109, 3, -109, 52, -109, -109, 0, -109, -109, + 61, -50, -109, -109, 117, -109, 63, -109, -15, -109, + -109, -109, -108 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -76 -static const yytype_int16 yytable[] = -{ - 17, 25, 26, 14, 34, 125, 27, 93, 88, 105, - 56, 31, 32, 57, 106, 137, 62, 89, 28, 10, - 29, 30, 115, 35, 36, 51, 52, 53, 54, 55, - 65, 63, 64, 33, 67, -44, 58, 59, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 116, 1, 121, 95, - 134, 1, 14, 2, 3, 4, 5, 2, 3, 4, - 5, 1, 53, 54, 55, 61, 1, 6, 7, 8, - 5, 97, 117, 99, 10, 5, 88, 100, 6, 7, - 8, 9, 135, 68, 10, 9, 101, 107, 10, 60, - 136, 131, 132, 133, 139, 9, 109, 108, 10, 122, - 9, 66, 112, 10, 113, 114, 119, 11, 138, 94, - 104, 11, 96, 145, 102, 12, 0, 0, 0, 12, - 128, 11, 0, 0, 0, 0, 11, 0, 95, 12, - 0, 14, 0, 0, 12, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 129, 130, 131, 132, 133, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, -75, 129, 130, 131, - 132, 133, 123, 0, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 0, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 0, 126, 0, 127, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 140, 141, 142, 143, - 144, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 49, 50, - 51, 52, 53, 54, 55 +static const yytype_int16 yytable[] = { + 17, 25, 26, 14, 34, 125, 27, 93, 88, 105, + 56, 31, 32, 57, 106, 137, 62, 89, 28, 10, + 29, 30, 115, 35, 36, 51, 52, 53, 54, 55, + 65, 63, 64, 33, 67, -44, 58, 59, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 116, 1, 121, 95, + 134, 1, 14, 2, 3, 4, 5, 2, 3, 4, + 5, 1, 53, 54, 55, 61, 1, 6, 7, 8, + 5, 97, 117, 99, 10, 5, 88, 100, 6, 7, + 8, 9, 135, 68, 10, 9, 101, 107, 10, 60, + 136, 131, 132, 133, 139, 9, 109, 108, 10, 122, + 9, 66, 112, 10, 113, 114, 119, 11, 138, 94, + 104, 11, 96, 145, 102, 12, 0, 0, 0, 12, + 128, 11, 0, 0, 0, 0, 11, 0, 95, 12, + 0, 14, 0, 0, 12, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 129, 130, 131, 132, 133, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, -75, 129, 130, 131, + 132, 133, 123, 0, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 0, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 0, 126, 0, 127, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 140, 141, 142, 143, + 144, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 49, 50, + 51, 52, 53, 54, 55 }; #define yypact_value_is_default(Yystate) \ @@ -765,60 +750,58 @@ static const yytype_int16 yytable[] = #define yytable_value_is_error(Yytable_value) \ YYID (0) -static const yytype_int16 yycheck[] = -{ - 0, 1, 2, 0, 57, 113, 11, 57, 48, 8, - 46, 11, 12, 49, 13, 123, 45, 57, 11, 48, - 11, 13, 11, 76, 77, 71, 72, 73, 74, 75, - 30, 28, 29, 0, 34, 0, 31, 31, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 45, 11, 108, 59, - 16, 11, 59, 17, 18, 19, 20, 17, 18, 19, - 20, 11, 73, 74, 75, 21, 11, 42, 43, 44, - 20, 56, 71, 12, 48, 20, 48, 12, 42, 43, - 44, 45, 48, 80, 48, 45, 12, 15, 48, 12, - 56, 73, 74, 75, 12, 45, 57, 56, 48, 109, - 45, 51, 12, 48, 11, 45, 48, 71, 12, 58, - 68, 71, 59, 138, 14, 79, -1, -1, -1, 79, - 14, 71, -1, -1, -1, -1, 71, -1, 138, 79, - -1, 138, -1, -1, 79, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 71, 72, 73, 74, 75, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 31, 71, 72, 73, - 74, 75, 56, -1, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -1, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, -1, 115, -1, 117, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 129, 130, 131, 132, - 133, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 69, 70, - 71, 72, 73, 74, 75 +static const yytype_int16 yycheck[] = { + 0, 1, 2, 0, 57, 113, 11, 57, 48, 8, + 46, 11, 12, 49, 13, 123, 45, 57, 11, 48, + 11, 13, 11, 76, 77, 71, 72, 73, 74, 75, + 30, 28, 29, 0, 34, 0, 31, 31, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 45, 11, 108, 59, + 16, 11, 59, 17, 18, 19, 20, 17, 18, 19, + 20, 11, 73, 74, 75, 21, 11, 42, 43, 44, + 20, 56, 71, 12, 48, 20, 48, 12, 42, 43, + 44, 45, 48, 80, 48, 45, 12, 15, 48, 12, + 56, 73, 74, 75, 12, 45, 57, 56, 48, 109, + 45, 51, 12, 48, 11, 45, 48, 71, 12, 58, + 68, 71, 59, 138, 14, 79, -1, -1, -1, 79, + 14, 71, -1, -1, -1, -1, 71, -1, 138, 79, + -1, 138, -1, -1, 79, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 71, 72, 73, 74, 75, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 31, 71, 72, 73, + 74, 75, 56, -1, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, -1, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, -1, 115, -1, 117, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 129, 130, 131, 132, + 133, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 69, 70, + 71, 72, 73, 74, 75 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 11, 17, 18, 19, 20, 42, 43, 44, 45, - 48, 71, 79, 82, 83, 84, 85, 88, 89, 90, - 91, 97, 98, 99, 83, 88, 88, 11, 11, 11, - 13, 88, 88, 0, 57, 76, 77, 86, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 46, 49, 31, 31, - 12, 21, 45, 83, 83, 88, 51, 88, 80, 87, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 48, 57, - 92, 93, 94, 92, 91, 88, 97, 56, 102, 12, - 12, 12, 14, 100, 85, 8, 13, 15, 56, 57, - 88, 103, 12, 11, 45, 11, 45, 71, 95, 48, - 96, 92, 88, 56, 101, 103, 95, 95, 14, 71, - 72, 73, 74, 75, 16, 48, 56, 103, 12, 12, - 95, 95, 95, 95, 95, 99 +static const yytype_uint8 yystos[] = { + 0, 11, 17, 18, 19, 20, 42, 43, 44, 45, + 48, 71, 79, 82, 83, 84, 85, 88, 89, 90, + 91, 97, 98, 99, 83, 88, 88, 11, 11, 11, + 13, 88, 88, 0, 57, 76, 77, 86, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 46, 49, 31, 31, + 12, 21, 45, 83, 83, 88, 51, 88, 80, 87, + 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 88, 48, 57, + 92, 93, 94, 92, 91, 88, 97, 56, 102, 12, + 12, 12, 14, 100, 85, 8, 13, 15, 56, 57, + 88, 103, 12, 11, 45, 11, 45, 71, 95, 48, + 96, 92, 88, 56, 101, 103, 95, 95, 14, 71, + 72, 73, 74, 75, 16, 48, 56, 103, 12, 12, + 95, 95, 95, 95, 95, 99 }; #define yyerrok (yyerrstatus = 0) @@ -840,10 +823,10 @@ static const yytype_uint8 yystos[] = #define YYFAIL goto yyerrlab #if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ +/* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ #endif #define YYRECOVERING() (!!yyerrstatus) @@ -921,26 +904,26 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - uscxml::PromelaParser* ctx; - void * scanner; +FILE *yyoutput; +int yytype; +YYSTYPE const * const yyvaluep; +uscxml::PromelaParser* ctx; +void * scanner; #endif { - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; - YYUSE (ctx); - YYUSE (scanner); + FILE *yyo = yyoutput; + YYUSE (yyo); + if (!yyvaluep) + return; + YYUSE (ctx); + YYUSE (scanner); # ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else - YYUSE (yyoutput); + YYUSE (yyoutput); # endif - YYUSE (yytype); + YYUSE (yytype); } @@ -955,20 +938,20 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, usc #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, ctx, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - uscxml::PromelaParser* ctx; - void * scanner; +FILE *yyoutput; +int yytype; +YYSTYPE const * const yyvaluep; +uscxml::PromelaParser* ctx; +void * scanner; #endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx, scanner); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx, scanner); + YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. @@ -983,17 +966,16 @@ yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yytype_int16 *yybottom; +yytype_int16 *yytop; #endif { - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ @@ -1014,26 +996,25 @@ yy_reduce_print (YYSTYPE *yyvsp, int yyrule, uscxml::PromelaParser* ctx, void * #else static void yy_reduce_print (yyvsp, yyrule, ctx, scanner) - YYSTYPE *yyvsp; - int yyrule; - uscxml::PromelaParser* ctx; - void * scanner; +YYSTYPE *yyvsp; +int yyrule; +uscxml::PromelaParser* ctx; +void * scanner; #endif { - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , ctx, scanner); - YYFPRINTF (stderr, "\n"); - } + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , ctx, scanner); + YYFPRINTF (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ @@ -1084,13 +1065,13 @@ yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) - const char *yystr; +const char *yystr; #endif { - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; } # endif # endif @@ -1108,17 +1089,17 @@ yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; +char *yydest; +const char *yysrc; #endif { - char *yyd = yydest; - const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; + while ((*yyd++ = *yys++) != '\0') + continue; - return yyd - 1; + return yyd - 1; } # endif # endif @@ -1132,42 +1113,40 @@ yystpcpy (yydest, yysrc) null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; +yytnamerr (char *yyres, const char *yystr) { + if (*yystr == '"') { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } +do_not_strip_quotes: + ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; } # endif @@ -1181,133 +1160,123 @@ yytnamerr (char *yyres, const char *yystr) required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { + yytype_int16 *yyssp, int yytoken) { + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } else { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ @@ -1323,22 +1292,22 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, uscxml::PromelaPar #else static void yydestruct (yymsg, yytype, yyvaluep, ctx, scanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - uscxml::PromelaParser* ctx; - void * scanner; +const char *yymsg; +int yytype; +YYSTYPE *yyvaluep; +uscxml::PromelaParser* ctx; +void * scanner; #endif { - YYUSE (yyvaluep); - YYUSE (ctx); - YYUSE (scanner); + YYUSE (yyvaluep); + YYUSE (ctx); + YYUSE (scanner); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - YYUSE (yytype); + YYUSE (yytype); } @@ -1356,7 +1325,7 @@ yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; +void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1366,17 +1335,17 @@ yyparse (uscxml::PromelaParser* ctx, void * scanner) #else int yyparse (ctx, scanner) - uscxml::PromelaParser* ctx; - void * scanner; +uscxml::PromelaParser* ctx; +void * scanner; #endif #endif { -/* The lookahead symbol. */ -int yychar; + /* The lookahead symbol. */ + int yychar; #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ + /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ @@ -1384,9 +1353,9 @@ int yychar; # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -static YYSTYPE yyval_default; + /* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ + static YYSTYPE yyval_default; # define YY_INITIAL_VALUE(Value) = Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN @@ -1397,993 +1366,975 @@ static YYSTYPE yyval_default; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); + /* The semantic value of the lookahead symbol. */ + YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - /* Number of syntax errors so far. */ - int yynerrs; + /* Number of syntax errors so far. */ + int yynerrs; - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - YYSIZE_T yystacksize; + YYSIZE_T yystacksize; - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; #if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); + YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + /*------------------------------------------------------------. + | yynewstate -- Push a new state, which is found in yystate. | + `------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; - yysetstate: - *yyssp = yystate; +yysetstate: + *yyssp = yystate; - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + if (yyss + yystacksize - 1 <= yyssp) { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; + goto yyexhaustedlab; # else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } # endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; + if (yystate == YYFINAL) + YYACCEPT; - goto yybackup; + goto yybackup; -/*-----------. -| yybackup. | -`-----------*/ + /*-----------. + | yybackup. | + `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } else { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ + /*-----------------------------. + | yyreduce -- Do a reduction. | + `-----------------------------*/ yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -/* Line 1787 of yacc.c */ + YY_REDUCE_PRINT (yyn); + switch (yyn) { + case 2: + /* Line 1787 of yacc.c */ #line 84 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_DECL; - } - break; - - case 3: -/* Line 1787 of yacc.c */ + { + ctx->ast = (yyvsp[(1) - (1)].node); + ctx->type = PromelaParser::PROMELA_DECL; + } + break; + + case 3: + /* Line 1787 of yacc.c */ #line 88 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_EXPR; - } - break; - - case 4: -/* Line 1787 of yacc.c */ + { + ctx->ast = (yyvsp[(1) - (1)].node); + ctx->type = PromelaParser::PROMELA_EXPR; + } + break; + + case 4: + /* Line 1787 of yacc.c */ #line 92 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_STMNT; - } - break; - - case 5: -/* Line 1787 of yacc.c */ + { + ctx->ast = (yyvsp[(1) - (1)].node); + ctx->type = PromelaParser::PROMELA_STMNT; + } + break; + + case 5: + /* Line 1787 of yacc.c */ #line 98 "promela.ypp" - {} - break; + {} + break; - case 6: -/* Line 1787 of yacc.c */ + case 6: + /* Line 1787 of yacc.c */ #line 101 "promela.ypp" - { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); } - break; + { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); free((yyvsp[(1) - (1)].value)); } + break; - case 7: -/* Line 1787 of yacc.c */ + case 7: + /* Line 1787 of yacc.c */ #line 102 "promela.ypp" - { (yyval.node) = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); } - break; + { (yyval.node) = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); free((yyvsp[(1) - (4)].value)); } + break; - case 8: -/* Line 1787 of yacc.c */ + case 8: + /* Line 1787 of yacc.c */ #line 105 "promela.ypp" - {} - break; + {} + break; - case 9: -/* Line 1787 of yacc.c */ + case 9: + /* Line 1787 of yacc.c */ #line 106 "promela.ypp" - {} - break; + {} + break; - case 10: -/* Line 1787 of yacc.c */ + case 10: + /* Line 1787 of yacc.c */ #line 109 "promela.ypp" - {} - break; + {} + break; - case 11: -/* Line 1787 of yacc.c */ + case 11: + /* Line 1787 of yacc.c */ #line 110 "promela.ypp" - {} - break; + {} + break; - case 12: -/* Line 1787 of yacc.c */ + case 12: + /* Line 1787 of yacc.c */ #line 120 "promela.ypp" - { (yyval.node) = (yyvsp[(2) - (3)].node); } - break; + { (yyval.node) = (yyvsp[(2) - (3)].node); } + break; - case 13: -/* Line 1787 of yacc.c */ + case 13: + /* Line 1787 of yacc.c */ #line 121 "promela.ypp" - { (yyval.node) = ctx->node(PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 14: -/* Line 1787 of yacc.c */ + case 14: + /* Line 1787 of yacc.c */ #line 122 "promela.ypp" - { (yyval.node) = ctx->node(MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 15: -/* Line 1787 of yacc.c */ + case 15: + /* Line 1787 of yacc.c */ #line 123 "promela.ypp" - { (yyval.node) = ctx->node(TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 16: -/* Line 1787 of yacc.c */ + case 16: + /* Line 1787 of yacc.c */ #line 124 "promela.ypp" - { (yyval.node) = ctx->node(DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 17: -/* Line 1787 of yacc.c */ + case 17: + /* Line 1787 of yacc.c */ #line 125 "promela.ypp" - { (yyval.node) = ctx->node(MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 18: -/* Line 1787 of yacc.c */ + case 18: + /* Line 1787 of yacc.c */ #line 126 "promela.ypp" - { (yyval.node) = ctx->node(BITAND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(BITAND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 19: -/* Line 1787 of yacc.c */ + case 19: + /* Line 1787 of yacc.c */ #line 127 "promela.ypp" - { (yyval.node) = ctx->node(BITXOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(BITXOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 20: -/* Line 1787 of yacc.c */ + case 20: + /* Line 1787 of yacc.c */ #line 128 "promela.ypp" - { (yyval.node) = ctx->node(BITOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(BITOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 21: -/* Line 1787 of yacc.c */ + case 21: + /* Line 1787 of yacc.c */ #line 129 "promela.ypp" - { (yyval.node) = ctx->node(GT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(GT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 22: -/* Line 1787 of yacc.c */ + case 22: + /* Line 1787 of yacc.c */ #line 130 "promela.ypp" - { (yyval.node) = ctx->node(LT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(LT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 23: -/* Line 1787 of yacc.c */ + case 23: + /* Line 1787 of yacc.c */ #line 131 "promela.ypp" - { (yyval.node) = ctx->node(GE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(GE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 24: -/* Line 1787 of yacc.c */ + case 24: + /* Line 1787 of yacc.c */ #line 132 "promela.ypp" - { (yyval.node) = ctx->node(LE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(LE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 25: -/* Line 1787 of yacc.c */ + case 25: + /* Line 1787 of yacc.c */ #line 133 "promela.ypp" - { (yyval.node) = ctx->node(EQ, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(EQ, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 26: -/* Line 1787 of yacc.c */ + case 26: + /* Line 1787 of yacc.c */ #line 134 "promela.ypp" - { (yyval.node) = ctx->node(NE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(NE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 27: -/* Line 1787 of yacc.c */ + case 27: + /* Line 1787 of yacc.c */ #line 135 "promela.ypp" - { (yyval.node) = ctx->node(AND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(AND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 28: -/* Line 1787 of yacc.c */ + case 28: + /* Line 1787 of yacc.c */ #line 136 "promela.ypp" - { (yyval.node) = ctx->node(OR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(OR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 29: -/* Line 1787 of yacc.c */ + case 29: + /* Line 1787 of yacc.c */ #line 137 "promela.ypp" - { (yyval.node) = ctx->node(LSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(LSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 30: -/* Line 1787 of yacc.c */ + case 30: + /* Line 1787 of yacc.c */ #line 138 "promela.ypp" - { (yyval.node) = ctx->node(RSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(RSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 31: -/* Line 1787 of yacc.c */ + case 31: + /* Line 1787 of yacc.c */ #line 139 "promela.ypp" - { (yyval.node) = ctx->node(NEG, 1, (yyvsp[(2) - (2)].node)); } - break; + { (yyval.node) = ctx->node(NEG, 1, (yyvsp[(2) - (2)].node)); } + break; - case 32: -/* Line 1787 of yacc.c */ + case 32: + /* Line 1787 of yacc.c */ #line 140 "promela.ypp" - { (yyval.node) = ctx->node(MINUS, 1, (yyvsp[(2) - (2)].node)); } - break; + { (yyval.node) = ctx->node(MINUS, 1, (yyvsp[(2) - (2)].node)); } + break; - case 33: -/* Line 1787 of yacc.c */ + case 33: + /* Line 1787 of yacc.c */ #line 142 "promela.ypp" - { (yyval.node) = ctx->node(LEN, 1, (yyvsp[(3) - (4)].node)); } - break; + { (yyval.node) = ctx->node(LEN, 1, (yyvsp[(3) - (4)].node)); } + break; - case 34: -/* Line 1787 of yacc.c */ + case 34: + /* Line 1787 of yacc.c */ #line 143 "promela.ypp" - { } - break; + { } + break; - case 35: -/* Line 1787 of yacc.c */ + case 35: + /* Line 1787 of yacc.c */ #line 144 "promela.ypp" - { (yyval.node) = ctx->value(CONST, yylval.value); } - break; + { (yyval.node) = ctx->value(CONST, (yyvsp[(1) - (1)].value)); free((yyvsp[(1) - (1)].value)); } + break; - case 36: -/* Line 1787 of yacc.c */ + case 36: + /* Line 1787 of yacc.c */ #line 148 "promela.ypp" - { (yyval.node) = ctx->node(SHOW, 0); } - break; + { (yyval.node) = ctx->node(SHOW, 0); } + break; - case 37: -/* Line 1787 of yacc.c */ + case 37: + /* Line 1787 of yacc.c */ #line 149 "promela.ypp" - { (yyval.node) = ctx->node(HIDDEN, 0); } - break; + { (yyval.node) = ctx->node(HIDDEN, 0); } + break; - case 38: -/* Line 1787 of yacc.c */ + case 38: + /* Line 1787 of yacc.c */ #line 150 "promela.ypp" - { (yyval.node) = ctx->node(SHOW, 0); } - break; + { (yyval.node) = ctx->node(SHOW, 0); } + break; - case 39: -/* Line 1787 of yacc.c */ + case 39: + /* Line 1787 of yacc.c */ #line 151 "promela.ypp" - { (yyval.node) = ctx->node(ISLOCAL, 0); } - break; + { (yyval.node) = ctx->node(ISLOCAL, 0); } + break; - case 40: -/* Line 1787 of yacc.c */ + case 40: + /* Line 1787 of yacc.c */ #line 154 "promela.ypp" - { (yyval.node) = ctx->node(DECL, 3, (yyvsp[(1) - (3)].node), ctx->value(TYPE, (yyvsp[(2) - (3)].value)), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(DECL, 3, (yyvsp[(1) - (3)].node), ctx->value(TYPE, (yyvsp[(2) - (3)].value)), (yyvsp[(3) - (3)].node)); free((yyvsp[(2) - (3)].value)); } + break; - case 41: -/* Line 1787 of yacc.c */ + case 41: + /* Line 1787 of yacc.c */ #line 155 "promela.ypp" - { (yyval.node) = ctx->node(UNAME, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(UNAME, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 42: -/* Line 1787 of yacc.c */ + case 42: + /* Line 1787 of yacc.c */ #line 156 "promela.ypp" - { (yyval.node) = ctx->node(DECL, 3, (yyvsp[(1) - (6)].node), ctx->value(TYPE, (yyvsp[(2) - (6)].value)), (yyvsp[(5) - (6)].node)); } - break; + { (yyval.node) = ctx->node(DECL, 3, (yyvsp[(1) - (6)].node), ctx->value(TYPE, (yyvsp[(2) - (6)].value)), (yyvsp[(5) - (6)].node)); free((yyvsp[(2) - (6)].value)); } + break; - case 43: -/* Line 1787 of yacc.c */ + case 43: + /* Line 1787 of yacc.c */ #line 159 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; - case 44: -/* Line 1787 of yacc.c */ + case 44: + /* Line 1787 of yacc.c */ #line 160 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (2)].node); } - break; + { (yyval.node) = (yyvsp[(1) - (2)].node); } + break; - case 45: -/* Line 1787 of yacc.c */ + case 45: + /* Line 1787 of yacc.c */ #line 161 "promela.ypp" - { - (yyval.node) = ctx->node(DECLLIST, 1, (yyvsp[(1) - (3)].node)); - if((yyvsp[(3) - (3)].node)->type == DECLLIST) { - (yyval.node)->merge((yyvsp[(3) - (3)].node)); delete (yyvsp[(3) - (3)].node); - } else { - (yyval.node)->push((yyvsp[(3) - (3)].node)); - } - } - break; - - case 46: -/* Line 1787 of yacc.c */ + { + (yyval.node) = ctx->node(DECLLIST, 1, (yyvsp[(1) - (3)].node)); + if((yyvsp[(3) - (3)].node)->type == DECLLIST) { + (yyval.node)->merge((yyvsp[(3) - (3)].node)); + delete (yyvsp[(3) - (3)].node); + } else { + (yyval.node)->push((yyvsp[(3) - (3)].node)); + } + } + break; + + case 46: + /* Line 1787 of yacc.c */ #line 171 "promela.ypp" - { (yyval.node) = ctx->node(VARLIST, 1, (yyvsp[(1) - (1)].node)); } - break; + { (yyval.node) = ctx->node(VARLIST, 1, (yyvsp[(1) - (1)].node)); } + break; - case 47: -/* Line 1787 of yacc.c */ + case 47: + /* Line 1787 of yacc.c */ #line 172 "promela.ypp" - { (yyval.node) = ctx->node(VARLIST, 1, (yyvsp[(1) - (3)].node)); (yyval.node)->merge((yyvsp[(3) - (3)].node)); delete (yyvsp[(3) - (3)].node); } - break; + { (yyval.node) = ctx->node(VARLIST, 1, (yyvsp[(1) - (3)].node)); (yyval.node)->merge((yyvsp[(3) - (3)].node)); delete (yyvsp[(3) - (3)].node); } + break; - case 48: -/* Line 1787 of yacc.c */ + case 48: + /* Line 1787 of yacc.c */ #line 175 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; - case 49: -/* Line 1787 of yacc.c */ + case 49: + /* Line 1787 of yacc.c */ #line 176 "promela.ypp" - { (yyval.node) = ctx->node(ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 50: -/* Line 1787 of yacc.c */ + case 50: + /* Line 1787 of yacc.c */ #line 179 "promela.ypp" - { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); } - break; + { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); free((yyvsp[(1) - (1)].value)); } + break; - case 51: -/* Line 1787 of yacc.c */ + case 51: + /* Line 1787 of yacc.c */ #line 180 "promela.ypp" - { (yyval.node) = ctx->node(COLON, 2, ctx->value(NAME, (yyvsp[(1) - (3)].value)), ctx->value(CONST, (yyvsp[(3) - (3)].value))); } - break; + { (yyval.node) = ctx->node(COLON, 2, ctx->value(NAME, (yyvsp[(1) - (3)].value)), ctx->value(CONST, (yyvsp[(3) - (3)].value))); free((yyvsp[(1) - (3)].value)); free((yyvsp[(3) - (3)].value)); } + break; - case 52: -/* Line 1787 of yacc.c */ + case 52: + /* Line 1787 of yacc.c */ #line 181 "promela.ypp" - { (yyval.node) = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); } - break; + { (yyval.node) = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); free((yyvsp[(1) - (4)].value)); } + break; - case 53: -/* Line 1787 of yacc.c */ + case 53: + /* Line 1787 of yacc.c */ #line 184 "promela.ypp" - { (yyval.node) = ctx->value(CONST, yylval.value); } - break; + { (yyval.node) = ctx->value(CONST, (yyvsp[(1) - (1)].value)); free((yyvsp[(1) - (1)].value)); } + break; - case 54: -/* Line 1787 of yacc.c */ + case 54: + /* Line 1787 of yacc.c */ #line 185 "promela.ypp" - { (yyval.node) = ctx->node(MINUS, 1, (yyvsp[(2) - (2)].node)); } - break; + { (yyval.node) = ctx->node(MINUS, 1, (yyvsp[(2) - (2)].node)); } + break; - case 55: -/* Line 1787 of yacc.c */ + case 55: + /* Line 1787 of yacc.c */ #line 186 "promela.ypp" - { (yyval.node) = (yyvsp[(2) - (3)].node); } - break; + { (yyval.node) = (yyvsp[(2) - (3)].node); } + break; - case 56: -/* Line 1787 of yacc.c */ + case 56: + /* Line 1787 of yacc.c */ #line 187 "promela.ypp" - { (yyval.node) = ctx->node(PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 57: -/* Line 1787 of yacc.c */ + case 57: + /* Line 1787 of yacc.c */ #line 188 "promela.ypp" - { (yyval.node) = ctx->node(MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 58: -/* Line 1787 of yacc.c */ + case 58: + /* Line 1787 of yacc.c */ #line 189 "promela.ypp" - { (yyval.node) = ctx->node(TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 59: -/* Line 1787 of yacc.c */ + case 59: + /* Line 1787 of yacc.c */ #line 190 "promela.ypp" - { (yyval.node) = ctx->node(DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 60: -/* Line 1787 of yacc.c */ + case 60: + /* Line 1787 of yacc.c */ #line 191 "promela.ypp" - { (yyval.node) = ctx->node(MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; + { (yyval.node) = ctx->node(MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 61: -/* Line 1787 of yacc.c */ + case 61: + /* Line 1787 of yacc.c */ #line 194 "promela.ypp" - { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); } - break; + { (yyval.node) = ctx->value(NAME, (yyvsp[(1) - (1)].value)); free((yyvsp[(1) - (1)].value)); } + break; - case 62: -/* Line 1787 of yacc.c */ + case 62: + /* Line 1787 of yacc.c */ #line 195 "promela.ypp" - { - if ((yyvsp[(1) - (2)].node)->type == NAME) { - (yyval.node) = ctx->node(NAMELIST, 1, (yyvsp[(1) - (2)].node)); - (yyval.node)->push(ctx->value(NAME, (yyvsp[(2) - (2)].value))); - } else { - (yyvsp[(1) - (2)].node)->push(ctx->value(NAME, (yyvsp[(2) - (2)].value))); - } - } - break; - - case 63: -/* Line 1787 of yacc.c */ -#line 203 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (2)].node); } - break; - - case 64: -/* Line 1787 of yacc.c */ -#line 206 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 65: -/* Line 1787 of yacc.c */ + { + if ((yyvsp[(1) - (2)].node)->type == NAME) { + (yyval.node) = ctx->node(NAMELIST, 1, (yyvsp[(1) - (2)].node)); + (yyval.node)->push(ctx->value(NAME, (yyvsp[(2) - (2)].value))); + } else { + (yyvsp[(1) - (2)].node)->push(ctx->value(NAME, (yyvsp[(2) - (2)].value))); + } + free((yyvsp[(2) - (2)].value)); + } + break; + + case 63: + /* Line 1787 of yacc.c */ +#line 204 "promela.ypp" + { (yyval.node) = (yyvsp[(1) - (2)].node); } + break; + + case 64: + /* Line 1787 of yacc.c */ #line 207 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (2)].node); } - break; + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; - case 66: -/* Line 1787 of yacc.c */ + case 65: + /* Line 1787 of yacc.c */ #line 208 "promela.ypp" - { (yyval.node) = ctx->node(STMNT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; - - case 67: -/* Line 1787 of yacc.c */ -#line 211 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 68: -/* Line 1787 of yacc.c */ -#line 214 "promela.ypp" - { (yyval.node) = ctx->node(ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; - - case 69: -/* Line 1787 of yacc.c */ + { (yyval.node) = (yyvsp[(1) - (2)].node); } + break; + + case 66: + /* Line 1787 of yacc.c */ +#line 209 "promela.ypp" + { (yyval.node) = ctx->node(STMNT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; + + case 67: + /* Line 1787 of yacc.c */ +#line 212 "promela.ypp" + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; + + case 68: + /* Line 1787 of yacc.c */ #line 215 "promela.ypp" - { (yyval.node) = ctx->node(INCR, 1, (yyvsp[(1) - (2)].node)); } - break; + { (yyval.node) = ctx->node(ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; - case 70: -/* Line 1787 of yacc.c */ + case 69: + /* Line 1787 of yacc.c */ #line 216 "promela.ypp" - { (yyval.node) = ctx->node(DECR, 1, (yyvsp[(1) - (2)].node)); } - break; + { (yyval.node) = ctx->node(INCR, 1, (yyvsp[(1) - (2)].node)); } + break; - case 71: -/* Line 1787 of yacc.c */ + case 70: + /* Line 1787 of yacc.c */ #line 217 "promela.ypp" - { (yyval.node) = ctx->node(PRINT, 2, ctx->value(STRING, (yyvsp[(3) - (5)].value)), (yyvsp[(4) - (5)].node)); } - break; + { (yyval.node) = ctx->node(DECR, 1, (yyvsp[(1) - (2)].node)); } + break; - case 72: -/* Line 1787 of yacc.c */ + case 71: + /* Line 1787 of yacc.c */ #line 218 "promela.ypp" - { (yyval.node) = ctx->node(PRINTM, 1, (yyvsp[(3) - (4)].node)); } - break; + { (yyval.node) = ctx->node(PRINT, 2, ctx->value(STRING, (yyvsp[(3) - (5)].value)), (yyvsp[(4) - (5)].node)); free((yyvsp[(3) - (5)].value)); } + break; - case 73: -/* Line 1787 of yacc.c */ + case 72: + /* Line 1787 of yacc.c */ #line 219 "promela.ypp" - { (yyval.node) = ctx->node(PRINTM, 1, ctx->value(CONST, (yyvsp[(3) - (4)].value))); } - break; + { (yyval.node) = ctx->node(PRINTM, 1, (yyvsp[(3) - (4)].node)); } + break; - case 74: -/* Line 1787 of yacc.c */ + case 73: + /* Line 1787 of yacc.c */ #line 220 "promela.ypp" - { } - break; + { (yyval.node) = ctx->node(PRINTM, 1, ctx->value(CONST, (yyvsp[(3) - (4)].value))); free((yyvsp[(3) - (4)].value)); } + break; - case 75: -/* Line 1787 of yacc.c */ + case 74: + /* Line 1787 of yacc.c */ #line 221 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; - - case 76: -/* Line 1787 of yacc.c */ -#line 222 "promela.ypp" - { } - break; + { } + break; - case 77: -/* Line 1787 of yacc.c */ + case 75: + /* Line 1787 of yacc.c */ #line 222 "promela.ypp" - { } - break; - - case 78: -/* Line 1787 of yacc.c */ -#line 225 "promela.ypp" - { } - break; - - case 79: -/* Line 1787 of yacc.c */ + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; + + case 76: + /* Line 1787 of yacc.c */ +#line 223 "promela.ypp" + { } + break; + + case 77: + /* Line 1787 of yacc.c */ +#line 223 "promela.ypp" + { } + break; + + case 78: + /* Line 1787 of yacc.c */ #line 226 "promela.ypp" - { } - break; + { } + break; - case 80: -/* Line 1787 of yacc.c */ -#line 229 "promela.ypp" - { (yyval.node) = ctx->value(0, ""); } - break; + case 79: + /* Line 1787 of yacc.c */ +#line 227 "promela.ypp" + { } + break; - case 81: -/* Line 1787 of yacc.c */ + case 80: + /* Line 1787 of yacc.c */ #line 230 "promela.ypp" - { (yyval.node) = (yyvsp[(2) - (2)].node); } - break; + { (yyval.node) = ctx->value(0, ""); } + break; - case 82: -/* Line 1787 of yacc.c */ -#line 233 "promela.ypp" - { (yyval.node) = (yyvsp[(1) - (1)].node); } - break; + case 81: + /* Line 1787 of yacc.c */ +#line 231 "promela.ypp" + { (yyval.node) = (yyvsp[(2) - (2)].node); } + break; - case 83: -/* Line 1787 of yacc.c */ + case 82: + /* Line 1787 of yacc.c */ #line 234 "promela.ypp" - { (yyval.node) = ctx->node(0, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } - break; - - -/* Line 1787 of yacc.c */ -#line 2156 "promela.tab.cpp" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ + { (yyval.node) = (yyvsp[(1) - (1)].node); } + break; + + case 83: + /* Line 1787 of yacc.c */ +#line 235 "promela.ypp" + { (yyval.node) = ctx->node(0, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } + break; + + + /* Line 1787 of yacc.c */ +#line 2157 "promela.tab.cpp" + default: + break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + + /*------------------------------------. + | yyerrlab -- here on detecting error | + `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { + ++yynerrs; #if ! YYERROR_VERBOSE - yyerror (ctx, scanner, YY_("syntax error")); + yyerror (ctx, scanner, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (ctx, scanner, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } else { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (ctx, scanner, yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } # undef YYSYNTAX_ERROR #endif - } + } - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + if (yyerrstatus == 3) { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx, scanner); - yychar = YYEMPTY; + if (yychar <= YYEOF) { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else { + yydestruct ("Error: discarding", + yytoken, &yylval, ctx, scanner); + yychar = YYEMPTY; + } } - } - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ yyerrorlab: - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp, ctx, scanner); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END + yystate = yyn; + goto yynewstate; - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ yyacceptlab: - yyresult = 0; - goto yyreturn; + yyresult = 0; + goto yyreturn; -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ yyabortlab: - yyresult = 1; - goto yyreturn; + yyresult = 1; + goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ + /*-------------------------------------------------. + | yyexhaustedlab -- memory exhaustion comes here. | + `-------------------------------------------------*/ yyexhaustedlab: - yyerror (ctx, scanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ + yyerror (ctx, scanner, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ #endif yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, ctx, scanner); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx, scanner); - YYPOPSTACK (1); - } + if (yychar != YYEMPTY) { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, ctx, scanner); + } + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, ctx, scanner); + YYPOPSTACK (1); + } #ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + /* Make sure YYID is used. */ + return YYID (yyresult); } /* Line 2050 of yacc.c */ -#line 238 "promela.ypp" +#line 239 "promela.ypp" diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.ypp b/src/uscxml/plugins/datamodel/promela/parser/promela.ypp index b33ebd1..5d45c71 100644 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.ypp +++ b/src/uscxml/plugins/datamodel/promela/parser/promela.ypp @@ -98,8 +98,8 @@ program : varref : cmpnd {} ; -pfld : NAME { $$ = ctx->value(NAME, $1); } - | NAME '[' expr ']' { $$ = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, $1), $3); } +pfld : NAME { $$ = ctx->value(NAME, $1); free($1); } + | NAME '[' expr ']' { $$ = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, $1), $3); free($1); } ; cmpnd : pfld {} @@ -141,7 +141,7 @@ expr : '(' expr ')' { $$ = $2; } | LEN '(' varref ')' { $$ = ctx->node(LEN, 1, $3); } | varref { } - | CONST { $$ = ctx->value(CONST, yylval.value); } + | CONST { $$ = ctx->value(CONST, $1); free($1); } ; @@ -151,9 +151,9 @@ vis : /* empty */ { $$ = ctx->node(SHOW, 0); } | ISLOCAL { $$ = ctx->node(ISLOCAL, 0); } ; -one_decl: vis TYPE var_list { $$ = ctx->node(DECL, 3, $1, ctx->value(TYPE, $2), $3); } +one_decl: vis TYPE var_list { $$ = ctx->node(DECL, 3, $1, ctx->value(TYPE, $2), $3); free($2); } | vis UNAME var_list { $$ = ctx->node(UNAME, 2, $1, $3); } - | vis TYPE ASGN '{' nlst '}' { $$ = ctx->node(DECL, 3, $1, ctx->value(TYPE, $2), $5); } + | vis TYPE ASGN '{' nlst '}' { $$ = ctx->node(DECL, 3, $1, ctx->value(TYPE, $2), $5); free($2); } ; decl_lst: one_decl { $$ = $1; } @@ -176,12 +176,12 @@ ivar : vardcl { $$ = $1; } | vardcl ASGN expr { $$ = ctx->node(ASGN, 2, $1, $3); } ; -vardcl : NAME { $$ = ctx->value(NAME, $1); } - | NAME COLON CONST { $$ = ctx->node(COLON, 2, ctx->value(NAME, $1), ctx->value(CONST, $3)); } - | NAME '[' const_expr ']' { $$ = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, $1), $3); } +vardcl : NAME { $$ = ctx->value(NAME, $1); free($1); } + | NAME COLON CONST { $$ = ctx->node(COLON, 2, ctx->value(NAME, $1), ctx->value(CONST, $3)); free($1); free($3); } + | NAME '[' const_expr ']' { $$ = ctx->node(VAR_ARRAY, 2, ctx->value(NAME, $1), $3); free($1); } ; -const_expr: CONST { $$ = ctx->value(CONST, yylval.value); } +const_expr: CONST { $$ = ctx->value(CONST, $1); free($1); } | MINUS const_expr %prec MINUS { $$ = ctx->node(MINUS, 1, $2); } | '(' const_expr ')' { $$ = $2; } | const_expr PLUS const_expr { $$ = ctx->node(PLUS, 2, $1, $3); } @@ -191,7 +191,7 @@ const_expr: CONST { $$ = ctx->value(CONST, yylval.value); } | const_expr MODULO const_expr { $$ = ctx->node(MODULO, 2, $1, $3); } ; -nlst : NAME { $$ = ctx->value(NAME, $1); } +nlst : NAME { $$ = ctx->value(NAME, $1); free($1); } | nlst NAME { if ($1->type == NAME) { $$ = ctx->node(NAMELIST, 1, $1); @@ -199,6 +199,7 @@ nlst : NAME { $$ = ctx->value(NAME, $1); } } else { $1->push(ctx->value(NAME, $2)); } + free($2); } | nlst COMMA { $$ = $1; } ; @@ -214,9 +215,9 @@ stmnt : Stmnt { $$ = $1; } Stmnt : varref ASGN expr { $$ = ctx->node(ASGN, 2, $1, $3); } | varref INCR { $$ = ctx->node(INCR, 1, $1); } | varref DECR { $$ = ctx->node(DECR, 1, $1); } - | PRINT '(' STRING prargs ')' { $$ = ctx->node(PRINT, 2, ctx->value(STRING, $3), $4); } + | PRINT '(' STRING prargs ')' { $$ = ctx->node(PRINT, 2, ctx->value(STRING, $3), $4); free($3); } | PRINTM '(' varref ')' { $$ = ctx->node(PRINTM, 1, $3); } - | PRINTM '(' CONST ')' { $$ = ctx->node(PRINTM, 1, ctx->value(CONST, $3)); } + | PRINTM '(' CONST ')' { $$ = ctx->node(PRINTM, 1, ctx->value(CONST, $3)); free($3); } | ASSERT expr { } | expr { $$ = $1; } | varref ASGN INAME { } '(' args ')' Stmnt { } diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp index 27bf170..c3e82df 100644 --- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp +++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp @@ -54,7 +54,7 @@ boost::shared_ptr XPathDataModel::create(InterpreterImpl* interpr // dm->_xpath->setNamespaceContext(interpreter->getNSContext()); dm->_funcResolver.setInterpreter(interpreter); - dm->_xpath.setNamespaceContext(interpreter->getNSContext()); + dm->_xpath.setNamespaceContext(*interpreter->getNameSpaceInfo().nsContext); dm->_xpath.setFunctionResolver(dm->_funcResolver); dm->_xpath.setVariableResolver(dm->_varResolver); @@ -860,7 +860,7 @@ bool XPathFunctionIn::doEvaluate(const Node& context, continue; } } - return false; + return false; } return true; } diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.cpp b/src/uscxml/plugins/invoker/im/IMInvoker.cpp index 6de4063..d086a20 100644 --- a/src/uscxml/plugins/invoker/im/IMInvoker.cpp +++ b/src/uscxml/plugins/invoker/im/IMInvoker.cpp @@ -721,7 +721,7 @@ void IMInvoker::send(void *userdata, const std::string event) { if (ctx->sendReq.content.length() > 0) purple_conv_im_send(purple_conversation_get_im_data(conv), ctx->sendReq.content.c_str()); #endif - + #if 0 if (data.binary) { PurpleConnection *gc = purple_account_get_connection(ctx->instance->_account); @@ -770,7 +770,7 @@ void IMInvoker::send(void *userdata, const std::string event) { #else purple_account_add_buddy(ctx->instance->_account, buddy); #endif - + } else if (iequals(ctx->sendReq.name, "im.buddy.remove")) { std::string buddyName; Event::getParam(ctx->sendReq.params, "name", buddyName); diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp b/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp index 5237977..d3686f9 100644 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp +++ b/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp @@ -84,22 +84,22 @@ size_t IMAPInvoker::writeCurlData(void *ptr, size_t size, size_t nmemb, void *us size_t IMAPInvoker::readCurlData(void *ptr, size_t size, size_t nmemb, void *userdata) { if (!userdata) return 0; - + IMAPContext* ctx = (IMAPContext*)userdata; ctx->inContent << std::string((char*)ptr, size * nmemb); - + return size * nmemb; } - + void IMAPInvoker::send(const SendRequest& req) { IMAPContext* ctx = NULL; - + if (false) { } else if (iequals(req.name, "select")) { IMAPContext::Select* args = new IMAPContext::Select(); Event::getParam(req.params, "mailbox", args->mailbox); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_SELECT; ctx->arguments = args; @@ -107,7 +107,7 @@ void IMAPInvoker::send(const SendRequest& req) { } else if (iequals(req.name, "examine")) { IMAPContext::Examine* args = new IMAPContext::Examine(); Event::getParam(req.params, "mailbox", args->mailbox); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_EXAMINE; ctx->arguments = args; @@ -115,7 +115,7 @@ void IMAPInvoker::send(const SendRequest& req) { } else if (iequals(req.name, "delete")) { IMAPContext::Delete* args = new IMAPContext::Delete(); Event::getParam(req.params, "mailbox", args->mailbox); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_DELETE; ctx->arguments = args; @@ -124,7 +124,7 @@ void IMAPInvoker::send(const SendRequest& req) { IMAPContext::Rename* args = new IMAPContext::Rename(); Event::getParam(req.params, "mailbox", args->mailbox); Event::getParam(req.params, "name", args->newName); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_RENAME; ctx->arguments = args; @@ -132,7 +132,7 @@ void IMAPInvoker::send(const SendRequest& req) { } else if (iequals(req.name, "subscribe")) { IMAPContext::Subscribe* args = new IMAPContext::Subscribe(); Event::getParam(req.params, "mailbox", args->mailbox); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_SUBSCRIBE; ctx->arguments = args; @@ -140,7 +140,7 @@ void IMAPInvoker::send(const SendRequest& req) { } else if (iequals(req.name, "unsubscribe")) { IMAPContext::Unsubscribe* args = new IMAPContext::Unsubscribe(); Event::getParam(req.params, "mailbox", args->mailbox); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_UNSUBSCRIBE; ctx->arguments = args; @@ -149,7 +149,7 @@ void IMAPInvoker::send(const SendRequest& req) { IMAPContext::List* args = new IMAPContext::List(); Event::getParam(req.params, "mailbox", args->mailbox); Event::getParam(req.params, "reference", args->refName); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_LIST; ctx->arguments = args; @@ -158,7 +158,7 @@ void IMAPInvoker::send(const SendRequest& req) { IMAPContext::LSub* args = new IMAPContext::LSub(); Event::getParam(req.params, "mailbox", args->mailbox); Event::getParam(req.params, "reference", args->refName); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_LSUB; ctx->arguments = args; @@ -167,7 +167,7 @@ void IMAPInvoker::send(const SendRequest& req) { IMAPContext::Status* args = new IMAPContext::Status(); Event::getParam(req.params, "mailbox", args->mailbox); Event::getParam(req.params, "dataitems", args->dataItems); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_STATUS; ctx->arguments = args; @@ -181,107 +181,107 @@ void IMAPInvoker::send(const SendRequest& req) { if (!Event::getParam(req.params, "message", args->literal)) { args->literal = req.content; } - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_APPEND; ctx->arguments = args; } else if (iequals(req.name, "check")) { IMAPContext::Check* args = new IMAPContext::Check(); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_CHECK; ctx->arguments = args; } else if (iequals(req.name, "close")) { IMAPContext::Close* args = new IMAPContext::Close(); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_CLOSE; ctx->arguments = args; - + } else if (iequals(req.name, "expunge")) { IMAPContext::Expunge* args = new IMAPContext::Expunge(); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_EXPUNGE; ctx->arguments = args; - + } else if (iequals(req.name, "search")) { IMAPContext::Search* args = new IMAPContext::Search(); Event::getParam(req.params, "charset", args->charSet); Event::getParam(req.params, "criteria", args->criteria); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_SEARCH; ctx->arguments = args; - + } else if (iequals(req.name, "fetch")) { IMAPContext::Fetch* args = new IMAPContext::Fetch(); Event::getParam(req.params, "sequence", args->sequence); Event::getParam(req.params, "itemnames", args->itemNames); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_FETCH; ctx->arguments = args; - + } else if (iequals(req.name, "store")) { IMAPContext::Store* args = new IMAPContext::Store(); Event::getParam(req.params, "sequence", args->sequence); Event::getParam(req.params, "itemnames", args->itemNames); Event::getParam(req.params, "values", args->values); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_STORE; ctx->arguments = args; - + } else if (iequals(req.name, "copy")) { IMAPContext::Copy* args = new IMAPContext::Copy(); Event::getParam(req.params, "mailbox", args->mailbox); Event::getParam(req.params, "sequence", args->sequence); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_COPY; ctx->arguments = args; - + } else if (iequals(req.name, "uid")) { IMAPContext::UId* args = new IMAPContext::UId(); Event::getParam(req.params, "command", args->command); Event::getParam(req.params, "arguments", args->arguments); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_UID; ctx->arguments = args; - + } else if (boost::istarts_with(req.name, "x")) { IMAPContext::XExtension* args = new IMAPContext::XExtension(); args->command = req.name; Event::getParam(req.params, "arguments", args->arguments); - + ctx = new IMAPContext(); ctx->command = IMAPContext::IMAP_XEXTENSION; ctx->arguments = args; - + } - + if (ctx == NULL) { returnErrorExecution("Event '" + req.name + "' not known"); return; } - + Event::getParam(req.params, "verbose", ctx->verbose); Event::getParam(req.params, "ssl", ctx->useSSL); ctx->invoker = this; ctx->sendReq = req; - + _workQueue.push(ctx); } void IMAPInvoker::process(IMAPContext* ctx) { CURL* _curl; CURLcode curlError; - + // see http://curl.haxx.se/libcurl/c/imap-tls.html _curl = curl_easy_init(); if(_curl) { @@ -291,7 +291,7 @@ void IMAPInvoker::process(IMAPContext* ctx) { LOG(ERROR) << "Cannot set password: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_URL, _server.c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set server string: " << curl_easy_strerror(curlError); - + if (ctx->useSSL) { (curlError = curl_easy_setopt(_curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL)) == CURLE_OK || LOG(ERROR) << "Cannot use SSL: " << curl_easy_strerror(curlError); @@ -304,9 +304,9 @@ void IMAPInvoker::process(IMAPContext* ctx) { (curlError = curl_easy_setopt(_curl, CURLOPT_CAINFO, "/path/to/certificate.pem")) == CURLE_OK || LOG(ERROR) << "Cannot set CA info path: " << curl_easy_strerror(curlError); #endif - + } - + (curlError = curl_easy_setopt(_curl, CURLOPT_READFUNCTION, IMAPInvoker::writeCurlData)) == CURLE_OK || LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_READDATA, ctx)) == CURLE_OK || @@ -315,7 +315,7 @@ void IMAPInvoker::process(IMAPContext* ctx) { LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(_curl, CURLOPT_WRITEDATA, ctx)) == CURLE_OK || LOG(ERROR) << "Cannot register userdata for write function: " << curl_easy_strerror(curlError); - + if (ctx->verbose) { (curlError = curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L)) == CURLE_OK || LOG(ERROR) << "Cannot set curl to verbose: " << curl_easy_strerror(curlError); @@ -323,114 +323,114 @@ void IMAPInvoker::process(IMAPContext* ctx) { std::stringstream cmdSS; switch (ctx->command) { - case IMAPContext::IMAP_SELECT: { - IMAPContext::Select* cmd = (IMAPContext::Select*)ctx->arguments; - cmdSS << "SELECT " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_EXAMINE: { - IMAPContext::Examine* cmd = (IMAPContext::Examine*)ctx->arguments; - cmdSS << "EXAMINE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_CREATE: { - IMAPContext::Create* cmd = (IMAPContext::Create*)ctx->arguments; - cmdSS << "CREATE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_DELETE: { - IMAPContext::Delete* cmd = (IMAPContext::Delete*)ctx->arguments; - cmdSS << "DELETE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_RENAME: { - IMAPContext::Rename* cmd = (IMAPContext::Rename*)ctx->arguments; - cmdSS << "RENAME " << "\"" << cmd->mailbox << "\" \"" << cmd->newName << "\""; - break; - } - case IMAPContext::IMAP_SUBSCRIBE: { - IMAPContext::Subscribe* cmd = (IMAPContext::Subscribe*)ctx->arguments; - cmdSS << "SUBSCRIBE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_UNSUBSCRIBE: { - IMAPContext::Unsubscribe* cmd = (IMAPContext::Unsubscribe*)ctx->arguments; - cmdSS << "UNSUBSCRIBE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_LIST: { - IMAPContext::List* cmd = (IMAPContext::List*)ctx->arguments; - cmdSS << "LIST " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; - break; - } - case IMAPContext::IMAP_LSUB: { - IMAPContext::LSub* cmd = (IMAPContext::LSub*)ctx->arguments; - cmdSS << "LSUB " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; - break; - } - case IMAPContext::IMAP_STATUS: { - IMAPContext::Status* cmd = (IMAPContext::Status*)ctx->arguments; - cmdSS << "STATUS " << "\"" << cmd->mailbox << "\" (" << cmd->dataItems << ")"; - break; - } - case IMAPContext::IMAP_APPEND: { - IMAPContext::Append* cmd = (IMAPContext::Append*)ctx->arguments; - cmdSS << "APPEND " << "\"" << cmd->mailbox << "\" (" << cmd->flags << ") {" << cmd->dateTime << "}"; - break; - } - case IMAPContext::IMAP_CHECK: { - cmdSS << "CHECK"; - break; - } - case IMAPContext::IMAP_CLOSE: { - cmdSS << "CLOSE"; - break; - } - case IMAPContext::IMAP_EXPUNGE: { - cmdSS << "EXPUNGE"; - break; - } - case IMAPContext::IMAP_SEARCH: { - IMAPContext::Search* cmd = (IMAPContext::Search*)ctx->arguments; - cmdSS << "SEARCH "; - if (cmd->charSet.size() > 0) { - cmdSS << "CHARSET " << cmd->charSet << " "; - } - cmdSS << cmd->criteria; - break; - } - case IMAPContext::IMAP_FETCH: { - IMAPContext::Fetch* cmd = (IMAPContext::Fetch*)ctx->arguments; - cmdSS << "FETCH " << cmd->sequence << " " << cmd->itemNames; - break; - } - case IMAPContext::IMAP_STORE: { - IMAPContext::Store* cmd = (IMAPContext::Store*)ctx->arguments; - cmdSS << "STORE " << cmd->sequence << " " << cmd->itemNames << " " << cmd->values; - break; - } - case IMAPContext::IMAP_COPY: { - IMAPContext::Copy* cmd = (IMAPContext::Copy*)ctx->arguments; - cmdSS << "COPY " << "\"" << cmd->mailbox << "\" " << cmd->sequence; - break; - } - case IMAPContext::IMAP_UID: { - IMAPContext::UId* cmd = (IMAPContext::UId*)ctx->arguments; - cmdSS << "UID " << cmd->command << " " << cmd->arguments; - break; - } - case IMAPContext::IMAP_XEXTENSION: { - IMAPContext::XExtension* cmd = (IMAPContext::XExtension*)ctx->arguments; - cmdSS << cmd->command << " " << cmd->arguments; - break; + case IMAPContext::IMAP_SELECT: { + IMAPContext::Select* cmd = (IMAPContext::Select*)ctx->arguments; + cmdSS << "SELECT " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_EXAMINE: { + IMAPContext::Examine* cmd = (IMAPContext::Examine*)ctx->arguments; + cmdSS << "EXAMINE " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_CREATE: { + IMAPContext::Create* cmd = (IMAPContext::Create*)ctx->arguments; + cmdSS << "CREATE " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_DELETE: { + IMAPContext::Delete* cmd = (IMAPContext::Delete*)ctx->arguments; + cmdSS << "DELETE " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_RENAME: { + IMAPContext::Rename* cmd = (IMAPContext::Rename*)ctx->arguments; + cmdSS << "RENAME " << "\"" << cmd->mailbox << "\" \"" << cmd->newName << "\""; + break; + } + case IMAPContext::IMAP_SUBSCRIBE: { + IMAPContext::Subscribe* cmd = (IMAPContext::Subscribe*)ctx->arguments; + cmdSS << "SUBSCRIBE " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_UNSUBSCRIBE: { + IMAPContext::Unsubscribe* cmd = (IMAPContext::Unsubscribe*)ctx->arguments; + cmdSS << "UNSUBSCRIBE " << "\"" << cmd->mailbox << "\""; + break; + } + case IMAPContext::IMAP_LIST: { + IMAPContext::List* cmd = (IMAPContext::List*)ctx->arguments; + cmdSS << "LIST " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; + break; + } + case IMAPContext::IMAP_LSUB: { + IMAPContext::LSub* cmd = (IMAPContext::LSub*)ctx->arguments; + cmdSS << "LSUB " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; + break; + } + case IMAPContext::IMAP_STATUS: { + IMAPContext::Status* cmd = (IMAPContext::Status*)ctx->arguments; + cmdSS << "STATUS " << "\"" << cmd->mailbox << "\" (" << cmd->dataItems << ")"; + break; + } + case IMAPContext::IMAP_APPEND: { + IMAPContext::Append* cmd = (IMAPContext::Append*)ctx->arguments; + cmdSS << "APPEND " << "\"" << cmd->mailbox << "\" (" << cmd->flags << ") {" << cmd->dateTime << "}"; + break; + } + case IMAPContext::IMAP_CHECK: { + cmdSS << "CHECK"; + break; + } + case IMAPContext::IMAP_CLOSE: { + cmdSS << "CLOSE"; + break; + } + case IMAPContext::IMAP_EXPUNGE: { + cmdSS << "EXPUNGE"; + break; + } + case IMAPContext::IMAP_SEARCH: { + IMAPContext::Search* cmd = (IMAPContext::Search*)ctx->arguments; + cmdSS << "SEARCH "; + if (cmd->charSet.size() > 0) { + cmdSS << "CHARSET " << cmd->charSet << " "; } - default: - break; + cmdSS << cmd->criteria; + break; + } + case IMAPContext::IMAP_FETCH: { + IMAPContext::Fetch* cmd = (IMAPContext::Fetch*)ctx->arguments; + cmdSS << "FETCH " << cmd->sequence << " " << cmd->itemNames; + break; + } + case IMAPContext::IMAP_STORE: { + IMAPContext::Store* cmd = (IMAPContext::Store*)ctx->arguments; + cmdSS << "STORE " << cmd->sequence << " " << cmd->itemNames << " " << cmd->values; + break; + } + case IMAPContext::IMAP_COPY: { + IMAPContext::Copy* cmd = (IMAPContext::Copy*)ctx->arguments; + cmdSS << "COPY " << "\"" << cmd->mailbox << "\" " << cmd->sequence; + break; + } + case IMAPContext::IMAP_UID: { + IMAPContext::UId* cmd = (IMAPContext::UId*)ctx->arguments; + cmdSS << "UID " << cmd->command << " " << cmd->arguments; + break; + } + case IMAPContext::IMAP_XEXTENSION: { + IMAPContext::XExtension* cmd = (IMAPContext::XExtension*)ctx->arguments; + cmdSS << cmd->command << " " << cmd->arguments; + break; + } + default: + break; } curl_easy_setopt(_curl, CURLOPT_CUSTOMREQUEST, cmdSS.str().c_str()); CURLcode res = curl_easy_perform(_curl); - + /* Check for errors */ if(res != CURLE_OK) { LOG(ERROR) << "curl_easy_perform() failed: " << curl_easy_strerror(res); @@ -441,30 +441,30 @@ void IMAPInvoker::process(IMAPContext* ctx) { #if 0 switch (ctx->command) { - case IMAPContext::LIST: - e.data = parseListReponse(ctx->inContent.str()); - break; - default: - break; + case IMAPContext::LIST: + e.data = parseListReponse(ctx->inContent.str()); + break; + default: + break; } #endif - + e.name = ctx->sendReq.name + ".success"; e.data.compound["raw"] = Data(ctx->inContent.str(), Data::VERBATIM); returnEvent(e); } - + /* Always cleanup */ curl_easy_cleanup(_curl); - + } } #if 0 Data IMAPInvoker::parseListReponse(const std::string& response) { Data data; - + std::string line; std::istringstream inSS(response); @@ -472,14 +472,14 @@ Data IMAPInvoker::parseListReponse(const std::string& response) { // individual lines size_t lastSep = line.find_last_of("\" "); if (lastSep != std::string::npos) { - + } } - + return data; } #endif - + void IMAPInvoker::cancel(const std::string sendId) { } @@ -487,7 +487,7 @@ void IMAPInvoker::invoke(const InvokeRequest& req) { Event::getParam(req.params, "username", _username); Event::getParam(req.params, "password", _password); Event::getParam(req.params, "server", _server); - + _isRunning = true; _thread = new tthread::thread(IMAPInvoker::run, this); } diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h b/src/uscxml/plugins/invoker/imap/IMAPInvoker.h index 94d199b..b1da324 100644 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h +++ b/src/uscxml/plugins/invoker/imap/IMAPInvoker.h @@ -52,37 +52,37 @@ public: protected: class IMAPContext { - + public: enum Cmd { - // valid in authenticated state - IMAP_SELECT, - IMAP_EXAMINE, - IMAP_CREATE, - IMAP_DELETE, - IMAP_RENAME, - IMAP_SUBSCRIBE, - IMAP_UNSUBSCRIBE, - IMAP_LIST, - IMAP_LSUB, - IMAP_STATUS, - IMAP_APPEND, - // valid in selected state - IMAP_CHECK, - IMAP_CLOSE, - IMAP_EXPUNGE, - IMAP_SEARCH, - IMAP_FETCH, - IMAP_STORE, - IMAP_COPY, - IMAP_UID, - IMAP_XEXTENSION, + // valid in authenticated state + IMAP_SELECT, + IMAP_EXAMINE, + IMAP_CREATE, + IMAP_DELETE, + IMAP_RENAME, + IMAP_SUBSCRIBE, + IMAP_UNSUBSCRIBE, + IMAP_LIST, + IMAP_LSUB, + IMAP_STATUS, + IMAP_APPEND, + // valid in selected state + IMAP_CHECK, + IMAP_CLOSE, + IMAP_EXPUNGE, + IMAP_SEARCH, + IMAP_FETCH, + IMAP_STORE, + IMAP_COPY, + IMAP_UID, + IMAP_XEXTENSION, }; struct MailboxOp { std::string mailbox; }; - + struct Select : MailboxOp {}; struct Examine : MailboxOp {}; struct Create : MailboxOp {}; @@ -127,12 +127,12 @@ protected: }; struct XExtension : UId {}; - + IMAPContext() : readPtr(0) {} void* arguments; Cmd command; - + IMAPInvoker* invoker; SendRequest sendReq; std::stringstream inContent; @@ -149,7 +149,7 @@ protected: std::string _server; static void run(void*); - + tthread::thread* _thread; uscxml::concurrency::BlockingQueue _workQueue; bool _isRunning; diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp index f1d9ad1..37ec669 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp @@ -82,15 +82,7 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) { DataModel dataModel(_invokedInterpreter.getImpl()->getDataModel()); _invokedInterpreter.getImpl()->setParentQueue(&_parentQueue); // transfer namespace prefixes - _invokedInterpreter.getImpl()->_nsURL = _parentInterpreter->_nsURL; - _invokedInterpreter.getImpl()->_xpathPrefix = _parentInterpreter->_xpathPrefix; - _invokedInterpreter.getImpl()->_nsToPrefix = _parentInterpreter->_nsToPrefix; - std::map::iterator nsIter = _parentInterpreter->_nsToPrefix.begin(); - while(nsIter != _parentInterpreter->_nsToPrefix.end()) { - _invokedInterpreter.getImpl()->_nsContext.addNamespaceDeclaration(nsIter->first, nsIter->second); - nsIter++; - } - _invokedInterpreter.getImpl()->_xmlNSPrefix = _parentInterpreter->_xmlNSPrefix; + _invokedInterpreter.setNameSpaceInfo(_parentInterpreter->getNameSpaceInfo()); _invokedInterpreter.getImpl()->_sessionId = req.invokeid; /// test240 assumes that invoke request params will carry over to the datamodel diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp index 4129413..c84fd8f 100644 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp +++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp @@ -73,20 +73,20 @@ void UmundoInvoker::send(const SendRequest& req) { } else { msg.putMeta("event", "umundo"); } - + try { Data data = req.data; - + if (!data && req.content.length()) data = _interpreter->getDataModel().getStringAsData(req.content); - + if (!data) { LOG(ERROR) << "Cannot transform content to data object per datamodel or no data given"; return; } // std::cout << Data::toJSON(data) << std::endl; - + std::string type; if (req.params.find("type") != req.params.end()) { // we are supposed to build a typed object diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp index dda51b7..a080ff3 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp @@ -82,7 +82,7 @@ boost::shared_ptr SCXMLIOProcessor::create(InterpreterImpl* int Data SCXMLIOProcessor::getDataModelVariables() { Data data; if(_url.length() > 0) - data.compound["location"] = Data(_url, Data::VERBATIM); + data.compound["location"] = Data(_url, Data::VERBATIM); return data; } diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp index 69096fc..2d2b5e0 100644 --- a/src/uscxml/server/HTTPServer.cpp +++ b/src/uscxml/server/HTTPServer.cpp @@ -105,7 +105,7 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss LOG(ERROR) << "HTTP server cannot bind to tcp/" << _port; } } - + _wsPort = wsPort; if (_wsPort > 0) { _wsHandle = evws_bind_socket(_evws, _wsPort); @@ -443,7 +443,7 @@ void HTTPServer::processByMatchingServlet(const Request& request) { if (servletIter->first.length() == 0) { matches.insert(std::make_pair(servletPath, servletIter->second)); // single servlet at root } else if (iequals(actualPath.substr(0, servletPath.length()), servletPath) && // servlet path is a prefix - iequals(actualPath.substr(servletPath.length(), 1), "/")) { // and next character is a '/' + iequals(actualPath.substr(servletPath.length(), 1), "/")) { // and next character is a '/' matches.insert(std::make_pair(servletPath, servletIter->second)); } servletIter++; @@ -530,7 +530,7 @@ void HTTPServer::replyCallback(evutil_socket_t fd, short what, void *arg) { delete(reply); } - + void HTTPServer::wsSend(struct evws_connection *conn, enum evws_opcode opcode, const char *data, uint64_t length) { HTTPServer* INSTANCE = getInstance(); WSData* sendCB = new WSData(conn, NULL, opcode, data, length); @@ -553,10 +553,10 @@ void HTTPServer::wsSendCallback(evutil_socket_t fd, short what, void *arg) { evws_send_data(wsSend->conn, wsSend->opcode, wsSend->data.data(), wsSend->data.length()); } } - + delete wsSend; } - + bool HTTPServer::registerServlet(const std::string& path, HTTPServlet* servlet) { HTTPServer* INSTANCE = getInstance(); diff --git a/src/uscxml/server/HTTPServer.h b/src/uscxml/server/HTTPServer.h index 2003130..09a31df 100644 --- a/src/uscxml/server/HTTPServer.h +++ b/src/uscxml/server/HTTPServer.h @@ -108,7 +108,7 @@ public: static void unregisterServlet(WebSocketServlet* servlet); private: - + class WSData { public: WSData(struct evws_connection *conn_, const char *uri_, enum evws_opcode opcode_, const char *data_, uint64_t length_) { @@ -147,7 +147,7 @@ private: static void httpRecvReqCallback(struct evhttp_request *req, void *callbackData); static void wsRecvReqCallback(struct evws_connection *conn, struct evws_frame *, void *callbackData); - + void processByMatchingServlet(const Request& request); void processByMatchingServlet(evws_connection* conn, const WSFrame& frame); diff --git a/src/uscxml/server/InterpreterServlet.cpp b/src/uscxml/server/InterpreterServlet.cpp index b956820..303aad0 100644 --- a/src/uscxml/server/InterpreterServlet.cpp +++ b/src/uscxml/server/InterpreterServlet.cpp @@ -155,23 +155,23 @@ void InterpreterWebSocketServlet::send(const SendRequest& req) { if (false) { } else if (req.data.binary) { HTTPServer::wsSend(_requests[req.target], - EVWS_BINARY_FRAME, - req.data.binary->data, - req.data.binary->size); + EVWS_BINARY_FRAME, + req.data.binary->data, + req.data.binary->size); } else if (req.data.node) { std::stringstream ssXML; ssXML << req.data.node; std::string data = ssXML.str(); HTTPServer::wsSend(_requests[req.target], - EVWS_TEXT_FRAME, - data.c_str(), - data.length()); + EVWS_TEXT_FRAME, + data.c_str(), + data.length()); } else if (req.data) { std::string data = Data::toJSON(req.data); HTTPServer::wsSend(_requests[req.target], - EVWS_TEXT_FRAME, - data.c_str(), - data.length()); + EVWS_TEXT_FRAME, + data.c_str(), + data.length()); } else { LOG(WARNING) << "Not sure what to make off content given to send on websocket!"; } @@ -180,23 +180,23 @@ void InterpreterWebSocketServlet::send(const SendRequest& req) { if (false) { } else if (req.data.binary) { HTTPServer::wsBroadcast(req.target.c_str(), - EVWS_BINARY_FRAME, - req.data.binary->data, - req.data.binary->size); + EVWS_BINARY_FRAME, + req.data.binary->data, + req.data.binary->size); } else if (req.data.node) { std::stringstream ssXML; ssXML << req.data.node; std::string data = ssXML.str(); HTTPServer::wsBroadcast(req.target.c_str(), - EVWS_TEXT_FRAME, - data.c_str(), - data.length()); + EVWS_TEXT_FRAME, + data.c_str(), + data.length()); } else if (req.data) { std::string data = Data::toJSON(req.data); HTTPServer::wsBroadcast(req.target.c_str(), - EVWS_TEXT_FRAME, - data.c_str(), - data.length()); + EVWS_TEXT_FRAME, + data.c_str(), + data.length()); } else { LOG(WARNING) << "Not sure what to make off content given to broadcast on websocket!"; } diff --git a/src/uscxml/transform/ChartToFSM.cpp b/src/uscxml/transform/ChartToFSM.cpp index d962481..8b1725c 100644 --- a/src/uscxml/transform/ChartToFSM.cpp +++ b/src/uscxml/transform/ChartToFSM.cpp @@ -19,6 +19,8 @@ #include "uscxml/transform/ChartToFSM.h" #include +#include + #include #include "uscxml/UUID.h" #include @@ -34,7 +36,9 @@ using namespace Arabica::XPath; #define CREATE_TRANSIENT_STATE_WITH_CHILDS \ if (childs.size() > 0) { \ - Element transientState = _flatDoc.createElementNS(xmlNs, "state"); \ + Element transientState = _flatDoc.createElementNS(_nsInfo.nsURL, "state"); \ + _nsInfo.setPrefix(transientState);\ + transientState.setAttribute("transient", "true"); \ for (int i = 0; i < childs.size(); i++) { \ Node imported = _flatDoc.importNode(childs[i], true); \ transientState.appendChild(imported); \ @@ -43,19 +47,24 @@ if (childs.size() > 0) { \ } \ childs = NodeSet(); -Document ChartToFSM::flatten(const Document& doc, const std::map& nameSpaceInfo) { - boost::shared_ptr flatInterpreter = boost::shared_ptr(new FlatteningInterpreter(doc)); - flatInterpreter->setNameSpaceInfo(nameSpaceInfo); - flatInterpreter->interpret(); - return flatInterpreter->getDocument(); +Interpreter ChartToFSM::flatten(const Interpreter& other) { + + // instantiate a new InterpreterImpl to do the flattening + boost::shared_ptr flattener = boost::shared_ptr(new FlatteningInterpreter(other.getDocument())); + flattener->setNameSpaceInfo(other.getNameSpaceInfo()); + flattener->interpret(); + + // clone the flattener implementation to a new interpreter + Interpreter flat = Interpreter::fromClone(flattener); + return flat; } FlatteningInterpreter::FlatteningInterpreter(const Document& doc) { - + _currGlobalTransition = NULL; - - // kust copy given doc into _document an create _flatDoc for the FSM + + // just copy given doc into _document an create _flatDoc for the FSM DOMImplementation domFactory = Arabica::SimpleDOM::DOMImplementation::getDOMImplementation(); _document = domFactory.createDocument(doc.getNamespaceURI(), "", 0); _flatDoc = domFactory.createDocument(doc.getNamespaceURI(), "", 0); @@ -70,10 +79,24 @@ FlatteningInterpreter::FlatteningInterpreter(const Document& doc) { addMonitor(this); } -Document& FlatteningInterpreter::getDocument() { - std::cout << "######################" << std::endl; - std::cout << _flatDoc << std::endl; - std::cout << "######################" << std::endl; +FlatteningInterpreter::~FlatteningInterpreter() { + std::map::iterator confIter = _globalConf.begin(); + while(confIter != _globalConf.end()) { + std::map::iterator transIter = confIter->second->outgoing.begin(); + while (transIter != confIter->second->outgoing.end()) { + delete transIter->second; + transIter++; + } + delete confIter->second; + confIter++; + } + +} + +Document FlatteningInterpreter::getDocument() const { +// std::cout << "######################" << std::endl; +// std::cout << _flatDoc << std::endl; +// std::cout << "######################" << std::endl; return _flatDoc; } @@ -81,7 +104,7 @@ void FlatteningInterpreter::interpret() { init(); setupIOProcessors(); - + // initialize the datamodel std::string datamodelName; if (datamodelName.length() == 0 && HAS_ATTR(_scxml, "datamodel")) @@ -99,20 +122,19 @@ void FlatteningInterpreter::interpret() { _dataModel = _factory->createDataModel("null", this); } if(datamodelName.length() > 0 && !_dataModel) { - std::cout << "No datamodel for " << datamodelName << " registered"; - } - - if (_dataModel) { - _dataModel.assign("_x.args", _cmdLineOptions); + LOG(ERROR) << "No datamodel for " << datamodelName << " registered"; } - + _binding = (HAS_ATTR(_scxml, "binding") && iequals(ATTR(_scxml, "binding"), "late") ? LATE : EARLY); - + // reset + _globalConf.clear(); + _currGlobalTransition = NULL; + // very first state _start = new GlobalState(_configuration, _alreadyEntered, _historyValue); _globalConf[_start->stateId] = _start; - + NodeSet initialTransitions; // enter initial configuration @@ -120,9 +142,11 @@ void FlatteningInterpreter::interpret() { initialStates = getInitialStates(); assert(initialStates.size() > 0); for (int i = 0; i < initialStates.size(); i++) { - Element initialElem = _document.createElementNS(_nsURL, "initial"); + Element initialElem = _document.createElementNS(_nsInfo.nsURL, "initial"); + _nsInfo.setPrefix(initialElem); initialElem.setAttribute("generated", "true"); - Element transitionElem = _document.createElementNS(_nsURL, "transition"); + Element transitionElem = _document.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transitionElem); transitionElem.setAttribute("target", ATTR(initialStates[i], "id")); initialElem.appendChild(transitionElem); _scxml.appendChild(initialElem); @@ -130,8 +154,8 @@ void FlatteningInterpreter::interpret() { } labelTransitions(); weightTransitions(); - - std::cout << _scxml << std::endl; + +// std::cout << _scxml << std::endl; GlobalTransition* globalTransition = new GlobalTransition(initialTransitions, _dataModel); _start->outgoing[globalTransition->transitionId] = globalTransition; @@ -140,22 +164,22 @@ void FlatteningInterpreter::interpret() { enterStates(initialTransitions); explode(); - + #if 0 // print set of global configurations for(std::map::iterator globalConfIter = _globalConf.begin(); - globalConfIter != _globalConf.end(); - globalConfIter++) { + globalConfIter != _globalConf.end(); + globalConfIter++) { std::cout << globalConfIter->first << std::endl; } std::cout << _globalConf.size() << std::endl; #endif - + createDocument(); } void FlatteningInterpreter::executeContent(const Arabica::DOM::Node& content, bool rethrow) { - std::cout << content << std::endl; +// std::cout << content << std::endl; GlobalTransition::Action action; if (false) { @@ -199,51 +223,55 @@ void FlatteningInterpreter::cancelInvoke(const Arabica::DOM::Node& } void FlatteningInterpreter::internalDoneSend(const Arabica::DOM::Node& state) { - + if (!isState(state)) return; Arabica::DOM::Element stateElem = (Arabica::DOM::Element)state; // if (parentIsScxmlState(state)) // return; - + // std::cout << "internalDoneSend: " << state << std::endl; - + // create onentry with a raise element - Element onentry = _flatDoc.createElement("onentry"); - Element raise = _flatDoc.createElement("raise"); + Element onentry = _flatDoc.createElementNS(_nsInfo.nsURL, "onentry"); + _nsInfo.setPrefix(onentry); + + Element raise = _flatDoc.createElementNS(_nsInfo.nsURL, "raise"); + _nsInfo.setPrefix(raise); + onentry.appendChild(raise); - Arabica::XPath::NodeSet doneDatas = filterChildElements(_xmlNSPrefix + "donedata", stateElem); + Arabica::XPath::NodeSet doneDatas = filterChildElements(_nsInfo.xmlNSPrefix + "donedata", stateElem); if (doneDatas.size() > 0) { Arabica::DOM::Node doneData = doneDatas[0]; - Arabica::XPath::NodeSet contents = filterChildElements(_xmlNSPrefix + "content", doneDatas[0]); + Arabica::XPath::NodeSet contents = filterChildElements(_nsInfo.xmlNSPrefix + "content", doneDatas[0]); if (contents.size() > 0) { Node imported = _flatDoc.importNode(contents[0], true); raise.appendChild(imported); } - Arabica::XPath::NodeSet params = filterChildElements(_xmlNSPrefix + "param", doneDatas[0]); + Arabica::XPath::NodeSet params = filterChildElements(_nsInfo.xmlNSPrefix + "param", doneDatas[0]); if (params.size() > 0) { Node imported = _flatDoc.importNode(params[0], true); raise.appendChild(imported); } } - + raise.setAttribute("event", "done.state." + ATTR(stateElem.getParentNode(), "id")); // parent?! - + GlobalTransition::Action action; action.onEntry = onentry; - + _currGlobalTransition->actions.push_back(action); - + } static bool isSuperset(const GlobalTransition* t1, const GlobalTransition* t2) { bool isSuperset = true; - + if (t1->transitions.size() >= t2->transitions.size()) return false; - + for (int i = 0; i < t1->transitions.size(); i++) { if (!InterpreterImpl::isMember(t1->transitions[i], t2->transitions)) { isSuperset = false; @@ -251,7 +279,7 @@ static bool isSuperset(const GlobalTransition* t1, const GlobalTransition* t2) { } return isSuperset; } - + static NodeSet filterChildEnabled(const NodeSet& transitions) { // drop any transition that is already enabled by a child NodeSet filteredTransitions; @@ -269,7 +297,7 @@ static NodeSet filterChildEnabled(const NodeSet& trans std::string eventDesc1 = ATTR(t1, "event"); std::string eventDesc2 = ATTR(t2, "event"); if (InterpreterImpl::nameMatch(eventDesc1, eventDesc2)) { - std::cout << "Dropping " << t1 << std::endl << "for " << t2 << std::endl; +// std::cout << "Dropping " << t1 << std::endl << "for " << t2 << std::endl; goto SKIP_TRANSITION; } } @@ -277,7 +305,8 @@ static NodeSet filterChildEnabled(const NodeSet& trans } } filteredTransitions.push_back(t1); - SKIP_TRANSITION:; +SKIP_TRANSITION: + ; } return filteredTransitions; } @@ -286,14 +315,14 @@ static std::list sortTransitions(std::list bool stable = false; while(!stable) { for (std::list::iterator outerIter = list.begin(); - outerIter != list.end(); - outerIter++) { + outerIter != list.end(); + outerIter++) { for (std::list::iterator innerIter = outerIter; - innerIter != list.end(); - innerIter++) { + innerIter != list.end(); + innerIter++) { GlobalTransition* t1 = *outerIter; GlobalTransition* t2 = *innerIter; - + if (isSuperset(t1, t2)) { // std::cout << "swapping " << t1->transitionId << " / " << t2->transitionId << std::endl; std::swap(*innerIter, *outerIter); @@ -313,7 +342,8 @@ static std::list sortTransitions(std::list } } stable = true; - NEXT_ITER:; +NEXT_ITER: + ; } return list; } @@ -321,7 +351,7 @@ static std::list sortTransitions(std::list void FlatteningInterpreter::explode() { - + // save global configuration elements to restore after recursive explode Arabica::XPath::NodeSet configuration = _configuration; Arabica::XPath::NodeSet alreadyEntered = _alreadyEntered; @@ -334,19 +364,19 @@ void FlatteningInterpreter::explode() { if (_currGlobalTransition) { _currGlobalTransition->destination = globalState->stateId; globalState->incoming[_currGlobalTransition->transitionId] = _currGlobalTransition; - + // if (!_currGlobalTransition->isEventless) { - // if it was an eventful transition, add all invokers - for (unsigned int i = 0; i < _statesToInvoke.size(); i++) { - NodeSet invokes = filterChildElements(_xmlNSPrefix + "invoke", _statesToInvoke[i]); - for (unsigned int j = 0; j < invokes.size(); j++) { - invoke(invokes[j]); - } + // if it was an eventful transition, add all invokers + for (unsigned int i = 0; i < _statesToInvoke.size(); i++) { + NodeSet invokes = filterChildElements(_nsInfo.xmlNSPrefix + "invoke", _statesToInvoke[i]); + for (unsigned int j = 0; j < invokes.size(); j++) { + invoke(invokes[j]); } - _statesToInvoke = NodeSet(); + } + _statesToInvoke = NodeSet(); // } } - + if (_globalConf.find(globalState->stateId) != _globalConf.end()) { delete globalState; return; // we have already been here @@ -354,8 +384,8 @@ void FlatteningInterpreter::explode() { _globalConf[globalState->stateId] = globalState; // get all transition elements from states in the current configuration - NodeSet allTransitions = filterChildElements(_xmlNSPrefix + "transition", configuration); - + NodeSet allTransitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", configuration); + /** * From http://www.w3.org/TR/scxml/#SelectingTransitions * @@ -365,8 +395,8 @@ void FlatteningInterpreter::explode() { * c) T lacks a 'cond' attribute or its 'cond' attribute evaluates to "true" * * A transition is enabled by NULL in atomic state S if - * a) T lacks an 'event' attribute - * b) T's source state is S or an ancestor of S + * a) T lacks an 'event' attribute + * b) T's source state is S or an ancestor of S * c) T lacks an 'cond' attribute or its 'cond' attribute evaluates to "true" * * The _source state_ of a transition is the or element that it occurs in. @@ -380,14 +410,14 @@ void FlatteningInterpreter::explode() { * * Two transitions T1 and T2 conflict in state configuration C if their exit sets in C have a non-null intersection. * let transitions T1 and T2 conflict: - * T1 is optimally enabled in atomic state S1 + * T1 is optimally enabled in atomic state S1 * T2 is optimally enabled in atomic state S2 * S1 and S2 are both active * T1 has a higher priority than T2 if: * a) T1's source state is a descendant of T2's source state, or * b) S1 precedes S2 in document order * - * The _optimal transition set_ enabled by event E in state configuration C is + * The _optimal transition set_ enabled by event E in state configuration C is * the largest set of transitions such that: * a) each transition in the set is optimally enabled by E in an atomic state in C * b) no transition conflicts with another transition in the set @@ -395,14 +425,14 @@ void FlatteningInterpreter::explode() { * * A _microstep_ consists of the execution of the transitions in an optimal enabled transition set * - * A _macrostep_ is a series of one or more microsteps ending in a configuration + * A _macrostep_ is a series of one or more microsteps ending in a configuration * where the internal event queue is empty and no transitions are enabled by NULL */ - - + + if (allTransitions.size() == 0) return; // no transitions - + int nrElements = allTransitions.size(); int k = 0; int* stack = (int*)malloc((nrElements + 1) * sizeof(int)); @@ -414,17 +444,17 @@ void FlatteningInterpreter::explode() { while(1) { // create the power set of all potential transitions // see: http://www.programminglogic.com/powerset-algorithm-in-c/ - - if (stack[k] < nrElements){ + + if (stack[k] < nrElements) { stack[k+1] = stack[k] + 1; k++; } - + else { stack[k-1]++; k--; } - + if (k==0) break; @@ -438,10 +468,10 @@ void FlatteningInterpreter::explode() { // reduce to conflict-free subset transitions = filterPreempted(transitions); - + // algorithm can never reduce to empty set assert(transitions.size() > 0); - + // create a GlobalTransition object from the set GlobalTransition* transition = new GlobalTransition(transitions, _dataModel); if (!transition->isValid) { @@ -452,7 +482,7 @@ void FlatteningInterpreter::explode() { // two combinations might have projected onto the same conflict-free set if (transitionSets.find(transition->transitionId) != transitionSets.end()) { - std::cout << "skipping as projected onto existing conflict-free subset" << std::endl; +// std::cout << "skipping as projected onto existing conflict-free subset" << std::endl; delete transition; continue; } @@ -475,7 +505,7 @@ void FlatteningInterpreter::explode() { transition->firstElemPerLevel.push_back(lowestOrder); transition->prioPerLevel.push_back(prioPerLevel); } - + #if 0 // calculate priority transition->priority = 0; @@ -495,25 +525,26 @@ void FlatteningInterpreter::explode() { goto NEXT_DEPTH; } } - NEXT_DEPTH:; +NEXT_DEPTH: + ; } #endif // remember this conflict-free set - std::cout << "New conflict-free subset: " << transition->transitionId << ":" << transition->eventDesc << std::endl; +// std::cout << "New conflict-free subset: " << transition->transitionId << ":" << transition->eventDesc << std::endl; transitionSets[transition->transitionId] = transition; } // TODO: reduce and sort transition sets std::list transitionList; for(std::map::iterator transSetIter = transitionSets.begin(); - transSetIter != transitionSets.end(); - transSetIter++) { + transSetIter != transitionSets.end(); + transSetIter++) { transitionList.push_back(transSetIter->second); } - + for(std::list::iterator transListIter = transitionList.begin(); - transListIter != transitionList.end(); - transListIter++) { + transListIter != transitionList.end(); + transListIter++) { // add transition set to current global state globalState->outgoing[(*transListIter)->transitionId] = *transListIter; @@ -522,7 +553,7 @@ void FlatteningInterpreter::explode() { _currGlobalTransition = *transListIter; microstep((*transListIter)->transitions); explode(); - + // reset state for next transition set _configuration = configuration; _alreadyEntered = alreadyEntered; @@ -530,12 +561,13 @@ void FlatteningInterpreter::explode() { } } - + void FlatteningInterpreter::createDocument() { - std::string xmlNs = _nsURL; Node _origSCXML = _scxml; - - _scxml = _flatDoc.createElementNS(xmlNs, "scxml"); + + _scxml = _flatDoc.createElementNS(_nsInfo.nsURL, "scxml"); + _nsInfo.setPrefix(_scxml); + _scxml.setAttribute("flat", "true"); _flatDoc.appendChild(_scxml); @@ -546,16 +578,16 @@ void FlatteningInterpreter::createDocument() { if (HAS_ATTR(_origSCXML, "binding")) { _scxml.setAttribute("binding", ATTR(_origSCXML, "binding")); } - + _scxml.setAttribute("initial", _start->stateId); NodeSet datas; if (_binding == InterpreterImpl::LATE) { // with late binding, just copy direct datamodel childs - datas = filterChildElements(_xmlNSPrefix + "datamodel", _origSCXML); + datas = filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", _origSCXML); } else { // with early binding, copy all datamodel elements into scxml element - datas = _xpath.evaluate("//" + _xpathPrefix + "datamodel", _origSCXML).asNodeSet(); + datas = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "datamodel", _origSCXML).asNodeSet(); } for (int i = 0; i < datas.size(); i++) { if (isInEmbeddedDocument(datas[i])) @@ -564,25 +596,33 @@ void FlatteningInterpreter::createDocument() { _scxml.appendChild(imported); } - - NodeSet scripts = filterChildElements(_xmlNSPrefix + "script", _origSCXML); + + NodeSet scripts = filterChildElements(_nsInfo.xmlNSPrefix + "script", _origSCXML); for (int i = 0; i < scripts.size(); i++) { Node imported = _flatDoc.importNode(scripts[i], true); _scxml.appendChild(imported); } + NodeSet comments = filterChildType(Node_base::COMMENT_NODE, _origSCXML); + for (int i = 0; i < comments.size(); i++) { + Node imported = _flatDoc.importNode(comments[i], true); + _scxml.appendChild(imported); + } + for (std::map::iterator confIter = _globalConf.begin(); - confIter != _globalConf.end(); - confIter++) { - Node state = globalStateToNode(confIter->second, xmlNs); + confIter != _globalConf.end(); + confIter++) { + Node state = globalStateToNode(confIter->second); _scxml.appendChild(state); } // exit(0); } -Node FlatteningInterpreter::globalStateToNode(GlobalState* globalState, const std::string& xmlNs) { - Element state = _flatDoc.createElementNS(xmlNs, "state"); +Node FlatteningInterpreter::globalStateToNode(GlobalState* globalState) { + Element state = _flatDoc.createElementNS(_nsInfo.nsURL, "state"); + _nsInfo.setPrefix(state); + state.setAttribute("id", globalState->stateId); if (globalState->isFinal) @@ -590,20 +630,20 @@ Node FlatteningInterpreter::globalStateToNode(GlobalState* globalSt std::list transitionList; for (std::map::iterator outIter = globalState->outgoing.begin(); - outIter != globalState->outgoing.end(); - outIter++) { + outIter != globalState->outgoing.end(); + outIter++) { transitionList.push_back(outIter->second); } transitionList = sortTransitions(transitionList); - - std::cout << "/////////////////" << std::endl; + +// std::cout << "/////////////////" << std::endl; for (std::list::iterator outIter = transitionList.begin(); - outIter != transitionList.end(); - outIter++) { - state.appendChild(globalTransitionToNode(*outIter, xmlNs)); + outIter != transitionList.end(); + outIter++) { + state.appendChild(globalTransitionToNode(*outIter)); } - std::cout << "/////////////////" << std::endl; +// std::cout << "/////////////////" << std::endl; return state; } @@ -611,8 +651,9 @@ Node FlatteningInterpreter::globalStateToNode(GlobalState* globalSt /** * Creates transient states for executable content as a side-effect */ -Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition* globalTransition, const std::string& xmlNs) { - Element transition = _flatDoc.createElementNS(xmlNs, "transition"); +Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition* globalTransition) { + Element transition = _flatDoc.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(transition); if (!globalTransition->isEventless) { transition.setAttribute("event", globalTransition->eventDesc); @@ -649,25 +690,26 @@ Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition } transition.setAttribute("prioPerLevel", nrSS.str()); #endif - + transition.setAttribute("id", globalTransition->transitionId); - + // std::cout << " firstPerLevel:" << feSS.str() << " " << globalTransition->transitionId << std::endl; // std::cout << "event: " << globalTransition->eventDesc << " firstPerLevel:" << feSS.str() << " numberPerLevel:" << nrSS.str() << " prioPerLevel:" << prSS.str() << " " << globalTransition->transitionId << std::endl; // std::cout << globalTransition->transitionId << std::endl; - + NodeSet transientStateChain; // gather content for new transient state NodeSet childs; - + // iterate all actions taken during the transition for (std::list::iterator actionIter = globalTransition->actions.begin(); - actionIter != globalTransition->actions.end(); - actionIter++) { - + actionIter != globalTransition->actions.end(); + actionIter++) { + if (actionIter->transition) { - Element onexit = _flatDoc.createElementNS(xmlNs, "onexit"); + Element onexit = _flatDoc.createElementNS(_nsInfo.nsURL, "onexit"); + _nsInfo.setPrefix(onexit); Node child = actionIter->transition.getFirstChild(); while(child) { Node imported = _flatDoc.importNode(child, true); @@ -700,7 +742,9 @@ Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition } if (actionIter->uninvoke) { - Element uninvokeElem = _flatDoc.createElementNS(xmlNs, "uninvoke"); + Element uninvokeElem = _flatDoc.createElementNS(_nsInfo.nsURL, "uninvoke"); + _nsInfo.setPrefix(uninvokeElem); + if (HAS_ATTR(actionIter->uninvoke, "type")) { uninvokeElem.setAttribute("type", ATTR(actionIter->uninvoke, "type")); } @@ -720,7 +764,7 @@ Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition if (actionIter->entered) { // we entered a new child - check if it has a datamodel and we entered for the first time if (_binding == InterpreterImpl::LATE) { - NodeSet datamodel = filterChildElements(_xmlNSPrefix + "datamodel", actionIter->entered); + NodeSet datamodel = filterChildElements(_nsInfo.xmlNSPrefix + "datamodel", actionIter->entered); if (datamodel.size() > 0 && !isMember(actionIter->entered, _globalConf[globalTransition->source]->alreadyEnteredStates)) { childs.push_back(datamodel); } @@ -740,43 +784,44 @@ Node FlatteningInterpreter::globalTransitionToNode(GlobalTransition } CREATE_TRANSIENT_STATE_WITH_CHILDS - + if (transientStateChain.size() > 0) { for (int i = 0; i < transientStateChain.size(); i++) { Element transientStateElem = Element(transientStateChain[i]); transientStateElem.setAttribute("id", "transient-" + globalTransition->transitionId + "-" + globalTransition->source + "-" + toStr(i)); - Element exitTransition = _flatDoc.createElementNS(xmlNs, "transition"); - + Element exitTransition = _flatDoc.createElementNS(_nsInfo.nsURL, "transition"); + _nsInfo.setPrefix(exitTransition); + if (i == transientStateChain.size() - 1) { exitTransition.setAttribute("target", globalTransition->destination); } else { exitTransition.setAttribute("target", "transient-" + globalTransition->transitionId + "-" + globalTransition->source + "-" + toStr(i + 1)); } transientStateElem.appendChild(exitTransition); - + if (i == 0) transition.setAttribute("target", transientStateElem.getAttribute("id")); - + _scxml.appendChild(transientStateElem); } } else { transition.setAttribute("target", globalTransition->destination); } - + return transition; } void FlatteningInterpreter::weightTransitions() { maxDepth = 0; maxOrder = 0; - + int depth = 0; Arabica::XPath::NodeSet states = getChildStates(_scxml); while(states.size() > 0) { - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", states); - NodeSet initials = filterChildElements(_xmlNSPrefix + "initial", states); - transitions.push_back(filterChildElements(_xmlNSPrefix + "transition", initials)); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", states); + NodeSet initials = filterChildElements(_nsInfo.xmlNSPrefix + "initial", states); + transitions.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "transition", initials)); for (int j = 0; j < transitions.size(); j++) { if (depth > maxDepth) @@ -791,24 +836,24 @@ void FlatteningInterpreter::weightTransitions() { states = getChildStates(states); } } - + void FlatteningInterpreter::labelTransitions() { // put a unique id on each transition Arabica::XPath::NodeSet states = getAllStates(); states.push_back(_scxml); for (int i = 0; i < states.size(); i++) { std::string stateId = ATTR(states[i], "id"); - NodeSet transitions = filterChildElements(_xmlNSPrefix + "transition", states[i]); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", states[i]); // some transitions are in the inital elements - NodeSet initials = filterChildElements(_xmlNSPrefix + "initial", states[i]); - transitions.push_back(filterChildElements(_xmlNSPrefix + "transition", initials)); + NodeSet initials = filterChildElements(_nsInfo.xmlNSPrefix + "initial", states[i]); + transitions.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "transition", initials)); for (int j = 0; j < transitions.size(); j++) { Element transition = Element(transitions[j]); transition.setAttribute("id", stateId + ":"+ toStr(j + 1)); } } } - + void FlatteningInterpreter::beforeMicroStep(Interpreter interpreter) { } void FlatteningInterpreter::onStableConfiguration(Interpreter interpreter) { @@ -828,31 +873,31 @@ void FlatteningInterpreter::beforeEnteringState(Interpreter interpreter, const A void FlatteningInterpreter::beforeTakingTransition(Interpreter interpreter, const Arabica::DOM::Element& transition, bool moreComing) { } - + GlobalState::GlobalState(const Arabica::XPath::NodeSet& activeStates_, - const Arabica::XPath::NodeSet& alreadyEnteredStates_, // we need to remember for binding=late - const std::map >& historyStates_) { - + const Arabica::XPath::NodeSet& alreadyEnteredStates_, // we need to remember for binding=late + const std::map >& historyStates_) { + // make copies and sort activeStates = activeStates_; alreadyEnteredStates = alreadyEnteredStates_; historyStates = historyStates_; isFinal = true; // is set to false if we contain a non-final state - + // start state is not final if (activeStates.size() == 0) { isFinal = false; } - + // sort configuration activeStates.to_document_order(); alreadyEnteredStates.to_document_order(); for(std::map >::iterator historyIter = historyStates.begin(); - historyIter != historyStates.end(); - historyIter++) { + historyIter != historyStates.end(); + historyIter++) { historyIter->second.to_document_order(); } - + // create a unique identifier for a global configuration std::ostringstream idSS; idSS << "active-"; @@ -867,10 +912,10 @@ GlobalState::GlobalState(const Arabica::XPath::NodeSet& activeState idSS << ATTR(alreadyEnteredStates[i], "id") << "-"; } idSS << ";"; - + for(std::map >::const_iterator histIter = historyStates.begin(); - histIter != historyStates.end(); - histIter++) { + histIter != historyStates.end(); + histIter++) { const Arabica::XPath::NodeSet& histStates = histIter->second; idSS << "history-"; idSS << histIter->first << "-"; @@ -878,7 +923,7 @@ GlobalState::GlobalState(const Arabica::XPath::NodeSet& activeState idSS << ATTR(histStates[i], "id") << "-"; } } - + stateId = idSS.str(); } @@ -886,7 +931,7 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t transitions = transitionSet; isValid = true; isEventless = true; - + #if 0 std::cout << "################" << std::endl; for (int i = 0; i < transitions.size(); i++) { @@ -894,14 +939,14 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t } std::cout << "################" << std::endl; #endif - + std::list conditions; std::ostringstream setId; // also build id for subset for (int i = 0; i < transitions.size(); i++) { // get a unique string for the transition - we assume it is sorted assert(HAS_ATTR(transitions[i], "id")); setId << ATTR(transitions[i], "id") << "-"; - + // gather conditions while we are iterating anyway if (HAS_ATTR(transitions[i], "cond")) { conditions.push_back(ATTR(transitions[i], "cond")); @@ -920,7 +965,7 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t bool foundEventLess = false; bool foundWithTarget = false; bool foundTargetLess = false; - + for (int i = 0; i < transitions.size(); i++) { if (HAS_ATTR(transitions[i], "eventexpr")) { Event e("error.execution", Event::PLATFORM); @@ -947,7 +992,7 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t } } - + // do not mix eventless and event transitions if (foundEventLess && foundWithEvent) { isValid = false; @@ -962,20 +1007,20 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t isEventless = foundEventLess; isTargetless = !foundWithTarget; - + // is there a set of event names that would enable this conflict-free transition set? if (foundWithEvent) { // get the set of longest event descriptors that will enable this transition set eventNames = getCommonEvents(transitions); if (eventNames.size() == 0) { - std::cout << "No event will activate this conflict-free subset" << std::endl; +// LOG(INFO) << "No event will activate this conflict-free subset" << std::endl; isValid = false; return; } else { std::string seperator = ""; for (std::list::iterator eventIter = eventNames.begin(); - eventIter != eventNames.end(); - eventIter++) { + eventIter != eventNames.end(); + eventIter++) { eventDesc += seperator + *eventIter; seperator = " "; } @@ -983,35 +1028,35 @@ GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet& t if (eventDesc.size() == 0) eventDesc = "*"; } - + if (conditions.size() > 0) { condition = dataModel.andExpressions(conditions); if (condition.size() == 0) { - std::cout << "Datamodel does not support to conjungate expressions!" << std::endl; + LOG(ERROR) << "Datamodel does not support to conjungate expressions!" << std::endl; } } } - + std::list GlobalTransition::getCommonEvents(const NodeSet& transitions) { std::list prefixes; std::list longestPrefixes; - + for (int i = 0; i < transitions.size(); i++) { // for every transition std::list eventNames = Interpreter::tokenizeIdRefs(ATTR(transitions[i], "event")); - + for (std::list::iterator eventNameIter = eventNames.begin(); - eventNameIter != eventNames.end(); - eventNameIter++) { + eventNameIter != eventNames.end(); + eventNameIter++) { // for every event descriptor std::string eventName = *eventNameIter; - + // remove trailing .* if (eventName.find("*", eventName.size() - 1) != std::string::npos) eventName = eventName.substr(0, eventName.size() - 1); if (eventName.find(".", eventName.size() - 1) != std::string::npos) eventName = eventName.substr(0, eventName.size() - 1); - + bool isMatching = true; for (int j = 0; j < transitions.size(); j++) { // check if token would activate all other transitions @@ -1027,20 +1072,20 @@ std::list GlobalTransition::getCommonEvents(const NodeSet::iterator outerEventNameIter = prefixes.begin(); - outerEventNameIter != prefixes.end(); - outerEventNameIter++) { + outerEventNameIter != prefixes.end(); + outerEventNameIter++) { for (std::list::iterator innerEventNameIter = prefixes.begin(); - innerEventNameIter != prefixes.end(); - innerEventNameIter++) { + innerEventNameIter != prefixes.end(); + innerEventNameIter++) { if (!iequals(*outerEventNameIter, *innerEventNameIter) && Interpreter::nameMatch(*outerEventNameIter, *innerEventNameIter)) { goto IS_PREFIX; } } longestPrefixes.push_back(*outerEventNameIter); - IS_PREFIX: +IS_PREFIX: ; } return longestPrefixes; diff --git a/src/uscxml/transform/ChartToFSM.h b/src/uscxml/transform/ChartToFSM.h index 14ec4e7..80f532a 100644 --- a/src/uscxml/transform/ChartToFSM.h +++ b/src/uscxml/transform/ChartToFSM.h @@ -37,21 +37,21 @@ public: GlobalState() {} GlobalState(const Arabica::XPath::NodeSet& activeStates, - const Arabica::XPath::NodeSet& alreadyEnteredStates, // we need to remember for binding=late - const std::map >& historyStates); - + const Arabica::XPath::NodeSet& alreadyEnteredStates, // we need to remember for binding=late + const std::map >& historyStates); + Arabica::XPath::NodeSet activeStates; Arabica::XPath::NodeSet alreadyEnteredStates; std::map > historyStates; - + std::map incoming; std::map outgoing; std::string stateId; - + bool isFinal; }; - + class GlobalTransition { public: class Action { @@ -64,24 +64,24 @@ public: Arabica::DOM::Node invoke; Arabica::DOM::Node uninvoke; }; - + GlobalTransition(const Arabica::XPath::NodeSet& transitions, DataModel dataModel); - + bool isValid; // constructor will determine, calling code will delete if not bool isEventless; // whether or not all our transitions are eventless bool isTargetless; // whether or not all our transitions are eventless bool isSubset; // there is a superset to this set - + std::vector firstElemPerLevel; std::vector nrElemPerLevel; std::vector prioPerLevel; - + Arabica::XPath::NodeSet transitions; // constituting transitions std::list eventNames; // the list of longest event names that will enable this set std::string eventDesc; // space-seperated eventnames for convenience std::string condition; // conjunction of all the set's conditions - + // executable content we gathered when we took the transition std::list actions; @@ -90,19 +90,21 @@ public: Arabica::XPath::NodeSet invoke; Arabica::XPath::NodeSet uninvoke; - + std::string transitionId; std::string source; std::string destination; - + protected: - std::list getCommonEvents(const Arabica::XPath::NodeSet& transitions); + std::list getCommonEvents(const Arabica::XPath::NodeSet& transitions); }; - + class FlatteningInterpreter : public InterpreterDraft6, public InterpreterMonitor { public: FlatteningInterpreter(const Arabica::DOM::Document& doc); - Arabica::DOM::Document& getDocument(); // overwrite to return flat FSM + virtual ~FlatteningInterpreter(); + + Arabica::DOM::Document getDocument() const; // overwrite to return flat FSM void interpret(); protected: @@ -131,22 +133,22 @@ protected: void weightTransitions(); void createDocument(); - Arabica::DOM::Node globalStateToNode(GlobalState* globalState, const std::string& xmlNs); - Arabica::DOM::Node globalTransitionToNode(GlobalTransition* globalTransition, const std::string& xmlNs); + Arabica::DOM::Node globalStateToNode(GlobalState* globalState); + Arabica::DOM::Node globalTransitionToNode(GlobalTransition* globalTransition); GlobalState* _start; GlobalTransition* _currGlobalTransition; - + int maxDepth; int maxOrder; - + Arabica::DOM::Document _flatDoc; std::map _globalConf; }; - + class ChartToFSM { public: - static Arabica::DOM::Document flatten(const Arabica::DOM::Document& doc, const std::map& nameSpaceInfo); + static Interpreter flatten(const Interpreter& other); }; } diff --git a/src/uscxml/transform/FSMToPromela.cpp b/src/uscxml/transform/FSMToPromela.cpp index 0c61900..dc3b581 100644 --- a/src/uscxml/transform/FSMToPromela.cpp +++ b/src/uscxml/transform/FSMToPromela.cpp @@ -19,10 +19,13 @@ #include "uscxml/transform/ChartToFSM.h" #include "uscxml/transform/FSMToPromela.h" +#include "uscxml/plugins/datamodel/promela/PromelaParser.h" #include #include #include "uscxml/UUID.h" #include +#include +#include namespace uscxml { @@ -30,47 +33,696 @@ using namespace Arabica::DOM; using namespace Arabica::XPath; void FSMToPromela::writeProgram(std::ostream& stream, - const Arabica::DOM::Document& doc, - const std::map& namespaceInfo) { + const Interpreter& interpreter) { + FSMToPromela promelaWriter; + interpreter.getImpl()->copyTo(&promelaWriter); + promelaWriter.writeProgram(stream); +} + +FSMToPromela::FSMToPromela() : _eventTrie(".") { +} + +void FSMToPromela::writeEvents(std::ostream& stream) { + std::list eventNames = _eventTrie.getWordsWithPrefix(""); + std::list::iterator eventIter = eventNames.begin(); + stream << "// event name identifiers" << std::endl; + while(eventIter != eventNames.end()) { + stream << "#define " << "e" << (*eventIter)->identifier << " " << (*eventIter)->identifier; + stream << " // from \"" << (*eventIter)->value << "\"" << std::endl; + eventIter++; + } +} + +void FSMToPromela::writeStates(std::ostream& stream) { + stream << "// state name identifiers" << std::endl; + for (int i = 0; i < _globalStates.size(); i++) { + stream << "#define " << "s" << i << " " << i; + stream << " // from \"" << ATTR(_globalStates[i], "id") << "\"" << std::endl; + } + +} + +Arabica::XPath::NodeSet FSMToPromela::getTransientContent(const Arabica::DOM::Node& state) { + Arabica::XPath::NodeSet content; + Arabica::DOM::Node currState = state; + for (;;) { + if (!HAS_ATTR(currState, "transient") || !DOMUtils::attributeIsTrue(ATTR(currState, "transient"))) + break; + content.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "invoke", currState)); + content.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "onentry", currState)); + content.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "onexit", currState)); + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", currState); + currState = _states[ATTR(transitions[0], "target")]; + } + + return content; +} + +Node FSMToPromela::getUltimateTarget(const Arabica::DOM::Node& transition) { + Arabica::DOM::Node currState = _states[ATTR(transition, "target")]; + + for (;;) { + if (!HAS_ATTR(currState, "transient") || !DOMUtils::attributeIsTrue(ATTR(currState, "transient"))) + return currState; + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", currState); + currState = _states[ATTR(transitions[0], "target")]; + } +} + +void FSMToPromela::writeInlineComment(std::ostream& stream, const Arabica::DOM::Node& node) { + if (node.getNodeType() != Node_base::COMMENT_NODE) + return; + + std::string comment = node.getNodeValue(); + boost::trim(comment); + if (!boost::starts_with(comment, "promela-inline:")) + return; + + std::stringstream ssLine(comment); + std::string line; + std::getline(ssLine, line); // consume first line + while(std::getline(ssLine, line)) { + if (line.length() == 0) + continue; + stream << line; + } +} + +void FSMToPromela::writeExecutableContent(std::ostream& stream, const Arabica::DOM::Node& node, int indent) { + + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + + if (node.getNodeType() == Node_base::COMMENT_NODE) { + std::string comment = node.getNodeValue(); + boost::trim(comment); + std::stringstream inlinePromela; + if (!boost::starts_with(comment, "promela-inline:")) + return; + std::stringstream ssLine(comment); + std::string line; + std::getline(ssLine, line); // consume first line + while(std::getline(ssLine, line)) { + if (line.length() == 0) + continue; + inlinePromela << line << std::endl; + } + stream << padding << "skip;" << std::endl; + stream << beautifyIndentation(inlinePromela.str(), indent) << std::endl; + } + + if (node.getNodeType() != Node_base::ELEMENT_NODE) + return; + + if (false) { + } else if(TAGNAME(node) == "state") { + if (HAS_ATTR(node, "transient") && DOMUtils::attributeIsTrue(ATTR(node, "transient"))) { + Arabica::XPath::NodeSet execContent = getTransientContent(node); + for (int i = 0; i < execContent.size(); i++) { + writeExecutableContent(stream, execContent[i], indent); + } + } else { + Arabica::DOM::Node child = node.getFirstChild(); + while(child) { + writeExecutableContent(stream, child, indent); + child = child.getNextSibling(); + } + } + } else if(TAGNAME(node) == "transition") { + stream << "t" << _transitions[node] << ":" << std::endl; + + // check for special promela labels + PromelaInlines promInls = getInlinePromela(getTransientContent(_states[ATTR(node, "target")]), true); + + if (promInls.hasAcceptLabel) + stream << padding << "acceptLabelT" << _transitions[node] << ":" << std::endl; + if (promInls.hasEndLabel) + stream << padding << "endLabelT" << _transitions[node] << ":" << std::endl; + if (promInls.hasProgressLabel) + stream << padding << "progressLabelT" << _transitions[node] << ":" << std::endl; + + stream << padding << "atomic {" << std::endl; + writeExecutableContent(stream, _states[ATTR(node, "target")], indent+1); + stream << padding << " skip;" << std::endl; + + Node newState = getUltimateTarget(node); + for (int i = 0; i < _globalStates.size(); i++) { + if (newState != _globalStates[i]) + continue; + stream << padding << " s = s" << i << ";" << std::endl; + } + + stream << padding << "}" << std::endl; + if (isFinal(newState)) { + stream << padding << "goto terminate;" << std::endl; + } else { + stream << padding << "goto nextStep;" << std::endl; + } + + } else if(TAGNAME(node) == "onentry" || TAGNAME(node) == "onexit") { + Arabica::DOM::Node child = node.getFirstChild(); + while(child) { + writeExecutableContent(stream, child, indent); + child = child.getNextSibling(); + } + + } else if(TAGNAME(node) == "script") { + NodeSet scriptText = filterChildType(Node_base::TEXT_NODE, node, true); + for (int i = 0; i < scriptText.size(); i++) { + stream << beautifyIndentation(scriptText[i].getNodeValue(), indent) << std::endl; + } + + } else if(TAGNAME(node) == "log") { + // ignore + + } else if(TAGNAME(node) == "foreach") { + if (HAS_ATTR(node, "index")) + stream << padding << ATTR(node, "index") << " = 0;" << std::endl; + stream << padding << "for (" << ATTR(node, "item") << " in " << ATTR(node, "array") << ") {" << std::endl; + Arabica::DOM::Node child = node.getFirstChild(); + while(child) { + writeExecutableContent(stream, child, indent + 1); + child = child.getNextSibling(); + } + if (HAS_ATTR(node, "index")) + stream << padding << " " << ATTR(node, "index") << "++;" << std::endl; + stream << padding << "}" << std::endl; + + } else if(TAGNAME(node) == "if") { + NodeSet condChain; + condChain.push_back(node); + condChain.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "elseif", node)); + condChain.push_back(filterChildElements(_nsInfo.xmlNSPrefix + "else", node)); + + writeIfBlock(stream, condChain, indent); + + } else if(TAGNAME(node) == "raise") { + TrieNode* trieNode = _eventTrie.getNodeWithPrefix(ATTR(node, "event")); + stream << padding << "iQ!e" << trieNode->identifier << ";" << std::endl; + } else if(TAGNAME(node) == "invoke") { + stream << padding << "run " << ATTR(node, "invokeid") << "EventSource();" << std::endl; + } else if(TAGNAME(node) == "uninvoke") { + stream << padding << ATTR(node, "invokeid") << "EventSourceDone" << "= 1;" << std::endl; + } else { + + std::cerr << "'" << TAGNAME(node) << "'" << std::endl << node << std::endl; + assert(false); + } + +} + +PromelaInlines FSMToPromela::getInlinePromela(const Arabica::XPath::NodeSet& elements, bool recurse) { + PromelaInlines prom; + + if (elements.size() == 0) + return prom; + + Arabica::XPath::NodeSet comments = filterChildType(Node_base::COMMENT_NODE, elements, recurse); + for (int i = 0; i < comments.size(); i++) { + std::stringstream ssLine(comments[i].getNodeValue()); + std::string line; + + bool isInPromelaCode = false; + PromelaInline promInl; + + while(std::getline(ssLine, line)) { + std::string trimLine = boost::trim_copy(line); + if (line.length() == 0) + continue; + if (false) { + } else if (boost::starts_with(trimLine, "promela-progress")) { + prom.hasProgressLabel = true; + if (isInPromelaCode) { + prom.inlines.push_back(promInl); + isInPromelaCode = false; + } + promInl.type = PromelaInline::PROMELA_PROGRESS_LABEL; + promInl.content = line; + prom.inlines.push_back(promInl); + } else if (boost::starts_with(trimLine, "promela-accept")) { + prom.hasAcceptLabel = true; + if (isInPromelaCode) { + prom.inlines.push_back(promInl); + isInPromelaCode = false; + } + promInl.type = PromelaInline::PROMELA_ACCEPT_LABEL; + promInl.content = line; + prom.inlines.push_back(promInl); + } else if (boost::starts_with(trimLine, "promela-end")) { + prom.hasEndLabel = true; + if (isInPromelaCode) { + prom.inlines.push_back(promInl); + isInPromelaCode = false; + } + promInl.type = PromelaInline::PROMELA_END_LABEL; + promInl.content = line; + prom.inlines.push_back(promInl); + } else if (boost::starts_with(trimLine, "promela-inline")) { + prom.hasCode = true; + isInPromelaCode = true; + promInl.type = PromelaInline::PROMELA_CODE; + } else if (isInPromelaCode) { + promInl.content += line; + } + } + // inline code ends with comment + if (isInPromelaCode) { + prom.inlines.push_back(promInl); + } + } + return prom; +} + +void FSMToPromela::writeIfBlock(std::ostream& stream, const Arabica::XPath::NodeSet& condChain, int indent) { + if (condChain.size() == 0) + return; + + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + + bool noNext = condChain.size() == 1; + bool nextIsElse = false; + if (condChain.size() > 1) { + if (TAGNAME(condChain[1]) == "else") { + nextIsElse = true; + } + } + + Node ifNode = condChain[0]; + + stream << padding << "if" << std::endl; + // we need to nest the elseifs to resolve promela if semantics + stream << padding << ":: (" << ATTR(ifNode, "cond") << ") -> {" << std::endl; + + Arabica::DOM::Node child; + if (TAGNAME(ifNode) == "if") { + child = ifNode.getFirstChild(); + } else { + child = ifNode.getNextSibling(); + } + while(child) { + if (child.getNodeType() == Node_base::ELEMENT_NODE) { + if (TAGNAME(child) == "elseif" || TAGNAME(child) == "else") + break; + } + writeExecutableContent(stream, child, indent + 1); + child = child.getNextSibling(); + } + stream << padding << "}" << std::endl; + stream << padding << ":: else -> "; + + if (nextIsElse) { + child = condChain[1].getNextSibling(); + stream << "{" << std::endl; + while(child) { + writeExecutableContent(stream, child, indent + 1); + child = child.getNextSibling(); + } + stream << padding << "}" << std::endl; + + } else if (noNext) { + stream << "skip;" << std::endl; + } else { + stream << "{" << std::endl; + + Arabica::XPath::NodeSet cdrCondChain; + for (int i = 1; i < condChain.size(); i++) { + cdrCondChain.push_back(condChain[i]); + } + writeIfBlock(stream, cdrCondChain, indent + 1); + stream << padding << "}" << std::endl; + + } + + stream << padding << "fi;" << std::endl; + +} + +std::string FSMToPromela::beautifyIndentation(const std::string& code, int indent) { + + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + + // remove topmost indentation from every line and reindent + std::stringstream beautifiedSS; + + std::string initialIndent; + bool gotIndent = false; + bool isFirstLine = true; + std::stringstream ssLine(code); + std::string line; + + while(std::getline(ssLine, line)) { + size_t firstChar = line.find_first_not_of(" \t\r\n"); + if (firstChar != std::string::npos) { + if (!gotIndent) { + initialIndent = line.substr(0, firstChar); + gotIndent = true; + } + beautifiedSS << (isFirstLine ? "" : "\n") << padding << boost::replace_first_copy(line, initialIndent, ""); + isFirstLine = false; + } + } + + return beautifiedSS.str(); +} + +void FSMToPromela::writeDeclarations(std::ostream& stream) { + + // get all data elements + NodeSet datas = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "data", _scxml).asNodeSet(); + NodeSet dataText = filterChildType(Node_base::TEXT_NODE, datas, true); + + // write their text content + stream << "// datamodel variables" << std::endl; + for (int i = 0; i < dataText.size(); i++) { + Node data = dataText[i]; + stream << beautifyIndentation(data.getNodeValue()) << std::endl; + } + + stream << std::endl; + stream << "// global variables" << std::endl; + stream << "int e; /* current event */" << std::endl; + stream << "int s; /* current state */" << std::endl; + stream << "chan iQ = [100] of {int} /* internal queue */" << std::endl; + stream << "chan eQ = [100] of {int} /* external queue */" << std::endl; + + stream << std::endl; + stream << "// event sources" << std::endl; + if (_globalEventSource) + stream << "bool globalEventSourceDone;" << std::endl; + + std::map::iterator invIter = _invokers.begin(); + while(invIter != _invokers.end()) { + stream << "bool " << invIter->first << "EventSourceDone;" << std::endl; + stream << std::endl; + invIter++; + } + +} + +void FSMToPromela::writeEventSources(std::ostream& stream) { + if (_globalEventSource) + writeEventSource(stream, "global", _globalEventSource); + + std::map::iterator invIter = _invokers.begin(); + while(invIter != _invokers.end()) { + writeEventSource(stream, invIter->first, invIter->second); + invIter++; + } + +} + +void FSMToPromela::writeEventSource(std::ostream& stream, const std::string& name, const PromelaEventSource& source) { + stream << "proctype " << name << "EventSource() {" << std::endl; + stream << " " << name << "EventSourceDone = 0;" << std::endl; + stream << " " << name << "NewEvent:" << std::endl; + stream << " " << "if" << std::endl; + stream << " " << ":: " << name << "EventSourceDone -> skip;" << std::endl; + stream << " " << ":: else { " << std::endl; + stream << " " << " if" << std::endl; + stream << " " << " :: 1 -> " << "goto " << name << "NewEvent;" << std::endl; + + std::list >::const_iterator seqIter = source.sequences.begin(); + while(seqIter != source.sequences.end()) { + stream << " " << ":: "; + std::list::const_iterator evIter = seqIter->begin(); + while(evIter != seqIter->end()) { + TrieNode* node = _eventTrie.getNodeWithPrefix(*evIter); + stream << "eQ!" << node->identifier << "; "; + evIter++; + } + stream << "goto " << name << "NewEvent;" << std::endl; + seqIter++; + } + stream << " " << " fi" << std::endl; + stream << " " << "}" << std::endl; + stream << " " << "fi" << std::endl; + stream << "}" << std::endl; +} + + +void FSMToPromela::writeFSM(std::ostream& stream) { + NodeSet transitions; + + stream << "proctype step() {" << std::endl; + // write initial transition + transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", _startState); + assert(transitions.size() == 1); + stream << " // transition's executable content" << std::endl; + writeExecutableContent(stream, transitions[0], 1); + + for (int i = 0; i < _globalStates.size(); i++) { + if (_globalStates[i] == _startState) + continue; + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", _globalStates[i]); + for (int j = 0; j < transitions.size(); j++) { + writeExecutableContent(stream, transitions[j], 1); + } + } + + stream << std::endl; + stream << "nextStep: /* pop an event */" << std::endl; + stream << " if" << std::endl; + stream << " :: len(iQ) != 0 -> iQ ? e /* from internal queue */" << std::endl; + stream << " :: else -> eQ ? e /* from external queue */" << std::endl; + stream << " fi;" << std::endl; + stream << " /* event dispatching per state */" << std::endl; + stream << " if" << std::endl; + + writeEventDispatching(stream); + + stream << " :: else -> goto nextStep;" << std::endl; + stream << " fi;" << std::endl; + stream << "terminate: skip;" << std::endl; + + // stop all event sources + if (_globalEventSource) + stream << " globalEventSourceDone = 1;" << std::endl; + + std::map::iterator invIter = _invokers.begin(); + while(invIter != _invokers.end()) { + stream << " " << invIter->first << "EventSourceDone = 1;" << std::endl; + invIter++; + } + + + stream << "}" << std::endl; +} + +void FSMToPromela::writeEventDispatching(std::ostream& stream) { + for (int i = 0; i < _globalStates.size(); i++) { + if (_globalStates[i] == _startState) + continue; + + stream << " :: (s == s" << i << ") -> {" << std::endl; + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", _globalStates[i]); + writeDispatchingBlock(stream, transitions, 2); + stream << " goto nextStep;" << std::endl; + stream << " }" << std::endl; + } } -FSMToPromela::FSMToPromela(const Arabica::DOM::Document& doc, - const std::map& namespaceInfo) { +void FSMToPromela::writeDispatchingBlock(std::ostream& stream, const Arabica::XPath::NodeSet& transChain, int indent) { + if (transChain.size() == 0) + return; - std::map::const_iterator nsIter = namespaceInfo.begin(); - while(nsIter != namespaceInfo.end()) { - std::string uri = nsIter->first; - std::string prefix = nsIter->second; - if (iequals(uri, "http://www.w3.org/2005/07/scxml")) { - _nsURL = uri; - if (prefix.size() == 0) { - _xpathPrefix = "scxml:"; - _nsContext.addNamespaceDeclaration(uri, "scxml"); - _nsToPrefix[uri] = "scxml"; - } else { - _xpathPrefix = prefix + ":"; - _xmlNSPrefix = _xpathPrefix; - _nsContext.addNamespaceDeclaration(uri, prefix); - _nsToPrefix[uri] = prefix; + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + + stream << padding << "if" << std::endl; + stream << padding << ":: ((0"; + + Node currTrans = transChain[0]; + std::string eventDesc = ATTR(currTrans, "event"); + if (boost::ends_with(eventDesc, "*")) + eventDesc = eventDesc.substr(0, eventDesc.size() - 1); + if (boost::ends_with(eventDesc, ".")) + eventDesc = eventDesc.substr(0, eventDesc.size() - 1); + + if (eventDesc.size() == 0) { + stream << " || 1"; + } else { + std::list trieNodes = _eventTrie.getWordsWithPrefix(eventDesc); + + std::list::iterator trieIter = trieNodes.begin(); + while(trieIter != trieNodes.end()) { + stream << " || e == e" << (*trieIter)->identifier; + trieIter++; + } + } + + stream << ") && "; + stream << (HAS_ATTR(currTrans, "cond") ? ATTR(currTrans, "cond") : "1"); + stream << ") -> goto t" << _transitions[currTrans] << ";" << std::endl; +; + + stream << padding << ":: else {" << std::endl; + + Arabica::XPath::NodeSet cdrTransChain; + for (int i = 1; i < transChain.size(); i++) { + cdrTransChain.push_back(transChain[i]); + } + writeDispatchingBlock(stream, cdrTransChain, indent + 1); + + stream << padding << " goto nextStep;" << std::endl; + stream << padding << "}" << std::endl; + stream << padding << "fi;" << std::endl; +} + + +void FSMToPromela::writeMain(std::ostream& stream) { + stream << std::endl; + stream << "init {" << std::endl; + if (_globalEventSource) + stream << " run globalEventSource();" << std::endl; + stream << " run step();" << std::endl; + stream << "}" << std::endl; + +} + +void FSMToPromela::initNodes() { + // get all states + NodeSet states = filterChildElements(_nsInfo.xmlNSPrefix + "state", _scxml); + for (int i = 0; i < states.size(); i++) { + _states[ATTR(states[i], "id")] = states[i]; + if (HAS_ATTR(states[i], "transient") && DOMUtils::attributeIsTrue(ATTR(states[i], "transient"))) + continue; + _globalStates.push_back(states[i]); + } + _startState = _states[ATTR(_scxml, "initial")]; + + // initialize event trie with all events that might occur + NodeSet internalEventNames; + internalEventNames.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "transition", _scxml).asNodeSet()); + internalEventNames.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "raise", _scxml).asNodeSet()); + internalEventNames.push_back(_xpath.evaluate("//" + _nsInfo.xpathPrefix + "send", _scxml).asNodeSet()); + + for (int i = 0; i < internalEventNames.size(); i++) { + if (HAS_ATTR(internalEventNames[i], "event")) { + std::string eventNames = ATTR(internalEventNames[i], "event"); + std::list events = tokenizeIdRefs(eventNames); + for (std::list::iterator eventIter = events.begin(); + eventIter != events.end(); eventIter++) { + std::string eventName = *eventIter; + if (boost::ends_with(eventName, "*")) + eventName = eventName.substr(0, eventName.size() - 1); + if (boost::ends_with(eventName, ".")) + eventName = eventName.substr(0, eventName.size() - 1); + _eventTrie.addWord(eventName); + } + } + } + + // external event names from comments + NodeSet promelaEventSourceComments; + NodeSet invokers = _xpath.evaluate("//" + _nsInfo.xpathPrefix + "invoke", _scxml).asNodeSet(); + promelaEventSourceComments.push_back(filterChildType(Node_base::COMMENT_NODE, invokers, true)); // comments in invoke elements + promelaEventSourceComments.push_back(filterChildType(Node_base::COMMENT_NODE, _scxml, false)); // comments in scxml element + + for (int i = 0; i < promelaEventSourceComments.size(); i++) { + std::string comment = promelaEventSourceComments[i].getNodeValue(); + boost::trim(comment); + if (!boost::starts_with(comment, "promela-event-source:")) + continue; + PromelaEventSource* eventSource = NULL; + if (false) { + } else if (TAGNAME(promelaEventSourceComments[i].getParentNode()) == "scxml") { + eventSource = &_globalEventSource; + } else if (TAGNAME(promelaEventSourceComments[i].getParentNode()) == "invoke") { + if (!HAS_ATTR(promelaEventSourceComments[i].getParentNode(), "invokeid")) { + Element invoker = Element(promelaEventSourceComments[i].getParentNode()); + invoker.setAttribute("invokeid", "invoker" + toStr(_invokers.size())); } + std::string invokeId = ATTR(promelaEventSourceComments[i].getParentNode(), "invokeid"); + eventSource = &_invokers[invokeId]; } else { - _nsContext.addNamespaceDeclaration(uri, prefix); - _nsToPrefix[uri] = prefix; + assert(false); + } + if (!eventSource) + continue; + std::stringstream ssLine(comment); + std::string line; + std::getline(ssLine, line); // consume first line + while(std::getline(ssLine, line)) { + if (line.length() == 0) + continue; + std::list currSeq; + + std::stringstream ssToken(line); + std::string token; + while(std::getline(ssToken, token, ' ')) { + if (token.length() == 0) + continue; + currSeq.push_back(token); + _eventTrie.addWord(token); + } + eventSource->sequences.push_back(currSeq); } - nsIter++; } - _xpath.setNamespaceContext(_nsContext); + + // enumerate transitions + NodeSet transitions = filterChildElements(_nsInfo.xmlNSPrefix + "transition", _scxml, true); + int index = 0; + for (int i = 0; i < transitions.size(); i++) { + _transitions[transitions[i]] = index++; + } +} - _document = doc; - NodeList scxmls = _document.getElementsByTagNameNS(_nsURL, "scxml"); - if (scxmls.getLength() > 0) { - _scxml = (Arabica::DOM::Element)scxmls.item(0); +void PromelaEventSource::dump() { + std::list >::iterator outerIter = sequences.begin(); + while(outerIter != sequences.end()) { + std::list::iterator innerIter = outerIter->begin(); + while(innerIter != outerIter->end()) { + std::cout << *innerIter << " "; + innerIter++; + } + std::cout << std::endl; + outerIter++; } } void FSMToPromela::writeProgram(std::ostream& stream) { - stream << "foo"; + + if (!HAS_ATTR(_scxml, "flat") || !DOMUtils::attributeIsTrue(ATTR(_scxml, "flat"))) { + LOG(ERROR) << "Given SCXML document was not flattened"; + return; + } + + if (!HAS_ATTR(_scxml, "datamodel") || ATTR(_scxml, "datamodel") != "promela") { + LOG(ERROR) << "Can only convert SCXML documents with \"promela\" datamodel"; + return; + } + + if (HAS_ATTR(_scxml, "binding") && ATTR(_scxml, "binding") != "early") { + LOG(ERROR) << "Can only convert for early data bindings"; + return; + } + + initNodes(); + + writeEvents(stream); + stream << std::endl; + writeStates(stream); + stream << std::endl; + writeDeclarations(stream); + stream << std::endl; + writeEventSources(stream); + stream << std::endl; + writeFSM(stream); + stream << std::endl; + writeMain(stream); + stream << std::endl; + } } \ No newline at end of file diff --git a/src/uscxml/transform/FSMToPromela.h b/src/uscxml/transform/FSMToPromela.h index c3324bb..adb0f6a 100644 --- a/src/uscxml/transform/FSMToPromela.h +++ b/src/uscxml/transform/FSMToPromela.h @@ -21,37 +21,90 @@ #define FSMTOPROMELA_H_RP48RFDJ #include "uscxml/DOMUtils.h" +#include "uscxml/util/Trie.h" + #include #include #include #include namespace uscxml { + +class PromelaInline { +public: + enum PromelaInlineType { + PROMELA_CODE, + PROMELA_EVENT_SOURCE, + PROMELA_PROGRESS_LABEL, + PROMELA_ACCEPT_LABEL, + PROMELA_END_LABEL + }; -class FSMToPromela { + std::string content; + PromelaInlineType type; +}; + +class PromelaInlines { +public: + PromelaInlines() : hasProgressLabel(false), hasAcceptLabel(false), hasEndLabel(false), hasEventSource(false), hasCode(false) {} + + std::list inlines; + bool hasProgressLabel; + bool hasAcceptLabel; + bool hasEndLabel; + bool hasEventSource; + bool hasCode; +}; + +struct PromelaEventSource { + std::list > sequences; + void dump(); + operator bool() { + return sequences.size() > 0; + } +}; + +class FSMToPromela : public InterpreterDraft6 { public: static void writeProgram(std::ostream& stream, - const Arabica::DOM::Document& doc, - const std::map& namespaceInfo); + const Interpreter& interpreter); protected: - FSMToPromela(const Arabica::DOM::Document& doc, - const std::map& namespaceInfo); - + FSMToPromela(); void writeProgram(std::ostream& stream); + + void initNodes(); + + void writeEvents(std::ostream& stream); + void writeStates(std::ostream& stream); + void writeDeclarations(std::ostream& stream); + void writeEventSources(std::ostream& stream); + void writeEventSource(std::ostream& stream, const std::string& name, const PromelaEventSource& source); + void writeExecutableContent(std::ostream& stream, const Arabica::DOM::Node& node, int indent = 0); + void writeInlineComment(std::ostream& stream, const Arabica::DOM::Node& node); + void writeFSM(std::ostream& stream); + void writeEventDispatching(std::ostream& stream); + void writeMain(std::ostream& stream); - Arabica::DOM::Document _document; - Arabica::DOM::Node _scxml; - Arabica::XPath::XPath _xpath; - Arabica::XPath::StandardNamespaceContext _nsContext; - std::string _xmlNSPrefix; // the actual prefix for elements in the xml file - std::string _xpathPrefix; // prefix mapped for xpath, "scxml" is _xmlNSPrefix is empty but _nsURL set - std::string _nsURL; // ough to be "http://www.w3.org/2005/07/scxml" - std::map _nsToPrefix; - std::map _nameSpaceInfo; + void writeIfBlock(std::ostream& stream, const Arabica::XPath::NodeSet& condChain, int indent = 0); + void writeDispatchingBlock(std::ostream& stream, const Arabica::XPath::NodeSet& transChain, int indent = 0); -}; + std::string beautifyIndentation(const std::string& code, int indent = 0); + + Arabica::XPath::NodeSet getTransientContent(const Arabica::DOM::Node& state); + Arabica::DOM::Node getUltimateTarget(const Arabica::DOM::Node& transition); + PromelaInlines getInlinePromela(const Arabica::XPath::NodeSet& elements, bool recurse = false); + Trie _eventTrie; + Arabica::XPath::NodeSet _globalStates; + Arabica::DOM::Node _startState; + std::map > _states; + std::map, int> _transitions; + + std::map _invokers; + PromelaEventSource _globalEventSource; +}; + } #endif /* end of include guard: FSMTOPROMELA_H_RP48RFDJ */ diff --git a/src/uscxml/util/Trie.cpp b/src/uscxml/util/Trie.cpp new file mode 100644 index 0000000..ebcc3ef --- /dev/null +++ b/src/uscxml/util/Trie.cpp @@ -0,0 +1,165 @@ +/** + * @file + * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see . + * @endcond + */ + +#include "Trie.h" +#include + +namespace uscxml { + +Trie::Trie() { + root = new TrieNode(); + lastIdentifier = 0; +} + +Trie::Trie(const std::string& seperator) : seperator(seperator) { + root = new TrieNode(); + lastIdentifier = 0; +} + +Trie::~Trie() { + delete root; +} + +TrieNode::TrieNode() : hasWord(false) {} + +TrieNode::~TrieNode() { + std::map::iterator childIter = childs.begin(); + while(childIter != childs.end()) { + delete childIter->second; + childIter++; + } +} + +size_t Trie::getNextToken(const std::string& word, size_t offset, std::string& token) { + if (offset == std::string::npos || offset >= word.length()) { + token = ""; + return std::string::npos; + } + if (seperator.size() > 0) { + size_t sepPos = word.find(seperator, offset); + if (sepPos == offset) // starts with a seperator + return getNextToken(word, offset + seperator.length(), token); + if (sepPos == std::string::npos) { + token = word.substr(offset, word.length() - offset); + } else { + token = word.substr(offset, sepPos - offset); + sepPos += seperator.length(); + } + return sepPos; + } + token = word[offset]; + return offset + 1; +} + +void Trie::addWord(const std::string& word) { + TrieNode* currNode = root; + + std::string prefix; + size_t offset = 0; + + for(;;) { + offset = getNextToken(word, offset, prefix); + + if (prefix.size() > 0) { + if (currNode->childs.find(prefix) == currNode->childs.end()) + currNode->childs[prefix] = new TrieNode(); + currNode = currNode->childs[prefix]; + } + + if (offset == std::string::npos) + break; + } + if (!currNode->hasWord) { + currNode->identifier = lastIdentifier++; + currNode->value = word; + currNode->hasWord = true; + } +} + +TrieNode* Trie::getNodeWithPrefix(const std::string& prefix) { + std::string token; + size_t offset = 0; + + TrieNode* currNode = root; + + for(;;) { + offset = getNextToken(prefix, offset, token); + if (currNode->childs.find(token) == currNode->childs.end()) { + if (token.size() > 0) + currNode = NULL; + break; + } else { + currNode = currNode->childs[token]; + } + } + return currNode; +} + +std::list Trie::getWordsWithPrefix(const std::string& prefix) { + std::list nodes; + TrieNode* prefixNode = getNodeWithPrefix(prefix); + + if (prefixNode) { + nodes = getChildsWithWords(prefixNode); + } + + return nodes; +} + +std::list Trie::getChildsWithWords(TrieNode* node) { + std::list nodes; + if (node->hasWord) { + nodes.push_back(node); + } + + std::map::iterator childIter = node->childs.begin(); + while(childIter != node->childs.end()) { + std::list otherChilds = getChildsWithWords(childIter->second); + nodes.merge(otherChilds); + childIter++; + } + + return nodes; +} + +void TrieNode::dump(int indent) { + std::string padding; + for (int i = 0; i < indent; i++) { + padding += " "; + } + + std::map::iterator childIter = childs.begin(); + while(childIter != childs.end()) { + std::cout << padding << childIter->first; + if (childIter->second->hasWord) { + std::cout << " (word)"; + } + std::cout << std::endl; + childIter->second->dump(indent + 1); + childIter++; + } +} + +void Trie::dump() { + if (root->hasWord) + std::cout << "(word)" << std::endl; + root->dump(); +} + +} \ No newline at end of file diff --git a/src/uscxml/util/Trie.h b/src/uscxml/util/Trie.h new file mode 100644 index 0000000..5c2d14e --- /dev/null +++ b/src/uscxml/util/Trie.h @@ -0,0 +1,61 @@ +/** + * @file + * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see . + * @endcond + */ + +#ifndef TRIE_H_UZMQRBO5 +#define TRIE_H_UZMQRBO5 + +#include +#include +#include + +namespace uscxml { + +struct TrieNode { + TrieNode(); + virtual ~TrieNode(); + + bool hasWord; + int identifier; + std::string value; + std::map childs; + void dump(int indent = 0); +}; + +struct Trie { + Trie(); + Trie(const std::string& seperator); + virtual ~Trie(); + + void addWord(const std::string& word); + size_t getNextToken(const std::string& word, size_t offset, std::string& token); + + TrieNode* getNodeWithPrefix(const std::string& prefix); + std::list getWordsWithPrefix(const std::string& prefix); + std::list getChildsWithWords(TrieNode* node); + void dump(); + + TrieNode* root; + std::string seperator; + int lastIdentifier; +}; + +} + + +#endif /* end of include guard: TRIE_H_UZMQRBO5 */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e4f2260..24d05ab 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,21 +1,21 @@ # find_program(XMLLINT xmllint) # if (XMLLINT) -# file(GLOB SCXML_FILES samples/uscxml/*.scxml) +# file(GLOB SCXML_FILES uscxml/*.scxml) # endif() if (NOT WIN32) add_executable(test-predicates src/test-predicates.cpp) target_link_libraries(test-predicates uscxml) - add_test(test-predicates ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-predicates ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-predicates.scxml) + add_test(test-predicates ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-predicates ${CMAKE_SOURCE_DIR}/test/uscxml/test-predicates.scxml) set_target_properties(test-predicates PROPERTIES FOLDER "Tests") endif() -add_test(test-execution ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-execution.scxml) -add_test(test-communication ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser -t5493 ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-communication.scxml) -add_test(test-done-data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-donedata.scxml) +add_test(test-execution ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/uscxml/test-execution.scxml) +add_test(test-communication ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser -t5493 ${CMAKE_SOURCE_DIR}/test/uscxml/test-communication.scxml) +add_test(test-done-data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/uscxml/test-donedata.scxml) if (SWI_FOUND) - add_test(test-prolog-swi ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser -t2345 ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-prolog.scxml) + add_test(test-prolog-swi ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser -t2345 ${CMAKE_SOURCE_DIR}/test/uscxml/test-prolog.scxml) endif() # if (FFMPEG_FOUND) @@ -26,7 +26,7 @@ endif() # endif() if (V8_FOUND) - add_test(test-ecmascript ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-ecmascript.scxml) + add_test(test-ecmascript ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/uscxml-browser ${CMAKE_SOURCE_DIR}/test/uscxml/test-ecmascript.scxml) endif() if (OPENSCENEGRAPH_FOUND AND OFF) @@ -40,6 +40,11 @@ target_link_libraries(test-base64 uscxml) add_test(test-base64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-base64) set_target_properties(test-base64 PROPERTIES FOLDER "Tests") +add_executable(test-trie src/test-trie.cpp) +target_link_libraries(test-trie uscxml) +add_test(test-trie ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-trie) +set_target_properties(test-trie PROPERTIES FOLDER "Tests") + add_executable(test-eventdelay src/test-eventdelay.cpp) target_link_libraries(test-eventdelay uscxml) add_test(test-eventdelay ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-eventdelay) @@ -52,10 +57,15 @@ if (OFF) set_target_properties(test-dirmon PROPERTIES FOLDER "Tests") endif() +add_executable(test-arabica-namespaces src/test-arabica-namespaces.cpp) +target_link_libraries(test-arabica-namespaces uscxml) +add_test(test-arabica-namespaces ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-arabica-namespaces ${CMAKE_SOURCE_DIR}/test) +set_target_properties(test-arabica-namespaces PROPERTIES FOLDER "Tests") + if (NOT WIN32) add_executable(test-arabica-events src/test-arabica-events.cpp) target_link_libraries(test-arabica-events uscxml) - add_test(test-arabica-events ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-arabica-events ${CMAKE_SOURCE_DIR}/test/samples/uscxml/arabica/test-arabica-events.xml) + add_test(test-arabica-events ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-arabica-events ${CMAKE_SOURCE_DIR}/test/uscxml/arabica/test-arabica-events.xml) set_target_properties(test-arabica-events PROPERTIES FOLDER "Tests") add_executable(test-arabica-xpath src/test-arabica-xpath.cpp) @@ -74,7 +84,7 @@ if (NOT WIN32) # else() # target_link_libraries(test-stress uscxml) # endif() - # add_test(test-stress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-stress ${CMAKE_SOURCE_DIR}/test/samples/w3c) + # add_test(test-stress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-stress ${CMAKE_SOURCE_DIR}/test/w3c) # set_target_properties(test-stress PROPERTIES FOLDER "Tests") # if (LIBPURPLE_FOUND) @@ -102,7 +112,7 @@ set_target_properties(test-cmdline-parsing PROPERTIES FOLDER "Tests") # add_executable(test-initial-config src/test-initial-config.cpp) # target_link_libraries(test-initial-config uscxml) -# add_test(test-url ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-initial-config ${CMAKE_SOURCE_DIR}/test/samples/uscxml/test-initial-config.scxml) +# add_test(test-url ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-initial-config ${CMAKE_SOURCE_DIR}/test/uscxml/test-initial-config.scxml) # set_target_properties(test-initial-config PROPERTIES FOLDER "Tests") add_executable(test-datamodel src/test-datamodel.cpp) @@ -134,7 +144,7 @@ target_link_libraries(test-w3c uscxml) set_target_properties(test-w3c PROPERTIES FOLDER "Tests") file(GLOB_RECURSE W3C_TESTS - samples/w3c/*.scxml + w3c/*.scxml ) foreach( W3C_TEST ${W3C_TESTS} ) diff --git a/test/samples/apache/actions-initial-test.xml b/test/samples/apache/actions-initial-test.xml deleted file mode 100644 index d2d3e48..0000000 --- a/test/samples/apache/actions-initial-test.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/samples/apache/actions-parallel-test.xml b/test/samples/apache/actions-parallel-test.xml deleted file mode 100644 index be9d25c..0000000 --- a/test/samples/apache/actions-parallel-test.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/samples/apache/actions-state-test.xml b/test/samples/apache/actions-state-test.xml deleted file mode 100644 index 3374e21..0000000 --- a/test/samples/apache/actions-state-test.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/samples/apache/assign-test-01.xml b/test/samples/apache/assign-test-01.xml deleted file mode 100644 index ed7e977..0000000 --- a/test/samples/apache/assign-test-01.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - 10 - - - 20 - - - - - - - - - - - - - - diff --git a/test/samples/apache/assign-test-02.xml b/test/samples/apache/assign-test-02.xml deleted file mode 100644 index 38ab9b3..0000000 --- a/test/samples/apache/assign-test-02.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - 1 - 2 - - - - - 3 - 4 - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/bar.xml b/test/samples/apache/bar.xml deleted file mode 100644 index 3901080..0000000 --- a/test/samples/apache/bar.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/test/samples/apache/custom-hello-world-01.xml b/test/samples/apache/custom-hello-world-01.xml deleted file mode 100644 index 5d8a348..0000000 --- a/test/samples/apache/custom-hello-world-01.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/custom-hello-world-02.xml b/test/samples/apache/custom-hello-world-02.xml deleted file mode 100644 index 7b27ccf..0000000 --- a/test/samples/apache/custom-hello-world-02.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test/samples/apache/custom-hello-world-03.xml b/test/samples/apache/custom-hello-world-03.xml deleted file mode 100644 index c8cfc5e..0000000 --- a/test/samples/apache/custom-hello-world-03.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test/samples/apache/custom-hello-world-04-el.xml b/test/samples/apache/custom-hello-world-04-el.xml deleted file mode 100644 index 0d5300b..0000000 --- a/test/samples/apache/custom-hello-world-04-el.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/custom-hello-world-04-jexl.xml b/test/samples/apache/custom-hello-world-04-jexl.xml deleted file mode 100644 index c44e9b3..0000000 --- a/test/samples/apache/custom-hello-world-04-jexl.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/datamodel-01.xml b/test/samples/apache/datamodel-01.xml deleted file mode 100644 index cc874fb..0000000 --- a/test/samples/apache/datamodel-01.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - foo - - - - - - - - - - - - - - - - - bar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/datamodel-02.xml b/test/samples/apache/datamodel-02.xml deleted file mode 100644 index b719b8b..0000000 --- a/test/samples/apache/datamodel-02.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - 20 - - - - - - - - - - - - - - - - 30 - - - - - - - - - - - - - diff --git a/test/samples/apache/datamodel-03.xml b/test/samples/apache/datamodel-03.xml deleted file mode 100644 index f8a3310..0000000 --- a/test/samples/apache/datamodel-03.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - 20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 41 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/datamodel-04.xml b/test/samples/apache/datamodel-04.xml deleted file mode 100644 index 503a858..0000000 --- a/test/samples/apache/datamodel-04.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/edit-profile-config.xml b/test/samples/apache/edit-profile-config.xml deleted file mode 100644 index cdab498..0000000 --- a/test/samples/apache/edit-profile-config.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/eventdata-01.xml b/test/samples/apache/eventdata-01.xml deleted file mode 100644 index c07d42d..0000000 --- a/test/samples/apache/eventdata-01.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/eventdata-02.xml b/test/samples/apache/eventdata-02.xml deleted file mode 100644 index df130ae..0000000 --- a/test/samples/apache/eventdata-02.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/eventdata-03.xml b/test/samples/apache/eventdata-03.xml deleted file mode 100644 index d4c4388..0000000 --- a/test/samples/apache/eventdata-03.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - 1 - 2 - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/eventdata-04.xml b/test/samples/apache/eventdata-04.xml deleted file mode 100644 index 541d2e9..0000000 --- a/test/samples/apache/eventdata-04.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/external-hello-world.xml b/test/samples/apache/external-hello-world.xml deleted file mode 100644 index b6d1b9f..0000000 --- a/test/samples/apache/external-hello-world.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/test/samples/apache/foo.xml b/test/samples/apache/foo.xml deleted file mode 100644 index 486d36e..0000000 --- a/test/samples/apache/foo.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/test/samples/apache/hello-world.xml b/test/samples/apache/hello-world.xml deleted file mode 100644 index 7647899..0000000 --- a/test/samples/apache/hello-world.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/samples/apache/history-deep-01.xml b/test/samples/apache/history-deep-01.xml deleted file mode 100644 index 209a974..0000000 --- a/test/samples/apache/history-deep-01.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/history-default-01.xml b/test/samples/apache/history-default-01.xml deleted file mode 100644 index cf2f70f..0000000 --- a/test/samples/apache/history-default-01.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/history-shallow-01.xml b/test/samples/apache/history-shallow-01.xml deleted file mode 100644 index 20b5bb5..0000000 --- a/test/samples/apache/history-shallow-01.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoked-01.xml b/test/samples/apache/invoked-01.xml deleted file mode 100644 index a523995..0000000 --- a/test/samples/apache/invoked-01.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoked-02.xml b/test/samples/apache/invoked-02.xml deleted file mode 100644 index b1b471a..0000000 --- a/test/samples/apache/invoked-02.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoked-03-01.xml b/test/samples/apache/invoked-03-01.xml deleted file mode 100644 index 3b73a66..0000000 --- a/test/samples/apache/invoked-03-01.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoked-03.xml b/test/samples/apache/invoked-03.xml deleted file mode 100644 index 91244e8..0000000 --- a/test/samples/apache/invoked-03.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoker-01.xml b/test/samples/apache/invoker-01.xml deleted file mode 100644 index 5355896..0000000 --- a/test/samples/apache/invoker-01.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoker-02.xml b/test/samples/apache/invoker-02.xml deleted file mode 100644 index a6fb2cb..0000000 --- a/test/samples/apache/invoker-02.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - diff --git a/test/samples/apache/invoker-03.xml b/test/samples/apache/invoker-03.xml deleted file mode 100644 index be2d1fa..0000000 --- a/test/samples/apache/invoker-03.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/invoker-04.xml b/test/samples/apache/invoker-04.xml deleted file mode 100644 index 81c1bb8..0000000 --- a/test/samples/apache/invoker-04.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - foo - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/samples/apache/issue62-01-ext.xml b/test/samples/apache/issue62-01-ext.xml deleted file mode 100644 index 8c65a78..0000000 --- a/test/samples/apache/issue62-01-ext.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - diff --git a/test/samples/apache/issue62-01.xml b/test/samples/apache/issue62-01.xml deleted file mode 100644 index 3599e5e..0000000 --- a/test/samples/apache/issue62-01.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/samples/apache/issue62-02-ext.xml b/test/samples/apache/issue62-02-ext.xml deleted file mode 100644 index 98da5d6..0000000 --- a/test/samples/apache/issue62-02-ext.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/issue62-02.xml b/test/samples/apache/issue62-02.xml deleted file mode 100644 index 8e52e42..0000000 --- a/test/samples/apache/issue62-02.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/issue62-03-ext.xml b/test/samples/apache/issue62-03-ext.xml deleted file mode 100644 index 0168447..0000000 --- a/test/samples/apache/issue62-03-ext.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/issue62-03.xml b/test/samples/apache/issue62-03.xml deleted file mode 100644 index 46b8991..0000000 --- a/test/samples/apache/issue62-03.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/issue64-01.xml b/test/samples/apache/issue64-01.xml deleted file mode 100644 index bb848fe..0000000 --- a/test/samples/apache/issue64-01.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/issue64-02.xml b/test/samples/apache/issue64-02.xml deleted file mode 100644 index 7e44d30..0000000 --- a/test/samples/apache/issue64-02.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/jsp-rootctx-test.xml b/test/samples/apache/jsp-rootctx-test.xml deleted file mode 100644 index 6a71579..0000000 --- a/test/samples/apache/jsp-rootctx-test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/samples/apache/log-on-config.xml b/test/samples/apache/log-on-config.xml deleted file mode 100644 index b57780e..0000000 --- a/test/samples/apache/log-on-config.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-01.xml b/test/samples/apache/microwave-01.xml deleted file mode 100644 index 86efa26..0000000 --- a/test/samples/apache/microwave-01.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-02-legacy.xml b/test/samples/apache/microwave-02-legacy.xml deleted file mode 100644 index eaeb14a..0000000 --- a/test/samples/apache/microwave-02-legacy.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-02.xml b/test/samples/apache/microwave-02.xml deleted file mode 100644 index c03fe05..0000000 --- a/test/samples/apache/microwave-02.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-03.xml b/test/samples/apache/microwave-03.xml deleted file mode 100644 index 887b1a6..0000000 --- a/test/samples/apache/microwave-03.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-04.xml b/test/samples/apache/microwave-04.xml deleted file mode 100644 index 96656dd..0000000 --- a/test/samples/apache/microwave-04.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/microwave-05.xml b/test/samples/apache/microwave-05.xml deleted file mode 100644 index 06b9fc9..0000000 --- a/test/samples/apache/microwave-05.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/parallel-01.xml b/test/samples/apache/parallel-01.xml deleted file mode 100644 index e822285..0000000 --- a/test/samples/apache/parallel-01.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/parallel-02.xml b/test/samples/apache/parallel-02.xml deleted file mode 100644 index 106fc86..0000000 --- a/test/samples/apache/parallel-02.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - diff --git a/test/samples/apache/parallel-03.xml b/test/samples/apache/parallel-03.xml deleted file mode 100644 index d57196a..0000000 --- a/test/samples/apache/parallel-03.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/samples/apache/prefix-01.xml b/test/samples/apache/prefix-01.xml deleted file mode 100644 index 79cbe69..0000000 --- a/test/samples/apache/prefix-01.xml +++ /dev/null @@ -1,29 +0,0 @@ - - -