1

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!

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

An even easier method is to print Java code and run that through javac.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.