Warning: this thesis was produced with MS Word and cannot be viewed under some postscript viewers. However, it has printed fine on MS Windows and Sun Unix systems.
This thesis discusses an approach for easing the process of adapting a program analysis tool to different source languages. Our approach involves modifying the tool to work with existing program representations available from compilers or other sources. As part of this modification, we restructure the tool to limit its interaction with the underlying program representation to a small adaptation module interface comprised of two sets of functions: representation functions that synthesize information required by the tool about objects in the representation and language functions that determine program constructs of interest to the tool. Hiding representation and language details behind an adaptation module interface in this manner isolates the changes needed to adapt the tool to a different program representation that supports a different language.
We have applied this approach to the StarTool program analysis tool developed at UCSD. Defining an adaptation module has facilitated retargeting this tool to independent AST generators for C and Ada and to an AST representation of Tcl/Tk programs. Our work shows that defining our adaptation module interface in terms of specific requirements of StarTool, rather than in terms of general-purpose queries, significantly eases the process of retargeting the tool to additional representations and languages.