// FIXME ugly ugly ugly scary dangerous
public static String prefix = "";
-
+
/** A grammar (a set of nonterminals) */
public static class GrammarNode extends HashMap<String,NonTerminalNode> implements NonTerminalSource {
public NonTerminalNode[] getNonTerminals() {
System.err.println("#import " + fileName + " as " + as);
try {
- Tree t = new CharParser(MetaGrammar.make()).parse(new FileInputStream(fileName)).expand1();
+ Tree t = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream("tests/"+fileName)).expand1();
Tree.TreeFunctor<Object,Object> red = (Tree.TreeFunctor<Object,Object>)t.head();
String oldprefix = prefix;
prefix = as;
Sequence ret = null;
if (dropAll) ret = Sequence.drop(els, false);
else {
- ret = cx.rm.tryResolveTag(tag, cnt==null?null:cnt.name, els, drops);
+ Production prod = new Production(tag, (cnt==null?null:cnt.name), els, drops);
+ ret = cx.rm.tryResolveTag(prod);
if (ret == null) {
int idx = -1;
for(int i=0; i<els.length; i++)