【24h】

LL(*): the foundation of the ANTLR parser generator

机译:LL(*):ANTLR解析器生成器的基础

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

摘要

Despite the power of Parser Expression Grammars (PEGs) and GLR, parsing is not a solved problem. Adding nonde- terminism (parser speculation) to traditional LL and LR parsers can lead to unexpected parse-time behavior and in- troduces practical issues with error handling, single-step de- bugging, and side-e ecting embedded grammar actions. This paper introduces the LL(*) parsing strategy and an asso- ciated grammar analysis algorithm that constructs LL(*) parsing decisions from ANTLR grammars. At parse-time, decisions gracefully throttle up from conventional xed k ≥1 lookahead to arbitrary lookahead and, nally, fail over to backtracking depending on the complexity of the parsing de- cision and the input symbols. LL(*) parsing strength reaches into the context-sensitive languages, in some cases beyond what GLR and PEGs can express. By statically removing as much speculation as possible, LL(*) provides the expressiv- ity of PEGs while retaining LL's good error handling and unrestricted grammar actions. Widespread use of ANTLR (over 70,000 downloads/year) shows that it is e ective for a wide variety of applications.
机译:尽管解析器表达语法(PEGs)和GLR的功能强大,但解析并不是解决的问题。在传统的LL和LR解析器中添加非确定性(解析器推测)可能会导致意外的解析时行为,并在错误处理,单步调试和侧面嵌入语法操作等方面引入实际问题。本文介绍了LL(*)解析策略和一种相关的语法分析算法,该算法从ANTLR语法构造LL(*)解析决策。在解析时,决策会从传统的固定k≥1前瞻性过渡到任意前瞻性,并且最终会失败,取决于解析决策和输入符号的复杂度而回溯。 LL(*)的解析能力达到了上下文相关的语言,在某些情况下超出了GLR和PEG所能表达的范围。通过静态地消除尽可能多的推测,LL(*)提供了PEG的表现力,同时保留了LL的良好错误处理和不受限制的语法动作。 ANTLR的广泛使用(每年超过70,000次下载)表明,它对多种应用都是有效的。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号