首页 | 本学科首页   官方微博 | 高级检索  
     


Yet another generation of LALR parsers for regular right part grammars
Authors:Shin-ichi Morimoto  Masataka Sassa
Affiliation:(1) CS Quality Department, NEC Aerospace Systems, Ltd., 2-4-18, Shin-yokohama, Kouhoku-ku, Yokohama, Japan, (e-mail: morimoto@sf.nas.nec.co.jp) , JP;(2) Department of Mathematical and Computing Sciences, Tokyo Institute of Technology, Ookayama, Meguro-ku, Tokyo, Japan, (e-mail: sassa@is.titech.ac.jp) , JP
Abstract:In this paper we introduce two methods for building LALR parsers for regular right part grammars (RRPGs). Both methods build a parser directly from a grammar, require no extra state or data structure, and can deal with all LALR RRPGs. The first method is quite simple. For almost all LALR RRPGs, including the majority of grammars with stacking conflicts, parsing actions are similar to those of LALR parsers for usual context free grammars. No extra action is required to recognize a handle in this case. For other LALR RRPGs, the right hand side of a production is checked to recognize a handle. The second method does not require checking of the right hand side of a production to recognize a handle. Instead, it records the number of conflicts in LR items and in the stack. Unlike previous methods, our method needs no extra data structure. Received: 23 September 1998 / 16 March 2001
Keywords:
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号