Class LRTableReader


public class LRTableReader
extends java.lang.Object

This class contains a static method for reading an LR parsing table from a file

Constructor Summary
Method Summary
static LRTable readTable(java.lang.String fname)
          Reads an LR parsing table from a file.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public LRTableReader()
Method Detail


public static LRTable readTable(java.lang.String fname)
                         throws java.lang.Exception
Reads an LR parsing table from a file. File should have one line per table entry, where each line has one of the following forms:

state terminal s newstate

state terminal r production

state terminal acc

state nonterminal newstate

Start state should be the state in the first line of the file.

fname - name of the file
LRTable object built from lines in file
java.lang.Exception - on file open/read error or malformed table