Search-based inference of dialect grammars

  • Authors:
  • Massimiliano Di Penta;Pierpaolo Lombardi;Kunal Taneja;Luigi Troiano

  • Affiliations:
  • University of Sannio, Research Centre on Software Technology (RCOST), Via Traiano, 82100, Benevento, Italy;University of Sannio, Research Centre on Software Technology (RCOST), Via Traiano, 82100, Benevento, Italy;North Carolina State University, Via Traiano, 82100, Raleigh, NC, USA;University of Sannio, Research Centre on Software Technology (RCOST), Via Traiano, 82100, Benevento, Italy

  • Venue:
  • Soft Computing - A Fusion of Foundations, Methodologies and Applications
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

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.