Sciweavers

CPP
2011

Simple, Functional, Sound and Complete Parsing for All Context-Free Grammars

12 years 11 months ago
Simple, Functional, Sound and Complete Parsing for All Context-Free Grammars
Parsing text to identify grammatical structure is a common task, especially in relation to programming languages and associated tools such as compilers. Parsers for context-free grammars can be implemented directly and naturally in a functional style known as “combinator parsing”, using recursion following the structure of the grammar rules. However, naive implementations fail to terminate on left-recursive grammars, and despite extensive research, the only complete parsers for general context-free grammars are constructed using other techniques such as Earley parsing. Our main contribution is to show how to construct simple, sound and complete parser implementations directly from grammar specifications for all context-free grammars based on combinator parsing. We first develop a solution to handle a restricted class of grammars with left recursion based on the idea of commitments. We formalize the concepts involved in order to treat the general case, and use K¨onig’s infini...
Tom Ridge
Added 18 Dec 2011
Updated 18 Dec 2011
Type Journal
Year 2011
Where CPP
Authors Tom Ridge
Comments (0)