AbstractProtected AbstractatProtected AbstractdescribeReturns a human-readable description of the input element at pos for
use in error messages. In scannerless parsers this describes a byte; in
token parsers it describes a token.
The position index to describe.
ProtectederrorThrows an RDParserException with the given message and the current
position appended. The return type is never so call sites can write
return this.error(...) to satisfy TypeScript's control-flow analysis.
Description of the parse failure.
ProtectederrorThrows a RDParserException naming the unexpected input element at the furthest position reached during parsing.
Call this from the top-level parse() method when the first rule returns
null, to give callers a precise error location rather than a generic
"Failed to parse input (at position 0)" message.
ProtectedgetReturns the furthest position at which a terminal match was attempted and failed. Useful for producing informative error messages when the overall parse fails.
ProtectedgetReturns the current position within the input.
ProtectedrestoreRestores the current position to a previously saved value.
Used with getPosition to implement backtracking in parser alternatives.
The position to restore to.
ProtectedupdateRecords the current position as a fail point if it is further than any previously recorded fail. Subclasses call this when a terminal match fails.
Returns
truewhen the parser has reached the end of input. Implemented by subclasses based on their input representation.