This module implements a server function for node.js to script the practice page model, i.e., to run the examples from the command line.
Methods
-
<async, inner> script()
-
The server function. Blank-separated words, read from standard input, have the effects described below. Any other word is interpreted as a path from which an example is merged into the global strings.
word effect modelresets all flags and variables. loadresets global strings. ebnf,stack,bnfclear all flags and set a mode. actions,build,deep,error,follow,greedy,noargs,lookahead,parser,sets,shallow,statestoggle flags. newcalls model.doNew().scancalls model.doScan().parsecalls model.doParse().runcalls model.doRun().1calls model.doStep(1).10calls model.doStep(10).100calls model.doStep(100).exit terminates the script Example
Load an example, compile and run with each parser, overwrite parts, and repeat.
$ node script.js << 'end' model eg/06/06.eg new parse run stack new parse run ebnf test/06-06a.eg new parse run stack new parse run end