2023-11-02 12:40:50 +08:00
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
import java.util.Vector;
|
|
|
|
|
2023-11-02 10:53:16 +08:00
|
|
|
import org.antlr.v4.runtime.*;
|
|
|
|
import org.antlr.v4.runtime.tree.*;
|
|
|
|
|
|
|
|
public class MainRunner {
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
2023-11-02 12:40:50 +08:00
|
|
|
// get interface structture
|
|
|
|
FileInputStream fs = new FileInputStream("dest/BMExports.hpp");
|
|
|
|
CharStream antlrfs = CharStreams.fromStream(fs, StandardCharsets.UTF_8);
|
|
|
|
ExpFctsLexer lexer = new ExpFctsLexer(antlrfs);
|
|
|
|
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
|
|
|
ExpFctsParser parser = new ExpFctsParser(tokens);
|
|
|
|
|
|
|
|
ParseTree tree = parser.program();
|
|
|
|
ParseTreeWalker walker = new ParseTreeWalker();
|
|
|
|
ExpFctsWalker worker = new ExpFctsWalker();
|
|
|
|
walker.walk(worker, tree);
|
|
|
|
fs.close();
|
2023-11-02 10:53:16 +08:00
|
|
|
|
2023-11-02 12:40:50 +08:00
|
|
|
Vector<ExpFctDecl> result = worker.getResult();
|
|
|
|
|
2023-11-02 10:53:16 +08:00
|
|
|
// print message.
|
|
|
|
System.out.println("DONE!");
|
|
|
|
}
|
|
|
|
}
|