summaryrefslogtreecommitdiffstats
path: root/src/Exceptions/ParserException.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-05-26 01:02:55 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-06-08 19:37:46 +0300
commit0a52978705d59c50f785f0f9cf537161046beb21 (patch)
tree00051de2f829f6b1f5c95c54da89be1f298b77a8 /src/Exceptions/ParserException.php
downloadsql-parser-0a52978705d59c50f785f0f9cf537161046beb21.zip
sql-parser-0a52978705d59c50f785f0f9cf537161046beb21.tar.gz
sql-parser-0a52978705d59c50f785f0f9cf537161046beb21.tar.bz2
Initial commit.
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;
+ }
+}