-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaDumpTree.java
More file actions
30 lines (27 loc) · 973 Bytes
/
JavaDumpTree.java
File metadata and controls
30 lines (27 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import AST.*;
class JavaDumpTree extends Frontend {
public static void main(String args[]) {
if(!compile(args))
System.exit(1);
}
public static boolean compile(String args[]) {
return new JavaDumpTree().process(
args,
new BytecodeParser(),
new JavaParser() {
public CompilationUnit parse(java.io.InputStream is, String fileName) throws java.io.IOException, beaver.Parser.Exception {
return new parser.JavaParser().parse(is, fileName);
}
}
);
}
protected void processErrors(java.util.Collection errors, CompilationUnit unit) {
super.processErrors(errors, unit);
System.out.println(unit.dumpTreeNoRewrite());
}
protected void processNoErrors(CompilationUnit unit) {
System.out.println(unit.dumpTreeNoRewrite());
}
protected String name() { return "Java1.4Frontend + Backend + Java5Extensions Dumptree"; }
protected String version() { return "R20071015"; }
}