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.
, ,
,
Springer
D. Gasevic , R. Lämmel (Ralf) , E. van Wyk (Eric)
Lecture Notes in Computer Science
International Conference on Software Language Engineering
Software Analysis and Transformation

Basten, B., & Klint, P. (2008). DeFacto: Language-Parametric Fact Extraction from Source Code. In D. Gasevic, R. Lämmel, & E. van Wyk (Eds.), Proceedings of the 1st International Conference on Software Language Engineering. Springer.