Rule

object Rule : Operators

Functions

and
Link copied to clipboard
fun and(pe: EvalPE<*>): EvalPE<Unit>
"And" predicate on the pe parsing expression.
char
Link copied to clipboard
fun char(c: Char): EvalPE<Char>
Parsing expression that represents the character c.
fun char(b: CharacterBuilderBlock): EvalPE<Char>
Parsing expression that represents any character that satisfies the b lambda.
fun char(r: CharRange): EvalPE<Char>
Parsing expression that represents any character in the char range r.
fun char(firstC: Char, secondC: Char, vararg otherCs: Char): EvalPE<Char>
Parsing expression that represents any character from the firstC, secondC, or otherCs characters.
choice
Link copied to clipboard
fun <T> choice(firstPe: EvalPE<T>, secondPe: EvalPE<T>, vararg otherPes: EvalPE<T>): EvalPE<T>
Prioritized choice of parsing expressions.
joinToString
Link copied to clipboard
fun <T> EvalPE<List<T>>.joinToString(separator: CharSequence = "", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: (T) -> CharSequence? = null): EvalPE<String>
This function works just like the joinToString from the standard library, but for the parsing expressions.
list
Link copied to clipboard
fun <T> EvalPE<T>.list(separator: EvalPE<*>? = null, prefix: EvalPE<*>? = null, postfix: EvalPE<*>? = null, min: UInt = 0u, max: UInt = UInt.MAX_VALUE): EvalPE<List<T>>
Parsing expression that represents a list of elements with the optionally defined separator, prefix, and postfix.
literal
Link copied to clipboard
fun literal(l: String): EvalPE<String>
Parsing expression that represents the literal l.
fun literal(len: Int, b: LiteralBuilderBlock): EvalPE<String>
Parsing expression that represents any literal of length len that satisfies the b lambda.
mapPe
Link copied to clipboard
fun <T, R> EvalPE<T>.mapPe(transform: MapBuilderBlock<T, R>): EvalPE<R>
Map parsing expression using the transform lambda.
not
Link copied to clipboard
fun not(pe: EvalPE<*>): EvalPE<Unit>
"Not" predicate on the pe parsing expression.
oneOrMore
Link copied to clipboard
fun <T> EvalPE<T>.oneOrMore(): EvalPE<List<T>>
Repeat parsing expression 1 or more times.
optional
Link copied to clipboard
fun <T> EvalPE<T>.optional(): EvalPE<Option<T>>
Optional parsing expression that yields Some value of the type T on successful parsing, or None otherwise.
orDefault
Link copied to clipboard
fun <T> EvalPE<T>.orDefault(value: T): EvalPE<T>
repeated
Link copied to clipboard
fun <T> EvalPE<T>.repeated(range: UIntRange): EvalPE<List<T>>
Repeat parsing expression an arbitrary number of times in the specified range.
fun <T> EvalPE<T>.repeated(min: UInt = 0u, max: UInt = UInt.MAX_VALUE): EvalPE<List<T>>
Repeat parsing expression from the min to the max numbers of times.
repeatedExactly
Link copied to clipboard
fun <T> EvalPE<T>.repeatedExactly(times: UInt): EvalPE<List<T>>
Repeat parsing expression exactly the given times.
rule
Link copied to clipboard
fun <T> rule(name: String, ignoreWS: Boolean = true, b: RuleBlock<T>): EvalSymbol<T>
seq
Link copied to clipboard
fun <T> seq(b: SequenceBuilderBlock<T>): EvalPE<T>
Sequence of parsing expressions, defined inside the b block.
zeroOrMore
Link copied to clipboard
fun <T> EvalPE<T>.zeroOrMore(): EvalPE<List<T>>
Repeat parsing expression 0 or more times.

Properties

ANY
Link copied to clipboard
val ANY: EvalPE<Char>
Parsing expression that represents any possible character.
DIGIT
Link copied to clipboard
val DIGIT: EvalPE<Char>
Parsing expression that represents any decimal digit, that is, any character in '0'..'9'.
HEX_DIGIT
Link copied to clipboard
val HEX_DIGIT: EvalPE<Char>
Parsing expression that represents any hexadecimal digit, that is, any character in '0'..'9', 'a'..'f', or 'A'..'F'.
LETTER
Link copied to clipboard
val LETTER: EvalPE<Char>
Parsing expression that represents any letter, that is, any character for which it.isLetter() equals true.

Sources

JVM source
Link copied to clipboard