An error parse result.
A failure parse result.
The input consumed by a parser.
Parser combinators that use lists to represent repetitive constructs.
Repetitive parser combinators that use lists to represent repetitive constructs,
All parse results that are not successful.
Parse results.
Parser combinators that use vectors to represent repetitive constructs.
Simple packrat parsing combinator suite.
Simple packrat parsing combinator suite. These combinators are
largely source compatible with the Scala parser combinator library
but the implementation is simpler and less general. Broadly speaking
this library provides behaviour similar to the Scala library
RegexParsers
trait with sensible defaults and better integration
with the rest of Kiama.
The parameter positions
provides the position store that this
suite should use to track AST node positions. Usually the value
passed in is shared with the rest of a program that reports
errors etc.
This library should not be used if efficiency is a concern. These combinators are essentially interpreting the grammar so the performance can't compare to a parser generator which compiles the grammar. Nevertheless, the library is perfectly fine for prototyping and for processing small to medium-sized inputs.
Some of the implementation details in this module are based on the implementation of the Scala parser combinator library but in a much simpler form.
The algorithms used here to handle left recursion are from "Packrat parsers can support left recursion" by Warth, Douglass and Millstein, ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation, 2008.
A successful parse result.
Repetitive parser combinators that use vectors to represent repetitive constructs.
Support for NoSuccess.
An error parse result. Parsers that error do not backtrack.