X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fmisc%2FCharToken.java;h=e73ccddc26cc9bf17c3ec28bb99cae6565a97048;hp=93ae7bb8a122f79259bf51fbe60dbb23441f27dd;hb=695b95cf0b6140177098a5a2d7117aec4017e470;hpb=80602d89ede55b9ca1669b6222a1bf80fc0c41d2 diff --git a/src/edu/berkeley/sbp/misc/CharToken.java b/src/edu/berkeley/sbp/misc/CharToken.java index 93ae7bb..e73ccdd 100644 --- a/src/edu/berkeley/sbp/misc/CharToken.java +++ b/src/edu/berkeley/sbp/misc/CharToken.java @@ -50,6 +50,8 @@ public class CharToken implements Token, IntegerTopology.IntegerMappable { return new CharRange(new IntegerTopology(new Range.Set(new Range((int)start, (int)end)).complement().intersect(all))); } + public static final CharToken left = new CharToken((char)-3, 0, 0); + public static final CharToken right = new CharToken((char)-4, 0, 0); public static final Atom leftBrace = new Atom(new IntegerTopology(-3)) { public String toString() { return "{"; } }; public static final Atom rightBrace = new Atom(new IntegerTopology(-4)) { public String toString() { return "}"; } }; @@ -89,7 +91,7 @@ public class CharToken implements Token, IntegerTopology.IntegerMappable { public final char c; public final Location location; - CharToken(char c, int line, int col) { this(c, new CartesianLocation(line, col)); } + public CharToken(char c, int line, int col) { this(c, new CartesianLocation(line, col)); } private CharToken(char c, Location loc) { this.c = c; this.location = loc; } public String result() { return c+""; } public Location getLocation() { return location; }