Memetic grammatical inference approach for DSL embedding

Dejan Hrnčič, Marjan Mernik · International Convention on Information and Communication Technology, Electronics and Microelectronics · 2011

Domain-specific languages (DSLs) are often designed by domain experts who have no knowledge about the syntax and semantics of programming languages. However, they are able to write sample programs to accomplish their goals and illustrate the features of their language. Grammatical inference is a technique for inferring a context-free grammar (CFG) from a set of positive (and negative) samples. This paper presents an improved memetic algorithm for grammatical inference that may assist domain experts and software language engineers in developing DSLs by automatically producing a grammar which describes a set of sample DSL programs. Our approach uses local search technique with improved generalization step and mutation operator. Negative samples are also introduced to overcome overgeneralization problem. The algorithm was tested on several DSLs and a case study of embedding a DSL is presented.

Read the paper · More papers on PaperTik