ParseTreeNode
in package
Class used to model logical expressions parse tree.
Used to evaluate expressions by the TemplateMetadata class.
Tags
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
Methods
- evaluate() : bool
- fromOperator() : self
- fromValue() : self
- matchParenthesis() : self
- push() : self
Constants
OP_AND
public
mixed
OP_AND
= 'AND'
OP_NOT
public
mixed
OP_NOT
= 'NOT'
OP_OR
public
mixed
OP_OR
= 'OR'
OP_PARENTHESIS
public
mixed
OP_PARENTHESIS
= '('
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
$first
public
self
$first
$info
public
string
$info
$operator
public
string
$operator
$parent
public
self
$parent
$second
public
self
$second
$value
public
bool
$value
Methods
evaluate()
public
evaluate() : bool
Return values
boolfromOperator()
public
static fromOperator(string $operator, self|null $first) : self
Parameters
- $operator : string
- $first : self|null
Return values
selffromValue()
public
static fromValue(bool $value[, string $info = '' ]) : self
Parameters
- $value : bool
- $info : string = ''
Return values
selfmatchParenthesis()
public
matchParenthesis() : self
Return values
selfpush()
public
push(self $operand) : self
Parameters
- $operand : self