A fast algorithm is given to produce a small set of short sentences from a context free grammar such that each production of the grammar is used at least once. The sentences are useful for testing parsing programs and for debugging grammars (finding errors in a grammar which causes it to specify some language other than the one intended). Some experimental results from using the sentences to test some automatically generated simpleLR(1) parsers are also given.
KeywordsComputational Mathematic Fast Algorithm Context Free Grammar Short Sentence Sentence Generator
Unable to display preview. Download preview PDF.
- 1.Richard L. Sander,A General Test Data Generator for Cobol, Spring Joint Computer Conference 1962.Google Scholar
- 2.K. V. Hanford,Automatic Generation of Test Cases, I.B.M. System Journal Vol. 9 No. 4 (1970), 242–257.Google Scholar
- 3.F. L. DeRemer,Simple LR(k) Grammars, CACM 14 (1971), 453.Google Scholar
- 4.John Reynolds, See J. C. Earley,An Efficient Context-Free Parsing Algorithm, Thesis (1968), 128, 129, Computer Science Department, Carnegie-Mellon University.Google Scholar
- 5.F. L. DeRemer,Practical Translators for LR(k), Languages, Project MAC TY-65 MIT.Google Scholar
- 6.A. J. Korenjak,Deterministic Language Processing, Thesis, Princeton, 1967.Google Scholar
- 7.N. Wirth and H. Weber,EULER: A generalization of ALGOL and its Formal Definition, CACM, Vol. 9 No. 1 (1966), 13–25 and No. 2, 89–99.Google Scholar