SymbolRootNode

This class is a special case of SymbolNode. A SymbolRootNode object has no symbol of its own, but has children that represent all possible symbols.

Extends: SymbolNode

Description

The SymbolRootNode class is a special case of SymbolNode. A SymbolRootNode object has no symbol of its own, but has children that represent all possible symbols.

Constructors

Creates and initializes a root node.

public constructor()

Instance methods

add

Adds the given string as a symbol.

public add(value: string, tokenType: TokenType): void

  • value: string - character sequence to add.
  • tokenType: TokenType - token type

nextToken

Returns a symbol string from a scanner.

public nextToken(scanner: IScanner): Token

  • scanner: IScanner - scanner to read from
  • returns: Token - symbol string from a scanner