JDT – AST – Exemplo básico de uso

public static void main(String[] args) { try { App app = new App(); ASTParser parser = ASTParser.newParser(AST.JLS3); try { parser.setSource(app.readFileToString(“C:/programa-java/MetodoLiu/src/main/java/weiEtal/App.java”).toCharArray()); CompilationUnit cu = (CompilationUnit) parser.createAST(null); for (Object declaration : cu.types()) …