首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 0 毫秒
1.
This paper addresses two of the problems commonly associated with LR parsing and syntax directed translation schemes, namely grammar stratification and excessively large table size, A solution is discussed which can eliminate stratification of the grammar by allowing the designer to embed semantics directly within the LR table (i.e., at shift and error entries instead of just at reduce entries) and to use global context to determine what semantics should be performed. The non-stratified grammar can produce a significantly smaller LR table than the corresponding stratified grammar. The compatibility of this scheme with commonly used table compaction techniques is also discussed.  相似文献   

2.
Error recovery techniques for LR parsers presented in the literature are described and classified. The techniques considered range from the non-correcting ones to interactive and incremental ones. Also, some of the techniques presented are compared and evaluated. An example showing the advantages and the disadvantages of each class of strategies is given and is used as a guideline for classifying syntax errors according to the recovery strategies which are more adequate to correct them.  相似文献   

3.
4.
In the literature various proofs of the inclusion of the class of LL(k) grammars into the class of LR(k) grammars can be found. Some of these proofs are not correct, others are informal, semi-formal or contain flaws. Some of them are correct but the proof is less straightforward than demonstrated here.  相似文献   

5.
It is shown that if the basic method for eliminating single productions from canonical LR parsers developed by Pager is applied to an SLR parser and the resulting parser is free of conflicts, then the resulting parser is a valid parser which accepts exactly the strings in the language. However, if the elimination process is performed during the construction of an SLR parser, then the resulting parser may be invalid even if it were free of conflicts.  相似文献   

6.
H. Mssenbck 《Software》1988,18(7):691-700
We present a simple method for connecting semantic actions to parsers. Although applicable to any kind of parser it is especially suited for LR parsers. The method is based on the idea of separating syntax analysis and semantic processing and executing semantic actions by procedures, similar to those of a recursive descent compiler. The procedures are driven by structural information about the source program, which is collected during parsing. The method is applicable to L-attributed grammars. It can be incorporated easily into any existing parser.  相似文献   

7.
This paper describes the implementation of a constraint-based parser, PARSEC (Parallel ARchitecture SEntence Constrainer), which has the required flexibility that a user may easily construct a custom grammar and test it. Once the user designs grammar parameters, constraints, and a lexicon, our system checks them for consistency and creates a parser for the grammar. The parser has an X-windows interface that allows a user to view the state of a parse of a sentence, test new constraints, and dump the constraint network to a file. The parser has an option to perform the computationally expensive constraint propagation steps on the MasPar MP-1. Stream and socket communication was used to interface the MasPar constraint parser with a standard X-windows interface on our Sun Sparcstation. The design of our heterogeneous parser has benefitted from the use of object-oriented techniques. Without these techniques, it would have been more difficult to combine the processing power of the MasPar with a Sun Sparcstation. Also, these techniques allowed the parser to gracefully evolve from a system that operated on single sentences, to one capable of processing word graphs containing multiple sentences, consistent with speech processing. This system should provide an important component of a real-time speech understanding system.  相似文献   

8.
OpenMP has been focused in performance applied to numerical applications, but when we try to move this focus to other kind of applications, like Web servers, we detect one important lack. In these applications, performance is important, but reliability is even more important, and OpenMP does not have any recovery mechanism. In this paper we present a novel proposal to address this lack. In order to add error handling to OpenMP we propose some extensions to the current OpenMP specification. A directive and a clause are proposed, defining a scope for the error handling (where the error can occur) and specifying a behaviour for handling the specific errors. Some examples of use are presented, and we present also an evaluation showing the impact of this proposal in OpenMP applications. We show that this impact is low enough to consider the proposal worthwhile for OpenMP.  相似文献   

9.
The lemma in “An improved LALR(k) parser generation for regular right part grammars” [Inform. Process. Lett. 47 (1993) 123-129] to test the applicability of the method is shown to be false by means of a counter-example grammar.  相似文献   

10.
肖洋  姜淑娟 《计算机工程》2007,33(4):193-195
语法分析中的错误恢复是现代编译器中智能感知功能的重要组成部分,错误恢复的效果直接影响到智能感知功能的性能。在分析LR语法分析中LR分析表特性的基础上,提出了一种对LR分析表中的Goto表项进行改造来进行语法错误的诊断和恢复的方法。该方法充分利用了LR分析表中的空闲表项,在不增加空间需求的情况下,提高了语法错误的诊断和恢复的效率和准确率。  相似文献   

11.
随着C++语言标准的不断演进,词法语法解析工具如JavaCC等对于很多扩充的新特性以及复杂的语法结构不能做到完全支持,这可能会导致抽象语法树生成错误且不完整;针对这一问题,提出一个针对抽象语法树生成错误的处理框架;首先,通过对JavaCC的扩充,实现一套可以解析C++语言的词法语法分析器,生成抽象语法树并记录报错行;其次,根据报错行寻找所在函数区间即不支持或不匹配的语法片段;最后,通过注释函数区间的方式来跳过不支持或不匹配的语法片段进行错误处理并迭代生成抽象语法树;实验结果表明,对抽象语法树生成进行错误处理后可以更全面的分析代码,抽象语法树完成率上升37.8%,分析行数提高3.9倍。  相似文献   

12.
13.
Java uses exceptions to provide elegant error handling capabilities during program execution. However, the presence of exception handlers complicates the job of the just‐in‐time (JIT) compiler, while exceptions are rarely used in most programs. This paper describes two techniques for reducing such complications. First, we delay the translation of an exception handler until the exception really occurs. This on‐demand translation of exception handlers allows more optimizations when translating the main flow, without being hindered by constraints caused by the exception flows. Secondly, for those exceptions that are actually thrown during program execution we insert exception‐type check code and a direct branch to the translated exception handlers. This exception handler prediction is motivated by an observation that frequently thrown exceptions are likely to be handled by the same exception handlers, so this will eliminate the exception processing overhead of the Java virtual machine. Our experiments indicate that the code quality of the main flow is no longer affected by the presence of exception handlers. Also, frequently thrown exceptions can be efficiently handled by the exception handler prediction. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

14.
李宁宁  赵铁石 《机器人》2008,30(3):1-230
设计了一种应用于扫描电镜的四自由度并联定位平台.该平台结构简单,便于集成微操作装置和实现微结构物性在线检测.为使所设计的定位平台具有高的定位精度,建立了平台的误差矢量模型.通过模拟仿真手段分析了结构误差和上平台分支分布对平台末端定位精度的影响,分析了在大载荷作用下机构在非自由度方向产生的角位移输出.  相似文献   

15.
In this paper, we report on the role of the Urdu grammar in the Parallel Grammar (ParGram) project (Butt, M., King, T. H., Niño, M.-E., &; Segond, F. (1999). A grammar writer’s cookbook. CSLI Publications; Butt, M., Dyvik, H., King, T. H., Masuichi, H., &; Rohrer, C. (2002). ‘The parallel grammar project’. In: Proceedings of COLING 2002, Workshop on grammar engineering and evaluation, pp. 1–7). The Urdu grammar was able to take advantage of standards in analyses set by the original grammars in order to speed development. However, novel constructions, such as correlatives and extensive complex predicates, resulted in expansions of the analysis feature space as well as extensions to the underlying parsing platform. These improvements are now available to all the project grammars.  相似文献   

16.
一种四自由度并联机构的误差分析及其标定补偿   总被引:6,自引:2,他引:4  
针对一种四自由度并联机构进行了运动学分析,在此基础上以摄动法建立了其误差模型,明确了各误差源对末端位姿的影响.在对并联机构的标定技术进行简单介绍后,说明了对该机构误差模型中的机构参数进行标定的两种方法,介绍了标定装置、标定算法及标定过程.最后采用Matlab对基于逆解的标定方法进行了仿真,并对仿真结果进行了分析.  相似文献   

17.
Two types of kinematic calibration method for a 2-DOF (degrees of freedom) translational parallel manipulator are proposed using different error models. A calibration experiment is performed on both methods using an Absolute Laser Tracker and the results are compared. Two error models of the 2-DOF translational parallel manipulator are established using differential method and linear perturbation method, respectively. The two error models are solved using both the least squares method and linear equations. The results for the two different calibration methods show that the error model based on differential method is more effective in improving the accuracy of the 2-DOF translational parallel manipulator. Overall, the absolute position error of the 2-DOF translational parallel manipulator is significantly reduced to 0.13?mm from 0.93?mm after kinematic calibration.  相似文献   

18.
Binary images can be compressed efficiently using context‐based statistical modeling and arithmetic coding. However, this approach is fully sequential and therefore additional computing power from parallel computers cannot be utilized. We attack this problem and show how to implement the context‐based compression in parallel. Our approach is to segment the image into non‐overlapping blocks, which are compressed independently by the processors. We give two alternative solutions about how to construct, distribute and utilize the model in parallel, and study the effect on the compression performance and execution time. We show by experiments that the proposed approach achieves speedup that is proportional to the number of processors. The work efficiency exceeds 50% with any reasonable number of processors. Copyright © 2002 John Wiley & Sons, Ltd.  相似文献   

19.
Approximately 2700 manual handling injuries recorded among disability services workers in an Australian state government agency between 1997 and 2000 were analysed to identify high-risk groups and leading causes to be targeted for prevention. Client support, including assisting clients into and out of bed and holding clients during epileptic seizures, had the highest cause-specific injury rate per 100 full-time equivalents (12.2, 95% confidence interval (CI) 6.2-20.2). Women had significantly higher rates than men, an average of 29.8 (95% CI 19.9-41.7) compared with 16.6 (95% CI 9.5-25.7). Gender (being female) and low job classification significantly increased the odds of an injury resulting in time off work. Only gender significantly predicted the likelihood of high compensation payments. Together with the surveillance data, responses to the questionnaire survey of 120 workers indicate a need for effective ergonomics intervention.  相似文献   

20.
《Ergonomics》2012,55(12):2059-2081
This paper explores the use of subjective perception tasks and its correlations with biomechanical data in the evaluation of manual material handling. Three main dimensions were considered for perception: physical regroups sensations issued from a specific body area; operative regroups feelings related to the execution of the task; and performance regroups feelings that involve a judgement on the execution or reflect overall sensations. The following questions were then explored. To what extent are perception data related to biomechanics data? Do both approaches lead to similar conclusions or interpretations when effect of practice, format and off-centre were tested? How can they complement one another? The task consisted of transferring 50 series of three 15 kg loads in order to verify the impact of free practice, format (box/cylinder) and load centre of gravity position. Eleven subjects rated perception on a CR-10 scale (Borg 1982 Borg, G. A.V. 1982. Psychophysical bases of perceived exertion. Medicine and Science in Sports and Exercise, 14: 377381. [Crossref], [PubMed], [Web of Science ®] [Google Scholar]) after each series. The session was completed with an interview on perception. The net resulting moment was systematically found to be the best correlated with data perception. While all physical and performance items corresponded in various ways to biomechanics data, perceptions associated with operative dimension appeared to be less related with biomechanical data. As regards the impact of practice, format and off-centre, both approaches would lead to the same conclusions, except for the effect of the off-centre. Verbal data add rational information about how or why perception can or cannot be reflected in biomechanics data. How both approaches can be matched more closely in manual handling is discussed.  相似文献   

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

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

京公网安备 11010802026262号