© 2002 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Practical Earley Parsing
1 Department of Computer Science, University of Calgary, 2500 University Drive NW, Calgary, Alberta, Canada T2N 1N4 Email: aycock@cpsc.ucalgary.ca 2 Department of Computer Science, University of Victoria, Victoria, BC, Canada V8W 3P6
Earley's parsing algorithm is a general algorithm, able to handle any 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.
Received 5 November, 2001. Revised 17 April, 2002.