com.inxar.syntacs.grammar.context_free
Class CFLR1Item

java.lang.Object
  |
  +--com.inxar.syntacs.grammar.context_free.CFLR1Item
All Implemented Interfaces:
Item, LR1Item

public class CFLR1Item
extends Object
implements LR1Item

Standard LR1Item implementation.


Method Summary
 Item getCore()
          Returns the Item which represents the core of this Item.
 IntSet getFirstSet()
          Return a IntSet of Items over the FIRST(beta, a);
 int getID()
          Returns the unique allocated ID for this Item.
 Terminal getLookahead()
          Returns the Terminal symbol which may follow 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].
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getID

public int getID()
Description copied from interface: Item
Returns the unique allocated ID for this Item.
Specified by:
getID in interface Item

getProduction

public Production getProduction()
Description copied from interface: Item
Returns the Production to which this Item is associated.
Specified by:
getProduction in interface Item

getLookahead

public Terminal getLookahead()
Description copied from interface: LR1Item
Returns the Terminal symbol which may follow this Item.
Specified by:
getLookahead in interface LR1Item

getCore

public Item getCore()
Description copied from interface: LR1Item
Returns the Item which represents the core of this Item.
Specified by:
getCore in interface LR1Item

hasNext

public boolean hasNext()
Description copied from interface: Item
Returns true if the dot is not after the last symbol in the Production.
Specified by:
hasNext in interface Item

hasPrevious

public boolean hasPrevious()
Description copied from interface: Item
Returns true if the dot is not before the first symbol in the Production.
Specified by:
hasPrevious in interface Item

nextItem

public Item nextItem()
Description copied from interface: Item
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.
Specified by:
nextItem in interface Item

previousItem

public Item previousItem()
Description copied from interface: Item
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.
Specified by:
previousItem in interface Item

nextSymbol

public GrammarSymbol nextSymbol()
Description copied from interface: Item
Returns the GrammarSymbol b where [a dot b].
Specified by:
nextSymbol in interface Item

previousSymbol

public GrammarSymbol previousSymbol()
Description copied from interface: Item
Returns the GrammarSymbol a where [a dot b].
Specified by:
previousSymbol in interface Item

lookahead

public LR1Item lookahead(Terminal lookahead)
Description copied from interface: Item
Returns an LR1Item corresponding to this core Item with the given lookahead.
Specified by:
lookahead in interface Item

getFirstSet

public IntSet getFirstSet()
Description copied from interface: Item
Return a IntSet of Items over the FIRST(beta, a);
Specified by:
getFirstSet in interface Item

toString

public String toString()
Overrides:
toString in class Object