01: package path;
02:
03: import beaver.*;
04: import java.io.*;
05: import java.util.List;
06: import java.util.Iterator;
07:
08: class Run {
09: static public void main(String[] args) throws Exception {
10: int path_index = 0;
11: short alt_goal = 0;
12: if (args[0].equals("-p")) {
13: alt_goal = PathParser.AltGoals.pathname;
14: path_index = 1;
15: } else if (args[0].equals("-f")) {
16: alt_goal = PathParser.AltGoals.filename;
17: path_index = 1;
18: }
19: Scanner lexer = new PathScanner(new StringReader(
20: args[path_index]));
21: Parser parser = new PathParser();
22: List namelist = alt_goal != 0 ? (List) parser.parse(lexer,
23: alt_goal) : (List) parser.parse(lexer);
24:
25: for (Iterator i = namelist.iterator(); i.hasNext();) {
26: System.out.print(i.next());
27: System.out.print(' ');
28: }
29: System.out.print("\nDone.");
30: }
31: }
|