首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 31 毫秒
1.
This paper presents a syntax-directed editor dubbed SRE, for syntax recognizing editor. Unlike other syntax-directed editors, SRE enables the user to edit programs with nearly the same natural and unrestrictive ease as a conventional text editor. In addition, it helps identify syntax errors and many typing errors before leaving the editor and attempting to compile a program. Programs are also formatted during entry, thereby providing immediate visual feedback of the recognized structure. The editor replaces the scanner/parser pass of a conventional compiler and thus reduces compilation time substantially.  相似文献   

2.
3.
Compensating for systematic errors in 5-axis NC machining   总被引:5,自引:0,他引:5  
The errors introduced during 5-axis machining are higher than the intrinsic repeatability of the machine tool. It is possible to identify such systematic errors and compensate for them, thus achieving higher performance. A group of systematic errors can be compensated for directly in the inverse kinematics equations. Other systematic errors can be combined and compensated for through the total differentials of the inverse kinematics relations. A new general approach on how to compensate for the systematic errors based on the closed loop volumetric error relations is presented. The errors due to the 5-axis toolpath generation in current CAD/CAM and CNC are analyzed in detail. A new strategy for measurement and compensation is presented.  相似文献   

4.
A language-independent syntax-directed pretty printer has been implemented as the first step towards building a language-independent syntax-directed editor. The syntax-directed pretty printer works in two phases: the grammar processing phase and the program processing phase. In the grammar processing stage, a grammar which contains a context-free grammar and information for the parser and pretty printer is processed and all files needed by the second phase are written. With these files, the syntax-directed pretty printer works for the language of the grammar. The syntax-directed editor would use the same grammar processing phase to construct the files needed to make it work for a specific language. In the program processing phase, programs in the language of the grammar are parsed and parse trees are built. If syntax errors are found, error messages are produced and error recovery is done. The parse trees are pretty printed according to the pretty printer specifications given in the grammar, resulting in well-indented, syntactically clear programs.  相似文献   

5.
6.
Summary A formal model for automatic error-correction is presented. It considers clusters of errors, using a local context to determine the corrections. The process can be embedded in left-to-right recognizers. The recognizer is used for standard syntax checking. When an error is detected, an error correction mechanism is activated which, by a limited backward then forward move, determines the possible corrections. An important aspect of this process is that it does not slow down the parsing of correct programs.Work done mainly at Cornell University, Department of Computer Science, Ithaca NY 14850. Partially supported by the National Science Foundation under grant GJ-28176.  相似文献   

7.
A study of errors made by Pascal programmers is described. The results of this study are discussed in relation to compiler syntax error recovery procedures. It is found that syntax errors made in practice are quite simple and occur relatively infrequently (generally at most one per sentence of the language). Also a few types of errors account for most occurrences. These and other findings from the study are helpful in evaluating compiler error handling procedures. A discussion of the relation between these errors and language constructs is presented. Other uses of the information obtained from the study are briefly described.  相似文献   

8.
Parsing can be applied to compress source programs. A suitably encoded parse tree, together with the symbol table, constitutes a very compact representation of the program. The paper reports a Prolog implementation of the method, including automatic, syntax-directed, encoder and decoder generators. The test results show compression gains of 50–60 per cent.  相似文献   

9.
This article describes an algorithm for incremental parsing of expressions in the context of syntax-directed editors for programming languages. Since a syntax-directed editor represents programs as trees and statements and expressions as nodes in trees, making minor modifications in an expression can be difficult. Consider, for example, changing a “ + ” operator to a “1” operator or adding a short subexpression at a syntactically but not structurally correct position, such as inserting “) 1 (d“ at the # mark in” (a + b # + c)”. To make these changes in a typical syntax-directed editor, the user must understand the tree structure and type a number of tree-oriented construction and manipulation commands. This article describes an algorithm that allows the user to think in terms of the syntax of the expression as it is displayed on the screen (in infix notation) rather than in terms of its internal representation (which is effectively prefix), while maintaining the benefits of syntax-directed editing. This algorithm is significantly different from other incremental parsing algorithms in that it does not involve modifications to a traditional parsing algorithm or the overhead of maintaining a parser stack or any data structure other than the syntax tree. Instead, the algorithm applies tree transformations, in real-time as each token is inserted or deleted, to maintain a correct syntax tree.  相似文献   

10.
We present a method for recovering from syntax errors encountered during parsing. The method provides a form of minimum distance repair, has linear time complexity, and is completely automatic. A formal method is presented for evaluating the performance of error recovery methods, based on global minimum-distance error correction. The minimum-distance error recovery method achieves a theoretically best performance on 80% of Pascal programs in the weighted Ripley-Druseikis collection. Comparisons of performance with other error recovery methods are given.  相似文献   

11.
Jacques Cohen 《Software》1975,5(2):169-180
The author describes some of his experience gained by working in the area of syntax-directed compilers and parser generating systems during the past ten years. His most recent work in this area was designing and supervising the implementation of a conversational parser generator which has been operational for about two years. The paper describes this generator, its implementation, usage and the characteristics which make it practical to use. The author's main conclusion is that althouth it is relatively easy to implement nuclei of parser generating systems which are of educational value, the implementation of a practical system requires a major programming effort.  相似文献   

12.
13.
张志远 《计算机工程》2005,31(Z1):138-139
用状态转换图分析正规式时需要考虑的情况比较多,容易造成疏漏。且这种方法需要递归进行,多次扫描正规式,效率不高。该文采用SLR分析加属性文法只需一遍扫描就可以将正规式转存为NFA,效率要高得多。  相似文献   

14.
语法制导翻译在汇编程序自动构造中的应用   总被引:4,自引:0,他引:4  
温敬和 《计算机工程》2005,31(12):75-77
提出了语法制导翻译用于自动构造汇编程序的方法。该方法简洁实用,自动化程度高,可用于计算机系统汇编程序的自动构造。  相似文献   

15.
设计一个实用的程序控制流分析工具需要解决非结构程序中goto等语句的控制流图构造问题。C语言程序控制流图生成器CfgGen的设计采用基于基本块标识的控制流图构造方法解决该问题。CfgGen程序基于规则,通过语法制导翻译标识基本块、构造控制流图,易移植和维护。CfgGen构造的控制流图标识了基本块,可以很方便地用于程序分析和优化。  相似文献   

16.
Java语言语法制导编辑器JSDE的研究与设计   总被引:1,自引:0,他引:1  
语法制导方法、技术和系统的研究对软件工程研究产生了重要影响。本文详细讨论了面向Java语言的语法制导编辑器JSDE的理论基础、组成结构、基本功能和原型设计,本文结果为进一步研究Java语言增量开发环境提供了有价值的参考材料。  相似文献   

17.
We introduce a class of tree bimorphisms that define exactly the translations performed by syntax-directed translation schemata. We also show that these “quasi-alphabetic” tree bimorphisms preserve recognizability, and that their class is closed under composition and inverses.  相似文献   

18.
E. Kantorowitz  H. Laor 《Software》1986,16(7):627-640
Many current compilers produce in some situations wrong error messages that mislead the user and harm his confidence in the system. It is demonstrated that a reliable and efficient syntax error handling system may be produced automatically by a compiler generator from the BNF specification of the language, and without any effort by the language implementor. This result is achieved in three ways:
  • (a) Some errors may not be diagnosed without knowledge of the intentions of the programmer. Some compilers employ a sophisticated analysis that attempts to capture these intentions, but which is not always successful. Such an elaborate analysis is not employed here, and instead a list of all the legal corrections is displayed, so that the programmer may readily select the right one.
  • (b) The recovery symbols are selected by a ‘careful’ algorithm resulting in a high probability for correct error recovery.
  • (c) The ‘honest’ error messages show also the parts of the code which could not be analysed correctly because of errors, and where more errors may exist.
Efficiency is achieved by computing the recovery sets once and for all at compiler generation time, so that a fast error recovery at program compilation time is achieved. Experiments with erroneous programs suggest that the method compares well with the best compilers that we have seen, and is specially good at the avoidance of wrong error messages.  相似文献   

19.
中文文本自动校对中的语法错误检查   总被引:5,自引:1,他引:5  
文章将中文文本的语法错误分为搭配错误和与句型成分相关的错误两大类。分别采用模式匹配的方法和基于句型成分分析的进行检查,这两种方法的结合,可以同时考虑局部和全局的语法限制信息,并且降低了语法检查的复杂度。通过对实验结果的分析和评测,证明文章所述的方法是可行的。  相似文献   

20.
A user-friendly programming system should have a user-friendly syntax; natural and systematic, easy to understand and use. Syntax should allow substitution of semantically similar constructs by each other. Syntax should also be flexible and allow several variants of syntactic notations to reduce the burden of memorizing rigid syntactic notations and to make it possible for a user to think more about ‘what’ instead of ‘how’. Nowadays programming languages, e.g. Ada, do not obey these principles. Their complexity is mainly caused by their nonsystematic and rigid syntax. This together with unformal and ambiguous presentation of syntax makes Ada difficult to use and Ada parsers inefficient. Uniform, natural and flexible syntax, where several variants of syntactic notations and abbreviations are allowed and minor syntactic errors automatically corrected, can be introduced by systematic top-down design using multi-level grammars. Systematic design and presentation allows greatly improved syntax without increasing size of the syntax grammar and the complexity of the parser.  相似文献   

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

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