首页> 外文会议>Compiler Construction >Generalised Regular Parsers
【24h】

Generalised Regular Parsers

机译:广义常规解析器

获取原文

摘要

Aycock and Horspool have given an algorithm which improves the efficiency of GLR parsers. A grammar is 'reduced' so that there is no recursion apart from non-hidden left recursion, an FA recog-niser is then constructed and a stack is used when the recursive parts of the original grammar are required. Aycock and Horspool then give an algorithm which performs all possible traversals of the resulting PDA on a given input string. This mirrors the approach taken by Tomita to perform all traversals of an LR(0) FA. However, Aycock and Horspool's algorithm does not terminate in the case where the grammar contains hidden left recursion. In this paper we give a different method for constructing an FA which recognises the language generated by the grammar provided that the only recursion in the grammar arises from left or right recursion. Using this FA allows us to reduce the number of places that the stack is required. We also give a different algorithm for constructing all traversals of the final PDA which is correct in all cases, including grammars with hidden left recursion. Thus we can apply our algorithm to all context free grammars.
机译:Aycock和Horspool提供了一种可提高GLR解析器效率的算法。 “简化”语法,以便除了非隐藏的左递归外没有递归,然后构造一个FA语法,并在需要原始语法的递归部分时使用堆栈。然后,Aycock和Horspool给出一种算法,该算法在给定的输入字符串上执行结果PDA的所有可能遍历。这反映了富田公司执行LR(0)FA的所有遍历的方法。但是,在语法包含隐藏的左递归的情况下,Aycock和Horspool的算法不会终止。在本文中,我们给出了一种构造FA的不同方法,该FA可以识别由语法生成的语言,条件是语法中唯一的递归来自左递归或右递归。使用此FA可以使我们减少需要堆叠的位置数。我们还给出了用于构造最终PDA的所有遍历的不同算法,该算法在所有情况下都是正确的,包括具有隐藏的左递归的语法。因此,我们可以将算法应用于所有上下文无关文法。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号