Java源代码解析器/生成器 [英] Java source code parsers/generators

查看:140
本文介绍了Java源代码解析器/生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要工具:


  • 方便地解析Java源代码并轻松访问给定元素。

  • Conveniently parse Java source code and easily access given elements.

轻松生成源代码文件,轻松将数据结构转换为代码

Easily generate source code files, to easily transform data structures into code

任何好的技巧,库,框架,工具?感谢您的帮助。

Any good tips, libraries, frameworks, tools? Thank you for help.

推荐答案

从Java 6开始,编译器在JDK中包含了一个API。通过它,您可以通过 javax.lang.model API。 JDK5以镜像API 。有一篇很好的介绍性文章这里

Since Java 6, the compiler has an API included in the JDK. Through it you can access the results of the Java parser through the javax.lang.model APIs. The same functionality was present with JDK5 in the form of the Mirror API. There's a good introductory article here.

我见过的最好的代码生成工具是 CodeModel 。它有一个非常简单的API,可以同时生成多个Java源文件。

The best code generation tool I've seen is CodeModel. It has a very simple API and can generate multiple Java source files at once.

这篇关于Java源代码解析器/生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆