com.inxar.syntacs.automaton.pushdown
Class LR1Constructor
java.lang.Object
|
+--com.inxar.syntacs.automaton.pushdown.LRConstructor
|
+--com.inxar.syntacs.automaton.pushdown.LR1Constructor
- All Implemented Interfaces:
- DPAConstructor, Vizualizable
- public class LR1Constructor
- extends LRConstructor
- implements Vizualizable
Concrete implementation of LRConstructor
that builds
canonical LR1 parse tables. The algorithm used by this class was
coded based directly on the Dragon Book.
LR1Constructor
public LR1Constructor()
- Constructs an
LR1Constructor
.
closure
public IntSet closure(IntSet set)
- Returns the closure set of the given set of items.
getNextSet
public IntSet getNextSet(IntSet items)
- Calculates and returns the next set of items for the given set
of items. Each member in the set corresponds the the ID of a
grammar symbol.
construct
public DPA construct(ContextFreeSet grammar)
throws AlgorithmException
- Description copied from interface:
DPAConstructor
- Constructs a
DPA
.
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