GLL parse-tree generation

Backtracking techniques which are often used to extend recursive descent (RD) parsers can have explosive run-times and cannot deal with grammars with left recursion. GLL parsers are fully general, worst-case cubic parsers which have the recursive descent-like property that they are easy to write and to use for grammar debugging. They have the direct relationship with the grammar that an RD parser has. In this paper we give an algorithm for generating GLL parsers which build an SPPF representation of the derivations of the input, complementing our existing GLL recognition algorithm, and we show that such parsers and recognisers are worst-case cubic.

[1]  Adrian Johnstone,et al.  Recognition is not parsing - SPPF-style parsing from cubic recognisers , 2010, Sci. Comput. Program..

[2]  Bryan Ford,et al.  Packrat parsing:: simple, powerful, lazy, linear time, functional pearl , 2002, ICFP '02.

[3]  Eelco Visser,et al.  Program Transformation with Stratego/XT: Rules, Strategies, Tools, and Systems in Stratego/XT 0.9 , 2003, Domain-Specific Program Generation.

[4]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[5]  Paul Klint,et al.  Compiling language definitions: the ASF+SDF compiler , 2000, TOPL.

[6]  Terence Parr Language Translation Using PCCTS and C , 1999 .

[7]  Adrian Johnstone,et al.  Generalized Bottom Up Parsers With Reduced Stack Activity , 2005, Comput. J..

[8]  Masaru Tomita,et al.  Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems , 1985 .

[9]  Masaru Tomita,et al.  Efficient parsing for natural language , 1985 .

[10]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[11]  Alfred V. Aho,et al.  The Theory of Parsing, Translation, and Compiling , 1972 .

[12]  Adrian Johnstone,et al.  Right nulled GLR parsers , 2006, ACM Trans. Program. Lang. Syst..

[13]  Hanspeter Mössenböck,et al.  LL(1) Conflict Resolution in a Recursive Descent Compiler Generator , 2003, JMLC.

[14]  R. Nigel Horspool,et al.  Faster Generalized LR Parsing , 1999, CC.

[15]  Adrian Johnstone,et al.  BRNGLR: a cubic Tomita-style GLR parsing algorithm , 2007, Acta Informatica.

[16]  Adrian Johnstone,et al.  Generalised Recursive Descent parsing and Fellow-Determinism , 1998, CC.

[17]  Peter T. Breuer,et al.  A prettier compiler‐compiler: Generating higher‐order parsers in C , 1995, Softw. Pract. Exp..

[18]  Esko Ukkonen,et al.  Upper Bounds on the Size of LR(k) Parsers , 1985, Inf. Process. Lett..

[19]  Stefan Jähnichen Compiler construction : 8th international conference, CC '99, held as part of the Joint European Conferences on Theory and Practice of Software, ETAPS'99, Amsterdam, The Netherlands, March 22-28, 1999 : proceedings , 1999 .

[20]  Bryan Ford,et al.  Parsing expression grammars: a recognition-based syntactic foundation , 2004, POPL '04.

[21]  Adrian Johnstone,et al.  GLL Parsing , 2010, LDTA.

[22]  Adrian Johnstone,et al.  Modelling GLL Parser Implementations , 2010, SLE.

[23]  Daniel H. Younger,et al.  Recognition and Parsing of Context-Free Languages in Time n^3 , 1967, Inf. Control..