Parser Combinators for Ambiguous Left-Recursive Grammars

@inproceedings{Frost2008ParserCF,
  title={Parser Combinators for Ambiguous Left-Recursive Grammars},
  author={Richard A. Frost and Rahmatullah Hafiz and Paul Callaghan},
  booktitle={PADL},
  year={2008}
}
Parser combinators are higher-order functions used to build parsers as executable specifications of grammars. Some existing implementations are only able to handle limited ambiguity, some have exponential time and/or space complexity for ambiguous input, most cannot accommodate left-recursive grammars. This paper describes combinators, implemented in Haskell, which overcome all of these limitations. 
Executable Specifications of Fully General Attribute Grammars with Ambiguity and Left-Recursion
  • R. Hafiz
  • Computer Science
    Canadian Conference on AI
  • 2009
TLDR
A top-down parsing algorithm has been constructed to accommodate any form of ambiguous context-free grammar, augmented with semantic rules with arbitrary attribute dependencies, which allows Natural Language processors to be constructed as executable, modular and declarative specifications of Attribute Grammars.
Simple, Efficient, Sound and Complete Combinator Parsing for All Context-Free Grammars, Using an Oracle
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.
Lazy Combinators for Executable Specifications of General Attribute Grammars
A lazy-evaluation based top-down parsing algorithm has been implemented as a set of higher-order functions (combinators) which support directly-executable specifications of fully general attribute
Total parser combinators
A monadic parser combinator library which guarantees termination of parsing, while still allowing many forms of left recursion, is described. The library's interface is similar to those of many other
Simple, Functional, Sound and Complete Parsing for All Context-Free Grammars
TLDR
This work shows how to construct simple, sound and complete parser implementations directly from grammar specifications, for all context-free grammars, based on combinator parsing, and constructs a generic parser generator that is faster than the popular Happy parser generator.
Practical, general parser combinators
TLDR
This paper presents general parser combinators that support all context-free grammars and construct a parse forest in cubic time and space in the worst case, while behaving nearly linearly on Grammars of real programming languages.
Modular Natural Language Processing Using Declarative Attribute Grammars
TLDR
A system based on a general top-down parsing algorithm has been developed which allows language processors to be created as executable specifications of arbitrary attribute grammars and an innovative technique allows parses to be pruned by arbitrary semantic constraints.
A new view on parser combinators
TLDR
The idea is to replace the ordinary combinators by a set of type constructor classes that makes the DSL type-safe and extendable without needing to change existing parts and implementations, and to make multiple interpretations, views, of the specified grammar.
GLL parsing with flexible combinators
TLDR
This paper presents a combinator library with a similar architecture to P3, adjusting it to avoid grammar binarisation, which has a significant positive effect on the running times of the underlying parsing procedure, which is demonstrated using real-world grammars.
The Semantics of Parsing with Semantic Actions
  • R. Atkey
  • Computer Science
    2012 27th Annual IEEE Symposium on Logic in Computer Science
  • 2012
TLDR
This paper develops a hybrid approach to grammars as collections of active right-hand sides, indexed by a set of non-terminals, using Reynolds-style parametricity to ensure that the language that Grammars describe cannot be affected by the representation of parse results.
...
...

References

SHOWING 1-10 OF 33 REFERENCES
Modular and Efficient Top-Down Parsing for Ambiguous Left-Recursive Grammars
TLDR
This paper combines aspects of previous approaches and presents a method by which parsers can be built as modular and efficient executable specifications of ambiguous grammars containing unconstrained left recursion.
Parsec: direct style monadic parser combinators for the real world
TLDR
The Parsec parser combinator library described in this paper, utilizes a novel implementation technique for space and time e±cient parser combinators that in case of a parse error, report both the position of the error as well as all grammar productions that would have been legal at that point in the input.
A New Top-Down Parsing Algorithm for Left-Recursive DCGs
TLDR
Deterministic cancellation parsing with lookahead k can handle the C( k) grammars, which include the LL(k) Grammars and are contained in the LC(k).
Monadic parser combinators
TLDR
The purpose of this report is to provide a step-by-step tutorial on the monadic approach to building functional parsers, and to explain some of the benefits that result from exploiting monads.
A new top-down parsing algorithm to accommodate ambiguity and left recursion in polynomial time
TLDR
This work has shown that memoization and techniques for handling left recursion have either been presented independently, or else attempts at their integration have compromised modularity and clarity of the code.
Monadic Parsing in Haskell
TLDR
The paper shows how to define monadic parsers using do notation in Haskell, targeted at the level of a good undergraduate student who is familiar with Haskell, and has completed a grammars and parsing course.
Packrat parsing:: simple, powerful, lazy, linear time, functional pearl
  • B. Ford
  • Computer Science
    ICFP '02
  • 2002
TLDR
This paper describes packrat parsing informally with emphasis on its use in practical applications, and explores its advantages and disadvantages with respect to the more conventional alternatives.
Efficiency in Large-scale Parsing Systems - Parser Comparison. Evaluation Methodology and Data
TLDR
Investigation of efficient approaches to parsing is an important topic of research in response to the complexities of language-based application tasks such as speech-to-speech translation.
Packrat Parsing: Simple, Powerful, Lazy, Linear Time
  • B. Ford
  • Computer Science
    ICFP 2002
  • 2002
TLDR
This paper describes packrat parsing informally with emphasis on its use in practical applications, and explores its advantages and disadvantages with respect to the more conventional alternatives.
An efficient context-free parsing algorithm
TLDR
A parsing algorithm which seems to be the most efficient general context-free algorithm known is described and appears to be superior to the top-down and bottom-up algorithms studied by Griffiths and Petrick.
...
...