org.inxar.syntacs.grammar.context_free
Interface Item

All Known Subinterfaces:
LR1Item
All Known Implementing Classes:
CFItem

public interface Item

The Item interface represents a discrete position or progress along the right hand side of a Production.


Method Summary
 IntSet getFirstSet()
          Return a IntSet of Items over the FIRST(beta, a);
 int getID()
          Returns the unique allocated ID for this Item.
 Production getProduction()
          Returns the Production to which this Item is associated.
 boolean hasNext()
          Returns true if the dot is not after the last symbol in the Production.
 boolean hasPrevious()
          Returns true if the dot is not before the first symbol in the Production.
 LR1Item lookahead(Terminal lookahead)
          Returns an LR1Item corresponding to this core Item with the given lookahead.
 Item nextItem()
          Returns the Item which represents moving the dot forward one symbol.
 GrammarSymbol nextSymbol()
          Returns the GrammarSymbol b where [a dot b].
 Item previousItem()
          Returns the Item which represents moving the dot backwards one symbol.
 GrammarSymbol previousSymbol()
          Returns the GrammarSymbol a where [a dot b].
 

Method Detail

getID

public int getID()
Returns the unique allocated ID for this Item.

getProduction

public Production getProduction()
Returns the Production to which this Item is associated.

hasNext

public boolean hasNext()
Returns true if the dot is not after the last symbol in the Production.

hasPrevious

public boolean hasPrevious()
Returns true if the dot is not before the first symbol in the Production.

nextItem

public Item nextItem()
Returns the Item which represents moving the dot forward one symbol. If there is no such Item (ie the dot is already at the end), null is returned.

previousItem

public Item previousItem()
Returns the Item which represents moving the dot backwards one symbol. If there is no such Item (ie the dot is already at the beginning), null is returned.

nextSymbol

public GrammarSymbol nextSymbol()
Returns the GrammarSymbol b where [a dot b].

previousSymbol

public GrammarSymbol previousSymbol()
Returns the GrammarSymbol a where [a dot b].

getFirstSet

public IntSet getFirstSet()
Return a IntSet of Items over the FIRST(beta, a);

lookahead

public LR1Item lookahead(Terminal lookahead)
Returns an LR1Item corresponding to this core Item with the given lookahead.