[antlr-interest] code analysis tool

mzukowski at yci.com mzukowski at yci.com
Thu Oct 16 14:40:35 PDT 2003


Shiva,

Was that done with antlr?  With the gcc toolkit?  Would you put it on the
antlr.org showcase if it was?

Thanks,

Monty

-----Original Message-----
From: Kintali Shiva Prasad [mailto:skintali at sarvega.com] 
Sent: Thursday, October 16, 2003 12:49 PM
To: antlr-interest at yahoogroups.com
Subject: Re: [antlr-interest] code analysis tool

I worked on a similar project. Here are my experiences...

>A coupla small questions:
>
>  1) does this sound like a reasonable approach (AKA do I understand the
>utility of tree parsers)?
>  2) how difficult would you rate a project like this?
>
Depends on the feature set.
Look at http://www.grammatech.com/products/codesurfer/overview.html

>  3) how would you structure things to make adding new checks simple?
>
Define 'properties' for each AST node.
You can categorize the properties as initialization, checks etc.,
"annotate" each AST with its valid properties.

You can have three passes...

1) Structural analysis and identifying 'possible' properties.
2) Identifying dependencies across nodes.
3) Property checking and error reporting.

I mentioned second-pass to take care of the cases where two nodes
suffer from the same error. i.e., the error can be rectified by
modifying one of the nodes.

Eg :
p = new Type[10];
...
...
delete p;


Thanks & Regards
-Shiva



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list