blob: ca1d0b5b2e88099c30cf10227c5f64c661adff4f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package com.seaofnodes.simple;
import com.seaofnodes.simple.codegen.CodeGen;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
// Compile and run a simple program
public static void main( String[] args ) throws Exception {
// First arg is file, 2nd+ args are program args
String src = Files.readString(Path.of(args[0]));
int arg = Integer.valueOf(args[1]);
CodeGen code = new CodeGen(src);
code.driver(CodeGen.Phase.LocalSched);
System.out.println(code._stop);
System.out.println(Eval2.eval(code,arg,100000));
}
}
|