import java.io.*;
public class CommandLine {
- /*
public static void main(String[] argv) throws Throwable {
String grammarFile = argv[0];
String targetFile = argv[1];
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.setErr(new PrintStream(baos));
- Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(grammarFile)).expand1();
- Union meta = Grammar.create(res, "s",
- new Grammar.Bindings() {
- //public Sequence createSequence(Production p) {
- //Sequence ret = super.createSequence(p);
- //if (ret != null) return ret;
- //return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
- //}
- });
+ Tree<String> res = new CharParser(MetaGrammar.getMetaGrammar()).parse(new FileInputStream(grammarFile)).expand1();
+ Union meta = GrammarAST.buildFromAST(res, "s", null);
CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
Tree ret = new CharParser(meta).parse(input).expand1();
if (ret==null) throw new NullPointerException("CharParser returned null");
System.exit(-1);
}
}
- */
}