Shift-reduce conflicts in LR parsers

  • Authors:
  • S. D. Pezaris

  • Affiliations:
  • Thermo Electron Co., I01 First Ave, Waltham, MA

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1989

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this note, the shift-reduce conflicts of LR(1) and LR(0) are compared. It is concluded that, if LR(1) has no shift-reduce conflicts, or, if the LR(1) shift-reduce conflicts are resolved in favor of the shift, then all shift-reduce conflicts of the corresponding LR(0) can be correctly resolved by the simple rule: resolve in favor of the shift. With this resolution, LR(0) is adequate for parsing the C grammar.