首页> 外文会议>9th ACM SIGSOFT-SIGPLAN workshop on program analysis for software tools and engineering 2010 >Packrat Parsers Can Handle Practical Grammars in Mostly Constant Space
【24h】

Packrat Parsers Can Handle Practical Grammars in Mostly Constant Space

机译:Packrat解析器可以处理大多数恒定空间中的实用文法

获取原文
获取原文并翻译 | 示例

摘要

Packrat parsing is a powerful parsing algorithm presented by Ford in 2002. Packrat parsers can handle complicated grammars and recursive structures in lexical elements more easily than the traditional LL(k) or LR(1) parsing algorithms. However, packrat parsers require O(n) space for memoization, where n is the length of the input. This space inefficiency makes packrat parsers impractical in some applications. In our earlier work, we had proposed a packrat parser generator that accepts grammars extended with cut operators, which enable the generated parsers to reduce the amount of storage required.rnExperiments showed that parsers generated from cut-inserted grammars can parse Java programs and subset XML files in bounded space.rnIn this study, we propose methods to automatically insert cut operators into some practical grammars without changing the accepted languages. Our experimental evaluations indicated that using our methods, packrat parsers can handle some practical grammars including the Java grammar in mostly constant space without requiring any extra annotations.
机译:Packrat解析是Ford在2002年提出的功能强大的解析算法。与传统的LL(k)或LR(1)解析算法相比,Packrat解析器可以更轻松地处理词汇元素中的复杂语法和递归结构。但是,packrat解析器需要O(n)空间用于记忆,其中n是输入的长度。这种空间效率低下的特点使得packrat解析器在某些应用中不切实际。在我们早期的工作中,我们提出了一个packrat解析器生成器,该生成器接受带有cut运算符扩展的语法,这使生成的解析器能够减少所需的存储量。在这项研究中,我们提出了在不更改可接受语言的情况下将剪切运算符自动插入某些实用语法的方法。我们的实验评估表明,使用我们的方法,packrat解析器可以在几乎恒定的空间内处理一些实用的语法,包括Java语法,而无需任何额外的注释。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号