pod peg

PEG parser

Mixins

Block

Block is a part of input which is parsed by some rule.

BlockNode

A node in tree of blocks.

Grammar

Grammar is a set of expression associated with non-terminal symbols and the starting expression.

Handler

Handler represents a stack of visits of blocks with abilities to roll back to the previously pushed state.

Classes

Any

Any char (.).

Choice

Choice expression.

Class

Class expression.

ClassFailed

Failed match: unexpected character in input while we expected a character from the given class.

E

Expression factory.

Empty

Empty expression.

EofMatch

Failed match: unexpected end of input.

Expression

General parsing expression.

GrammarBuilder

Builds Grammar instance from the given blocks list.

GrammarImpl

General implementation of Grammar.

InfiniteLoop

fatal match: grammar has an infinite loop, and parser reached it.

LackMatch

Lack match (meaningful for stream parsing).

ListHandler

Handler, which stores blocks in a list.

Match

Describes parser state with some additional information.

MetaGrammar

PEG meta-grammar.

MultiGrammar

MultiGrammar combines multiple GrammarImpl instances

NoChoice

Failed match: we checked all alternatives of Choice expression, and each one is failed.

Not

Not-predicate expression.

NotFound

Fatal match: non-terminal symbol definition is not found in grammar.

Nt

Non-terminal expression.

NullHandler

Handler which does nothing.

Parser

Main class, allows to parse inputs using given grammars.

ParserState
PredicateFailed

Failed match: we checked the expression under NOT predicate and it matched (therefore, the predicate failed).

Rep

Repetition (e*) expression.

Seq

Sequence expression.

StackRecord
T

Terminal expression.

UnexpectedStr

Failed match: unexpected input.

Enums

MatchState

Parser state