期刊文献+

利用基本文法改写模式解决语法分析冲突

Resolving Parsing Conflicts by Basic Rules and Patterns of Grammar Rewriting
下载PDF
导出
摘要 分析了LALR(1)分析器生成系统中语法分析冲突问题的起因和解决冲突的时机及策略,提出改写文法应遵循的4条规则,将常用的文法改写技巧总结为7个基本的文法改写模式.应用案例表明,提出的文法改写规则和基本文法改写模式可有效解决语法分析冲突. The origin of the parsing conflicts of grammar by using LALR(1) parser generators is analyzed. The moment and methods to eliminate conflicts in compiling phases is studied. Four basic rules of grammar rewriting as well as seven basic grammar rewriting patterns to resolve conflicts are proposed. Case studies show that the proposed techniques are highly effective in developing conflict-free parsers.
出处 《北京邮电大学学报》 EI CAS CSCD 北大核心 2006年第3期86-90,共5页 Journal of Beijing University of Posts and Telecommunications
基金 国家自然科学基金项目(60573084)
关键词 LALR(1) 语法分析器生成器 YACC 语法分析 冲突 文法改写 消歧 LALR(1) parser generator yet another compiler's compiler parsing conflict grammar rewriting disambiguation
  • 相关文献

参考文献8

  • 1Levine J R,Mason T,Brown D.Lex & yacc (3rd edition)[M].New York:O'reilly & Associates Inc,1995.
  • 2Annika A.User defined syntax[D].Goteborg,Sweden:Chalmers University of Technology,1992.
  • 3Eun J L,Kwang M C.Grammar coverings of a deterministic parser with action conflicts[J].Information Processing Letters,1994,51:85-92.
  • 4Power J F,Malloy B A.Exploiting metrics to facilitate grammar transformation into LALR format[C]∥Proceedings of 16th ACM Symposium on Applied Computing.Las Vegas:[s.n.],2001:11-14.
  • 5Sarbo J J.Grammar transformation for optimizing backtrack parsers[J].Computer Languages,1994,20(2):89-100.
  • 6Aycock J,Horspool R N.Schrodinger's token[J].Sofware-Practice and Experience,2001,31(8):803-814.
  • 7Quyang S T,Wu P C,Wang F J.Locating free positions in LR(k) grammars[J].Journal of Information Science and Engineering,2002,18(2):411-423.
  • 8American National Standards Institute.ISO/IEC International Standard No.14882(E) in ASC X3.Programming Languages-C++[S].1998.

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部