一个基于导数的可视下推文法分析器生成器
A Derivative-based Parser Generator for Visibly Pushdown Grammars
摘要:
在本文中,我们提出了一个衍生物为基础的,功能识别器和语法分析器生成器的可见下推语法。生成的解析器接受二义性语法,并在线性时间内生成一个包含输入字符串的所有有效解析树的解析森林。森林中的每个解析树也可以在线性时间内提取。除了解析器生成器,允许更灵活的形式的可见下推语法,我们还提出了一个翻译器,转换标记的CFG到一个可见下推语法在一个声音的方式,和标记的CFG的解析树进一步产生通过运行嵌入在翻译的可见下推语法的解析树中的语义动作。分析器的性能进行了比较与流行的分析工具ANTLR和其他流行的手工制作的分析器。在证明助手Coq中对核心解析算法的正确性进行了形式化验证。
英文摘要:
In this paper, we present a derivative-based, functional recognizer and parser generator for visibly pushdown grammars. The generated parser accepts ambiguous grammars and produces a parse forest containing all valid parse trees for an input string in linear time. Each parse tree in the forest can then be extracted also in linear time. Besides the parser generator, to allow more flexible forms of the visibly pushdown grammars, we also present a translator that converts a tagged CFG to a visibly pushdown grammar in a sound way, and the parse trees of the tagged CFG are further produced by running the semantic actions embedded in the parse trees of the translated visibly pushdown grammar. The performance of the parser is compared with a popular parsing tool ANTLR and other popular hand-crafted parsers. The correctness of the core parsing algorithm is formally verified in the proof assistant Coq.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。