Skip to main content

A Deterministic Shift-Reduce Parser Generator for a Logic Programming Language

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 1861))

Abstract

This paper addresses efficient parsing in the context of logical inference for the purpose of using logic programming languages in compiler writing. A bottom-up, deterministic parsing mechanism is formulated for “bounded right context” grammars, a subclass of LR(k) grammars with characteristics amenable to declarative parser specification. A working parser generator for λProlog is described, although the basic parsing mechanism is applicable to logic programming in general.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. A. V. Aho, R. Sethi, and J. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986.

    Google Scholar 

  2. A. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998.

    Google Scholar 

  3. J. Cohen and T. Hickey. Parsing and compiling using prolog. ACM Transactions on Programming Languages and Systems, 9(2):125–163, 1987.

    Article  Google Scholar 

  4. R. Floyd. Bounded context syntactic analysis. Communications of the ACM, 7(2):62–67, 1964.

    Article  MATH  Google Scholar 

  5. S. Fong. Computational Properties of Principle-Based Grammatical Theories. PhD thesis, MIT, June 1991.

    Google Scholar 

  6. S. L. Graham. On bounded right context languages and grammars. SIAM Journal on Computing, 3(3):224–254, 1974.

    Article  MATH  MathSciNet  Google Scholar 

  7. M. Harrison and I. Havel. On the parsing of deterministic languages. Journal of the ACM, 21(4):525–548, 1974.

    Article  MATH  MathSciNet  Google Scholar 

  8. M. A. Harrison. Introduction to Formal Language Theory. Addison-Wesley, 1978.

    Google Scholar 

  9. R. Ochitani K. Uehara and O. Kakusho. A bottom-up parser based on predicate logic. IEEE Proceedings, International Symposium on Logic Programming, pages 220–227, 1984.

    Google Scholar 

  10. D. E. Knuth. On the translation of languages from left to right. Information and Control, 8(6):607–639, 1965.

    Article  MathSciNet  Google Scholar 

  11. G. Nadathur and D. Mitchell. System description: Teyjus—a compiler and abstract machine based implementation of λProlog. In Automated Deduction-CADE-13, Springer-Verlag LNAI no. 1632, pages 287–291, July 1999.

    Google Scholar 

  12. U. Nilsson. AID: an alternative implementation of DCGs. New Generation Computing, 4:383–399, 1986.

    Article  MATH  Google Scholar 

  13. F. Pereira and D. Warren. Definite clause grammars for language analysis. Artificial Intelligence, 13:231–278, 1980.

    Article  MATH  MathSciNet  Google Scholar 

  14. F. Pereira and D. Warren. Parsing as deduction. In 21st Annual Meeting of the Association for Computational Linguistics, pages 137–144, 1983.

    Google Scholar 

  15. Shieber S., Schabes Y., and Pereira F. Principles and implementation of deductive parsing. Technical Report TR-11-94, Center for Research in Computing Technology, Harvard University, December 1998.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Liang, C. (2000). A Deterministic Shift-Reduce Parser Generator for a Logic Programming Language. In: Lloyd, J., et al. Computational Logic — CL 2000. CL 2000. Lecture Notes in Computer Science(), vol 1861. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44957-4_88

Download citation

  • DOI: https://doi.org/10.1007/3-540-44957-4_88

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67797-0

  • Online ISBN: 978-3-540-44957-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics