ParserOp

zio.parser.internal.stacksafe.ParserOp
See theParserOp companion trait
object ParserOp

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ParserOp.type

Members list

Type members

Classlikes

case object BacktrackOnFailure extends ParserOp

Pop the last branch position, and in case of failure, reset the position to it.

Pop the last branch position, and in case of failure, reset the position to it.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
Self type
final case class CheckEnd() extends ParserOp

Pushes a failure if the current position is not at the end

Pushes a failure if the current position is not at the end

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
case object Cut extends ParserOp

Cut stored bookmarks if result is a success

Cut stored bookmarks if result is a success

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
Self type
Cut.type
case class InitialParser(op: ParserOp, initialStack: Stack[ParserOp], initialPositions: Array[Int], initialPositionIndex: Int, initialNames: List[String], initialBuilders: Chunk[Int])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Lazy(op: () => ParserOp) extends ParserOp

Deferred parser operation, used for recursion

Deferred parser operation, used for recursion

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class MatchRegex(regex: Compiled, pushAs: RegexResultPush, failAs: Option[Any]) extends ParserOp

Match a compiled regex on the input, and push a result with the given strategy or failure on the result stack

Match a compiled regex on the input, and push a result with the given strategy or failure on the result stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class MatchSeq(sequence: Chunk[Any], as: AnyRef, createParserFailure: (Int, Any) => Any) extends ParserOp

Match a sequence on the input, and push the given value or failure on the result stack

Match a sequence on the input, and push the given value or failure on the result stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait PairTransformation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case object PopName extends ParserOp

Pop the last pushed name from the name stack

Pop the last pushed name from the name stack

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
Self type
PopName.type
case class PopResultPushOp(f: Any => ParserOp) extends ParserOp

Pop the last result and use the function to push it as parser operation (flatmap)

Pop the last result and use the function to push it as parser operation (flatmap)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class ProcessRepeatedElement(parseElement: ParserOp, min: Int, max: Option[Int]) extends ParserOp

Pushes the last result to the top chunk builder. If the last result was successful, repush the element parser and itself. If the last result is a failure, finish building the result and check the min/max constraints.

Pushes the last result to the top chunk builder. If the last result was successful, repush the element parser and itself. If the last result is a failure, finish building the result and check the min/max constraints.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushCapturedResult() extends ParserOp

Pops the last stored branch position and the last result, and replaces it with the captured string as a result.

Pops the last stored branch position and the last result, and replaces it with the captured string as a result.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushChunkBuilder(sizeHint: Int) extends ParserOp

Creates a chunk builder and pushes on the chunk builder stack

Creates a chunk builder and pushes on the chunk builder stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushCurrentPosition() extends ParserOp

Pushes the current input position as a result

Pushes the current input position as a result

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushName(name: String) extends ParserOp

Store a name in the name stack

Store a name in the name stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushOp2(a: ParserOp, b: ParserOp, pushBranchPosition: Boolean) extends ParserOp

Push a and then b to the operation stack

Push a and then b to the operation stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushOp3(a: ParserOp, b: ParserOp, c: ParserOp) extends ParserOp

Push a, b and then c to the operation stack

Push a, b and then c to the operation stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushOp4(a: ParserOp, b: ParserOp, c: ParserOp, d: ParserOp, pushBranchPosition: Boolean) extends ParserOp

Push a, b, c and then d to the operation stack

Push a, b, c and then d to the operation stack

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class PushResult(success: AnyRef, failure: ParserError[Any], popFirst: Boolean) extends ParserOp

Store a result. One of success or failure must be null. If popFirst is true, the last result will be replaced but only if it was a success.

Store a result. One of success or failure must be null. If popFirst is true, the last result will be replaced but only if it was a success.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
case object ReadInputToResult extends ParserOp

Read an item from the input and push it to the result stack

Read an item from the input and push it to the result stack

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait RegexResultPush

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Ignored
object MatchedChunk
object SingleChar
case object SkipOnFailure2 extends ParserOp

If the result is failure, skip the next two parser operations. This can be used to shortcut the right side of a zip operation.

If the result is failure, skip the next two parser operations. This can be used to shortcut the right side of a zip operation.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
Self type
final case class SkipOnSuccess2(checkBranchPosition: Boolean, transform: Any => Any) extends ParserOp

If the result is success, skip the next two parser operations. Optionally if the transform is not null, it replaces the result with the transform function applied to it. This can be used to shortcut the right side of an or operation. If checkBranchPosition is true, the last branch position will be popped and checked and if the position was moved the left failure is kept and the next operations get skipped.

If the result is success, skip the next two parser operations. Optionally if the transform is not null, it replaces the result with the transform function applied to it. This can be used to shortcut the right side of an or operation. If checkBranchPosition is true, the last branch position will be popped and checked and if the position was moved the left failure is kept and the next operations get skipped.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class TransformLast2Results(strategy: PairTransformation) extends ParserOp

Pop the last two results from the stack and if both were success, create a single value based on the given strategy and push it back. If any of them failed, push back a single failure.

Pop the last two results from the stack and if both were success, create a single value based on the given strategy and push it back. If any of them failed, push back a single failure.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class TransformResult(onSuccess: Any => Any, onFailure: (ParserError[Any]) => ParserError[Any]) extends ParserOp

Pop the last result from the stack, transform it and with one of the functions and push back. It is possible to pass null to onSuccess or onFailure in which case it does not touch the result.

Pop the last result from the stack, transform it and with one of the functions and push back. It is possible to pass null to onSuccess or onFailure in which case it does not touch the result.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class TransformResultEither(f: Any => Either[Any, Any]) extends ParserOp

Pop the last result from the stack, transform it to either a success or a failure and push back

Pop the last result from the stack, transform it to either a success or a failure and push back

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class TransformResultFlipped(onSuccess: (Int, Any) => ParserError[Any], onFailure: (Int, ParserError[Any]) => Any) extends ParserOp

Pop the last result from the stack, transform it and with one of the functions and push back. It converts success to failure and failure to success.

Pop the last result from the stack, transform it and with one of the functions and push back. It converts success to failure and failure to success.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all
final case class TransformResultToOption(checkBranchPosition: Boolean) extends ParserOp

Pop the last result from the stack and if it was success, respush wrapped in Some, if it was failure, repush as a successful None. When checkBranchPosition is true, if position was moved compared to the last branch position then keep the failure.

Pop the last result from the stack and if it was success, respush wrapped in Some, if it was failure, repush as a successful None. When checkBranchPosition is true, if position was moved compared to the last branch position then keep the failure.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait ParserOp
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def compile(syntax: ErasedParser): InitialParser