LLLR: a Combination of LL and LR
A new parsing method called
LLLRparsing is defined and a method for producingLLLRparsers is described. AnLLLRparser uses anLLparser as its backbone and parses as much of its input string usingLLparsing as possible. To resolveLLconflicts it triggers small embeddedLRparsers. An embeddedLRparser starts parsing the remaining input and once theLLconflict is resolved, theLRparser produces the left parse of the substring it has just parsed and passes the control back to the backboneLLparser. 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 anLLLRparser can perform a significantly better error recovery than anLRparser since the most part of the input string is parsed with the backboneLLparser.LLLRparsing 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: