I have written my lexer and parser in flex
and bison
. My project is based on C++ and I would love to stick to it. Currently my Interpreter is written in C++
but I want to achieve faster execution time by converting to bytecode (some form of a VM-level bytecode) when my interpreter works. I know this can be achieved through LLVM
. I had problems using it from a x64 OS and developing on a Visual Studio 2012 (32-bit). Some of which can be found @ LLVM linker errors on VS. The other tool I came across is ANTLR
and if I understand correctly then the latest release does not easily integrate into C++
yet. Many references were found for the same but a quick one can be @ ANTLR integration with C++ issue. Also I do not want to dispose off my lexer and parser written in flex and bison. What are my options if I want to generate bytecode from my AST?
EDIT: My aim is to generate bytecode from my AST (for the target architecture) so the code can be executed at a Virtual Machine level. Currently I have an Interpretor which interpretes (executes the AST) based on C++ library and generates bytecode. I want to generate Bytecode straight from my AST and execute the AST in its bytecode.
Would be appreciated.