new Model(global)
Create a model.
Parameters:
| Name | Type | Description |
|---|---|---|
global |
object | either |
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
grammar |
string | global |
|
tokens |
string | global |
|
skip |
RegExp | set by |
|
actions |
string | global |
|
program |
string | global |
|
mode |
string |
|
|
greedy |
boolean | use |
|
error |
boolean | insert |
|
tShallow |
boolean | trace algorithm and display sets. |
|
tDeep |
boolean | trace algorithm and display sets. |
|
tFollow |
boolean | trace algorithm and display sets. |
|
dSets |
boolean | display sets. |
|
dStates |
boolean | display states. |
|
tLookahead |
boolean | trace lookahead during parse. |
|
tParser |
boolean | trace parse. |
|
tActions |
boolean | trace actions. |
|
tNoargs |
boolean | do not check argument count for actions. |
|
build |
boolean | build lists. |
|
memory |
Array |
<nullable> |
for stepping a stack machine. |
Examples
// Use in scripting in a Windows environment new Model(windows);
// Use in scripting in a node.js environment new Model(globalThis);
Methods
-
doNew()
-
Event:
eval?.(tokens), if any, and represent and check the grammar; modifiesg, clearsrun, and removesmemory.- Source:
-
doParse()
-
Event:
eval?.(this.actions), if any, create a parser, and parse the program; modifiesrunand removesmemory.- Source:
-
doRun()
-
Event: run the executable, if any.
- Source:
-
doScan()
-
Event: create a scanner and apply it to this.program.
- Source:
-
doStep(n)
-
Event: step the stack machine, if any.
Parameters:
Name Type Description nnumber number of steps to execute.
- Source: