use of net.sourceforge.pmd.lang.java.symboltable.ScopeAndDeclarationFinder in project pmd by pmd.
the class JavaRuleViolationTest method parse.
private ASTCompilationUnit parse(final String code) {
final LanguageVersionHandler languageVersionHandler = LanguageRegistry.getLanguage(JavaLanguageModule.NAME).getDefaultVersion().getLanguageVersionHandler();
final ParserOptions options = languageVersionHandler.getDefaultParserOptions();
final ASTCompilationUnit ast = (ASTCompilationUnit) languageVersionHandler.getParser(options).parse(null, new StringReader(code));
// set scope of AST nodes
ast.jjtAccept(new ScopeAndDeclarationFinder(), null);
return ast;
}
Aggregations