Test Grammar

Format

goldtest Table-File Test-File [Log-File] [options]

Overview

After the grammar has been successfully compiled by the Builder, the developer can check how Deterministic Finite Automata and LALR algorithms will analyze any number of test cases.

To test the behavior of the algorithms, a local embedded implementation of the Visual Basic 6 Engine is used. Although different implementations of the Engine exist, the behavior of the LALR and DFA algorithms is constant. Regardless of whether an Engine is written for Visual Basic, C++ or Java, the parse tables will create the same number of reductions and will accept or reject the same information. As a result, the specific details on how the Engine was implemented, will have no effect on testing.

Details

Field Values Description
Table File Required. This can be either a CGT or EGT file.
Test File Required. This file will be read and parsed.
Log File Optional. If this field is left blank, the program will automatically create a filename using the test file's filename. The new filename will contain the same base, but will have a .out extension. For example, if the test filename is "test.txt", the file "test.out" will be created.
Options -verbose,
+verbose
If this flag is set to true, the program will output progress text to the screen as well as error messages. If set to false, no output will be generated. It defaults to true.
-logs,
+logs
If this option is set to true, a separate log file will be generated for each file tested. The file will contain detailed information about what parse actions were taken and where if any errors occured.
-tree,
+tree
If this flag is set to true, a text version of the parse tree will be saved to the Log File. This feature is identical to the Export Parse Tree option in the Windows version of the Builder. If the test file is not accepted by the parser (there was a syntax or  lexical error), then no tree will be generated. The option defaults to "+tree" if not specified.
-trim,
+trim
If this flag is set true, the program will use the Trim Reductions feature This reduces the number of nodes in the parse tree.
-noise,
+noise
If set to true, the individual parse logs will record when noise (comments, whitespace, etc... were read. This defaults to false.
-actions,
+actions
If this flag is set to true, the parse actions performed by the Engine will be saved to the Log File. The option defaults to "+actions" if not specified.

Note: If you prefer, you can use the common / character for designating options. The slash will be interpreted as a +.  So, +verbose can be specified as /verbose.