Static Source Code Analysis using OCL - Seifert, Mirko; Samlaus, Roland (Electronic Communications of the EASST, 2008)
The majority of artifacts created during software development are representations of programs in textual syntax. Although graphical descriptions are becomingmore widespread, source code is still indispensable. To obtain programs that behave correctly and adhere to given coding conventions, source code must be analyzed - preferably using automated tools.Building source code analyzers has a long tradition and various mature tools exist to check code written in conventional languages, such as Java or C. As new languages emerge (e.g., Domain Specific Languages) these tools can not be applied and building a tool for each language does not seem feasible either.This paper investigates how meta models for textual languages and the Object Constraint Language can enable generic static source code analysis for arbitrary languages. The presented approach is evaluated using three languages (Java, SQL and a DSL for state machines).