首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 156 毫秒
1.
管笑笑  葛宁  阮方 《微计算机信息》2006,22(34):248-250
介绍一种应用于数字系统设计中的基于函数式语言的代码解析方案,主要包括该函数式语言和解析工具的介绍,该语言的词法与语法分析程序的结构介绍,由语法树到语法规则到抽象语法树的生成过程,以及具体的应用实例。该解析方案已经成功应用于数字系统的设计中。  相似文献   

2.
描述了一个VHDL语言词法和语法分析器的设计与实现,采用语法规则描述与分析引擎分离的方法,首先将VHDL语法规则用GPLD元语言描述,然后生成二进制语法分析表。选择所需语言编写分析引擎程序,在对VHDL代码进行分析时,用分析引擎载入生成的分析表,显示分析过程的移进、规约状态步并构建分析树并报告错误。  相似文献   

3.
为实现基于TTCN-3的协议一致性测试系统,提出一种通过编译方式将TTCN-3语言转换为C++语言的编译器方案。通过对TTCN-3核心语言的研究分析,运用正则语言解析方法实现词法分析模块;在词法分析输出基础上编写上下文无关文法规则,使用多种方法较为彻底地解决语法冲突问题,实现语法分析模块;实现将TTCN-3语言转换为C++语言的编译器前端模块。该方案可快速实现对TTCN-3源代码的词法分析和语法分析,输出单词符号序列并检查其是否符合预定义的语法规则,对错误进行定位、报错并输出编译结果。  相似文献   

4.
程序分析技术包括控制流分析、数据流分析、别名分析、程序切片和程序插桩等技术,在程序理解,代码重构、代码优化和软件自动化调试等方面有着重要的应用,而词法分析和语法分析技术是程序分析技术的基础。本文设计与实现了一个轻量级的C语言词法语法分析工具CParser,通过词法分析、预处理和语法分析三个步骤,实现了根据源代码建立相应的抽象语法树的功能。工具使用简单方便,而且能够完整支持C99标准,可用于克隆代码检测、软件错误定位等后续研究工作。  相似文献   

5.
阎志欣 《软件学报》1996,7(Z1):239-248
本文提出了程序设计语言的一种新的计算模型,带迭代算子的函数式模型.文中给出了基于该计算模型的程序设计语言的语法、计算规则集及确定性证明.该类语言以表达式的复合描述顺序,以迭代表达式描述循环,以条件表达式描述分支,使得程序以数学语义为基础,易于理解、证明及构造高技的执行系统.褶信该类语言是一种有坚实理论基础、高教的、实际有用的,高级确定性程序设计语言.  相似文献   

6.
带迭代算子的函数式程序设计   总被引:2,自引:2,他引:0  
阎志欣 《软件学报》1996,7(A00):239-248
本文提出了程序设计语言的一种新的计算模型,带迭代处子的函数式模型,文中给出了基于该计算模型的程序设计语言的语法、计算规则集及确定怀证明,该类语言以表达式的复合描述顺序,以迭代表达式描述循环,以条件表达式描述分支,使得程序以数学语义为基础,易于理解,证明及构造高效的执行系统,相信该类语言是一咱有坚实理论基础、高效的、实际有用的高级确定性程序设计语言。  相似文献   

7.
一个自动编译系统ACS   总被引:1,自引:0,他引:1  
程虎  李爱武 《软件学报》1991,2(2):23-30
本文介绍一个自动编译系统ACS。对某上下文无关文法语言,写出其词法描述、语法描述、语义描述和目标机描述。ACS系统可以自动生成此语言在目标机上的编译程序。ACS系统由六个子模块组成:词法自动生成器、语法自动生成器、语义自动生成器、中间语言转换程序、优化程序和代码自动生成器。本文将分别讨论这六个子模块的原理和功能,还将给出用ACS系统生成的一个编译程序实例—Mini_Ada编译程序。  相似文献   

8.
<正> 一、引音本文根据作者参加复旦大学研制的FPE/l系统的实际工作,开发了一个在微型机IBMPC/XT上的能够非常高效地对程序设计语言中的关键字进行自动纠错的程序。FPE/1是目前正在复旦大学开发研制的面向PASCAL语言的程序设计环境,它把编辑、测试、监控执行和排错等多种软件工具组合成为一个整体。支持用户进行软件开发,以提高软件生产的效率与质量。其中的语法分析器是用户与系统在程序语言上的接口。由于用户在编辑、输入程序过程中常常产生各种词法错误,要求语法、词法分析器能按照一定的准则,自动地纠正这  相似文献   

9.
陈剑桥  陈启安 《福建电脑》2010,26(6):105-107
本文在厦门大学研发的基于WinCE系统内存数据库xMMDB的基础上,利用xMMDB提供的内存数据库API,设计并实现了SQL解析器,使该内存数据库系统能够支持SQL语言。本文阐述了使用yacc工具设计SQL操作的语法树及完成内存数据库系统语法分析的过程,提出了一种SQL解析器的实现方法,通过C语言编写的词法分析程序,向语法分析程序提供单词,并设计了一个结构体存储词法分析中的关键字属性,以便在调用内存数据库API的时候使用。  相似文献   

10.
禹丹  严宏志  王继娜 《计算机应用》2008,28(2):522-524,
采用了扩展的巴科斯范式(EBNF)定义NC程序语法规则,提出了一种基于语言识别工具(ANTLR)的NC代码编译器的设计模型。该模型采用Java语言开发,具有良好的平台无关性;分别从词法分析、语法和语义分析、信息提取等方面进行编译器的设计与实现。实际运行结果表明:该模型能够高效地构建编译器原型;可快速、准确地对NC代码进行编译;具有良好的可扩展性。  相似文献   

11.
LR分析法在词法分析器自动构造中的应用   总被引:7,自引:2,他引:7  
温敬和 《计算机工程》2001,27(7):188-190
提出了一种新的自动构造编译程序词法分析器的方法,LR分析法通常用于语法分析,但只要适当修改LR分析总控程序,就可将LR分析法用于词法分析器的自动构造。该方法的优点不仅在于将词法分析器自动构造方法与语法分析器自动构造方法统一,简化了编译程序的设计和构造,而且该方法自动化程序较高,只要确定描述单词的文法和词形编码表,便可自动生成任何程序设计语言编译程序的词法分析器。  相似文献   

12.
工业机器人通常采用特定的机器人语言进行示教编程与控制,对于操作人员需要具有较高专业与技能要求,并且示教周期长导致工作效率降低。为了提高工业机器人使用效率与易用性,提出一种基于受限自然语言解析器的设计方法。该系统通过对受限自然语言进行词法解析、语法解析、语义解析,得到所需求的工作意图,然后与实时生成的三维空间语义地图进行匹配,结合机械臂轨迹规划,生成能够完成工作任务的机器人作业程序,并完成了机器人作业程序的解析与实际机械臂的控制。通过实验证明设计的基于受限自然语言处理的分拣机器人解析器能够正确解析自然语言命令,实现对机械臂的控制。  相似文献   

13.
Two-level grammars can define the syntax and the operational semantics of programming languages and these definitions are directly executable by interpretation. In this paper it is shown that axiomatic semantics can also be defined using a two-level grammar with the result being a partially automatic program verification system accomplished within the framework of a language definition. These results imply that a programming language can be defined operationally and axiomatically together in complementary definitions as advocated by Hoare and Lauer. Because two-level grammars are executable, these complementary definitions accomplish a system for interpreting and verifying programs.  相似文献   

14.
15.
Wuu Yang 《Software》1991,21(7):739-755
Programmers frequently face the need to identify the differences between two programs, usually two different versions of a program. Text-based tools such as the UNIXr? utility diff often produce unsatisfactory comparisons because they cannot accurately pinpoint the differences and because they sometimes produce irrelevant differences. Since programs have a rigid syntactic structure as described by the grammar of the programming language in which they are written, we develop a comparison algorithm that exploits knowledge of the grammar. The algorithm, which is based on a dynamic programming scheme, can point out the differences between two programs more accurately than previous text comparison tools. Finally, the two programs are pretty-printed ‘synchronously’ with the differences highlighted so that the differences are easily identified.  相似文献   

16.
This paper presents a practical method of adding problem-specific notation to an established computer language. Our idea is to use unrestricted operator overloading as a tool to map the problem domain notation directly into an existing programming language. Our method introduces new operator symbols and function names into a host language by overloading existing usage. We extend the host programming language syntax to an augmented language which is mapped to the host language by a programmable preprocessor. The preprocessor uses a programmer-modifiable symbolic language grammar to translate an augmented program into a standard program. This process gives a natural extension to any computer language without modifying the host language. Direct use of problem notation can improve program legibility and code comprehension within the problem domain. The preprocessor provides a useful research tool for exploring language issues without the need to write a compiler for a new language. It can also be used to provide a domain specific language for a programming group at lower cost than new language development. This paper presents several working examples which illustrate our work. We redefine many of the standard C operators to alleviate some of the more common programming errors, thus creating a ‘cleaner’ C. As a more esoteric example, we encode a subset of APL vector operators as an algebraic extension to the C language. A curious application of our method shows its success in an arbitrary problem domain by compiling and executing poetry. Our final example introduces standard symbolic logic notation into C for tautology verification. © 1998 John Wiley & Sons, Ltd.  相似文献   

17.
一种层次化的LSD规则体系及其分析算法   总被引:1,自引:0,他引:1  
本文提出了一种基于词汇属性结构描述和规则继承的层次化LSD规则体系,讨论了该规则体系下的规则搜索策略和词汇化规则索引的实现方法,并在此基础上首次给出了LSD文法的非确定性分析算法。该规则系统具有从传统属性文法到现代词汇文法的可伸缩性,同时较好地解决了线性规则库中复杂的规则交互问题。  相似文献   

18.
The EXODUS database toolkit, and in particular the E persistent programming language, have been used in two substantial database system implementation efforts by the authors, the Ariel database rule system and the Triton nested relation DBMS. An important advantage of using a persistent programming language for database system implementation is that it is easy to implement special-purpose persistent objects used by the DBMS such as catalogs, rule indexes, and nested relational structures. Support for transactions built into a persistent programming language greatly reduces the effort required to implement a database system. A disadvantage observed is that it is not possible to map the type system of the DBMS to the type system of the underlying programming language while still retaining good performance for ad hoc queries. Also, software engineering difficulties arise when a persistent language makes a distinction between database types and main-memory types.  相似文献   

19.
DCTG-GP is a genetic programming system that uses definite clause translation grammars. A DCTG is a logical version of an attribute grammar that supports the definition of context-free languages, and it allows semantic information associated with a language to be easily accommodated by the grammar. This is useful in genetic programming for defining the interpreter of a target language, or incorporating both syntactic and semantic problem-specific constraints into the evolutionary search. The DCTG-GP system improves on other grammar-based GP systems by permitting nontrivial semantic aspects of the language to be defined with the grammar. It also automatically analyzes grammar rules in order to determine their minimal depth and termination characteristics, which are required when generating random program trees of varied shapes and sizes. An application using DCTG-GP is described. Brian James Ross, Ph.D.: He is an associate professor of computer science at Brock University, where he has worked since 1992. He obtained his BCSc at the University of Manitoba, Canada, in 1984, his MSc at the University of British Columbia, Canada, in 1988, and his PhD at the University of Edinburgh, Scotland, in 1992. His research interests include evolutionary computation, machine learning, language induction, concurrency, and logic programming.  相似文献   

20.
O’Caml语言是一门优秀的函数式程序语言,具有计算模型简单、语法语义描述清晰等特点,而通用编程技术方法通过高度抽象算法、数据结构及其他软件组件可以避免功能相似代码的重复编写。针对如何将通用编程技术方法和O’Caml语言相结合来提高O’Caml程序复用程度的问题,通过对O’Caml语言语法进行扩展引入类型标记1函数,然后运用类型结构化转换和类型映射机制,实现通用函数,从而达到在O’Caml语言中引入通用编程技术的目的。实例结果表明,在O’Caml语言中实现通用编程技术,有效提高了编程效率和程序的通用性。  相似文献   

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

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