X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FParser.java;h=24f8410d0d5f521a19cc47b2091dc65b69d447b1;hp=18bec5a0aebfa2c5179116f1c92617f1162dd04b;hb=37d28a2fa4ecc9534ca03827c23fdb493af79645;hpb=21da21b94e794fa4d7c7207327764895d92ea528 diff --git a/src/edu/berkeley/sbp/Parser.java b/src/edu/berkeley/sbp/Parser.java index 18bec5a..24f8410 100644 --- a/src/edu/berkeley/sbp/Parser.java +++ b/src/edu/berkeley/sbp/Parser.java @@ -96,16 +96,8 @@ public abstract class Parser { Reduction red = new Reduction(p); Topology follow = wf.walk(p.owner()); - if (p.owner() instanceof Sequence.RewritingSequence && - (((Sequence.RewritingSequence)p.owner()).tag+"").equals("emailaddr")) { - System.out.println("follow before: " + new edu.berkeley.sbp.misc.CharToken.CharRange(follow)); - } for(Position p2 = p; p2 != null && p2.element() != null; p2 = p2.next()) follow = follow.intersect(new Walk.Follow(top.empty(), p2.element(), all_elements, cache).walk(p2.element())); - if (p.owner() instanceof Sequence.RewritingSequence && - (((Sequence.RewritingSequence)p.owner()).tag+"").equals("emailaddr")) { - System.out.println("follow after: " + new edu.berkeley.sbp.misc.CharToken.CharRange(follow)); - } state.reductions.put(follow, red); if (wf.includesEof()) state.eofReductions.add(red); } @@ -131,36 +123,6 @@ public abstract class Parser { public class State implements Comparable, IntegerMappable, Iterable { - public int toInt() { return idx; } - - public boolean lame() { - for(Position p : this) - for(Position p2 = p; p2!=null; p2=p2.next()) - if (p2.isLast() && !p2.owner().lame) - return false; - return true; - } - /* - public boolean isResolvable(Token t) { - boolean found = false; - for(Reduction r : getReductions(t)) { - Position p = r.position; - if (!p.isRightNullable(cache)) continue; - if (p.owner().firstp()==p) continue; - if (found) { - // found two items meeting criteria #1 - return false; - } else { - found = true; - continue; - } - if (p.element()==null) continue; - Topology first = new Walk.First(top(), cache).walk(p.element()); - if (first.contains(t)) - } - } - */ - public final int idx = master_state_idx++; private final HashSet hs; @@ -282,6 +244,7 @@ public abstract class Parser { } public int compareTo(Table.State s) { return idx==s.idx ? 0 : idx < s.idx ? -1 : 1; } + public int toInt() { return idx; } } /**