From 29d32a155f9956d1041a4420c19986565f695040 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Fri, 31 Aug 2018 12:22:58 -0400 Subject: Add ability to get functions and operators that have been registered --- src/NXP/Classes/TokenFactory.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/NXP/Classes') diff --git a/src/NXP/Classes/TokenFactory.php b/src/NXP/Classes/TokenFactory.php index 19ba1cf..2b1e00e 100644 --- a/src/NXP/Classes/TokenFactory.php +++ b/src/NXP/Classes/TokenFactory.php @@ -51,6 +51,18 @@ class TokenFactory $this->functions[$name] = array($places, $function); } + + /** + * get functions + * + * @return array containing callback and places indexed by + * function name + */ + public function getFunctions() + { + return $this->functions; + } + /** * Add operator * @param string $operatorClass @@ -68,6 +80,16 @@ class TokenFactory $this->operators = array_unique($this->operators); } + /** + * Get registered operators + * + * @return array of operator class names + */ + public function getOperators() + { + return $this->operators; + } + /** * Add variable * @param string $name -- cgit v1.2.3