McSAF: An extensible static analysis framework for the MATLAB language
Jesse Doherty · eScholarship@McGill (McGill) · 2012
MATLAB is a popular language for scientific and numerical programming. Despite its popularity, there are few active rojects providing open tools for MATLAB related compiler research. This thesis provides the McLAB Static Analysis Framework, McSAF, the goal of which is to simplify the development of new compiler tools for MATLAB. The McLAB project was started in order to develop such tools in the hopes of attracting further research. The goal of the project is to provide an extensible compiler toolkit for MATLAB and scientific programming. It is intended to explore the compilation challenges unique to MATLAB and to explore new language features that could help scientific programmers be more productive. One piece of functionality that is particularly important for compiler research is the ability to perform static analysis. Without the information provided by static analyses, program transformations and optimizations, and automated programmer feedback would not be possible. In order to make the development of static analyses simpler, this thesis contributes a framework for creating static analyses for the MATLAB language. This framework is intended to make writing analyses easier by providing core functionality and API for developing such analyses. It also aims to make analysis development easier by providing an intermediate representation called McLAST, which provides simpler syntax and explicitly exposes some of MATLAB's semantics. In order to give analysis writers a head start, some example analyses are provided. These include simple analyses intended to demonstrate the use of the framework, and some more complicated analyses that provide basic semantic information about MATLAB programs. In addition to the framework making development of analyses simpler, McSAF is also designed to be extended to new language features. Not only can the framework be extended, but existing analyses can also be extended. This allows work that was previously done for analyzing MATLAB code to be applied to future language extensions.