1: <?php
2:
3: namespace BN\Compiler\Parser\Operator;
4:
5: class OperatorOrder
6: {
7: private $precedence;
8: private $isLeftAssociative;
9:
10: public function __construct($precedence, $isLeftAssociative)
11: {
12: $this->precedence = $precedence;
13: $this->isLeftAssociative = $isLeftAssociative;
14: }
15:
16: public function isNotPreceding(OperatorOrder $operator)
17: {
18: return ($this->isLeftAssociative && $this->precedence <= $operator->precedence)
19: || $this->precedence < $operator->precedence;
20: }
21: }
22: