Skip to main content

Ordered Context-Free Grammars

  • Conference paper
  • First Online:
Implementation and Application of Automata (CIAA 2022)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13266))

Included in the following conference series:

Abstract

We propose a new unambiguous grammar formalism, referred to as ordered context-free grammars, which is identical to context-free grammars, apart from the property that it also places an order on parse trees. Since only a minor modification to ordered context-free grammars is required to obtain parsing expression grammars, the relationship between context-free grammars and parsing expression grammars becomes more evident. By preserving how ordered context-free grammars support left-recursion, parsing expression grammars is modified to support left recursion in ways much more natural than current approaches.

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 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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

References

  1. Berglund, M., van der Merwe, B.: On the semantics of regular expression parsing in the wild. Theor. Comput. Sci. 679, 69–82 (2017)

    Article  MathSciNet  Google Scholar 

  2. Ford, B.: Parsing expression grammars: a recognition-based syntactic foundation. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 111–122 (2004)

    Google Scholar 

  3. Loff, B., Moreira, N., Reis, R.: The computational power of parsing expression grammars. J. Comput. Syst. Sci. 111, 1–21 (2020)

    Article  MathSciNet  Google Scholar 

  4. Parr, T., Fisher, K.: LL(*): the foundation of the ANTLR parser generator. In: Hall, M.W., Padua, D.A. (eds.) Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 425–436 (2011)

    Google Scholar 

  5. Nivat, M., Podelski, A. (eds.): Tree Automata and Languages. North-Holland, Amsterdam (1992)

    MATH  Google Scholar 

  6. Warth, A., Douglass, J.R., Millstein, T.D.: Packrat parsers can support left recursion. In: Glück, R., de Moor, O. (eds.) Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation, pp. 103–110 (2008)

    Google Scholar 

  7. Pegen. https://github.com/we-like-parsers/pegen. Accessed 28 Feb 2022

  8. Medeiros, S., Mascarenhas, F., Ierusalimschy, R.: Left recursion in parsing expression grammars. Sci. Comput. Program. 96, 177–190 (2014)

    Article  Google Scholar 

  9. Okhotin, A.: Boolean grammars. Inf. Comput. 194(1), 19–48 (2004)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Martin Berglund .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

van der Merwe, B., Berglund, M. (2022). Ordered Context-Free Grammars. In: Caron, P., Mignot, L. (eds) Implementation and Application of Automata. CIAA 2022. Lecture Notes in Computer Science, vol 13266. Springer, Cham. https://doi.org/10.1007/978-3-031-07469-1_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-07469-1_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-07468-4

  • Online ISBN: 978-3-031-07469-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics