aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Token.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/NXP/Classes/Token.php')
-rw-r--r--src/NXP/Classes/Token.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/NXP/Classes/Token.php b/src/NXP/Classes/Token.php
index 49bf741..e12315e 100644
--- a/src/NXP/Classes/Token.php
+++ b/src/NXP/Classes/Token.php
@@ -5,31 +5,34 @@ 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 const Literal = "literal";
+ public const Variable = "variable";
+ public const Operator = "operator";
+ public const LeftParenthesis = "LP";
+ public const RightParenthesis = "RP";
+ public const Function = "function";
+ public const ParamSeparator = "separator";
+ public const String = "string";
+ public const Space = "space";
+ /** @var self::* */
public $type = self::Literal;
- /**
- * @var float|string
- */
+ /** @var float|string */
public $value;
+ /** @var string */
+ public $name;
+
/**
* Token constructor.
- * @param string $type
+ * @param self::* $type
* @param float|string $value
*/
- public function __construct(string $type, $value)
+ public function __construct(string $type, $value, string $name = null)
{
$this->type = $type;
$this->value = $value;
+ $this->name = $name;
}
}