Class LRTableReader

java.lang.Object
  |
  +--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
LRTableReader()
           
 
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

LRTableReader

public LRTableReader()
Method Detail

readTable

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.

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