LR分析技术以其自身的优点在实践中有着非常广泛的应用,但是,用自底向上的策略实现属性计算对属性文法本身有着非常严格的限制,不得不将语法分析与属性计算分别进行,引入了极大的复杂性。利用属性栈及回填技术能够从根本上解决这一问题。主要讨论了基于回填技术的LR属性计算器的算法原理及实现技术。
With its excellent characteristics, LR analysis technique has gained extensive use in pratical. But the applicable attributed grammars to the bottom - up attribute evaluator are strictly narrowed down for the sake of its bottom - up policy. Usually,we had to separate attributes evaluation from syntax analysis, but it introduced much of complexity in. Taking advantage of attribute stack and backfilling technique, we can solve this problem radically. In this paper, the principles and implementing techniques of the algorithm for attributed grammar evaluator based on LR analysis and backfilling technique is presented.