- public abstract Forest<Result> shiftToken(Tok t, Token.Location loc);
-
- /** parse <tt>input</tt>, using the table <tt>pt</tt> to drive the parser */
- public Forest<Result> parse(Token.Stream<Tok> input) throws IOException, ParseFailed {
- GSS gss = new GSS();
- Token.Location loc = input.getLocation();
- GSS.Phase current = gss.new Phase<Tok>(null, this, null, input.next(1, 0, 0), loc, null);
- current.newNode(null, Forest.leaf(null, null), pt.start, true);
+ public abstract Forest<NodeType> shiftToken(Token t, Input.Location newloc);
+
+ boolean helpgc = true;
+
+ public String toString() { return pt.toString(); }
+
+ /** parse <tt>input</tt>, and return the shared packed parse forest (or throw an exception) */
+ public Forest<NodeType> parse(Input<Token> input) throws IOException, ParseFailed {
+ GSS gss = new GSS(input);
+ Input.Location loc = input.getLocation();
+ Token tok = input.next();
+ GSS.Phase current = gss.new Phase<Token>(null, null, tok, loc, input.getLocation(), null);
+ current.newNode(new Result(Forest.create(loc.createRegion(loc), null, null, false), null, null), pt.start, true);