GenericNumberState

A NumberState object returns a number from a scanner.

Inherits: INumberState

Description

The GenericNumberState class allows you to create a NumberState object returns a number from a scanner.

Important points

  • This state’s idea of a number allows an optional, initial minus sign, followed by one or more digits. A decimal point and another string of digits may follow these digits.

Instance methods

NextToken

Gets the next token from the stream started from the character linked 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.