计算机科学与探索 ›› 2013, Vol. 7 ›› Issue (7): 659-666.DOI: 10.3778/j.issn.1673-9418.1303015

• 学术研究 • 上一篇    下一篇

量子程序设计语言NDQJava2处理系统——代码转换程序

蔡希辉1,2,徐家福1,2+   

  1. 1. 南京大学 计算机软件新技术国家重点实验室,南京 210046
    2. 南京大学 计算机科学与技术系,南京 210046
  • 出版日期:2013-07-01 发布日期:2013-07-02

Quantum Programming Language NDQJava2 Processing System:Code Converter

CAI Xihui1,2, XU Jiafu1,2+   

  1. 1. State Key Laboratory for Novel Software Technology, Nanjing University, Nanjing 210046, China
    2. Department of Computer Science and Technology, Nanjing University, Nanjing 210046, China
  • Online:2013-07-01 Published:2013-07-02

摘要: NDQJava2语言是一种混成式、结构化、命令式量子程序设计语言,它在NDQJava语言的基础上增添了更多的量子成分。NDQJava2处理系统则是在经典计算机上对NDQJava2语言进行模拟实现的处理系统。着重介绍了NDQJava2处理系统的代码转换程序,详细讨论了其设计与实现过程,采用自顶向下、逐层转换的方式,将语法树转换成带量子汇编指令的Java代码。实验表明,该代码转换程序较好地完成了预期目标。

关键词: NDQJava2语言, 处理系统, 语法树, 代码转换程序

Abstract: NDQJava2 language is a hybrid, structured and imperative quantum programming language, which is an extension of NDQJava language with some additional quantum components. The processing system of NDQJava2 is a simulative implementation of NDQJava2 on classical computers. This paper describes the code converter of NDQJava2 processing system, and discusses its design and implementation in detail. It adopts top-down and layer-by-layer conversion method, and converts syntax tree into Java code with quantum assembly instructions. Experiments show that the code converter achieves the desired purpose.

Key words: NDQJava2 language, processing system, syntax tree, code converter