简体   繁体   中英

Code Generation with JVM in C++

I'm trying to scan and parse my toy language with Flex and Bison which is in C++. I wonder if there is any resources explaining how to generate JVM bytecode from AST in C++. Many thanks!

The language you're using to generate code is halfway moot unless you can find a library to help you. Since most of the tools for directly manipulating Java bytecode seem to be written in Java, your best bet might be output Jasmin assembly, then assembly it into bytecode.

更简单的方法是打印Java代码并通过javac运行它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM