public Forest.Many finalResult;
private PriorityQueue<Reduction> reductionQueue = new PriorityQueue<Reduction>();
+ Parser parser() { return parser; }
public void addReduction(Reduction r) {
//System.out.println("+ " + r);
parser.spin();
newNode(primordealResult, startState, true);
}
public Phase(Phase prev, Forest forest) throws ParseFailed, IOException {
- this.location = input.getLocation();
+ this.prevLocation = input.getLocation();
this.token = (Tok)input.next();
- this.prevLocation = prev==null ? location : prev.getLocation();
+ this.location = input.getLocation();
this.prev = prev;
this.forest = forest;
this.pos = prev==null ? 0 : prev.pos+1;
public Input.Location getPrevLocation() { return prevLocation; }
public Input.Location getLocation() { return location; }
- public Input.Region getRegion() { return getPrevLocation().createRegion(getLocation()); }
+ public Input.Region getRegion() { return prevLocation.createRegion(location); }
public Input.Location getNextLocation() { return nextLocation; }
public boolean isFrontier() { return hash!=null; }
if (!state.canReduce(token)) return false;
} while(false);
Node n = new Node(Phase.this, result, state, fromEmptyReduction); // ALLOC
- for(Object s : state.also)
+ for(Object s : state.conjunctStates)
newNode(new Result(null, n, null), (State)s, fromEmptyReduction);
return true;
}