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

快速、灵活、声明性地构造带有PEG的抽象树

Fast, Flexible, and Declarative Construction of Abstract Syntax Trees with PEGs

Kimio Kuramitsu

摘要:

我们解决了一个声明性的构造抽象语法树与解析表达式文法。AST操作符(构造器、连接器和标记)是新定义的,用于指定灵活的AST构造。PEG带来的一个新挑战是AST在回溯和Packrat解析中的一致性管理。我们使事务AST机器,以便在PEG的推测性解析的上下文中执行AST操作。所有的一致性控制都是通过AST操作员的分析自动化的。所提出的方法是在Nez解析器中实现的,用Java编写。性能研究表明,事务性AST机器在CSV、XML和C语法方面需要大约25%的时间。

英文摘要:

We address a declarative construction of abstract syntax trees with Parsing Expression Grammars. AST operators (constructor, connector, and tagging) are newly defined to specify flexible AST constructions. A new challenge coming with PEGs is the consistency management of ASTs in backtracking and packrat parsing. We make the transaction AST machine in order to perform AST operations in the context of the speculative parsing of PEGs. All the consistency control is automated by the analysis of AST operators. The proposed approach is implemented in the Nez parser, written in Java. The performance study shows that the transactional AST machine requires 25\% approximately more time in CSV, XML, and C grammars.

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

↑