I am trying to find a way to use the PPI (Module for parsing Perl) in EPIC. Or better still use the B::* modules to extract the AST/Parse tree directly from the Perl interpreter. But I do not have sufficient knowledge for doing that and so am hoping someone would be able to advise me on what to do.
If you just want to use it on user's demand, have a look at how SourceFormatter is implemented. It invokes perltidy to process a single source file. In your case you'd invoke some custom script of yours to process a single source file.
If you want to process in the background whenever a Perl file is modified on disk, have a look at PerlBuilder/PerlBuilderJob. It may be a good idea to implement your own builder in that case and refer to it from plugin.xml.
If you want to process unsaved files while they are being entered, have a look at how PerlValidator is invoked. (Keep in mind that PPI is painfully slow, probably not suitable for real-time parsing.)
Here's a link related to this topic.
1. ANTLR isn't really designed for real-time parsing either, but it does the job, so your decision seems appropriate to me.
2. Consider compatibility of OS licenses when reusing parts of EPIC (I found no license information in your project).
3. It would be a good idea to provide an RSS feed on your blog (maybe I just couldn't find it).
4. You should be improving EPIC instead of writing new NetBeans plugins! ;-)
Here's my blog feed for anyone interested
Log in to post a comment.