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

一个模型驱动的解析器生成器,从抽象树到抽象图

A Model-Driven Parser Generator, from Abstract Syntax Trees to Abstract Syntax Graphs

Luis Quesada, Fernando Berzal, Juan-Carlos Cubero

摘要:

基于模型的解析器生成器将语言规范与语言处理解耦。模型驱动的方法避免了传统解析器生成器对语言设计者的限制。传统的工具要求所设计的语言语法符合特定解析器生成器(最常见的是LL和LR解析器生成器)所支持的特定类型的语法。模型驱动的解析器生成器,如ModelCC,不需要语法规范,因为语法可以自动从语言模型中导出,并且如果需要,可以进行调整以符合给定类型解析器的要求,所有这些都不会干扰语言及其相关应用程序的概念设计。此外,模型驱动工具(如ModelCC)能够自动解析语言元素之间的引用,因此作为解析过程的结果,生成抽象语法图而不是抽象语法树。这样的图并不局限于有向无环图,它们可以包含循环,因为ModelCC支持前指、后指和递归引用。

英文摘要:

Model-based parser generators decouple language specification from language processing. The model-driven approach avoids the limitations that conventional parser generators impose on the language designer. Conventional tools require the designed language grammar to conform to the specific kind of grammar supported by the particular parser generator (being LL and LR parser generators the most common). Model-driven parser generators, like ModelCC, do not require a grammar specification, since that grammar can be automatically derived from the language model and, if needed, adapted to conform to the requirements of the given kind of parser, all of this without interfering with the conceptual design of the language and its associated applications. Moreover, model-driven tools such as ModelCC are able to automatically resolve references between language elements, hence producing abstract syntax graphs instead of abstract syntax trees as the result of the parsing process. Such graphs are not confined to directed acyclic graphs and they can contain cycles, since ModelCC supports anaphoric, cataphoric, and recursive references.

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

↑