aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Token/TokenUnequal.php
diff options
context:
space:
mode:
authorBruce Wells <brucekwells@gmail.com>2019-11-27 20:39:25 +0300
committerGitHub <noreply@github.com>2019-11-27 20:39:25 +0300
commitf24038043894da8e9de2f437559d95f4fe93b305 (patch)
tree2b01f4b6c9a695da3246eebc4828372abd659d06 /src/NXP/Classes/Token/TokenUnequal.php
parentf975f0bfbc6ac28f0a868b2c237cca071c37c39e (diff)
Version 1.1 (#51)V1.1.0
* Update README.md and more function support
Diffstat (limited to 'src/NXP/Classes/Token/TokenUnequal.php')
-rw-r--r--src/NXP/Classes/Token/TokenUnequal.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/NXP/Classes/Token/TokenUnequal.php b/src/NXP/Classes/Token/TokenUnequal.php
deleted file mode 100644
index c8c5d1a..0000000
--- a/src/NXP/Classes/Token/TokenUnequal.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-namespace NXP\Classes\Token;
-
-use NXP\Exception\IncorrectExpressionException;
-
-class TokenUnequal extends AbstractOperator
-{
- /**
- * @return string
- */
- public static function getRegex()
- {
- return '\!\=';
- }
-
- /**
- * @return int
- */
- public function getPriority()
- {
- return 140;
- }
-
- /**
- * @return string
- */
- public function getAssociation()
- {
- return self::LEFT_ASSOC;
- }
-
- /**
- * @param InterfaceToken[] $stack
- *
- * @return $this
- *
- * @throws \NXP\Exception\IncorrectExpressionException
- */
- public function execute(&$stack)
- {
- $op2 = array_pop($stack);
- $op1 = array_pop($stack);
-
- if ($op1 === null || $op2 === null) {
- throw new IncorrectExpressionException("!= requires two operators");
- }
-
- $result = $op1->getValue() != $op2->getValue();
-
- return new TokenNumber($result);
- }
-}