LLLR: a Combination of LL and LR
A new parsing method called
LLLR
parsing is defined and a method for producingLLLR
parsers is described. AnLLLR
parser uses anLL
parser as its backbone and parses as much of its input string usingLL
parsing as possible. To resolveLL
conflicts it triggers small embeddedLR
parsers. An embeddedLR
parser starts parsing the remaining input and once theLL
conflict is resolved, theLR
parser produces the left parse of the substring it has just parsed and passes the control back to the backboneLL
parser. TheLLLR(k)
parser can be constructed for anyLR(k)
grammar. It produces the left parse of the input string without any backtracking and, if used for a syntax-directed translation, it evaluates semantic actions using the top-down strategy just like the canonicalLL(k)
parser. AnLLLR(k)
parser is appropriate for grammars where theLL(k)
conflicting nonterminals either appear relatively close to the bottom of the derivation trees or produce short substrings. In such cases anLLLR
parser can perform a significantly better error recovery than anLR
parser since the most part of the input string is parsed with the backboneLL
parser.LLLR
parsing is similar toLL(∗)
parsing except that it (a) usesLR(k)
parsers instead of finite automata to resolve theLL(k)
conflicts and (b) does not perform any backtracking.— LLLR Parsing: a Combination of LL and LR Parsing, Boštjan Slivnik, 2016 ↗
Related: