[antlr-interest] ANTLR-generated code & Findbugs

Kay Roepke kroepke at classdump.org
Tue Oct 31 06:10:27 PST 2006


Hi Michael!

On 31. Oct 2006, at 13:48 , Gerz, Michael wrote:

> Findbugs (http://findbugs.sf.net; see also http://fb- 
> contrib.sf.net) is a very popular and powerful static analysis tool  
> that helps to identify bugs in Java code.

Haven't seen that one, I will take a closer look at that tonight :)

> One of my colleagues reported that the parser code generated by  
> ANTLR triggers many findbugs warnings. Do you have any plans to  
> address those warnings? Of course, automatically generated code is  
> not meant for human inspection but OTOH: the less warnings, the  
> better :-)

I have brought up the matter with Terence and others on the antlr-dev  
list. The most irritating thing for me is the fact that there are so  
many unused variables and lists. For me in Objective-C it's a more a  
performance issue, though I'd like to get rid of the warnings, too.  
It's easy to get a couple hundred warnings from a moderately large  
grammar. Irritating at times. This, however, will be quite difficult  
to do and AFAIK is not on the short-term todo list. IMHO it's more  
important to fix some outstanding issues first. Of course I cannot  
speak for Terence here, it's simply my personal opinion.

> It would also be a very nice exercise to apply findbugs to ANTLR  
> and ist runtime library itself. You will be surprised by its  
> output, no doubt!

I will try it tonight and see what shows up. Might be a very nice way  
to further improve the quality of the core code. Always good to know  
thy tools :)

Thanks for the pointer!

cheers,
-k

P.S.: Everything I mentioned applies to ANTLR v3, not 2.7.x which I'm  
not using anymore.



More information about the antlr-interest mailing list