A command line interface is provided.
The grammar command provides a simple way to check the current EBNF grammar:
> storyscript grammar
...
boolean: TRUE| FALSE
null: NULL
number: INT| FLOAT
...
The lex command print a list of all the tokens in a story:
> storyscript lex hello.story
...tokens list
The parse command returns the internal representation of the abstract syntax tree (AST) after the parsing phase:
> storyscript lex hello.story
...tokens list
The compile command compiles stories:
> storyscript parse hello.story
Script syntax passed!
A JSON output of the compilation is available:
> storyscript parse -j hello.story
{
"stories": {
"one.story": {
"tree": {
...
It’s possible to specify an EBNF file, instead of using the generated one. This is particularly useful for debugging:
> storyscript parse --ebnf-file grammar.ebnf hello.story