An Improved LALR(k) Parser Generation for Regular Right Part Grammars
暂无分享,去创建一个
A regular right part grammar (RRPG) is a context-free grammar, in which right parts of productions are finite automata to extend the descriptive power of context-free grammar by including notations for describing repetitions and alternations [6,8]. On LR parsing of RRPGs, extra work is required to identify the left end of a handle at reduction time because a nonterminal can derive potentially infinite number of strings via a single production. For parsing RRPGs, some methods such as grammar transformation from RRPGs to LR(k) context-flee grammars [5,8], augmenting LR(0) automaton with readback machines to recognize the reverse of state sequences leading to a reduction [2,6,7], and stacking an LR state only when the symbol being processed indicates the beginning of a new right part [11], are suggested. In stacking method, the parser is efficient because exactly one state entry is popped from the stack when the right end of a production is found. However, if stacking conflicts occur, the transfor-
[1] Alfred V. Aho,et al. The Theory of Parsing, Translation, and Compiling , 1972 .
[2] Frank DeRemer,et al. Efficient computation of LALR(1) look-ahead sets , 2004, SIGP.
[3] Franklin L. DeRemer,et al. Simple LR(k) grammars , 1971, Commun. ACM.
[4] Wilf R. LaLonde,et al. Regular right part grammars and their parsers , 1977, CACM.
[5] C. H. Chang,et al. A new analysis of LALR formalisms , 1985, TOPL.