[antlr-interest] code analysis tool

Kintali Shiva Prasad skintali at sarvega.com
Thu Oct 16 12:49:08 PDT 2003


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/ 




More information about the antlr-interest mailing list