Flashtease analysis tool
Posted: Tue Dec 29, 2009 6:59 pm
It find it quite anoying, if I stumble accross errors in flashteases. Especially if it took quite some time to do the tease up to that point, I'm realy horny and I can't finish the tease because of some missspelled page name in the script.
Thus I thought it would be nice to have a tool that checks scripts for some common errors and prints out a list of terminal pages so that an author can take a look and see whether or the tease was intended to end there.
The tool can be downloaded here: http://milovanaflashparser.kenai.com/
I'm also willing to publish the source code but until now its rather prototypish.
As an example I took the liberty to analyse the last flash tease "Paige decides your orgasm"
At first the parser just terminates with an error, since the script contains some empty parantheses "()" after page 14. Maybe the flashtease viewer doesn't care about them, but I didn't click through the tease that far.
After fixing that my program produces the following output.
##Relevant pages:
[]
### Undefined pages:
20preend
22
18a-repeat
21b
21c
21d
### Terminal pages:
17end
16end
18end
20h
20goodend
end
19end
### Transitions:
{start: {}, {}} -> {page2: {}, {}}
{page2: {}, {}} -> {page3: {}, {}}
{page3: {}, {}} -> {page4: {}, {}}
{page4: {}, {}} -> {page5: {}, {}}
{page5: {}, {}} -> {page6: {}, {}}
{page6: {}, {}} -> {page7: {}, {}}
{page7: {}, {}} -> {page8: {}, {}}
{page8: {}, {}} -> {page12: {}, {}}
{page8: {}, {}} -> {page9: {}, {}}
{page12: {}, {}} -> {page13: {}, {}}
{page9: {}, {}} -> {page10: {}, {}}
{page13: {}, {}} -> {page14: {}, {}}
{page10: {}, {}} -> {end: {}, {}}
{page10: {}, {}} -> {page11: {}, {}}
{page14: {}, {}} -> {page15: {}, {}}
{page11: {}, {}} -> {page12: {}, {}}
{page15: {}, {}} -> {18: {}, {}}
{page15: {}, {}} -> {20: {}, {}}
{page15: {}, {}} -> {16: {}, {}}
{page15: {}, {}} -> {17: {}, {}}
{page15: {}, {}} -> {21: {}, {}}
{page15: {}, {}} -> {19: {}, {}}
{18: {}, {}} -> {18a: {}, {}}
{20: {}, {}} -> {20a: {}, {}}
{16: {}, {}} -> {16a: {}, {}}
{17: {}, {}} -> {17a: {}, {}}
{21: {}, {}} -> {21a: {}, {}}
{19: {}, {}} -> {19a: {}, {}}
{18a: {}, {}} -> {18b: {}, {}}
{20a: {}, {}} -> {20b: {}, {}}
{16a: {}, {}} -> {16b: {}, {}}
{17a: {}, {}} -> {17b: {}, {}}
{19a: {}, {}} -> {19b: {}, {}}
{18b: {}, {}} -> {18c: {}, {}}
{20b: {}, {}} -> {20c: {}, {}}
{16b: {}, {}} -> {16c: {}, {}}
{17b: {}, {}} -> {17c: {}, {}}
{19b: {}, {}} -> {19c: {}, {}}
{18c: {}, {}} -> {18d: {}, {}}
{18c: {}, {}} -> {18end: {}, {}}
{20c: {}, {}} -> {20d: {}, {}}
{16c: {}, {}} -> {16end: {}, {}}
{17c: {}, {}} -> {17d: {}, {}}
{19c: {}, {}} -> {19d: {}, {}}
{18d: {}, {}} -> {18end: {}, {}}
{20d: {}, {}} -> {20e: {}, {}}
{17d: {}, {}} -> {17e: {}, {}}
{19d: {}, {}} -> {19e: {}, {}}
{20e: {}, {}} -> {20f: {}, {}}
{17e: {}, {}} -> {17f: {}, {}}
{19e: {}, {}} -> {19f: {}, {}}
{20f: {}, {}} -> {20g: {}, {}}
{17f: {}, {}} -> {17g: {}, {}}
{19f: {}, {}} -> {19g: {}, {}}
{20g: {}, {}} -> {20h: {}, {}}
{17g: {}, {}} -> {17end: {}, {}}
{19g: {}, {}} -> {19end: {}, {}}
### Deadlocks:
{21a: {}, {}}
### Unreachable pages:
22b
22c
22d
20goodend
### Terminal states:
{20h: {}, {}}
{17end: {}, {}}
{18end: {}, {}}
{19end: {}, {}}
{end: {}, {}}
{16end: {}, {}}
{21a: {}, {}}
"Relevant Pages" lists pages where the set-status has to be considered. In this case (and most other case) there are no such pages.
"Undefined Pages" lists pages, that are used by some actions but are never defined. So this tease clearly has some errors.
"Terminal Pages" list pages, that contain no actions. The user has to check, whether this is intended.
"Transitions" list possible transitions between actions. This is more for debugging reasons but may be helpfull for smaller teases.
"Deadlocks" lists states, that can be reached and the related page has some actions but no action can be executed. In this case the action refers to an undefined page, but a deadlock can also occure because of the set-status of a page, the range command and must/mustnot conditions.
"Unreachable Pages" list pages, that can't be reached. Usually this indicates an error, but some teases use unreachable actions as flags using their set-status.
"Terminal States" lists the states reached when a terminal page is reached. Between the empty braces "{}" the program puts out information about the set-status of relevant pages. So this listing is only interessting if the set-feature is used.
I hope for some feedback, whether this tool is usefull and how it may be improved.
dtspam
Thus I thought it would be nice to have a tool that checks scripts for some common errors and prints out a list of terminal pages so that an author can take a look and see whether or the tease was intended to end there.
The tool can be downloaded here: http://milovanaflashparser.kenai.com/
I'm also willing to publish the source code but until now its rather prototypish.
As an example I took the liberty to analyse the last flash tease "Paige decides your orgasm"
At first the parser just terminates with an error, since the script contains some empty parantheses "()" after page 14. Maybe the flashtease viewer doesn't care about them, but I didn't click through the tease that far.
After fixing that my program produces the following output.
##Relevant pages:
[]
### Undefined pages:
20preend
22
18a-repeat
21b
21c
21d
### Terminal pages:
17end
16end
18end
20h
20goodend
end
19end
### Transitions:
{start: {}, {}} -> {page2: {}, {}}
{page2: {}, {}} -> {page3: {}, {}}
{page3: {}, {}} -> {page4: {}, {}}
{page4: {}, {}} -> {page5: {}, {}}
{page5: {}, {}} -> {page6: {}, {}}
{page6: {}, {}} -> {page7: {}, {}}
{page7: {}, {}} -> {page8: {}, {}}
{page8: {}, {}} -> {page12: {}, {}}
{page8: {}, {}} -> {page9: {}, {}}
{page12: {}, {}} -> {page13: {}, {}}
{page9: {}, {}} -> {page10: {}, {}}
{page13: {}, {}} -> {page14: {}, {}}
{page10: {}, {}} -> {end: {}, {}}
{page10: {}, {}} -> {page11: {}, {}}
{page14: {}, {}} -> {page15: {}, {}}
{page11: {}, {}} -> {page12: {}, {}}
{page15: {}, {}} -> {18: {}, {}}
{page15: {}, {}} -> {20: {}, {}}
{page15: {}, {}} -> {16: {}, {}}
{page15: {}, {}} -> {17: {}, {}}
{page15: {}, {}} -> {21: {}, {}}
{page15: {}, {}} -> {19: {}, {}}
{18: {}, {}} -> {18a: {}, {}}
{20: {}, {}} -> {20a: {}, {}}
{16: {}, {}} -> {16a: {}, {}}
{17: {}, {}} -> {17a: {}, {}}
{21: {}, {}} -> {21a: {}, {}}
{19: {}, {}} -> {19a: {}, {}}
{18a: {}, {}} -> {18b: {}, {}}
{20a: {}, {}} -> {20b: {}, {}}
{16a: {}, {}} -> {16b: {}, {}}
{17a: {}, {}} -> {17b: {}, {}}
{19a: {}, {}} -> {19b: {}, {}}
{18b: {}, {}} -> {18c: {}, {}}
{20b: {}, {}} -> {20c: {}, {}}
{16b: {}, {}} -> {16c: {}, {}}
{17b: {}, {}} -> {17c: {}, {}}
{19b: {}, {}} -> {19c: {}, {}}
{18c: {}, {}} -> {18d: {}, {}}
{18c: {}, {}} -> {18end: {}, {}}
{20c: {}, {}} -> {20d: {}, {}}
{16c: {}, {}} -> {16end: {}, {}}
{17c: {}, {}} -> {17d: {}, {}}
{19c: {}, {}} -> {19d: {}, {}}
{18d: {}, {}} -> {18end: {}, {}}
{20d: {}, {}} -> {20e: {}, {}}
{17d: {}, {}} -> {17e: {}, {}}
{19d: {}, {}} -> {19e: {}, {}}
{20e: {}, {}} -> {20f: {}, {}}
{17e: {}, {}} -> {17f: {}, {}}
{19e: {}, {}} -> {19f: {}, {}}
{20f: {}, {}} -> {20g: {}, {}}
{17f: {}, {}} -> {17g: {}, {}}
{19f: {}, {}} -> {19g: {}, {}}
{20g: {}, {}} -> {20h: {}, {}}
{17g: {}, {}} -> {17end: {}, {}}
{19g: {}, {}} -> {19end: {}, {}}
### Deadlocks:
{21a: {}, {}}
### Unreachable pages:
22b
22c
22d
20goodend
### Terminal states:
{20h: {}, {}}
{17end: {}, {}}
{18end: {}, {}}
{19end: {}, {}}
{end: {}, {}}
{16end: {}, {}}
{21a: {}, {}}
"Relevant Pages" lists pages where the set-status has to be considered. In this case (and most other case) there are no such pages.
"Undefined Pages" lists pages, that are used by some actions but are never defined. So this tease clearly has some errors.
"Terminal Pages" list pages, that contain no actions. The user has to check, whether this is intended.
"Transitions" list possible transitions between actions. This is more for debugging reasons but may be helpfull for smaller teases.
"Deadlocks" lists states, that can be reached and the related page has some actions but no action can be executed. In this case the action refers to an undefined page, but a deadlock can also occure because of the set-status of a page, the range command and must/mustnot conditions.
"Unreachable Pages" list pages, that can't be reached. Usually this indicates an error, but some teases use unreachable actions as flags using their set-status.
"Terminal States" lists the states reached when a terminal page is reached. Between the empty braces "{}" the program puts out information about the set-status of relevant pages. So this listing is only interessting if the set-feature is used.
I hope for some feedback, whether this tool is usefull and how it may be improved.
dtspam