From: adam Date: Tue, 13 Dec 2005 06:42:14 +0000 (-0500) Subject: checkpoint X-Git-Tag: tag_for_25-Mar~610 X-Git-Url: http://git.megacz.com/?p=sbp.git;a=commitdiff_plain;h=f5f20224ef2595f60d430d97ecf43f7348c49440 checkpoint darcs-hash:20051213064214-5007d-642722296e1ca5852e6f7c46a408204610431692.gz --- diff --git a/src/edu/berkeley/sbp/misc/MetaGrammar.java b/src/edu/berkeley/sbp/misc/MetaGrammar.java index 4d8bfc5..b3b78e1 100644 --- a/src/edu/berkeley/sbp/misc/MetaGrammar.java +++ b/src/edu/berkeley/sbp/misc/MetaGrammar.java @@ -88,6 +88,10 @@ public class MetaGrammar extends ReflectiveWalker { if (s instanceof String) s = CharToken.string((String)s); return new Rep(r, (Element)s, false, false); } + public Object _star__slash_(final Element r, Object s) { + 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 Element _star__star_(final Element r, Element s) { return Repeat.maximal(Repeat.many0(r, s)); } public Object _plus__plus_(final Element r) { return new Rep(r, null, true, false); } diff --git a/tests/testcase.g b/tests/testcase.g index 8eb36f0..0d0dd29 100644 --- a/tests/testcase.g +++ b/tests/testcase.g @@ -1,5 +1,4 @@ -ts ::= ws Ts ws => ts -Ts ::= test* +ts ::= ws test*/ws ws => ts ws !::= w* test ::= ^"testcase" "{" input output+/ws Grammar "}" /ws | ^"testcase" "{" input Grammar "}" /ws