Simulator
basilsim simulates a parser. It reads the log file generated by
basil, allocates the parser tables dynamically, then parses
the input you provide.
basilsim is run from the command line as follows:
basilsim [options] input-file
Options begin with the - character. The options are:
-
-l log-filename
-
Set the name of the log file generated by basil. By default,
the name of the log file is
log.txt.
-
-a start-state
-
Set the parsing start state. By default, the parser will start at
state
0.
-
-t
-
Print to standard output all state transitions.
-
-s
-
Print to standard output the complete syntax tree.
-
-r rec-commands
-
Set the syntax error recover strategies, comma delimited. The strategies
are (
TOKEN is a token name):
-
i:TOKEN
-
insert
TOKEN
-
i:[TOKEN,TOKEN,...]
-
insert a sequence of
TOKENs
-
d
-
delete one token
-
d:NUMBER
-
delete at most
NUMBER tokens
-
d:TOKEN
-
delete
TOKEN
-
r:TOKEN
-
replace one token with
TOKEN
-
r:TOKEN:NUMBER
-
replace at most
NUMBER tokens with TOKEN
-
r:TOKEN:TOKEN
-
replace (second)
TOKEN with (first) TOKEN
-
r:[TOKEN,TOKEN,...]
-
replace one token with a sequence of
TOKENs
-
r:[TOKEN,TOKEN,...]:NUMBER
-
replace at most
NUMBER tokens with a sequence of TOKENs
-
r:[TOKEN,TOKEN,...]:TOKEN
-
replace
TOKEN with a sequence of TOKENs
In the log file and input file the '#' character and all remaining
characters on the line are ignored.
The lexemes in the input file must be token names, the same names used in
the grammar file.
If the -t option is set, then the trace flag is set
to true when the parser is called.
|