Journal of Beijing University of Posts and Telecommunications

  • EI核心期刊

JOURNAL OF BEIJING UNIVERSITY OF POSTS AND TELECOM ›› 2006, Vol. 29 ›› Issue (3): 86-90.doi: 10.13190/jbupt.200603.86.lih

• Reports • Previous Articles     Next Articles

Resolving Parsing Conflicts by Basic Rules and Patterns of Grammar Rewriting

LI Hu, JIN Mao-zhong, LIU Chao, XU Fu   

  1. Software Engineering Institute, Beihang University, Beijing 100083, China
  • Received:2005-04-27 Revised:1900-01-01 Online:2006-06-30 Published:2006-06-30
  • Contact: LI Hu

Abstract:

The paper analyzed the origin of the problem of parsing conflicts when using LALR(1) parser generators, and summarized the moments as well as methods to eliminate conflicts in compiling phases. Four basic rules of grammar rewriting as well as seven basic grammar rewriting patterns for the purpose of resolving conflicts were proposed. Case studies show that the proposed techniques are highly effective in developing conflict-free parsers.

Key words: LALR(1), parser generator, yet another compiler’s compiler, parsing conflict, grammar rewriting, disambiguation

CLC Number: