16
Views
1
CrossRef citations to date
0
Altmetric
Original Articles

Suffix languages in Lr parsing

&
Pages 135-153 | Received 04 Jul 1994, Published online: 20 Mar 2007
 

Abstract

For each state in the LR(0) automaton of a context-free grammar, there exists a language consisting of the valid strings that might be parsed from that state. Existing techniques for adding lookahead to an LR(0) automaton do not explicitly consider these “suffix” languages. Instead, existing techniques examine prefixes of suffix languages or some other simplification or approximation of them. We define suffix languages and describe an algorithm for computing them. We then show that suffix languages can provide lookahead for inconsistent states of an LR(0) automaton, providing single-symbol lookahead, k-symbol lookahead, and regular lookahead, each only where needed. We submit that suffix languages provide a sound theoretical basis for the study of LR parsing.

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.