Semantic grep: regular expressions + relational abstraction

Authors: R.I. Bull A. Trevors A.J. Malton Michael W. Godfrey

Venue: SANER   Ninth Working Conference on Reverse Engineering, 2002. Proceedings., pp. 267-276, 2002

Year: 2002

Abstract: Searching source code is one of the most common activities of software engineers. Text editors and other support tools normally provide searching based on lexical expressions (regular expressions). Some more advanced editors provide a way to add semantic direction to some of the searches. Recent research has focused on advancing the semantic options available to text-based queries. Most of these results make use of heavy weight relational database management technology. In this paper we explore the extension of lexical pattern matching by means of light weight relational queries, implemented using a tool called grok. A "semantic grep" (sgrep) command was implemented, which translates queries in a mixed algebraic and lexical language into a combination of grok queries and grep commands. This paper presents the design decisions behind sgrep, and example queries that can be posed. The paper concludes with a case study in which sgrep was used to identify architectural anomalies in PostgreSQL, an open source Database Management System.

BibTeX:

@inproceedings{r.i.bull2002sgre+ra,
    author = "R.I. Bull and A. Trevors and A.J. Malton and Michael W. Godfrey",
    title = "Semantic grep: regular expressions + relational abstraction",
    year = "2002",
    pages = "267-276",
    booktitle = "Proceedings of Ninth Working Conference on Reverse Engineering, 2002. Proceedings."
}

Plain Text:

R.I. Bull, A. Trevors, A.J. Malton, and Michael W. Godfrey, "Semantic grep: regular expressions + relational abstraction," Ninth Working Conference on Reverse Engineering, 2002. Proceedings., pp. 267-276