GenericQuoteState

A quoteState returns a quoted string token from a scanner.

Inherits: IQuoteState

Description

The GenericQuoteState allows you to create a quoteState that returns a quoted string token from a scanner.

Important points

  • 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.

Instance methods

DecodeString

Decodes a string value.

public virtual string DecodeString(string value, char quoteSymbol)

  • value: string - string value to be decoded.
  • quoteSymbol: char - string quote character.
  • returns: string - decoded string.

EncodeString

Encodes a string value.

public virtual string EncodeString(string value, char quoteSymbol)

  • value: string - string value to be encoded.
  • quoteSymbol: char - string quote character.
  • returns: string - encoded string.

NextToken

Returns 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.

public virtual Token NextToken(IScanner scanner, ITokenizer tokenizer)

  • scanner: IScanner - text string to be tokenized.
  • tokenizer: ITokenizer - tokenizer class that controls the process.
  • returns: Token - next token from the top of the stream.