ExpressionParser
in package
Table of Contents
Properties
- $depth : int
Methods
- parse() : Node
- parseArray() : Node
- parseBracketedExpression() : Node
- parseExpression() : Node
- Parse one or more expressions separated by operators.
- parseFunction() : Node
- parseIndex() : array<int, string>
- parseInternal() : Node
- parseNumber() : ValueNode
- Expression := Number | quoted-string | FunctionName "(" ExpressionList ")" | Variable | BracketedExpression | Expression BinaryOp Expression
- parseString() : ValueNode
- parseVariable() : Node
- resolveOperators() : Node
Properties
$depth
private
int
$depth
= 0
Methods
parse()
public
parse(string $expression) : Node
Parameters
- $expression : string
Return values
NodeparseArray()
private
parseArray(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NodeparseBracketedExpression()
private
parseBracketedExpression(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NodeparseExpression()
Parse one or more expressions separated by operators.
private
parseExpression(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NodeparseFunction()
private
parseFunction(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NodeparseIndex()
private
parseIndex(Buffer $buffer) : array<int, string>
Parameters
- $buffer : Buffer
Return values
array<int, string>parseInternal()
private
parseInternal(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NodeparseNumber()
Expression := Number | quoted-string | FunctionName "(" ExpressionList ")" | Variable | BracketedExpression | Expression BinaryOp Expression
private
parseNumber(Buffer $buffer) : ValueNode
Number = "-" PositiveNumber | PositiveNumber PositiveNumber = "\d+" ("." \d+)? Variable = "{" VariableName "}" BracketedExpression: = "(" Expression ")" FunctionName = "[a-Z][_a-Z0-9]" ExpressionList = Expression ("," Expression) VariableName = "[a-Z][_a-Z0-9.]*"
Parameters
- $buffer : Buffer
Return values
ValueNodeparseString()
private
parseString(Buffer $buffer) : ValueNode
Parameters
- $buffer : Buffer
Return values
ValueNodeparseVariable()
private
parseVariable(Buffer $buffer) : Node
Parameters
- $buffer : Buffer
Return values
NoderesolveOperators()
private
resolveOperators(array<int, Node> $operands, array<int, Operator> $operators) : Node