We show how LR parsers for the analysis of arbitrary context-free grammars can be derived from classical Earley's parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n3 ) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has often been the case in previous approaches. The algorithm behave better in practical cases, achieving linear complexity on LR grammars. Experimental results show the performance of our proposal.
Miguel A. Alonso, David Cabrero, Manuel Vilares Fe