Re: [pmd-devel] Parse ast generated by PMD
A source code analyzer
Brought to you by:
adangel,
juansotuyo
|
From: Juan M. S. D. <jua...@gm...> - 2017-10-24 13:44:05
|
Hi Vikram, Is this to be done as part of a PMD rule, or for a different application? If it's a PMD rule, you should be looking at https://pmd.github.io/latest/apidocs/net/sourceforge/pmd/lang/apex/rule/AbstractApexRule.html which is a visitor on the AST you can implement to look at ASTUserClass nodes and get their names. If this is for a different application, you can use that parser to obtain a root node for the compilation unit, and then use https://pmd.github.io/latest/apidocs/net/sourceforge/pmd/lang/apex/ast/ApexParserVisitorAdapter.html to write a visitor on that tree. However, you may opt to use Apex Jorje directly instead of PMD's abstractions over it. Regards On Tue, Oct 24, 2017 at 9:52 AM, Vikram Singh <sin...@gm...> wrote: > Hi, I've been wanting to parse or iterate through AST generated for APEX > class and extract method names from the class file. I've been studying > about parsing and here's what i found so far. https://pmd.github.io/ > latest/apidocs/net/sourceforge/pmd/lang/apex/ast/ApexParser.html > > Any help regarding this is well appreciated. > Thanks in advance. > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Pmd-devel mailing list > Pmd...@li... > https://lists.sourceforge.net/lists/listinfo/pmd-devel > > |