Skip to main content

Shift-Reduce Parsers for Transition Networks

  • Conference paper
Language and Automata Theory and Applications (LATA 2014)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8370))

Abstract

We give a new direct construction of the shift-reduce ELR (1) parsers for recursive Transition Networks (TN), which is suitable for languages specified by Extended BNF grammars (EBNF). Such parsers are characterized by their absence of conflicts, not just the classical shift-reduce and reduce-reduce types, but also a new type named convergence conflict. Such a condition is proved correct and is more general than the past proposed conditions for the shift-reduce parsing of EBNF grammars or TN’s. The corresponding parser is smaller than a classical one, without any extra bookkeeping. A constraint on TN’s is mentioned, which enables top-down deterministic ELL (1) analysis.

Work partially supported by PRIN “Automi e Linguaggi Formali”, and by CNR - IEIIT.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Beatty, J.C.: On the relationship between the LL(1) and LR(1) grammars. JACM 29(4), 1007–1022 (1982)

    Article  MATH  MathSciNet  Google Scholar 

  2. Breveglieri, L., Crespi Reghizzi, S., Morzenti, A.: Parsing methods streamlined. arXiv:1309.7584 [cs.FL], pp. 1–64 (2013)

    Google Scholar 

  3. Celentano, A.: LR parsing technique for extended context-free grammars. Comput. Lang. 6(2), 95–107 (1981)

    Article  Google Scholar 

  4. Chapman, N.P.: LALR(1,1) parser generation for regular right part grammars. Acta Inform. 21, 29–45 (1984), http://dx.doi.org/10.1007/BF00289138

    Article  MATH  MathSciNet  Google Scholar 

  5. Conway, M.E.: Design of a separable transition-diagram compiler. Comm. ACM 6(7), 396–408 (1963)

    Article  MATH  Google Scholar 

  6. Crespi Reghizzi, S., Breveglieri, L., Morzenti, A.: Formal languages and compilation, 2nd edn. Springer, London (2013)

    Book  MATH  Google Scholar 

  7. Crespi Reghizzi, S., Psaila, G.: Grammar partitioning and modular deterministic parsing. Comput. Lang. 24(4), 197–227 (1998)

    Article  MATH  Google Scholar 

  8. Gálvez, J.F.: A note on a proposed LALR parser for extended context-free grammars. Inf. Process. Lett. 50(6), 303–305 (1994), http://dx.doi.org/10.1016/0020-01909400051-4

    Article  MATH  Google Scholar 

  9. Heilbrunner, S.: On the definition of ELR(k) and ELL(k) grammars. Acta Inform. 11, 169–176 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  10. Hemerik, K.: Towards a taxonomy for ECFG and RRPG parsing. In: Dediu, A.H., Ionescu, A.M., Martín-Vide, C. (eds.) LATA 2009. LNCS, vol. 5457, pp. 410–421. Springer, Heidelberg (2009), http://dx.doi.org/10.1007/978-3-642-00982-2

    Chapter  Google Scholar 

  11. Kannapinn, S.: Reconstructing LR theory to eliminate redundance, with an application to the construction of ELR parsers (in German). Ph.D. thesis, Tech. Univ. Berlin (2001)

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  13. Korenjak, A.J.: A practical method for constructing LR(k) processors. Commun. ACM 12(11), 613–623 (1969)

    Article  MATH  Google Scholar 

  14. LaLonde, W.R.: Constructing LR parsers for regular right part grammars. Acta Inform. 11, 177–193 (1979), http://dx.doi.org/10.1007/BF00264024

    Article  MATH  MathSciNet  Google Scholar 

  15. Lee, G.O., Kim, D.H.: Characterization of extended LR(k) grammars. Inf. Process. Lett. 64(2), 75–82 (1997), http://dx.doi.org/10.1016/S0020-01909700152-X

    Article  Google Scholar 

  16. Morimoto, S., Sassa, M.: Yet another generation of LALR parsers for regular right part grammars. Acta Inform. 37, 671–697 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  17. Sassa, M., Nakata, I.: A simple realization of LR-parsers for regular right part grammars. Inf. Process. Lett. 24(2), 113–120 (1987), http://dx.doi.org/10.1016/0020-01908790104-9

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Breveglieri, L., Crespi Reghizzi, S., Morzenti, A. (2014). Shift-Reduce Parsers for Transition Networks. In: Dediu, AH., Martín-Vide, C., Sierra-Rodríguez, JL., Truthe, B. (eds) Language and Automata Theory and Applications. LATA 2014. Lecture Notes in Computer Science, vol 8370. Springer, Cham. https://doi.org/10.1007/978-3-319-04921-2_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-04921-2_18

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-04920-5

  • Online ISBN: 978-3-319-04921-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics