首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到18条相似文献,搜索用时 171 毫秒
1.
深入分析并实现词法分析及语法分析过程,对于理解编译原理全过程有着极为重要的作用。利用流行的面向对象技术进行词法分析类及语法分析类的设计,加深对编译技术理解同时,得到了锻炼编程技术的机会。  相似文献   

2.
深入分析并实现词法分析及语法分析过程,对于理解编译原理全过程有着极为重要的作用。利用流行的面向对象技术进行词法分析类及语法分析类的设计,加深对编译技术理解同时,得到了锻炼编程技术的机会。  相似文献   

3.
基于编译技术的程序可视化   总被引:4,自引:0,他引:4  
程序可视化的目的是使程序的内部结构以及行为可视化更容易被理解。程序可视化工具有助于程序员理解程序的实际行为和其开发的深层的系统,以及调试程序或者测试程序所用资源。特别是对于正在学习初级编程的人,程序可视化工具能帮助他们学习一个程序是如何被编译和执行的。因此,有必要进行关于程序执行可视化的研究。介绍了一种以编译技术,主要是以词法分析和语法分析为基础的开发程序可视化工具的方法,并给出了C语言程序执行可视化工具的实例,以说明该方法的实用性。该工具是在程序执行特征测试工具的基础上,将其词法分析器和词法分析器加以修改而实现的。  相似文献   

4.
量子程序设计语言NDQJava处理系统   总被引:6,自引:2,他引:6  
简要介绍了量子程序设计语言NDQJava的一个处理系统.其特点是:程序中经典部分之处理借助Java系统,着重考虑量子部分之处理.该处理系统遵循编译-解释的途径,由词法分析程序、语法分析与代码转换程序以及量子汇编与解释程序3部分组成.文末还给出了示例,该系统已于2006年6月底在经典计算机上模拟实现.  相似文献   

5.
网络游戏脚本系统的面向对象实现   总被引:1,自引:0,他引:1  
陈立志 《计算机科学》2006,33(B12):196-198,218
网络游戏脚本中大量采用IF_THEN_ELSE控制结构,笔者针对这一特点,利用面向对象技术设计并实现了一个小型的游戏脚本系统。该脚本系统在实现中简化了繁琐的词法分析、语法分析等过程,用面向对象技术把脚本的数据结构组织和解释执行过程进行了统一。通过把它嵌入到具体的网络游戏中进行应用,证实了该实现方案可扩充性好,运行稳定。本方案与采用一般编译方法实现的语言处理系统相比,省时省力,针对性强,同时又能满足网络游戏的对脚本的基本要求。  相似文献   

6.
为了提升数控系统的效率和功能,提出模块化的解释器结构模型.该模型将整个解释器分为词法分析模块,语法分析模块和解释执行模块3个模块.在词法分析模块中,提出利用EBNF(Extended Backus-Naur Form)对标准数控代码规则进行形式化描述的方法,并采用自顶向下的递归下降分析构建词法分析程序.通过将词法分析得到的数据存入设计好的加工信息存储结构,实现了数控指令的形式化表达.加工命令转化模块将加工数据转化成相应的数控指令送入系统底层模块.详细阐述了各模块的构建方法,并开发了一个简单的解释器原型系统,验证了所提方法的有效性,为高性能数控代码解释器的实现提供了技术支持.  相似文献   

7.
在编译原理和虚拟机技术的基础上,采用一种高级语言设计了一个简单的编译器。通过词法分析、语法分析和中间代码、虚拟机等进程,将源程序编译成目标程序,实现了复杂编译器的简单设计。  相似文献   

8.
SEG系统是一个语法制导编辑程序的生成程序,它由三部分组成:元语言Meta;元语言分析程序;以及语法制导的编辑处理程序,该系统具有下列特性:ⅰ)它面向多种语言,所以给定一个语言,很快就能产生其编辑程序;ⅱ)可以在多个窗口中同时编辑多个文件;ⅲ)可以让用户设置舒适的私有环境;ⅳ)Mouse设备与精巧的菜单配合使用户输入命令既正确又迅速;ⅴ)以及漂亮的格式,它既可以由系统自动产生,又可以让用户交互式调整。 本文简略地介绍了SEG系统,并讨论了其设计原理与实现技术。  相似文献   

9.
刘建伟 《微机发展》1995,5(6):27-29
提高程序设计和编译效率是计算机科学的一个普遍性问题,本文介绍了将C语言的词法单位-标识定义为扩展键盘宏的方法,并讨论了交互式宏编辑技术在编程和编译方面的显著优点。  相似文献   

10.
为解决RTI(运行时间基础设施)中FED(联邦执行数据)文件解析效率、可重用性问题,提出了应用编译原理中的词法分析和语法分析技术对FED文件进行解析的方法.根据RTI研发过程中FED文件解析的要求,对FED文件解析模块进行了研究,并设计出改进的FED文件解析程序的结构框架.在此基础上,给出了应用词法分析和语法分析技术解析FED文件的具体方案和实现过程,最后通过实例验证了基于词法和语法分析技术对FED解析的方案明显优于通常方案.  相似文献   

11.
W. M. Waite 《Software》1986,16(5):473-488
This paper examines a common design for a lexical analyser and its supporting modules. An implementation of the design was tuned to produce the best possible performance. In effect, many of the optimizations that one would expect of a production-quality compiler were carried out by hand. After measuring the cost of tokenizing two large programs with this version, the code was ‘detuned’ to remove specific optimizations and the measurements were repeated. In all cases, the basic algorithm was unchanged, so that the difference in cost is an indication of the effectiveness of the optimization. Comparisons were also made with a tool-generated lexical analyser for the same task. On the basis of the measurements, several specific design and optimization strategies are recommended. These recommendations are also valid for software other than lexical analysers.  相似文献   

12.
以在嵌入式系统中建立C编译器的技术特点为主要内容,用设计实例论述了C编译器实现中前端、后端的主要工作内容。说明了在前、后端之间起桥梁作用的中间描述语言有向无环图(DAG)的设计原理及形成方法,同时还就如何将DAG与目标机系统之间形成映射关系进行描述,提出了在映射中规约规则制定的方法和原则,给出了一些有指导意义的经验性结论。  相似文献   

13.
策略翻译是实现策略管理的关键问题之一.设计了一种可扩展的策略翻译系统结构,提出了两阶段转换的思想,阶段1采用编译原理的思想,设计策略编译器,通过词法和语法分析,将源策略首先转换为与设备无关的中间策略,阶段2采用人工智能的思想,设计策略组装器,通过策略知识库,将中间策略转换为目标设备可执行的策略.并且通过设计词法库和策略知识库,实现了可扩展的策略翻译,增强了策略翻译的灵活性和可操作性.  相似文献   

14.
Andorra-I is an experimental parallel Prolog system which transparently exploits both dependent and-parallelism and or-parallelism. One of the main components of Andorra-I is its preprocessor. In order to obtain efficient execution of programs in Andorra-I, the preprocessor includes a compiler for Andorra-I. The compiler includes a determinacy analyser and a clause compiler, and generates code for a specialised abstract machine. In this paper we discuss the main issues in the Andorra-I compiler, presenting its abstract instruction set and describing the algorithms used in its implementation.  相似文献   

15.
提出用编译的方法设计一款能直接生成 MCS-51系列单片机的目标代码,不依赖操作系统和JVM的嵌入式Ja-va编译器,使得Java语言在低档嵌入式系统中应用更加广泛,实现成本低廉的工业环境及家庭电器与 Internet 相结合实现远程监测和控制.详细分析了Java语言与嵌入式系统的特点,以实时版jRate及 sun公司的GJC编译系统为参考,采用单遍扫描语法制导翻译模式,以语法分析程序单元为核心,构建嵌入式Java 编译器的词法分析器、语法/语义分析器和代码生成器,并对测试方法进行了探讨.  相似文献   

16.
张承瑞  程荣亮  王恒 《计算机工程》2004,30(3):76-77,110
针对软件PLC的IL的语言,进行面向对象的设计和分析。通过对面向对象的技术的具体应用,透过使用设计模式的思想增强了系统的可维护性、可扩展性以及可复用性。文章对词法分析、数据类型、符号表和语句处理的类的结构进行了介绍,通过这些类的使用增加了编译系统灵活性。  相似文献   

17.
V. Seshadri  D. B. Wortman 《Software》1991,21(12):1323-1348
Concurrency is an attractive method for reducing the execution time of compilers. By dividing source programs into segments which can be compiled concurrently, the task of compiling programs can be accelerated. Many of the difficult problems which arise when constructing a concurrent compiler occur in the implementation of the semantic analyser. This paper investigates the problems involved in designing the semantic analyser for a concurrent compiler for a modern, block-structured language. Several approaches to solving the problems which arise are presented. These solutions are then implemented as part of a concurrent Modula-2 + compiler, running on a shared memory multiprocessor. A performance evaluation of these semantic analysers is presented.  相似文献   

18.
The lexical analyzer of a compiler usually adopts the longest-match rule to resolve ambiguities when deciding the next token in the input stream. However, that rule may not be applicable in all situations. Because the longest-match rule is widely used, a language designer or a compiler implementor frequently overlooks the subtle implications of the rule. The consequence is either a flawed language design or a deficient implementation. We propose a method that automatically checks the applicability of the longest-match rule and identifies precisely the situations in which that rule is not applicable. The method is useful to both language designers and compiler implementors. In particular, the method is indispensable to automatic generators of language translation systems since, without the method, the generated lexical analyzers can only blindly apply the longest-match rule and this results in erroneous behaviors. The crux of the method consists of two algorithms: one is to compute the regular set of the sequences of tokens produced by a nondeterministic Mealy automaton when the automaton processes elements of an input regular set. The other is to determine whether a regular set and a context-free language have nontrivial intersection with a set of equations.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号