摘要
代码的自动生成技术的应用范围越来越广,尤其是具有很大灵活性的解决方案。AutoQuotation就是这样一种代码生成技术,所产生的Quotation代码具有独立于平台的词法分析及语法分析程序,但是它的算法是自顶向下的,在实际引用中具有很大的局限性。算法是程序的核心,采用的GLR(generalized LR)分析法,能够处理大部分的上下文无关文法,因而具有很高的实用性。描述一个自动生成系统,该系统能够根据文法自动生成Quotation代码,并自动进行Quotation注册。经测试系统能够处理回溯及左递归。
The application scope of code auto-generation technology is expanding,especially for those solutions with great flexibility.AutoQuotation is such a technology,the Quotation-code it generates has platform-independent lexer and parser programmer.But existing generating program of it has too big limitation in practical use,for it uses top-down parsing algorithm.The algorithm is the core of the program.The GLR analysis algorithm used by us in the paper is such an algorithm that it can deal with most of context-free syntax,therefore has quite good practicality.In the thesis,an auto-generated system is laid out,which can generate Quotation-code automatically according to the grammar.And the Quotation registration is also automated as well.Proved by test,the system can handle the case of backtrack and left-recursion.
出处
《计算机应用与软件》
CSCD
北大核心
2012年第11期215-216,224,共3页
Computer Applications and Software
关键词
GLR
引文
元编程
GLR(generalized LR) Quotation Meta-programming