checkpoint
[sbp.git] / src / edu / berkeley / sbp / Parser.java
index 868b200..5c399cc 100644 (file)
@@ -185,6 +185,7 @@ public abstract class Parser<T extends Token, R> {
             public Iterable<State>     getShifts(Token t)          { return shifts.get(t); }
             public boolean             isAccepting()               { return accept; }
             public Iterable<Reduction> getReductions(Token t)      { return t==null ? eofReductions : reductions.get(t); }
             public Iterable<State>     getShifts(Token t)          { return shifts.get(t); }
             public boolean             isAccepting()               { return accept; }
             public Iterable<Reduction> getReductions(Token t)      { return t==null ? eofReductions : reductions.get(t); }
+            public boolean             hasReductions(Token t)      { return t==null ? eofReductions.size()>0 : reductions.has(t); }
             public Iterable<Reduction> getEofReductions()          { return eofReductions; }
             public Iterator<Position>  iterator()                  { return hs.iterator(); }
 
             public Iterable<Reduction> getEofReductions()          { return eofReductions; }
             public Iterator<Position>  iterator()                  { return hs.iterator(); }