Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GenericQuoteState

A quoteState returns a quoted string token from a scanner. This state will collect characters until it sees a match to the character that the tokenizer used to switch to this state. For example, if a tokenizer uses a double-quote character to enter this state, then nextToken() will search for another double-quote until it finds one or finds the end of the scanner.

Hierarchy

  • GenericQuoteState

Implements

Index

Methods

decodeString

  • decodeString(value: string, quoteSymbol: number): string
  • Decodes a string value.

    Parameters

    • value: string

      A string value to be decoded.

    • quoteSymbol: number

      A string quote character.

    Returns string

    An decoded string.

encodeString

  • encodeString(value: string, quoteSymbol: number): string
  • Encodes a string value.

    Parameters

    • value: string

      A string value to be encoded.

    • quoteSymbol: number

      A string quote character.

    Returns string

    An encoded string.

nextToken

  • Return a quoted string token from a scanner. This method will collect characters until it sees a match to the character that the tokenizer used to switch to this state.

    Parameters

    • scanner: IScanner

      A textual string to be tokenized.

    • tokenizer: ITokenizer

      A tokenizer class that controls the process.

    Returns Token

    The next token from the top of the stream.

Generated using TypeDoc