EclipsePluginで、Javaソースを作成する機会があり、org.eclipse.jdt.core.dom.AST というのを使ってみました。 AST...始めは何も意識していなかったのですが、抽象構文木(abstract syntax tree)のことですねー。 ASTを使ってJavaコードを生成する事自体は、そこそこ簡単です。 ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setSource(EMPTY.toCharArray()); CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null); compilationUnit.recordModifications(); を行い、compilationUnitにクラス名や
SummaryThe Abstract Syntax Tree is the base framework for many powerful tools of the Eclipse IDE, including refactoring, Quick Fix and Quick Assist. The Abstract Syntax Tree maps plain Java source code in a tree form. This tree is more convenient and reliable to analyse and modify programmatically than text-based source. This article shows how you can use the Abstract Syntax Tree for your own appl
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く