首页> 外文期刊>OASIcs : OpenAccess Series in Informatics >LLLR Parsing: a Combination of LL and LR Parsing
【24h】

LLLR Parsing: a Combination of LL and LR Parsing

机译:LLLR解析:LL和LR解析的组合

获取原文
           

摘要

A new parsing method called LLLR parsing is defined and a method for producing LLLR parsers is described. An LLLR parser uses an LL parser as its backbone and parses as much of its input string using LL parsing as possible. To resolve LL conflicts it triggers small embedded LR parsers. An embedded LR parser starts parsing the remaining input and once the LL conflict is resolved, the LR parser produces the left parse of the substring it has just parsed and passes the control back to the backbone LL parser. The LLLR(k) parser can be constructed for any LR(k) grammar. It produces the left parse of the input string without any backtracking and, if used for a syntax-directed translation, it evaluates semantic actions using the top-down strategy just like the canonical LL(k) parser. An LLLR(k) parser is appropriate for grammars where the LL(k) conflicting nonterminals either appear relatively close to the bottom of the derivation trees or produce short substrings. In such cases an LLLR parser can perform a significantly better error recovery than an LR parser since the most part of the input string is parsed with the backbone LL parser. LLLR parsing is similar to LL(^*) parsing except that it (a) uses LR(k) parsers instead of finite automata to resolve the LL(k) conflicts and (b) does not perform any backtracking.
机译:定义了一种称为LLLR解析的新解析方法,并描述了一种用于生成LLLR解析器的方法。 LLLR解析器将LL解析器用作其主干,并使用LL解析来尽可能多地解析其输入字符串。为了解决LL冲突,它会触发小型嵌入式LR解析器。嵌入式LR解析器开始解析其余的输入,一旦LL冲突解决,LR解析器将生成刚解析的子字符串的左解析,并将控制权传递回主干LL解析器。可以为任何LR(k)语法构造LLLR(k)解析器。它产生输入字符串的左解析,而没有任何回溯,并且,如果用于语法指导的翻译,它会像标准的LL(k)解析器一样,使用自顶向下策略评估语义动作。 LLLR(k)解析器适用于语法,其中LL(k)冲突的非终结符要么看起来相对靠近派生树的底部,要么产生较短的子字符串。在这种情况下,LLLR解析器可以比LR解析器执行明显更好的错误恢复,因为大部分输入字符串都是使用主干LL解析器进行解析的。 LLLR解析与LL(^ *)解析相似,不同之处在于它(a)使用LR(k)解析器而不是有限自动机来解决LL(k)冲突,并且(b)不执行任何回溯。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号