Premium
The design and implementation of a grammar‐based data generator
Author(s) -
Maurer Peter M.
Publication year - 1992
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380220303
Subject(s) - compiler , computer science , programming language , macro , code generation , grammar , generator (circuit theory) , string (physics) , code (set theory) , table (database) , context (archaeology) , compile time , data structure , set (abstract data type) , database , operating system , paleontology , linguistics , philosophy , power (physics) , physics , quantum mechanics , key (lock) , biology
DGL is a context‐free grammar‐based language for generating test data. Although many of the features of DGL are implemented in a straighforward way, the implementation of several of the most important features is neither trivial nor obvious. Before one can understand the implementation of these features, however, it is necessary to understand the overall structure of the compiler and its output, which was designed to be flexible enough to incorporate new features easily. Variables and chains are two of the most important features of DGL, and also two of the trickiest features to implement. The run‐time dictionaires, which are built into the C code generated by the compiler, are implemented as pure code rather than as table‐look‐up routines. The compiler itself is reasonably straightforward, except for the expansion of character sets and compile‐time macros. These two features can cause the ‘multi‐dimensional’ expansion of a string, the implementation of which must be carefully designed.