CLI Tool

December 28, 2020 ยท View on GitHub

All subcommands:

watson encode

Usage

watson encode -t=TYPE [-initial-mode=MODE] [FILE]

Converts FILE of type TYPE into Watson and outputs its Watson Representation to the standard output.

If FILE is not specified, it uses the standard input.

Flags

flagmandatorytypedefaultdescription
-tnojson, yaml, msgpack, or cboryamlinput file format
-initial-modenoA or SAinitial mode of the lexer. see the specification for more details.

watson decode

Usage

watson decode -t=TYPE [-initial-mode=MODE] [-stack-size=SIZE] [FILES...]

Converts Watson files FILES into another format that is specified by TYPE and outputs it to the standard output.

If FILES is not specified, it uses the standard input.

If multiple files are specified, they are executed sequencially by the same lexer and VM, that is, the mode of the lexer and the stack of the VM remains unchanged when the VM finished processing one file and continues to another. After processing the last file, a value at the top of the VM's stack is displayed.

Flags

flagmandatorytypedefaultdescription
-tnojson, yaml, msgpack, or cboryamlinput file format
-initial-modenoA or SAinitial mode of the lexer. see the specification for more details.
-stack-sizenointeger1024stack size of the VM. see the specification for more details.