Documentation

ParseTreeNode
in package

Class used to model logical expressions parse tree.

Used to evaluate expressions by the TemplateMetadata class.

Tags
author

zozlak

Table of Contents

Constants

OP_AND  = 'AND'
OP_NOT  = 'NOT'
OP_OR  = 'OR'
OP_PARENTHESIS  = '('
PRECEDENCE  = [self::OP_PARENTHESIS => 0, self::OP_NOT => 1, self::OP_OR => 2, self::OP_AND => 4]
SINGLE_OPERAND_OPERATORS  = [self::OP_NOT]

Properties

$first  : self
$info  : string
$operator  : string
$parent  : self
$second  : self
$value  : bool

Methods

evaluate()  : bool
fromOperator()  : self
fromValue()  : self
matchParenthesis()  : self
push()  : self

Constants

PRECEDENCE

public mixed PRECEDENCE = [self::OP_PARENTHESIS => 0, self::OP_NOT => 1, self::OP_OR => 2, self::OP_AND => 4]

SINGLE_OPERAND_OPERATORS

public mixed SINGLE_OPERAND_OPERATORS = [self::OP_NOT]

Properties

Methods

fromOperator()

public static fromOperator(string $operator, self|null $first) : self
Parameters
$operator : string
$first : self|null
Return values
self

fromValue()

public static fromValue(bool $value[, string $info = '' ]) : self
Parameters
$value : bool
$info : string = ''
Return values
self

matchParenthesis()

public matchParenthesis() : self
Return values
self

push()

public push(self $operand) : self
Parameters
$operand : self
Return values
self

        
On this page

Search results