BIT Numerical Mathematics

, Volume 12, Issue 3, pp 366–375 | Cite as

A sentence generator for testing parsers

  • Paul Purdom


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.


Computational Mathematic Fast Algorithm Context Free Grammar Short Sentence Sentence Generator 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Richard L. Sander,A General Test Data Generator for Cobol, Spring Joint Computer Conference 1962.Google Scholar
  2. 2.
    K. V. Hanford,Automatic Generation of Test Cases, I.B.M. System Journal Vol. 9 No. 4 (1970), 242–257.Google Scholar
  3. 3.
    F. L. DeRemer,Simple LR(k) Grammars, CACM 14 (1971), 453.Google Scholar
  4. 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. 5.
    F. L. DeRemer,Practical Translators for LR(k), Languages, Project MAC TY-65 MIT.Google Scholar
  6. 6.
    A. J. Korenjak,Deterministic Language Processing, Thesis, Princeton, 1967.Google Scholar
  7. 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

Copyright information

© BIT Foundations 1972

Authors and Affiliations

  • Paul Purdom
    • 1
  1. 1.Computer Science DepartmentIndiana UniversityBloomingtonUSA

Personalised recommendations