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

parseAll
ParseResult!(T) parseAll(T[] s)
Undocumented in source. Be warned that the author may not have intended to support it.
setCallback
Parser setCallback(Variant[] function(Variant[] objects) tocall)
Undocumented in source. Be warned that the author may not have intended to support it.
setCallback
Parser setCallback(Variant[] delegate(Variant[] objects) tocall)
Undocumented in source. Be warned that the author may not have intended to support it.
transform
ParseResult!(T) transform(ParseResult!(T) result)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

success
success(T[] rest, U args)

helper to create a successfull result

Variables

fCallable
Variant[] delegate(Variant[]) fCallable;
Undocumented in source.

Meta