RuleDSLBasics

org.parboiled2.RuleDSLBasics

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class RuleDSL
class Parser

Members list

Type members

Classlikes

sealed trait CharRangeSupport

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def ANY: Rule0

Matches any character except EOI.

Matches any character except EOI.

Attributes

def EOI: Char

Matches the EOI (end-of-input) character.

Matches the EOI (end-of-input) character.

Attributes

def MATCH: Rule0

Matches no character (i.e. doesn't cause the parser to make any progress) but succeeds always (as a rule).

Matches no character (i.e. doesn't cause the parser to make any progress) but succeeds always (as a rule).

Attributes

def MISMATCH[I <: HList, O <: HList]: Rule[I, O]

A generic Rule that always fails.

A generic Rule that always fails.

Attributes

A Rule0 that always fails.

A Rule0 that always fails.

Attributes

def anyOf(chars: String): Rule0

Matches any single one of the given characters.

Matches any single one of the given characters.

Note: This helper has O(n) runtime with n being the length of the given string. If your string consists only of 7-bit ASCII chars using a pre-allocated CharPredicate will be more efficient.

Attributes

def fail(expected: String): Rule0

A rule that always fails and causes the parser to immediately terminate the parsing run. The resulting parse error only has a single trace with a single frame which holds the given error message.

A rule that always fails and causes the parser to immediately terminate the parsing run. The resulting parse error only has a single trace with a single frame which holds the given error message.

Attributes

def failX[I <: HList, O <: HList](expected: String): Rule[I, O]

Fully generic variant of fail.

Fully generic variant of fail.

Attributes

def ignoreCase(c: Char): Rule0

Matches the given single character case insensitively. Note: the given character must be specified in lower-case! This requirement is currently NOT enforced!

Matches the given single character case insensitively. Note: the given character must be specified in lower-case! This requirement is currently NOT enforced!

Attributes

def ignoreCase(s: String): Rule0

Matches the given string of characters case insensitively. Note: the given string must be specified in all lower-case! This requirement is currently NOT enforced!

Matches the given string of characters case insensitively. Note: the given string must be specified in all lower-case! This requirement is currently NOT enforced!

Attributes

def noneOf(chars: String): Rule0

Matches any single character except the ones in the given string and except EOI.

Matches any single character except the ones in the given string and except EOI.

Note: This helper has O(n) runtime with n being the length of the given string. If your string consists only of 7-bit ASCII chars using a pre-allocated CharPredicate will be more efficient.

Attributes

def valueMap[T](m: Map[String, T], ignoreCase: Boolean)(implicit h: HListable[T]): RuleN[Out]

Matches any of the given maps keys and pushes the respective value upon a successful match.

Matches any of the given maps keys and pushes the respective value upon a successful match.

Value parameters

ignoreCase

a flag that tells if map keys case should be ignored

Attributes

Implicits

Implicits

implicit def ch(c: Char): Rule0

Matches the given single character.

Matches the given single character.

Attributes

implicit def predicate(p: CharPredicate): Rule0

Matches any (single) character matched by the given CharPredicate.

Matches any (single) character matched by the given CharPredicate.

Attributes

implicit def str(s: String): Rule0

Matches the given string of characters.

Matches the given string of characters.

Attributes

implicit def str2CharRangeSupport(s: String): CharRangeSupport
implicit def valueMap[T](m: Map[String, T])(implicit h: HListable[T]): RuleN[Out]

Matches any of the given maps keys and pushes the respective value upon a successful match.

Matches any of the given maps keys and pushes the respective value upon a successful match.

Attributes