com.inxar.syntacs.automaton.pushdown
Class LALR1Constructor

java.lang.Object
  |
  +--com.inxar.syntacs.automaton.pushdown.LALR1Constructor
All Implemented Interfaces:
DPAConstructor, Vizualizable

public class LALR1Constructor
extends Object
implements DPAConstructor, Vizualizable

Concrete implementation of LRConstructor that builds LALR1 parse tables. The implementation of this class was coded based directly on: DeRemer, F.; and Pennello, T. Efficient computation of LALR(1) look-ahead sets, ACM Trans. Program. Lang. Syst. 4 (1982), 615-649. as well as the simpler explanation of this algorithm given in: The Theory and Practice of Compiler Writing (McGraw-Hill Computer Science Series) by Jean-Paul Tremblay, Paul G. Sorenson .


Constructor Summary
LALR1Constructor()
          Constructs the LALR1Constructor.
 
Method Summary
 DPA construct(ContextFreeSet grammar)
          Constructs a DPA.
 String toString()
           
 void vizualize(GraphViz dot)
          Burn state to the GraphViz instance such that the instance may be visualized in postscript.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LALR1Constructor

public LALR1Constructor()
Constructs the LALR1Constructor. The setGrammar(ContextFreeSet) method needs to be called before the construct() method.
Method Detail

construct

public DPA construct(ContextFreeSet grammar)
              throws AlgorithmException
Description copied from interface: DPAConstructor
Constructs a DPA.
Specified by:
construct in interface DPAConstructor

toString

public String toString()
Overrides:
toString in class Object

vizualize

public void vizualize(GraphViz dot)
Description copied from interface: Vizualizable
Burn state to the GraphViz instance such that the instance may be visualized in postscript.
Specified by:
vizualize in interface Vizualizable