X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=69d9eedd9ca47ace174051567865632b399d6d95;hp=2d9f6ff0e7ccbe56066d09be042c66b2c622d144;hb=fd97655ce34c3aff1a47bfb2f45775ac711923b1;hpb=1a79f2232401c95fb0a6a0c2bddf78d4c82e612c diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index 2d9f6ff..69d9eed 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -59,9 +59,11 @@ class GSS { boolean closed = false; - public Phase(Phase previous, Token token) { + private Token.Location location; + public Phase(Phase previous, Token token, Token.Location location) { this.pos = previous==null ? 0 : previous.pos+1; this.token = token; + this.location = location; } public boolean isDone() { return token == null; } @@ -72,7 +74,7 @@ class GSS { throw new Parser.Failed(error, getLocation()); } - public Token.Location getLocation() { return token==null ? null : token.getLocation(); } + public Token.Location getLocation() { return location; } /** add a new node (merging with existing nodes if possible) * @param parent the parent of the new node