The Marpa recognizer is described. Marpa is a practical and fully implemented algorithm for the recognition, parsing and evaluation of context-free grammars. The Marpa recognizer is the first to unite the improvements to Earley's algorithm found in Joop Leo's 1991 paper to those in Aycock and Horspool's 2002 paper. Marpa tracks the full state of the parse, at it proceeds, in a form convenient for the application. This greatly improves error detection and enables event-driven parsing. One such technique is "Ruby Slippers" parsing, in which the input is altered in response to the parser's expectations.
翻译:本文描述Marpa识别器。Marpa是一种用于上下文无关文法识别、解析和求值的实用且完全实现的算法。该识别器首次将Joop Leo于1991年论文中提出的Earley算法改进与Aycock和Horspool于2002年论文中的改进相结合。Marpa在解析过程中以便于应用的形式跟踪完整解析状态,从而显著提升错误检测能力并支持事件驱动解析。其中一种技术是"Ruby Slippers"解析,即根据解析器的预期对输入进行动态调整。