Setting Flags
Brainhat maintains a collection of around 260 state flags. Some are for debug. Others are for other purposes. You can see which flags are set under debug:
$ ./run
make: 'data' is up to date.
Initializing
>> debug
Break in debug at the start:
debug> flags
Global match level = 1
Match level = 1
creditspkr
verbatim
repeat
debug, start
debug>
The same flag may be set multiple times. It is only "unset" when there are no copies of the flag left in the list.
To set a flag, use the "set" command:
debug> set addtocontext
debug>
This sets the flag "addtocontext." Check to see that the flag is set:
debug> flags
Global match level = 1
Match level = 1
addtocontext
creditspkr
verbatim
repeat
debug, start
debug>
We see "addtocontext" among the flags. What does it do? It sets debug output for one of the many grammar post-processing routines, addtocontext():
debug> exit
>> i love my dog
addtocontext: testing concept = Root-05f68bd2
Adding recently cloned con speaker-1,{dirty}.
Labelling just cloned con: dog-n1 to dog-aaf0.
Adding recently cloned con dog-aaf0,{dirty}.
You love your dog.
addtocontext: testing concept = Root-05f68c0a
A complete list of the state flags can be found in constant.h, in the second block of constant declarations.
State flags can also be set on the command line, like so:
$ ./brainhat +repeat +addtocontext
>> i love my dog
addtocontext: testing concept = Root-05f68b9b
Adding recently cloned con speaker-1,{dirty}.
Labelling just cloned con: dog-n1 to dog-aab9.
Adding recently cloned con dog-aab9,{dirty}.
You love your dog.
addtocontext: testing concept = Root-05f68bd3
>>