integermappable
[sbp.git] / src / edu / berkeley / sbp / Parser.java
index c270a90..95c3985 100644 (file)
@@ -37,7 +37,7 @@ public abstract class Parser<T extends Token, R> {
         GSS gss = new GSS();
         Token.Location loc = input.getLocation();
         GSS.Phase current = gss.new Phase(null, this, null, input.next(1, 0, 0), loc, null);
-        current.newNode(null, Forest.leaf(null, null, null), pt.start, true);
+        current.newNode(null, Forest.leaf(null, null), pt.start, true);
         int count = 1;
         for(;;) {
             loc = input.getLocation();
@@ -162,8 +162,10 @@ public abstract class Parser<T extends Token, R> {
         }
 
         /** a single state in the LR table and the transitions possible from it */
-        public class State implements Comparable<Table.State>, Iterable<Position> {
+        public class State implements Comparable<Table.State>, Iterable<Position>, IntegerMappable {
         
+            public int toInt() { return idx; }
+
             /*
             public boolean isResolvable(Token t) {
                 boolean found = false;