Full LR(1) parser generator Hyacc and study on the performance of LR(1) algorithms

  • Authors:
  • Xin Chen;David Pager

  • Affiliations:
  • University of Hawaii at Manoa, Honolulu, HI;University of Hawaii at Manoa, Honolulu, HI

  • Venue:
  • Proceedings of The Fourth International C* Conference on Computer Science and Software Engineering
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Despite the popularity of LALR(1) parser generators such as Yacc/Bison and LL parser generators such as ANTLR, robust and effective LR(1) parser generators are rare due to expensive performance and implementation difficulty. This work employed relevant algorithms, including the Knuth canonical algorithm, Pager's practical general method, lane-tracing algorithm, unit production elimination algorithm and its extension, and the edge-pushing algorithm, implemented an efficient, practical and Yacc/Bison-compatible open-source parser generator Hyacc, which supports full LR(0)/LALR(1)/LR(1) and partial LR(k). Based on the implementation, an empirical study was conducted comparing different LR(1) parser generation algorithms and LALR(1) algorithms. The result shows that LR(1) parser generation based upon improved algorithms and carefully selected data structures can be sufficiently efficient to be of practical use with modern computing facilities.