Practical Earley Parsing

Earley’s parsing algorithm isa general algorithm, ableto handleany context-free grammar. As with most parsing algorithms, however, the presence of grammar rules having empty right-hand sides complicates matters. By analyzing why Earley’s algorithm struggles with these grammar rules, we have devised a simple solution to the problem. Our empty-rule solution leads to a new type of finite automaton expressly suited for use in Earley parsers and to a new statement of Earley’s algorithm. We show that this new form of Earley parser is much more time efficient in practice than the original.

[1]  C. Q. Lee,et al.  The Computer Journal , 1958, Nature.

[2]  Alfred V. Aho,et al.  Deterministic parsing of ambiguous grammars , 1975, Commun. ACM.

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

[4]  John Aycock,et al.  Compiling Little Languages in Python , 1998 .

[5]  R. Nigel Horspool,et al.  A Faster Earley Parser , 1996, CC.

[6]  Charles N. Fischer,et al.  Crafting a Compiler , 1988 .

[7]  Susan L. Graham,et al.  A new method for compiler code generation , 1978, POPL '78.

[8]  Chris Verhoef,et al.  Current parsing techniques in software renovation considered harmful , 1998, Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242).

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

[10]  R. Nigel Horspool,et al.  Directly-Executable Earley Parsing , 2001, CC.

[11]  Walter L. Ruzzo,et al.  An Improved Context-Free Recognizer , 1980, ACM Trans. Program. Lang. Syst..

[12]  Miguel A. Alonso,et al.  Construction of Efficient Generalized LR Parsers , 1997, Workshop on Implementing Automata.

[13]  Manuel Vilares Ferro,et al.  Efficient incremental parsing for context-free languages , 1994, Proceedings of 1994 IEEE International Conference on Computer Languages (ICCL'94).

[14]  Edward D. Willink,et al.  Meta-compilation for C++ , 2001 .

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

[16]  Paul Klint,et al.  Incremental generation of parsers , 1989, PLDI '89.

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

[18]  Alain Pirotte,et al.  Efficient parsing algorithms for general context-free parsers , 1975, Inf. Sci..

[19]  Eelco Visser,et al.  Using Filters for the Disambiguation of Context-free Grammars , 1994 .

[20]  Andrew W. Appel,et al.  Modern Compiler Implementation in Java , 1997 .

[21]  Bernard Lang,et al.  The Structure of Shared Forests in Ambiguous Parsing , 1989, ACL.