X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FParser.java;h=9db0bf95b61e642415f48595e0ca8f39807433ba;hp=c77ad6e2827d03c5bc210e907239d2561e9cba47;hb=3ee451bce342d4bb61ad6235ba57bdf817bfdd1a;hpb=2cca97362e80d5a3cd3e02d791a10cd7c6f6b29c diff --git a/src/edu/berkeley/sbp/Parser.java b/src/edu/berkeley/sbp/Parser.java index c77ad6e..9db0bf9 100644 --- a/src/edu/berkeley/sbp/Parser.java +++ b/src/edu/berkeley/sbp/Parser.java @@ -1,3 +1,5 @@ +// Copyright 2006 all rights reserved; see LICENSE file for BSD-style license + package edu.berkeley.sbp; import edu.berkeley.sbp.*; import edu.berkeley.sbp.util.*; @@ -11,11 +13,11 @@ public abstract class Parser { protected final Table pt; /** create a parser to parse the grammar with start symbol u */ - protected Parser(Union u, Topology top) { this.pt = new Table(u, top); } - protected Parser(Table pt) { this.pt = pt; } + public Parser(Union u, Topology top) { this.pt = new Table(u, top); } + Parser(Table pt) { this.pt = pt; } /** implement this method to create the output forest corresponding to a lone shifted input token */ - protected abstract Forest shiftToken(Token t, Input.Location newloc); + public abstract Forest shiftToken(Token t, Input.Location newloc); boolean helpgc = true; @@ -27,7 +29,7 @@ public abstract class Parser { Input.Location loc = input.getLocation(); Token tok = input.next(); GSS.Phase current = gss.new Phase(null, this, null, tok, loc, input.getLocation(), null); - current.newNode(null, Forest.create(null, null, null, false), pt.start, true); + current.newNode(null, Forest.create(loc.createRegion(loc), null, null, false), pt.start, true); int count = 1; for(int idx=0;;idx++) { Input.Location oldloc = loc;