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-