X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fchr%2FCharAtom.java;h=3206269180193dafcb3bfdb317d23d7487a3b185;hb=HEAD;hp=f05c3452658525771a11a7fa2a4cb064d674f434;hpb=3ee451bce342d4bb61ad6235ba57bdf817bfdd1a;p=sbp.git diff --git a/src/edu/berkeley/sbp/chr/CharAtom.java b/src/edu/berkeley/sbp/chr/CharAtom.java index f05c345..3206269 100644 --- a/src/edu/berkeley/sbp/chr/CharAtom.java +++ b/src/edu/berkeley/sbp/chr/CharAtom.java @@ -1,4 +1,4 @@ -// Copyright 2006 all rights reserved; see LICENSE file for BSD-style license +// Copyright 2006-2007 all rights reserved; see LICENSE file for BSD-style license package edu.berkeley.sbp.chr; import java.io.*; @@ -23,9 +23,9 @@ public class CharAtom extends Atom { public static final char left = (char)9998; public static final char right = (char)9999; - public static final Atom leftBrace = new CharAtom(left,left) { public String toString() { return "[{]"; } }; - public static final Atom rightBrace = new CharAtom(right,right) { public String toString() { return "[}]"; } }; - public static final Atom braces = new CharAtom(left,right) { public String toString() { return "[{}]"; } }; + public static final Atom leftBrace = new CharAtom(left,left) { public String toString() { return ">>"; } }; + public static final Atom rightBrace = new CharAtom(right,right) { public String toString() { return "<<"; } }; + //public static final Atom braces = new CharAtom(left,right) { public String toString() { return "[\\{\\}]"; } }; public static Atom set(Range.Set r) { return new CharAtom(new CharTopology(r)); } public String toString() { return t.toString(); } @@ -33,8 +33,8 @@ public class CharAtom extends Atom { /** returns an element which exactly matches the string given */ public static Element string(String s) { return string(s, true); } public static Element string(String s, boolean share) { - if (share && s.length() == 0) return epsilon; - final String escapified = "\""+StringUtil.escapify(s, "\"\r\n\\")+"\""; + if (share && s.length() == 0) return emptyString; + final String escapified = "\""+StringUtil.escapify(s, "\"\r\t\n\\")+"\""; Element ret; if (share && s.length() == 1) { ret = @@ -45,14 +45,17 @@ public class CharAtom extends Atom { public String toString() { return escapified; } }; Element[] refs = new Element[s.length()]; for(int i=0; i> unwrap() { return this; } public Topology> empty() { return new CharAtom(); }