Package org.extendj.neobeaver
Class Item
- java.lang.Object
-
- org.extendj.neobeaver.Item
-
public class Item extends java.lang.ObjectAn Item is a parsing rule with a dot at the current symbol position. LR1 rules have an additional lookahead symbol.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFollow(Symbol sym)voidaddFollows(java.util.Collection<Symbol> sym)voidaddToFollowSet(java.util.Map<Symbol,Tuple<Symbol,ItemSet>> map)Add the item set following this one to the follow set argument.Itemadvance()SymbolafterDot()ItembaseItem()Gives an item identical to this one but without follow symbol.booleancanAdvance()booleanequals(java.lang.Object obj)java.util.Collection<Symbol>followSyms()inthashCode()java.util.Collection<Item>immediateExtension(Grammar grammar)booleannullable(Grammar grammar)Returns true if this item is nullable.booleannullableAfter(int pos, Grammar grammar)Returns true if the symbols after the given position form a nullable sentence.java.util.Collection<Tuple3<ItemSet,Symbol,Action>>reduceActions(Grammar grammar, ItemSet set)booleanrelated(Symbol sym)Returnstrueif the this item is related to a conflict on symbolsym.java.lang.StringtoString()
-
-
-
Method Detail
-
addFollow
public void addFollow(Symbol sym)
-
addFollows
public void addFollows(java.util.Collection<Symbol> sym)
-
addToFollowSet
public void addToFollowSet(java.util.Map<Symbol,Tuple<Symbol,ItemSet>> map)
Add the item set following this one to the follow set argument.- Parameters:
map- a map of follow sets, indexed by the lookahead symbol
-
nullable
public boolean nullable(Grammar grammar)
Returns true if this item is nullable.
-
nullableAfter
public boolean nullableAfter(int pos, Grammar grammar)Returns true if the symbols after the given position form a nullable sentence.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
canAdvance
public boolean canAdvance()
-
afterDot
public Symbol afterDot()
-
advance
public Item advance()
-
baseItem
public Item baseItem()
Gives an item identical to this one but without follow symbol.
-
reduceActions
public java.util.Collection<Tuple3<ItemSet,Symbol,Action>> reduceActions(Grammar grammar, ItemSet set)
-
followSyms
public java.util.Collection<Symbol> followSyms()
-
related
public boolean related(Symbol sym)
Returnstrueif the this item is related to a conflict on symbolsym.
-
-