How to programmatically generate .class files?

后端 未结 4 1377
迷失自我
迷失自我 2021-01-02 04:03

I would like to write a compiler for a toy-language for Java. I would like to generate runnable .class files. I was wondering what is the best library or tool available for

4条回答
  •  轮回少年
    2021-01-02 04:36

    It sounds like you're looking for Apache BCEL:

    The Byte Code Engineering Library (Apache Commons BCEL™) is intended to give users a convenient way to analyze, create, and manipulate (binary) Java class files (those ending with .class).

提交回复
热议问题