Parser

interface for all parser combinators parse must be implemented.

Members

Functions

opBinary
Parser opBinary(Variant[] function(Variant[] objects) toCall)

dsl for transforming results of a parser

opBinary
Parser opBinary(Parser rhs)

dsl for alternatives e.g. match("abc") | match("def") matches "abc" or "def"

opBinary
Parser opBinary(Parser rhs)

dsl for sequences e.g. match("a") ~ match("b") matches "ab"

opUnary
Parser opUnary()

dsl for repetition of a parser e.g. (*match("a")) matches sequences of a

opUnary
Parser opUnary()

dsl for optional parser e.g. (-match("abc")) matches "abc" and "efg"

parse
ParseResult!(T) parse(T[] input)

this must be implemented by subclasses

Static functions

success
success(T[] rest, U args)

helper to create a successfull result

Meta