aboutsummaryrefslogtreecommitdiff
path: root/lib/exTpl/BinaryExpression.php
blob: 1c82730e4c06755112f37c2934b3aaa7fab37ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace exTpl;

/**
 * BinaryExpression represents a binary operator.
 */
abstract class BinaryExpression implements Expression
{
    protected Expression $left;
    protected Expression $right;
    protected mixed $operator;

    /**
     * Initializes a new Expression instance.
     *
     * @param Expression $left left operand
     * @param Expression $right right operand
     * @param mixed $operator operator token
     */
    public function __construct(Expression $left, Expression $right, mixed $operator)
    {
        $this->left     = $left;
        $this->right    = $right;
        $this->operator = $operator;
    }
}