DeFacto: Language-Parametric Fact Extraction from Source Code

Bas Basten, Paul Klint. DeFacto: Language-Parametric Fact Extraction from Source Code. In Dragan Gasevic, Ralf Lämmel, Eric {Van Wyk}, editors, Software Language Engineering, First International Conference, SLE 2008, Toulouse, France, September 29-30, 2008. Revised Selected Papers. Volume 5452 of Lecture Notes in Computer Science, pages 265-284, Springer, 2008. [doi]

Abstract

Abstract. Extracting facts from software source code forms the foundation for any software analysis. Experience shows, however, that extracting facts from programs written in a wide range of programming and application languages is labour-intensive and error-prone. We present DeFacto, a new technique for fact extraction. It amounts to annotating the context-free grammar of a language of interest with fact annotations that describe how to extract elementary facts for language elements such as, for instance, a declaration or use of a variable, a procedure or method call, or control flow statements. Once the elementary facts have been extracted, we use relational techniques to further enrich them and to perform the actual software analysis.

We motivate and describe our approach, sketch a prototype implementation and assess it using various examples. A comparison with other fact extraction methods indicates that our fact extraction descriptions are considerably smaller than those of competing methods