Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Parser

Class for parsing commands.

Hierarchy

  • Parser

Index

Constructors

constructor

Properties

Private modeStack

modeStack: unknown[] = []

The parsing mode stack.

options

options: ParserOptions

The parser options.

source

source: InputStream

The source input stream.

Accessors

Private mode

  • get mode(): unknown

Methods

argument

command

commandPart

commandParts

  • commandParts(count?: undefined | number): CommandPart[]
  • Parses command parts while the source is valid and the desired part count is not reached (if set).

    Parameters

    • Optional count: undefined | number

      Number of parts to parse.

    Returns CommandPart[]

Private findPresentingOpeningQuote

  • findPresentingOpeningQuote(): Lexeme | undefined
  • Returns the opening quote presented at the current source position, if any.

    Returns Lexeme | undefined

flag

Private getClosingQuote

  • getClosingQuote(opening: Lexeme): string
  • Returns the corresponding closing quote for the opening one.

    Parameters

    • opening: Lexeme

      The opening quote.

    Returns string

matchRest

quoted

reset

  • reset(): void

rest

  • Tries to match a rest marker. If matched, matches and returns the rest of the source as a string argument. Otherwise, returns null.

    Returns StringArgument | null

simple

simpleOrEmpty

skipSeparators

  • skipSeparators(): void

string

Generated using TypeDoc