A sentence generator for a compiler for PT, a pascal subset

Vijayaraghavan Murali, Rudrapatna K. Shyamasundar · Software Practice and Experience · 1983

Abstract An implementation of a sentence generator system for a compiler for PT, a subset of Pascal, is discussed. Using the syntax definition of PT, the system automatically produces leftmost generations in a pseudorandom fashion. Syntactically correct as well as compile‐time correct programs can be generated. In the generation of compile‐time correct programs, only those statements that satisfy the contextual constraints imposed by the declarative part of the generated program are generated. The system also provides the facility of producing programs that have lexical or syntactic errors. All the generated programs are printed with appropriate indentations to show structural properties. Furthermore, the number of procedures in the generated program, the number of statements, identifier length and the number of generations can be controlled. The implementation has been successfully used for testing an error recovery parser as well as an intermediate code generator for PT.

Read the paper · More papers on PaperTik