diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2020-05-15 21:51:23 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2020-05-15 21:51:23 +0300 |
commit | cab8e2d38ae1c8c7fb75022f7d9b0539a0a86d4e (patch) | |
tree | d3107b0f586885d56b13dc65411b455a7aee37cb /src/NXP/Classes/Token.php | |
parent | 01415abc9d7f7401d9f4c09fbbec24930c65a097 (diff) |
Massive refactoring
More clean structure
Parsing without regular expressions
Diffstat (limited to 'src/NXP/Classes/Token.php')
-rw-r--r-- | src/NXP/Classes/Token.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/NXP/Classes/Token.php b/src/NXP/Classes/Token.php new file mode 100644 index 0000000..49bf741 --- /dev/null +++ b/src/NXP/Classes/Token.php @@ -0,0 +1,35 @@ +<?php + + +namespace NXP\Classes; + +class Token +{ + const Literal = "literal"; + const Variable = "variable"; + const Operator = "operator"; + const LeftParenthesis = "LP"; + const RightParenthesis = "RP"; + const Function = "function"; + const ParamSeparator = "separator"; + const String = "string"; + const Space = "space"; + + public $type = self::Literal; + + /** + * @var float|string + */ + public $value; + + /** + * Token constructor. + * @param string $type + * @param float|string $value + */ + public function __construct(string $type, $value) + { + $this->type = $type; + $this->value = $value; + } +} |