摘要
可逆变换和双向变换等数据转换问题一直是近年来的研究热点,研究人员针对该问题提出了大量相关的语言和模型。但是,这些实现往往建立在一种新的计算模型上,从而导致需要花费较大的学习成本去了解计算模型。另一方面,作为语法解析的基本工具,上下文无关文法对于绝大多数程序员来说都是不陌生的。提出了一种基于上下文无关文法的计算模型,用来构造字符串上的可逆变换,并对其性质和表达能力进行了探讨。采用Scheme语言实现了该计算模型,并通过在MIPS指令集上进行汇编和反汇编开发验证了该模型。验证结果表明,该模型具有较强的表达能力,在添加小型的公共数值变换模块后,可以完整地实现MIPS指令集上的汇编和反汇编。
Data transformation problems like reversible transformation and bidirectional transformation have been a research focus in recent years, a large number of different transformation languages and models have been proposed.But they are often based on a new computation model, which leads a non-trivial learning cost to understand the new computation model. On the other hand, as an essential tool in language parsing, context-free grammar is familiar to most programmers. This paper proposes a computation model to construct reversible transformation for string data based on context- free grammars, and discusses its properties and computability. This paper also implements the model in Scheme, and evaluates the model by developing a pair of assembler and disassembler of MIPS instruction set. The evaluation result shows that the model is expressive and can implement the assembler and disassembler of MIPS instruction set with the help of a small data transformation module.
出处
《计算机科学与探索》
CSCD
北大核心
2015年第7期793-802,共10页
Journal of Frontiers of Computer Science and Technology
基金
国家自然科学基金
国家重点基础研究发展计划(973计划)
国家高技术研究发展计划(863计划)~~
关键词
可逆变换
上下文无关文法
字符串数据
reversible transformation
context-free grammar
string data