pc4d.parsers

Members

Classes

Alternative
class Alternative(T)

class for matching alternatives

BlockComment
class BlockComment(T)

parser for blockcomments

ExprParser
class ExprParser

example of an expression parser. expr -> term { + term } term -> factor { * factor } factor -> number | ( expr )

Integer
class Integer

parser for parsing ints

Lazy
class Lazy(T)

this parser is needed to build recursive parser hierarchies. look for expression.d for a more realistic example than in the unittest

Match
class Match(T)

class for matching an array exactly

Optional
class Optional(T)

class for matching something optional

Regex
class Regex

parser for regular expressions a successful parse step returns all captures in an array

Repetition
class Repetition(T)

class for matching repetitions

Sequence
class Sequence(T)

class for matching sequences

Functions

alnum
auto alnum(bool collect = true)

convenient function to instantiate a AlphaNumericParser

blockComment
Parser!(T) blockComment(T[] startString, T[] endString, bool collect = true)

convenient function

integer
Parser!(T) integer()

convenience function to create an integer parser

killResults
Parser!(T) killResults(Parser!(T) parser)

convenient function to build a parser that kills the result of another parser e.g. killResults(match("a")) succeeds, but returns an empty result

lazyParser
Parser!(T) lazyParser(Parser!(T) delegate() parser)

convenient function to instantiate a lazy parser with a delegate

lazyParser
Parser!(T) lazyParser(Parser!(T) function() parser)

convenient function to instantiate a lazy parser with a function

match
Parser!(T) match(T[] s, bool collect = true)

convenient function to instantiate a matcher

number
Parser!(T) number()

convenient function to instantiate a number parser

or
Parser!(T) or(Parser!(T)[] parsers...)

convenient function

regex
Parser!(T) regex(T[] s, bool collect = true)

convenient function to instantiate a regexparser

sequence
Parser!(T) sequence(Parser!(T)[] parsers...)

convenient function

Meta

Authors

Christian Koestlin, Christian Köstlin