remove unused code from CommandLine
[sbp.git] / src / edu / berkeley / sbp / misc / CommandLine.java
1 // Copyright 2006 all rights reserved; see LICENSE file for BSD-style license
2
3 package edu.berkeley.sbp.misc;
4
5 import edu.berkeley.sbp.*;
6 import edu.berkeley.sbp.misc.*;
7 import edu.berkeley.sbp.meta.*;
8 import edu.berkeley.sbp.chr.*;
9 import java.io.*;
10
11 public class CommandLine {
12     /*
13     public static void main(String[] argv) throws Throwable {
14         String grammarFile = argv[0];
15         String targetFile = argv[1];
16         ByteArrayOutputStream baos = new ByteArrayOutputStream();
17         try {
18             System.setErr(new PrintStream(baos));
19             Tree<String> res = new CharParser(MetaGrammar.newInstance()).parse(new FileInputStream(grammarFile)).expand1();
20             Union meta = Grammar.create(res, "s",
21                                         new Grammar.Bindings() {
22                                             //public Sequence createSequence(Production p) {
23                                             //Sequence ret = super.createSequence(p);
24                                             //if (ret != null) return ret;
25                                             //return Sequence.create(p.nonTerminal, p.elements, p.drops, false);
26                                             //}
27                                         });
28             CharInput input = new CharInput(new FileInputStream(targetFile), "", true);
29             Tree ret = new CharParser(meta).parse(input).expand1();
30             if (ret==null) throw new NullPointerException("CharParser returned null");
31             System.out.println(ret);
32             System.exit(0);
33         } catch (Throwable e) {
34             e.printStackTrace();
35             System.out.println(new String(baos.toByteArray()));
36             System.exit(-1);
37         }
38     }
39     */
40 }