A PRACTICAL METHOD FOR CONSTRUCTING LR(K) PROCESSORS

被引:20
作者
KORENJAK, AJ
机构
[1] RCA Labs., Princeton, NJ
关键词
ALGOL; context-free language; deterministic language; language processor; LR(k) grammar; parser; syntactic analysis; syntax-directed compiler;
D O I
10.1145/363269.363281
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
A practical method for constructing LR(k) processors is developed. These processors are capable of recognizing and parsing an input during a single no-backup scan in a number of steps equal to the length of the input plus the number of steps in its derivation. The technique presented here is based on the original method described by Knuth, but decreases both the effort required to construct the processor and the size of the processor produced. This procedure involves partitioning the given grammar into a number of smaller parts. If an LR(k) processor can be constructed for each part (using Knuth's algorithm) and if certain conditions relating these individual processors are satisfied, then an LR(k) processor for the entire grammar can be constructed for them. Using this procedure, an LR(1) parser for ALGOL has been obtained. © 1969 ACM. All rights reserved.
引用
收藏
页码:613 / &
相关论文
共 7 条
[1]   TRANSLATOR WRITING SYSTEMS [J].
FELDMAN, J ;
GRIES, D .
COMMUNICATIONS OF THE ACM, 1968, 11 (02) :77-&
[2]   DETERMINISTIC CONTEXT FREE LANGUAGES [J].
GINSBURG, S ;
GREIBACH, S .
INFORMATION AND CONTROL, 1966, 9 (06) :620-&
[3]   ON TRANSLATION OF LANGUAGES FROM LEFT TO RIGHT [J].
KNUTH, DE .
INFORMATION AND CONTROL, 1965, 8 (06) :607-&
[4]  
KORENJAK AJ, 1967, THESIS PRINCETON U
[5]  
Naur P., 1963, COMMUN ACM, V6, P1, DOI DOI 10.1145/366193.366201
[6]  
SRINIVASAN CV, 1967, AF196284789 CONTR
[7]  
[No title captured]