JumpParsingOperation

abstract class JumpParsingOperation<Self : JumpParsingOperation<Self>>(commutesWithParsePart: Boolean, canRunIfHasFirstArgument: Boolean) : ArityOneParsingOperation<Int>

JumpParsingOperation is a ParsingOperation that performs a branch or jump.

Author

Todd L Smith

Mark van Gulik

Parameters

commutesWithParsePart

Whether a ParsePart or ParsePartCaseInsensitively instructions can be moved safely leftward over this instruction.

canRunIfHasFirstArgument

Whether this instruction can be run if the first argument has been parsed but not yet consumed by a PARSE_ARGUMENT instruction.

Inheritors

Constructors

Link copied to clipboard
constructor(commutesWithParsePart: Boolean, canRunIfHasFirstArgument: Boolean)

Construct a new ArityOneParsingOperation for this enum.

Properties

Link copied to clipboard

Whether this operation can run successfully if there is a pre-parsed first argument that has not yet been consumed.

Link copied to clipboard

Assume that the instruction encodes an operand that represents the index of an argument to be checked (for grammatical restrictions): answer the operand.

Link copied to clipboard

Whether this instance commutes with ParsePart instructions.

Link copied to clipboard

A Statistic that records the number of nanoseconds spent while expanding occurrences of this ParsingOperation.

Link copied to clipboard
open val keywordIndex: Int

Assume that the instruction encodes an operand that represents a message part index: answer the operand. Answer 0 if the operand does not represent a message part.

Link copied to clipboard

The name of the instruction.

Link copied to clipboard
abstract val operand: Int

The operand.

Link copied to clipboard

A Statistic that records the number of nanoseconds spent while executing occurrences of this ParsingOperation.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun interned(): ParsingOperation

Given a ParsingOperation, answer an equal operation object that is equal to it, possibly itself, such that all invocations of intern with equal operations will produce the same object. It uses the weak internedInstructions map(s).

Link copied to clipboard
abstract fun newOperand(operand: Int): Self

Copy the receiver, replacing its operand with the given value.

Link copied to clipboard
open fun successorPcs(currentPc: Int): List<Int>

Given a program counter, answer the list of successor program counters that should be explored. For example, a BranchForward instruction will need to visit both the next program counter and the branch target.

Link copied to clipboard
open override fun toString(): String