checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / CharToken.java
index bad4372..93ae7bb 100644 (file)
@@ -50,6 +50,9 @@ public class CharToken implements Token, IntegerTopology.IntegerMappable {
         return new CharRange(new IntegerTopology<CharToken>(new Range.Set(new Range((int)start, (int)end)).complement().intersect(all)));
     }
 
+    public static final Atom leftBrace  = new Atom(new IntegerTopology<CharToken>(-3)) { public String toString() { return "{"; } };
+    public static final Atom rightBrace = new Atom(new IntegerTopology<CharToken>(-4)) { public String toString() { return "}"; } };
+
     private static final Range.Set all = new Range.Set(new Range(0, Character.MAX_VALUE));
     public  static final Atom      any = new CharRange(new IntegerTopology<CharToken>(all));
     public  static final Atom     none = new CharRange(new IntegerTopology<CharToken>());
@@ -86,7 +89,7 @@ public class CharToken implements Token, IntegerTopology.IntegerMappable {
 
     public final char c;
     public final Location location;
-    private CharToken(char c, int line, int col)   { this(c, new CartesianLocation(line, col)); }
+    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; }