summaryrefslogtreecommitdiffstats
path: root/src/Exceptions/ParserException.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Exceptions/ParserException.php')
-rw-r--r--src/Exceptions/ParserException.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Exceptions/ParserException.php b/src/Exceptions/ParserException.php
new file mode 100644
index 0000000..e23d03d
--- /dev/null
+++ b/src/Exceptions/ParserException.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace SqlParser\Exceptions;
+
+use SqlParser\Token;
+
+/**
+ * Exception thrown by the parser.
+ */
+class ParserException extends \Exception
+{
+
+ /**
+ * The token that produced this error.
+ *
+ * @var Token
+ */
+ public $token;
+
+ /**
+ * Constructor.
+ *
+ * @param string $message
+ * @param Token $token
+ * @param int $code
+ */
+ public function __construct($message = '', Token $token = null, $code = 0)
+ {
+ parent::__construct($message, $code);
+ $this->token = $token;
+ }
+}