expression.php
This file is part of the Parsica library.
Copyright (c) 2020 Mathias Verraes mathias@verraes.net
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Table of Contents
Functions
- expression() : Parser
- Build an expression parser from a term parser and an expression table.
- binaryOperator() : BinaryOperator
- A binary operator in an expression. The operands of the expression will be passed into $transform to produce the output of the expression parser.
- unaryOperator() : UnaryOperator<TSymbol, TExpressionAST>
- A unary operator in an expression. The operands of the expression will be passed into $transform to produce the output of the expression parser.
- leftAssoc() : LeftAssoc
- rightAssoc() : RightAssoc
- nonAssoc() : NonAssoc
- prefix() : Prefix
- postfix() : Postfix
Functions
expression()
Build an expression parser from a term parser and an expression table.
expression(Parser $term, array<string|int, mixed> $expressionTable) : Parser
Parameters
- $term : Parser
- $expressionTable : array<string|int, mixed>
Tags
Return values
ParserbinaryOperator()
A binary operator in an expression. The operands of the expression will be passed into $transform to produce the output of the expression parser.
binaryOperator(Parser $symbol, callable $transform[, string $label = "" ]) : BinaryOperator
Parameters
- $symbol : Parser
- $transform : callable
- $label : string = ""
Tags
Return values
BinaryOperatorunaryOperator()
A unary operator in an expression. The operands of the expression will be passed into $transform to produce the output of the expression parser.
unaryOperator(Parser $symbol, callable $transform[, string $label = "" ]) : UnaryOperator<TSymbol, TExpressionAST>
Parameters
- $symbol : Parser
- $transform : callable
- $label : string = ""
Tags
Return values
UnaryOperator<TSymbol, TExpressionAST>leftAssoc()
leftAssoc(BinaryOperator ...$operators) : LeftAssoc
Parameters
- $operators : BinaryOperator
Tags
Return values
LeftAssocrightAssoc()
rightAssoc(BinaryOperator ...$operators) : RightAssoc
Parameters
- $operators : BinaryOperator
Tags
Return values
RightAssocnonAssoc()
nonAssoc(BinaryOperator $operator) : NonAssoc
Parameters
- $operator : BinaryOperator
Tags
Return values
NonAssocprefix()
prefix(UnaryOperator ...$operators) : Prefix
Parameters
- $operators : UnaryOperator
Tags
Return values
Prefixpostfix()
postfix(UnaryOperator ...$operators) : Postfix
Parameters
- $operators : UnaryOperator