摘要
传统的C、C++、Java编译系统大而全,集成了大量的库和框架,足让开发者使用非常方便,却不利于开发者对编译理论与技术的理解。该文针对上述问题,研究了简单的代码编译器的技术构成,开发出了一个具有通用意义的简单编译系统,可使读者更好地学习编译原理和技术并提高对这门课的兴趣。首先,该文对Tina解释器的主要功能和应用进行了概述,并对其执行过程进行了分析和讨论;针对该研究领域的实际情况,提出了Tina解释器的设计方法。其次,从Tina的代码结构和格式入手,分析了常见的词法、语法问题;研究了编译技术,并对程序的控制结构、判断的解析过程进行详细的分析。编译过程分为词法分析、语法分析以及代码生成和处理三个阶段。以Windows系统为开发平台、以C语言为开发工具,运用递归技术和链表、队列、栈等数据结构对这三个模块进行了具体的设计。
The traditional C、C ++、Java compiler system are large and integrate a large number of libraries and frameworks, allowingdevelopers to use conveniently, are not conducive to understand the compiler theory and technology. In this paper, aiming at theabove problems, we research the a simple structure of code compiler technology, developed a simple compiler system with commonsense,making the reader betterly learn compiler theory and technology and increasing the interest of this course. Firstly, the mainfeatures and applications what Tina interpreter were discussed, and the analysis and discussion of the implementation process. Theactual situation in the field of researching, proposed Tina compiler which is the design method of this solution. Secondly, from codestructure and format of Tina, it analyzes the common lexical, grammatical problems. Research on the compiler technology, controlstructures and procedures, parsing judgment for detailed analysis. Compilation process is divided into lexical analysis, syntax analy-sis and code generation three processing stages,which let the Windows system as the development platform and let C language asdevelopment tools and use recursive technique and the data structure of lists and queue and stacks implementing the three modulesof the specific design.
出处
《电脑知识与技术》
2018年第5Z期223-225,共3页
Computer Knowledge and Technology
关键词
编译技术
解释器
词法分析
语法分析
compiler technology
lexical analysis
lexical analysis
interpreter parsing