Search-based inference of dialect grammars |
| |
Authors: | Massimiliano Di Penta Pierpaolo Lombardi Kunal Taneja Luigi Troiano |
| |
Affiliation: | (1) Research Centre on Software Technology (RCOST), University of Sannio, Via Traiano, 82100 Benevento, Italy;(2) North Carolina State University, Raleigh, NC, USA |
| |
Abstract: | Building parsers is an essential task for the development of many tools, from software maintenance tools to any kind of business-specific,
programmable environment having a command-line interface. Whilst grammars for many programming languages are available, these
are, very often, almost useless because of the large diffusion of dialects and variants not contemplated by standard grammars.
Writing a grammar by hand is clearly feasible, however it can be a tedious and error-prone task, requiring appropriate skills
not always available. Grammar inference is a possible, challenging approach for obtaining suitable grammars from program examples.
However, inference from scratch poses serious scalability issues and tends to produce correct, but meaningless grammars, hard
to be understood and used to build tools. This paper describes an approach, based on genetic algorithms, for evolving existing
grammars towards target (dialect) grammars, inferring changes from examples written using the dialect. Results obtained experimenting
the inference of C dialect rules show that the algorithm is able to successfully evolve the grammar. Inspections indicated
that the changes automatically made to the grammar during its evolution preserved its meaningfulness, and were comparable
to what a developer could have done by hand. |
| |
Keywords: | Grammar inference Genetic algorithms Source code analysis |
本文献已被 SpringerLink 等数据库收录! |
|