Class TreeNode

Represents a tree node in an operation tree

Branches can hold either another tree node or a Token. A full Operation Tree can be referenced only by its root node

Hierarchy

  • TreeNode

Constructors

Properties

char: number

The column number of the expression, for error messages

left: undefined | Token | TreeNode

The left branch of this tree node

priority: number

The priotity of the tree node, this property is present for the purpose of making a TreeNode instance usable as a single Token which can then act as a value once computed

result: undefined | boolean

The result of a tree computation

right: undefined | Token | TreeNode

The right branch of this tree node

type: string

The type of this tree node, this property is present for the purpose of making a TreeNode instance usable as a single Token which can then act as a value once computed

value: Token

The root of the tree node, This value is often an operator Token

Methods

  • calculate the TreeNode values

    Parameters

    • input: boolean[]

      an array of input bits

    • profile: string

      the expression's profile

    Returns boolean

  • Detect wheter or not the TreeNode has already been computed

    Returns

    wheter or not the TreeNode was computed

    Returns boolean

Generated using TypeDoc