checkpoint
authoradam <adam@megacz.com>
Wed, 14 Dec 2005 03:04:16 +0000 (22:04 -0500)
committeradam <adam@megacz.com>
Wed, 14 Dec 2005 03:04:16 +0000 (22:04 -0500)
darcs-hash:20051214030416-5007d-6c42782d91a3bc91258130166f6369bed62fcb80.gz

src/edu/berkeley/sbp/misc/MetaGrammar.java

index dd94368..f408275 100644 (file)
@@ -16,7 +16,7 @@ public class MetaGrammar extends ReflectiveWalker {
     }
 
     // FIXME
     }
 
     // FIXME
-    private static HashSet<Union> dropAll = new HashSet<Union>();
+    private static HashSet<Element> dropAll = new HashSet<Element>();
 
     // Statics //////////////////////////////////////////////////////////////////////////////
 
 
     // Statics //////////////////////////////////////////////////////////////////////////////
 
@@ -78,7 +78,6 @@ public class MetaGrammar extends ReflectiveWalker {
         }
         return ret;
     }
         }
         return ret;
     }
-    //public Element _tilde__slash__tilde_(final Element r) { return Repeat.maximal(r); }
     public Object _plus__slash_(final Element r, Object s) {
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, false);
     public Object _plus__slash_(final Element r, Object s) {
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, false);
@@ -87,7 +86,6 @@ public class MetaGrammar extends ReflectiveWalker {
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, true);
     }
         if (s instanceof String) s = CharToken.string((String)s);
         return new Rep(r, (Element)s, false, true);
     }
-    //public Element _star__slash_(final Element r, Element s) { return Repeat.many0(r, s); }
     public Object _star__star_(final Element r) { return new Rep(r, null, true, true); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
     public Element _question_(final Element r) { return Repeat.maybe(r); }
     public Object _star__star_(final Element r) { return new Rep(r, null, true, true); }
     public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); }
     public Element _question_(final Element r) { return Repeat.maybe(r); }
@@ -97,8 +95,13 @@ public class MetaGrammar extends ReflectiveWalker {
     public char    _backslash_n() { return '\n'; }
     public char    _backslash_r() { return '\r'; }
     public String  literal(String s) { return s; }
     public char    _backslash_n() { return '\n'; }
     public char    _backslash_r() { return '\r'; }
     public String  literal(String s) { return s; }
-    //public Element  literal(String s)    { return CharToken.string(s); }
-
+    /*
+    public Element literal(String s) {
+        Element e = CharToken.string(s);
+        dropAll.add(e);
+        return e;
+    }
+    */
     public Range     range0(char a)         { return new Range(a, a); }
     public Range     range0(char a, char b) { return new Range(a, b); }
     public Range     range1(char a, char b) { return new Range(a, b); }
     public Range     range0(char a)         { return new Range(a, a); }
     public Range     range0(char a, char b) { return new Range(a, b); }
     public Range     range1(char a, char b) { return new Range(a, b); }
@@ -169,6 +172,7 @@ public class MetaGrammar extends ReflectiveWalker {
         g = new Union(str);
         startSymbol = str;
         nt = new HashMap<String,Union>();
         g = new Union(str);
         startSymbol = str;
         nt = new HashMap<String,Union>();
+        dropAll = new HashSet<Element>();
         nt.put(str, g);
         this.dws = Repeat.maximal(Repeat.many0(nonTerminalY("w")));
         return ret;
         nt.put(str, g);
         this.dws = Repeat.maximal(Repeat.many0(nonTerminalY("w")));
         return ret;
@@ -361,6 +365,8 @@ public class MetaGrammar extends ReflectiveWalker {
 
 
 
 
 
 
+
+
         // DO NOT EDIT STUFF BELOW: IT IS AUTOMATICALLY GENERATED
 new Tree(null, "gram", new Tree[] { new Tree(null, null, new Tree[] { }),
         new Tree(null, "grammar", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "::=", new Tree[] { new Tree(null, "sify", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "s", new Tree[] { })})}),
         // DO NOT EDIT STUFF BELOW: IT IS AUTOMATICALLY GENERATED
 new Tree(null, "gram", new Tree[] { new Tree(null, null, new Tree[] { }),
         new Tree(null, "grammar", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "::=", new Tree[] { new Tree(null, "sify", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "s", new Tree[] { })})}),
@@ -945,3 +951,5 @@ new Tree(null, "gram", new Tree[] { new Tree(null, null, new Tree[] { }),
 
 
 
 
 
 
+
+