projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eeba855
)
checkpoint
author
adam
<adam@megacz.com>
Mon, 19 Dec 2005 08:52:30 +0000
(
03:52
-0500)
committer
adam
<adam@megacz.com>
Mon, 19 Dec 2005 08:52:30 +0000
(
03:52
-0500)
darcs-hash:
20051219085230
-5007d-
d223c7557186b1fc6786d21667f9757f09f1d64f
.gz
src/edu/berkeley/sbp/misc/MetaGrammar.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/misc/MetaGrammar.java
b/src/edu/berkeley/sbp/misc/MetaGrammar.java
index
ab359c6
..
031dccd
100644
(file)
--- a/
src/edu/berkeley/sbp/misc/MetaGrammar.java
+++ b/
src/edu/berkeley/sbp/misc/MetaGrammar.java
@@
-87,20
+87,15
@@
public class MetaGrammar extends ReflectiveWalker {
new PreSequence[] {
new PreSequence(new Element[] { leftBrace(),
p.buildUnion(),
new PreSequence[] {
new PreSequence(new Element[] { leftBrace(),
p.buildUnion(),
- rightBrace() })
+ rightBrace()
+ })
}
},
false,
false);
}
}
},
false,
false);
}
- public PreSequence rewrite(Object[] o) { return new PreSequence(o, null); }
-
- public PreSequence seqx(PreSequence p, String tag) { return _equals__greater_(p, tag); }
- public PreSequence _equals__greater_(PreSequence p, String tag) {
- p.tag = tag;
- return p;
- }
+ public PreSequence _equals__greater_(PreSequence p, String tag) { p.tag = tag; return p; }
public PreSequence ps(Object[] o) { return new PreSequence(o); }
public PreSequence ps2(Object[] o1, String s, Object[] o2) {
public PreSequence ps(Object[] o) { return new PreSequence(o); }
public PreSequence ps2(Object[] o1, String s, Object[] o2) {
@@
-124,9
+119,9
@@
public class MetaGrammar extends ReflectiveWalker {
public Object _plus__plus_(final Element r) { return Repeat.maximal(Repeat.many1(r)); }
public Element _question_(final Element r) { return Repeat.maybe(r); }
public Object _plus__plus_(final Element r) { return Repeat.maximal(Repeat.many1(r)); }
public Element _question_(final Element r) { return Repeat.maybe(r); }
- public MetaGrammar gram(Object o, MetaGrammar g, Object o2) { return g; }
- public MetaGrammar grammar(Object[] o) { return this; }
public MetaGrammar grammar(Object o, Union[] u, Object x) { return this; }
public MetaGrammar grammar(Object o, Union[] u, Object x) { return this; }
+ public Object gram(Object o, Object g, Object o2) { return g; }
+ public MetaGrammar grammar(Object[] o) { return this; }
public char _backslash_n() { return '\n'; }
public char _backslash_r() { return '\r'; }
public Element literal(String s) { Element ret = string(s); dropAll.add(ret); return ret; }
public char _backslash_n() { return '\n'; }
public char _backslash_r() { return '\r'; }
public Element literal(String s) { Element ret = string(s); dropAll.add(ret); return ret; }
@@
-143,6
+138,8
@@
public class MetaGrammar extends ReflectiveWalker {
return set(ret);
}
return set(ret);
}
+ //////////////////////////////////////////////////////////////////////////////
+
public class PreSequence {
public final HashSet<Sequence> and = new HashSet<Sequence>();
public final HashSet<Sequence> not = new HashSet<Sequence>();
public class PreSequence {
public final HashSet<Sequence> and = new HashSet<Sequence>();
public final HashSet<Sequence> not = new HashSet<Sequence>();