ABSTRACT
Parsing expressions grammars (PEGs) are a recognition-based formalism for language specification, which has been the subject of several research works. A PEG that succeeds or rejects every input string is said to be complete. However, checking if an arbitrary PEG is complete is an undecidable problem. In this work we propose a sound type-based termination analysis for PEGs as a type inference algorithm.
- Michael D. Adams. 2013. Principled parsing for indentation-sensitive languages: revisiting landin's offside rule. In Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (Rome, Italy) (POPL '13). ACM, New York, NY, USA, 511--522. Google ScholarDigital Library
- Clark Barrett, Aaron Stump, and Cesare Tinelli. 2010. The SMT-LIB Standard: Version 2.0. In Proceedings of the 8th International Workshop on Satisfiability Modulo Theories (Edinburgh, UK), A. Gupta and D. Kroening (Eds.).Google Scholar
- Jean-Philippe Bernardy and Patrik Jansson. 2016. Certified Context-Free Parsing: A formalisation of Valiant's Algorithm in Agda. Logical Methods in Computer Science 12 (2016). Issue 2. Google ScholarCross Ref
- Clement Blaudeau and Natarajan Shankar. 2020. A Verified Packrat Parser Interpreter for Parsing Expression Grammars. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (New Orleans, LA, USA) (CPP 2020). Association for Computing Machinery, New York, NY, USA, 3--17. Google ScholarDigital Library
- Janusz A. Brzozowski. 1964. Derivatives of Regular Expressions. J. ACM 11, 4 (oct 1964), 481--494. Google ScholarDigital Library
- Leonardo Mendonça de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings (Lecture Notes in Computer Science, Vol. 4963), C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer, 337--340. Google ScholarCross Ref
- Thales Antônio Delfino and Rodrigo Geraldo Ribeiro. 2018. Towards certified virtual machine-based regular expression parsing. In Proceedings of the XXII Brazilian Symposium on Programming Languages, SBLP 2018, Sao Carlos, Brazil, September 20-21, 2018, Carlos Camarão and Martin Sulzmann (Eds.). ACM, 67--74. Google ScholarDigital Library
- Romain Edelmann, Jad Hamza, and Viktor Kunčak. 2020. Zippy LL(1) Parsing with Derivatives. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (London, UK) (PLDI 2020). Association for Computing Machinery, New York, NY, USA, 1036--1051. Google ScholarDigital Library
- Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay A. McCarthy, and Sam Tobin-Hochstadt. 2018. A programmable programming language. Commun. ACM 61, 3 (2018), 62--71. Google ScholarDigital Library
- Denis Firsov and Tarmo Uustalu. 2013. Certified Parsing of Regular Languages. In Certified Programs and Proofs - Third International Conference, CPP 2013, Melbourne, VIC, Australia, December 11-13, 2013, Proceedings (Lecture Notes in Computer Science, Vol. 8307), Georges Gonthier and Michael Norrish (Eds.). Springer, 98--113. Google ScholarDigital Library
- Denis Firsov and Tarmo Uustalu. 2014. Certified CYK parsing of context-free languages. J. Log. Algebraic Methods Program. 83, 5-6 (2014), 459--468. Google ScholarCross Ref
- Bryan Ford. 2004. Parsing Expression Grammars: A Recognition-Based Syntactic Foundation. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Venice, Italy) (POPL '04). Association for Computing Machinery, New York, NY, USA, 111--122. Google ScholarDigital Library
- Dick Grune and Ceriel J.H. Jacobs. 1990. Parsing Techniques - A Practical Guide. Ellis Horwood, Chichester, England. 300+ pages. http://www.cs.vu.nl/~dick/PTAPG.html PDF online free.Google Scholar
- Grzegorz Herman. 2020. Faster General Parsing through Context-Free Memoization. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (London, UK) (PLDI 2020). Association for Computing Machinery, New York, NY, USA, 1022--1035. Google ScholarDigital Library
- Trevor Jim, Yitzhak Mandelbaum, and David Walker. 2010. Semantics and Algorithms for Data-dependent Grammars. In Proceedings of the 37th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Madrid, Spain) (POPL'10). ACM, New York, NY, USA, 417--430. Google ScholarDigital Library
- Adam Koprowski and Henri Binsztok. 2011. TRX: A Formally Verified Parser Interpreter. Log. Methods Comput. Sci. 7, 2 (2011). Google ScholarCross Ref
- Neelakantan R. Krishnaswami and Jeremy Yallop. 2019. A Typed, Algebraic Approach to Parsing. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (Phoenix, AZ, USA) (PLDI 2019). Association for Computing Machinery, New York, NY, USA, 379--393. Google ScholarDigital Library
- Sam Lasser, Chris Casinghino, Kathleen Fisher, and Cody Roux. 2021. CoStar: A Verified ALL(*) Parser. Association for Computing Machinery, New York, NY, USA, 420--434. Google ScholarDigital Library
- Raul Lopes, Rodrigo Geraldo Ribeiro, and Carlos Camarão. 2016. Certified Derivative-Based Parsing of Regular Expressions. In Programming Languages - 20th Brazilian Symposium, SBLP 2016, Maringá, Brazil, September 22-23, 2016, Proceedings (Lecture Notes in Computer Science, Vol. 9889), Fernando Castor and Yu David Liu (Eds.). Springer, 95--109. Google ScholarCross Ref
- Fabio Mascarenhas, Sérgio Medeiros, and Roberto Ierusalimschy. 2014. On the relation between context-free grammars and parsing expression grammars. Sci. Comput. Program. 89 (2014), 235--250. Google ScholarCross Ref
- Sérgio Medeiros, Fabio Mascarenhas, and Roberto Ierusalimschy. 2014. Left recursion in Parsing Expression Grammars. Sci. Comput. Program. 96 (2014), 177--190. Google ScholarDigital Library
- Lasse Nielsen and Fritz Henglein. 2011. Bit-coded Regular Expression Parsing. In Language and Automata Theory and Applications - 5th International Conference, LATA 2011, Tarragona, Spain, May 26-31, 2011. Proceedings (Lecture Notes in Computer Science, Vol. 6638), Adrian-Horia Dediu, Shunsuke Inenaga, and Carlos Martín-Vide (Eds.). Springer, 402--413. Google ScholarCross Ref
- Terence Parr, Sam Harwell, and Kathleen Fisher. 2014. Adaptive LL(*) Parsing: The Power of Dynamic Analysis. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (Portland, Oregon, USA) (OOPSLA'14). ACM, New York, NY, USA, 579--598. Google ScholarDigital Library
- François Pottier and Didier Rémy. 2005. The Essence of ML Type Inference. In Advanced Topics in Types and Programming Languages, Benjamin C. Pierce (Ed.). MIT Press, Chapter 10, 389--489.Google Scholar
- Leonardo V. S. Reis, Roberto S. Bigonha, Vladimir Oliveira Di Iorio, and Luis Eduardo Souza Amorim. 2014. The formalization and implementation of Adaptable Parsing Expression Grammars. Science of Computer Programming 96, Part 2 (2014), 191--210.Google ScholarDigital Library
- Rodrigo Ribeiro and André Du Bois. 2017. Certified Bit-Coded Regular Expression Parsing. In Proceedings of the 21st Brazilian Symposium on Programming Languages (Fortaleza, CE, Brazil) (SBLP 2017). Association for Computing Machinery, New York, NY, USA, Article 4, 8 pages. Google ScholarDigital Library
- Rodrigo Ribeiro, Leonardo V. S. Reis, Samuel Feitosa, and Elton M. Cardoso. 2019. Towards Typed Semantics for Parsing Expression Grammars. In Proceedings of the XXIII Brazilian Symposium on Programming Languages (Salvador, Brazil) (SBLP 2019). Association for Computing Machinery, New York, NY, USA, 70--77. Google ScholarDigital Library
- Tom Ridge. 2011. Simple, Functional, Sound and Complete Parsing for All Context-Free Grammars. In Certified Programs and Proofs, Jean-Pierre Jouannaud and Zhong Shao (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 103--118.Google Scholar
- Elton M. Cardoso Rodrigo G. Ribeiro. 2022. typed-peg Library - online repository. https://github.com/lives-group/typed-peg.Google Scholar
- Martin Sulzmann and Peter Thiemann. 2017. A Computational Interpretation of Context-Free Expressions. In Programming Languages and Systems - 15th Asian Symposium, APLAS 2017, Suzhou, China, November 27-29, 2017, Proceedings (Lecture Notes in Computer Science, Vol. 10695), Bor-Yuh Evan Chang (Ed.). Springer, 387--405. Google ScholarCross Ref
- Alessandro Warth, James R. Douglass, and Todd Millstein. 2008. Packrat Parsers Can Support Left Recursion. In Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (San Francisco, California, USA) (PEPM '08). Association for Computing Machinery, New York, NY, USA, 103--110. Google ScholarDigital Library
Index Terms
- Type-based Termination Analysis for Parsing Expression Grammars
Recommendations
Parsing expression grammars: a recognition-based syntactic foundation
POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languagesFor decades we have been using Chomsky's generative system of grammars, particularly context-free grammars (CFGs) and regular expressions (REs), to express the syntax of programming languages and protocols. The power of generative grammars to express ...
Left recursion in Parsing Expression Grammars
Parsing Expression Grammars (PEGs) are a formalism that can describe all deterministic context-free languages through a set of rules that specify a top-down parser for some language. PEGs are easy to use, and there are efficient implementations of PEG ...
Left recursion in parsing expression grammars
SBLP'12: Proceedings of the 16th Brazilian conference on Programming LanguagesParsing Expression Grammars (PEGs) are a formalism that can describe all deterministic context-free languages through a set of rules that specify a top-down parser for some language. PEGs are easy to use, and there are efficient implementations of PEG ...
Comments