projects
/
sbp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf51bec
)
reenable XTree
author
adam
<adam@megacz.com>
Mon, 26 Mar 2007 07:13:29 +0000
(
03:13
-0400)
committer
adam
<adam@megacz.com>
Mon, 26 Mar 2007 07:13:29 +0000
(
03:13
-0400)
darcs-hash:
20070326071329
-5007d-
ca9d9c64769e4e3d3d6cc4a9916684e2ca027956
.gz
src/edu/berkeley/sbp/meta/GrammarBuilder.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/sbp/meta/GrammarBuilder.java
b/src/edu/berkeley/sbp/meta/GrammarBuilder.java
index
d9b04c2
..
c7ef44a
100644
(file)
--- a/
src/edu/berkeley/sbp/meta/GrammarBuilder.java
+++ b/
src/edu/berkeley/sbp/meta/GrammarBuilder.java
@@
-84,6
+84,7
@@
public class GrammarBuilder {
if (head.equals("Elements")) return seq2((ElementNode[])Reflection.rebuild(walkChildren(t), ElementNode[].class));
if (head.equals("NonTerminalReference")) return new ReferenceNode(stringifyChildren(t.child(0)));
//if (head.equals(")")) return new ReferenceNode(stringifyChildren(t.child(0)));
if (head.equals("Elements")) return seq2((ElementNode[])Reflection.rebuild(walkChildren(t), ElementNode[].class));
if (head.equals("NonTerminalReference")) return new ReferenceNode(stringifyChildren(t.child(0)));
//if (head.equals(")")) return new ReferenceNode(stringifyChildren(t.child(0)));
+ if (head.equals("{")) return new XTree((Seq)walk(t.child(0)));
if (head.equals("::")) return tag((String)walk(t.child(0)), (Seq)walk(t.child(1)));
if (head.equals("++")) return plusmax((ElementNode)walk(t.child(0)));
if (head.equals("+")) return plus((ElementNode)walk(t.child(0)));
if (head.equals("::")) return tag((String)walk(t.child(0)), (Seq)walk(t.child(1)));
if (head.equals("++")) return plusmax((ElementNode)walk(t.child(0)));
if (head.equals("+")) return plus((ElementNode)walk(t.child(0)));
@@
-501,9
+502,9
@@
public class GrammarBuilder {
}
}
- /*
- public class XTree extends ElementNode {
- public Seq body;
+ public class XTree extends ElementNode {
+ public Seq body;
+ public XTree(Seq seq) { this.body = seq; }
public Element build(Context cx, NonTerminalNode cnt, boolean dropall) {
Union u = new Union(null, false);
Sequence s = body.build(cx, u, null, dropall);
public Element build(Context cx, NonTerminalNode cnt, boolean dropall) {
Union u = new Union(null, false);
Sequence s = body.build(cx, u, null, dropall);
@@
-518,5
+519,4
@@
public class GrammarBuilder {
return u2;
}
}
return u2;
}
}
- */
}
}