arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1501.02795cs.FL
收藏

扫描和解析具有歧义和约束的语言:Lamb和Fence算法

Scanning and Parsing Languages with Ambiguities and Constraints: The Lamb and Fence Algorithms

Luis Quesada, Fernando Berzal, Francisco J. Cortijo

摘要:

传统的语言处理工具将语言设计者限制在特定类型的语法上。相比之下,基于模型的语言处理工具将语言设计与语言处理解耦。这些工具允许在语言规范中出现词汇和句法歧义,并声明性地规范解决这些歧义的约束。因此,这些技术要求扫描器和解析器能够解析上下文无关文法、处理歧义并强制消除歧义的约束。在本文中,我们介绍了羔羊和围栏。Lamb是一种扫描算法,它支持模糊的标记定义以及自定义模式匹配器和约束的规范。Fence是一种图表分析算法,支持模糊的上下文无关文法和关于关联性、组合和优先级的约束的定义,以及自定义约束。Lamb和Fence结合在一起,实现了基于ModelCC模型的语言处理工具。

英文摘要:

Traditional language processing tools constrain language designers to specific kinds of grammars. In contrast, model-based language processing tools decouple language design from language processing. These tools allow the occurrence of lexical and syntactic ambiguities in language specifications and the declarative specification of constraints for resolving them. As a result, these techniques require scanners and parsers able to parse context-free grammars, handle ambiguities, and enforce constraints for disambiguation. In this paper, we present Lamb and Fence. Lamb is a scanning algorithm that supports ambiguous token definitions and the specification of custom pattern matchers and constraints. Fence is a chart parsing algorithm that supports ambiguous context-free grammars and the definition of constraints on associativity, composition, and precedence, as well as custom constraints. Lamb and Fence, in conjunction, enable the implementation of the ModelCC model-based language processing tool.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑