-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.java
More file actions
26 lines (23 loc) · 1000 Bytes
/
Driver.java
File metadata and controls
26 lines (23 loc) · 1000 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
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.ParseTreeWalker;
import java.io.FileReader;
import java.io.IOException;
public class Driver {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
System.out.println("Usage: java Driver <test-file>\n\t\tProvide name of test file as argument.");
return;
}
CharStream input = CharStreams.fromReader(new FileReader(args[0]));
LoopNestLexer lexer = new LoopNestLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
LoopNestParser parser = new LoopNestParser(tokens);
parser.setBuildParseTree(true);
ParseTree tree = parser.tests();
Analysis cacheMissAnalysis = new Analysis();
ParseTreeWalker.DEFAULT.walk(cacheMissAnalysis, tree);
}
}