LALR State Browser Window

Overview

Most errors that occur in grammars are found in the LALR State Table. When the system analyzes a grammar and computes the parser tables, often shift-reduce and reduce-reduce conflicts are occur. These conflicts are caused, ultimately, by ambiguities in the grammar which might not obvious to the developer.

The LALR State Table Window allows the developer to review the produced states - in particular the state that contains the error.

Controls

The LALR State Browser functions much like a common Internet web browser. If you double click on any "Shift" or "Goto" link, the window will automatically advance to that state. At the bottom of the window, there are a number of simple controls that allow you to jump to any state in table or return to the last state you were examining.

Browser Controls

The "Back" and "Forward" buttons function exactly like those found on an Internet web browser. To the right of these buttons, a series of controls allow you jump to any state in the table.

Screenshots

The LALR State Browser window consists of three different tabs which contain information about the current state. The Configurations Tab displays the configuration set that the state represents. Essentially, each LALR state represents a particular "state" the system can be in during the parse. Rules which are being analyzed are called "configurations" with a cursor (representing the parse) represented by a dot.

For each token (an instance of a terminal) received from the scanner, the LR algorithm can take four different actions: Shift, Reduce, Accept and Goto.

 

Each configuration has a Lookahead Set which contains all the terminals that can follow it. This information is used to create the actions - what the parser can do - at the current state.

 

The third tab in the LALR State Browser contains all the "prior states". Each of these states will advance to the current state through either a shift or goto.

Essentially, this tab allows the developer to move backwards through the state table.