-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRun.java
More file actions
20 lines (17 loc) · 652 Bytes
/
Copy pathRun.java
File metadata and controls
20 lines (17 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.lang.Exception;
import org.antlr.v4.runtime.ANTLRFileStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
public class Run {
public static void main(String[] args) throws Exception {
if (args.length == 0) {
args = new String[]{"../test.mu"};
}
System.out.println("parsing: " + args[0]);
MuLexer lexer = new MuLexer(new ANTLRFileStream(args[0]));
MuParser parser = new MuParser(new CommonTokenStream(lexer));
ParseTree tree = parser.parse();
EvalVisitor visitor = new EvalVisitor();
visitor.visit(tree);
}
}