论文部分内容阅读
本文提出了一个上下文无关文法的LR(k)分析机的分级构造算法及其文法的分划方法。并对K=1的情况进行了详细的讨论。该方法不仅适用于任何实际LR(K)文法并且较之[5]中方法更加有效。文中对算法的正确性进行了证明,同时指出由本文建立的强相容性标准是所有合并同心状态的相容性标准中最宽的一个。根据获得的结果。用本文中算法构造的LR(K)分析机中的状态个数与LALR(K)分析机中的状态个数相同或略多。
This paper presents a hierarchical construction algorithm of LR (k) analysis machine and its grammar division method based on context-free grammar. The case of K = 1 is discussed in detail. This method not only applies to any actual LR (K) grammar but also is more efficient than the method in [5]. In the paper, the correctness of the algorithm is proved. At the same time, it is pointed out that the criterion of strong compatibility established by this paper is the widest of the compatibility criteria of all concentric states. According to the results obtained. The number of states in the LR (K) analyzer constructed with the algorithm in this paper is the same as or slightly larger than the number of states in the LALR (K) analyzer.