Design and implementation of a language-complete C++ semantic graph

Edward Duffy, Brian A. Malloy · 2012

In this paper, we describe a system, Hylian, for construction of a language-complete abstract semantic graph that can be used for statement-level analysis, both static and dynamic, of a C++ application. We begin by extending the GNU gcc parser to generate parse trees in XML format for each of the compilation units in a C++ application. We then provide verification that the generated parse trees are structurally equivalent to the code in the original C++ application. We use the generated parse trees, together with an augmented version of the gcc test suite, to recover a grammar for the C++ dialect that we parse. We then construct the Abstract Semantic Graph, ASG, by extending the parse tree for each compilation unit with semantic information derived from the parse trees and guided by the C++ language standard. Finally, we link the ASGs for all of the compilation units into a unified ASG for the entire application under study.

Read the paper · More papers on PaperTik