Evaluating GLR parsing algorithms

We describe the behaviour of three variants of GLR parsing: (i) Farshi's original Correction to Tomita's non-general algorithm; (ii) the Right Nulled GLR algorithm which provides a more efficient generalisation of Tomita and (iii) the Binary Right Nulled GLR algorithm, on three types of LR table. We present a guide to the parse-time behaviour of these algorithms which illustrates the inefficiencies in conventional Farshi-style GLR parsing. We also describe the tool GTB (Grammar Tool Box) which provides a platform for comparative studies of parsing algorithms; and use GTB to exercise the three GLR algorithms running with LR(0), SLR(1) and LR(1) tables for ANSI-C, ISO-Pascal and IBM VS-COBOL. We give results showing the size of the structures constructed by these parsers and the amount of searching reguired during the parse, which abstracts their runtime.

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

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

[3]  J. Rekers,et al.  Parser Generation for Interactive Environments , 1992 .

[4]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

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

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

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

[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]  Dennis M. Ritchie,et al.  The C programming language - ANSI C - Second edition , 1988 .

[11]  Adrian Johnstone,et al.  Reverse compilation of digital signal processor assembler source to ANSI-C , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[12]  Brian W. Kernighan,et al.  The C Programming Language , 1978 .

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

[14]  M. Tomita Generalized LR Parsing , 1991, Springer US.

[15]  Bjarne Stroustrup,et al.  The Design and Evolution of C , 1994 .

[16]  Giorgios Economopoulos,et al.  Generalised LR parsing algorithms , 2006 .

[17]  Georg Sander VCG - visualization of compiler graphs , 1995 .

[18]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[19]  Adrian Johnstone,et al.  Generalised Parsing: Some Costs , 2004, CC.

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

[21]  Eelco Visser,et al.  Syntax definition for language prototyping , 1997 .

[22]  Franklin L. DeRemer,et al.  Simple LR(k) grammars , 1971, Commun. ACM.

[23]  Robert D. Cameron Extending context-free grammars with permutation phrases , 1993, LOPL.

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

[25]  Adrian Johnstone,et al.  Tomita-Style Generalised LR , 2006 .

[26]  Ralf Lämmel,et al.  Deriving tolerant grammars from a base-line grammar , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..

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

[28]  Ralf Lämmel,et al.  Semi‐automatic grammar recovery , 2001, Softw. Pract. Exp..

[29]  Adrian Johnstone,et al.  Right nulled GLR parsers , 2006, TOPL.

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

[31]  Ralf Lämmel,et al.  Transformation of SDF syntax definitions in the ASF+SDF Meta-Environment , 2001, LDTA@ETAPS.

[32]  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 .