-
Notifications
You must be signed in to change notification settings - Fork 3
Grun.Exe
The Grun.exe tool is an almost entirely faithful port of functionality from the existing Antlr Java TestRig tool. This tool will allow you to test and debug your C# deployed grammar from the command line. The tool has two required arguments. The first is the name of the grammar you wish to load and the second is the name of the parser rule you want to use. If you grammar only contains a lexer, you may use the parser rule 'tokens'. The There is a third optional file name argument you may pass if you wish to parse the contents of a file. If you do not supply the optinal file name, then the console will begin reading from the standard input and expect you to enter some text to be parsed. The usage of the tool is as follows
Grun.exe <Grammar Name> <Parser Rule Name> [<Input File>] [Option flags]
The supported command line option flags are as follows:
Note that the flags require two dashes, not one
--tokens = Displays a list of parsed grammar tokens.
--tree = Displays the parse tree in a Lisp style format.
--SLL = Parses the text using Simple LL prediction mode.
--diagnostics = Parses the text using LL exact ambiguous detection prediction mode. (Note that if you specify this option and the SLL option, SLL will take precedence)
--gui = Opens the GrunWin.exe tool with the other specified settings.
--svg <file name> = Writes the parse tree graph to a scalable vector grahpics file with the specfied file path and name.
--encoding <encoding name> = Instructs Grun to use the specified file encoding when loading the specified input file. If no input file was specified, this option gets ignored.
--trace = Displays a list of trace events, demonstrating the the parser's logic when evaluating the tokens and rules.
--help = Displays the usage help message for the tool.
--version = Displays version information for the tool.