sealed class Rule[-I <: HList, +O <: HList] extends RuleX

The general model of a parser rule. It is characterized by consuming a certain number of elements from the value stack (whose types are captured by the HList type parameter I for "Input") and itself pushing a certain number of elements onto the value stack (whose types are captured by the HList type parameter O for "Output").

At runtime there are only two instances of this class which signal whether the rule has matched (or mismatched) at the current point in the input.

Source
Rule.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rule
  2. RuleX
  3. AnyRef
  4. Any
Implicitly
  1. by Runnable
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Rule()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def *(separator: Rule0)(implicit l: Lifter[Seq, I, O]): Rule[In, OptionalOut]

    Postfix shortcut for zeroOrMore(...).separatedBy(...).

    Postfix shortcut for zeroOrMore(...).separatedBy(...).

    Annotations
    @compileTimeOnly( ... )
  4. def *(implicit l: Lifter[Seq, I, O]): Rule[In, OptionalOut] with Repeated

    Postfix shortcut for zeroOrMore.

    Postfix shortcut for zeroOrMore.

    Annotations
    @compileTimeOnly( ... )
  5. def +(separator: Rule0)(implicit l: Lifter[Seq, I, O]): Rule[In, StrictOut]

    Postfix shortcut for oneOrMore(...).separatedBy(...).

    Postfix shortcut for oneOrMore(...).separatedBy(...).

    Annotations
    @compileTimeOnly( ... )
  6. def +(implicit l: Lifter[Seq, I, O]): Rule[In, StrictOut] with Repeated

    Postfix shortcut for oneOrMore.

    Postfix shortcut for oneOrMore.

    Annotations
    @compileTimeOnly( ... )
  7. def ->[B](y: B): (Rule[I, O], B)
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to ArrowAssoc[Rule[I, O]] performed by method ArrowAssoc in scala.Predef. This conversion will take place only if I is a superclass of HNil (I >: HNil).
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  8. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def ?(implicit l: Lifter[Option, I, O]): Rule[In, OptionalOut]

    Postfix shortcut for optional.

    Postfix shortcut for optional.

    Annotations
    @compileTimeOnly( ... )
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  12. def ensuring(cond: (Rule[I, O]) ⇒ Boolean, msg: ⇒ Any): Rule[I, O]
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to Ensuring[Rule[I, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (Rule[I, O]) ⇒ Boolean): Rule[I, O]
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to Ensuring[Rule[I, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): Rule[I, O]
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to Ensuring[Rule[I, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): Rule[I, O]
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to Ensuring[Rule[I, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to StringFormat[Rule[I, O]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def named(name: String): Rule.this.type

    Attaches the given explicit name to this rule.

    Attaches the given explicit name to this rule.

    Annotations
    @compileTimeOnly( ... )
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. macro def run()(implicit scheme: DeliveryScheme[O]): Result
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to Runnable[O] performed by method Runnable in akka.parboiled2.Rule. This conversion will take place only if I is a superclass of HNil (I >: HNil) and at the same time O is a subclass of HList (O <: HList).
    Definition Classes
    Runnable
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def unary_!(): Rule0

    Creates a "negative syntactic predicate", i.e.

    Creates a "negative syntactic predicate", i.e. a rule that matches only if this rule mismatches and vice versa. The resulting rule doesn't cause the parser to make any progress (i.e. match any input) and also clears out all effects that the underlying rule might have had on the value stack.

    Annotations
    @compileTimeOnly( ... )
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  34. def |[I2 <: I, O2 >: O <: HList](that: Rule[I2, O2]): Rule[I2, O2]

    Combines this rule with the given other one in a way that the resulting rule matches if this rule matches or the other one matches.

    Combines this rule with the given other one in a way that the resulting rule matches if this rule matches or the other one matches. If this rule doesn't match the parser is reset and the given alternative tried. This operators therefore implements the "ordered choice' PEG combinator.

    Annotations
    @compileTimeOnly( ... )
  35. def ~[I2 <: HList, O2 <: HList](that: Rule[I2, O2])(implicit i: TailSwitch[I2, O, I], o: TailSwitch[O, I2, O2]): Rule[Out, Out]

    Concatenates this rule with the given other one.

    Concatenates this rule with the given other one. The resulting rule type is computed on a type-level. Here is an illustration (using an abbreviated HList notation): Rule[, A] ~ Rule[, B] = Rule[, A:B] Rule[A:B:C, D:E:F] ~ Rule[F, G:H] = Rule[A:B:C, D:E:G:H] Rule[A, B:C] ~ Rule[D:B:C, E:F] = Rule[D:A, E:F]

    Annotations
    @compileTimeOnly( ... )
  36. def ~!~[I2 <: HList, O2 <: HList](that: Rule[I2, O2])(implicit i: TailSwitch[I2, O, I], o: TailSwitch[O, I2, O2]): Rule[Out, Out]

    Same as ~ but with "cut" semantics, meaning that the parser will never backtrack across this boundary.

    Same as ~ but with "cut" semantics, meaning that the parser will never backtrack across this boundary. If the rule being concatenated doesn't match a parse error will be triggered immediately.

    Annotations
    @compileTimeOnly( ... )
  37. def [B](y: B): (Rule[I, O], B)
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to ArrowAssoc[Rule[I, O]] performed by method ArrowAssoc in scala.Predef. This conversion will take place only if I is a superclass of HNil (I >: HNil).
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Rule[I, O] to any2stringadd[Rule[I, O]] performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (rule: any2stringadd[Rule[I, O]]).+(other)
    Definition Classes
    any2stringadd

Inherited from RuleX

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion Runnable from Rule[I, O] to Runnable[O]

Inherited by implicit conversion any2stringadd from Rule[I, O] to any2stringadd[Rule[I, O]]

Inherited by implicit conversion StringFormat from Rule[I, O] to StringFormat[Rule[I, O]]

Inherited by implicit conversion Ensuring from Rule[I, O] to Ensuring[Rule[I, O]]

Inherited by implicit conversion ArrowAssoc from Rule[I, O] to ArrowAssoc[Rule[I, O]]

Ungrouped