Brute Parser

Brute Parser is a tool for parsing restricted (regular, context free) and unrestricted grammars by creating a derivation tree of all possible derivations. The shortest derivation found is displayed in either a textual derivation format or a graphical parse tree. Below is a picture of both the textual visualization and the graphical visualization in the parser.

User Input
In the text area at the top of the window, the user needs to enter a 'String to parse.' The string to be parsed can consist only of terminals in the grammar (do not enter any blanks! they will be treated as illegal input). The grammar in the parsing window cannot be changed. If you decide to go back to the production window and change the grammar, you need to create a new parsing window by clicking on the Parser button in the production window.

Parsing
The parser will try to find whether a word inputted by the user exists within the language defined by the grammar, and if so, it will give the user a derivation for the word.

The parser is started by pressing the 'Parse' button, and as long as the program is parsing, the 'Parse' button will stay depressed, with images flashing on it. The user can stop the parser by choosing the 'Pause Parser' button -- a dialog window will pop up, informing how many nodes were created in the parser tree, and asking whether the user would like to continue.

If the parser has been busy for a long time with no results, the program will pop up a window informing the user that the word has not yet been found, and that it might not exist within the language. (Advice from the author: discontinue parsing only after several notices have popped up -- some words can take a very long time to parse).

Stepping through the Output
After the parsing is done, only the starting variable is shown. The buttons at the bottom of the parser window will become enabled and allow for the gradual revelation of the derivation. Pressing "Show Next" will show the next step in the derivation. Pressing "Show Previous" will show the previous step in the derivation. Pressing "Show All" will show all of the steps in the resulting derivation. When stepping through a derivation, the textual and the graphical representations will stay synchronized.

Parser Output
If the parser is stopped while parsing, or the word is not in the language, a message will appear in the large text area at the bottom of the window. If the word is found in the language, a derivation will appear in the text area.

The user can choose with the combo box above the text area the output form for the derivation. The 'Text Output' displays a texual derivation and the productions used in the derivation. The 'Graphical Output' draws a parse tree for the word, showing which productions where used and where. The colored nodes (leaves), read from left to right, spell out the word. Nodes that are grouped together via a purple oval are the result of unrestricted rules. The nodes that are grouped represent the left side of the unrestricted rule. The nodes resulting from the group represent the right side of the unrestricted rule.

Saving Output
The user can save a derivation by choosing the 'File' 'Save Derivation As' menu option. The derivation will be saved in a ASCII text form.

Menu Items
The parser has the following menu items