LLLR Parsing: a Combination of LL and LR Parsing

Author Boštjan Slivnik



PDF
Thumbnail PDF

File

OASIcs.SLATE.2016.5.pdf
  • Filesize: 477 kB
  • 13 pages

Document Identifiers

Author Details

Boštjan Slivnik

Cite AsGet BibTex

Boštjan Slivnik. LLLR Parsing: a Combination of LL and LR Parsing. In 5th Symposium on Languages, Applications and Technologies (SLATE'16). Open Access Series in Informatics (OASIcs), Volume 51, pp. 5:1-5:13, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2016)
https://doi.org/10.4230/OASIcs.SLATE.2016.5

Abstract

A new parsing method called LLLR parsing is defined and a method for producing LLLR parsers is described. An LLLR parser uses an LL parser as its backbone and parses as much of its input string using LL parsing as possible. To resolve LL conflicts it triggers small embedded LR parsers. An embedded LR parser starts parsing the remaining input and once the LL conflict is resolved, the LR parser produces the left parse of the substring it has just parsed and passes the control back to the backbone LL parser. The LLLR(k) parser can be constructed for any LR(k) grammar. It produces the left parse of the input string without any backtracking and, if used for a syntax-directed translation, it evaluates semantic actions using the top-down strategy just like the canonical LL(k) parser. An LLLR(k) parser is appropriate for grammars where the LL(k) conflicting nonterminals either appear relatively close to the bottom of the derivation trees or produce short substrings. In such cases an LLLR parser can perform a significantly better error recovery than an LR parser since the most part of the input string is parsed with the backbone LL parser. LLLR parsing is similar to LL(^*) parsing except that it (a) uses LR(k) parsers instead of finite automata to resolve the LL(k) conflicts and (b) does not perform any backtracking.
Keywords
  • LL parsing
  • LR languages
  • left parse

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Alfred V. Aho and Jeffrey D. Ullman. The Theory of Parsing, Translation and Compiling, volume Volume I: Parsing. Prentice-Hall, Englewood Cliffs, N.J., USA, 1972. Google Scholar
  2. Alan J. Demers. Generalized left corner parsing. In Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages POPL'77, pages 170-182, Los Angeles, CA, USA, 1977. ACM, ACM. Google Scholar
  3. Bryan Ford. Parsing expression grammars: a recognition-based syntactic foundation. In Proceedings of the 31st ACM SIGACT-SIGPLAN symposium on Principles of programming languages POPL'04, pages 111-122, Venice, Italy, 2004. ACM, ACM. Google Scholar
  4. R. Nigel Horspool. Recursive ascent-descent parsers. In Dieter Hammer, editor, Compiler Compilers, Third International Workshop CC '90, Schwerin, FRG, volume 477 of Lecture Notes in Computer Science, pages 1-10. Springer-Verlag, 1990. Google Scholar
  5. R. Nigel Horspool. Recursive ascent-descent parsing. Journal of Computer Languages, 18(1):1-16, 1993. Google Scholar
  6. Matthew Might and David Darais. Yacc is dead. Available online at Cornell University Library (arXiv.org:1010.5023), 2010. Google Scholar
  7. Mark-Jan Nederhof. Generalized left corner parsing. In Proceedings of the sixth conference on European chapter of the Association for Computational Linguistics EACL'93, pages 305-314, Stroudsburg, PA, USA, 1993. Association for Computational Linguistics. Google Scholar
  8. Terence Parr and Kathleen Fischer. LL(*): The foundation of the ANTLR parser generator. ACM SIGPLAN Notices - PLDI'10, 46(6):425-436, 2011. Google Scholar
  9. Terence Parr, Sam Harwell, and Kathleen Fischer. Adaptive LL(*) parsing: The power of dynamic analysis. In Proceedings of the 2014 ACM SIGPLAN International Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA'14), volume 579-598, Portland, OR, USA, 2014. ACM, ACM. Google Scholar
  10. Paul Purdom and Cynthia A. Brown. Semantic routines and LR(k) parsers. Acta Informatica, 14(4):299-315, 1980. Google Scholar
  11. James P. Schmeiser and David T. Barnard. Producing a top-down parse order with bottom-up parsing. Information Processing Letters, 54(6):323-326, 1995. Google Scholar
  12. Elizabeth Scott and Adrian Johnstone. GLL parsing. Electronic Notes in Theoretical Computer Science, 253(7):177-189, 2010. Google Scholar
  13. Elizabeth Scott, Adrian Johnstone, and Rob Economopoulos. BRNGLR: a cubic Tomita-style GLR parsing algorithm. Acta Informatica, 44(6):427-461, 2007. Google Scholar
  14. Seppo Sippu and Eljas Soisalon-Soininen. Parsing Theory, Volume I: Languages and Parsing, volume 15 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, Berlin, Germany, 1988. Google Scholar
  15. Seppo Sippu and Eljas Soisalon-Soininen. Parsing Theory, Volume II: LR(k) and LL(k) Parsing, volume 20 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, Berlin, Germany, 1990. Google Scholar
  16. Boštjan Slivnik. The embedded left LR parser. In Proceedings of the Federated Conference on Computer Science and Information Systems, pages 871-878, Szczecin, Poland, 2011. IEEE Computer Society Press. Google Scholar
  17. Boštjan Slivnik. LL conflict resolution using the embedded left LR parser. Computer Science and Information Systems, 9(3):1105-1124, 2012. Google Scholar
  18. Boštjan Slivnik and Boštjan Vilfan. Producing the left parse during bottom-up parsing. Information Processing Letters, 96(6):220-224, 2005. Google Scholar
  19. Boštjan Slivnik. LLLR parsing. In Proceedings of the 28th Annual ACM Symposium on Applied Computing SAC'13, pages 1698-1699, Coimbra, Portugal, 2013. ACM. Google Scholar
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail