摘要
随着计算机硬件的发展,电子元件的功能即将受到量子效应的影响.对量子计算和量子计算机的研究迫在眉睫.Shor(JournalofComputing,1994,26:1484-1509)提出的大数质因子分解算法,向人们展示量子计算诱人的潜力.为验证量子算法正确性、通用量子计算机的可行性以及帮助理解量子力学中诸多问题,南京大学量子计算与量子信息研究组于2006年春设计了一种量子程序设计语言——NDQJava,并于同年夏在经典计算机上模拟实现了NDQJava的处理系统.此处理系统遵循编译一解释的途径,由词法分析程序、语法分析与代码转换程序、量子汇编与解释程序三部分组成.作为处理系统的第一部分,词法分析程序须将能够正确分析源程序并给出结构明确的单词属性字序列,它的设计实现遵循了简明、易用两条准则.本文着重介绍词法分析程序,较为详细地讨论了其设计与实现过程,并讨论了其主要优缺点.
With the development of computer hardware, the functions of electronic components will soon be affected by the quantum effect. So the research on quantum computing and quantum computer stares us in the face. The algorithm for dividing a large integer into prime factors presented by Shor(Journal of Computing, 1994, 26: 1484-1509), shows us the charming potential of quantum computing. For validating quantum algorithms, checking the feasibility to build a universal quantum computer and helping to understand many problems in quantum mechanics, the QCI (Quantum Computing and Quantum Information) Group of Nanjing University designed a quantum programming language: NDOJava in the spring of 2006, and implemented the NDOJava processing system by simulation on the classical computer in the summer of that year. This processing system follows a compilationinterpretation approach. The compiler of NDOJava, which includes lexical analyzer and syntactic analyzer and code transformer, compiles NDOJava source code into Java Byte-Code. Then the interpreter of NDQIava, which includes quantum assembler, quantum interpreter, and Java interpreter, interprets the Java Byte-Code on runtime and gives the running result. As the first step of NDQJava processing system, lexical analyzer must analyze the NI)QJava source program correctly and output the middle-code whose structure is definitely given. While designing and implementing we consider two rules: simplicity use-friendly. This paper introduces the lexical analyzer, and discusses its design and implementation in detail. We also sum up both the advantages and disadvantages of this lexical analyzer in the end.
出处
《南京大学学报(自然科学版)》
CAS
CSCD
北大核心
2008年第2期116-122,共7页
Journal of Nanjing University(Natural Science)
基金
江苏省自然科学基金(BK2007138)
关键词
量子计算
程序设计语言
处理系统
词法分析
quantum computation, programming language, processing system, lexical analysis