summaryrefslogtreecommitdiffstats
path: root/src/Fragments
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fragments')
-rw-r--r--src/Fragments/ArrayFragment.php19
-rw-r--r--src/Fragments/CallKeyword.php19
-rw-r--r--src/Fragments/CreateDefFragment.php27
-rw-r--r--src/Fragments/DataTypeFragment.php19
-rw-r--r--src/Fragments/FieldDefFragment.php19
-rw-r--r--src/Fragments/FieldFragment.php44
-rw-r--r--src/Fragments/FromKeyword.php19
-rw-r--r--src/Fragments/IntoKeyword.php19
-rw-r--r--src/Fragments/JoinKeyword.php21
-rw-r--r--src/Fragments/LimitKeyword.php19
-rw-r--r--src/Fragments/OptionsFragment.php29
-rw-r--r--src/Fragments/OrderKeyword.php19
-rw-r--r--src/Fragments/ParamDefFragment.php19
-rw-r--r--src/Fragments/RenameKeyword.php19
-rw-r--r--src/Fragments/SelectKeyword.php19
-rw-r--r--src/Fragments/SetKeyword.php19
-rw-r--r--src/Fragments/ValuesKeyword.php19
-rw-r--r--src/Fragments/WhereKeyword.php21
18 files changed, 287 insertions, 102 deletions
diff --git a/src/Fragments/ArrayFragment.php b/src/Fragments/ArrayFragment.php
index 6436823..eb5a80b 100644
--- a/src/Fragments/ArrayFragment.php
+++ b/src/Fragments/ArrayFragment.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses an array.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class ArrayFragment extends Fragment
{
@@ -29,9 +34,9 @@ class ArrayFragment extends Fragment
public $raw = array();
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return ArrayFragment
*/
@@ -56,7 +61,11 @@ class ArrayFragment extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/CallKeyword.php b/src/Fragments/CallKeyword.php
index 6147cf4..db11120 100644
--- a/src/Fragments/CallKeyword.php
+++ b/src/Fragments/CallKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses a function call.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class CallKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class CallKeyword extends Fragment
public $parameters = array();
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return CallKeyword
*/
@@ -53,7 +58,11 @@ class CallKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/CreateDefFragment.php b/src/Fragments/CreateDefFragment.php
index 675ad81..58eabaa 100644
--- a/src/Fragments/CreateDefFragment.php
+++ b/src/Fragments/CreateDefFragment.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses the definition that follows the `CREATE` keyword.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class CreateDefFragment extends Fragment
{
@@ -70,9 +75,9 @@ class CreateDefFragment extends Fragment
public $name;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return CreateDefFragment
*/
@@ -81,7 +86,11 @@ class CreateDefFragment extends Fragment
$ret = new CreateDefFragment();
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
@@ -90,11 +99,15 @@ class CreateDefFragment extends Fragment
}
// Skipping whitespaces and comments.
- if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) {
+ if (($token->type === Token::TYPE_WHITESPACE)
+ || ($token->type === Token::TYPE_COMMENT)
+ ) {
continue;
}
- if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) {
+ if (($token->type === Token::TYPE_OPERATOR)
+ && ($token->value === '(')
+ ) {
break;
}
diff --git a/src/Fragments/DataTypeFragment.php b/src/Fragments/DataTypeFragment.php
index ca7cfaf..7baefdd 100644
--- a/src/Fragments/DataTypeFragment.php
+++ b/src/Fragments/DataTypeFragment.php
@@ -4,13 +4,18 @@ namespace SqlParser\Fragments;
use SqlParser\Context;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses a data type.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class DataTypeFragment extends Fragment
{
@@ -46,9 +51,9 @@ class DataTypeFragment extends Fragment
public $options = array();
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return DataTypeFragment[]
*/
@@ -70,7 +75,11 @@ class DataTypeFragment extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// Skipping whitespaces and comments.
diff --git a/src/Fragments/FieldDefFragment.php b/src/Fragments/FieldDefFragment.php
index 3079681..ba4b6dc 100644
--- a/src/Fragments/FieldDefFragment.php
+++ b/src/Fragments/FieldDefFragment.php
@@ -4,7 +4,6 @@ namespace SqlParser\Fragments;
use SqlParser\Context;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
@@ -13,6 +12,12 @@ use SqlParser\TokensList;
* Parses the definition of a field.
*
* Used for parsing `CREATE TABLE` statement.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class FieldDefFragment extends Fragment
{
@@ -64,9 +69,9 @@ class FieldDefFragment extends Fragment
public $options;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return FieldDefFragment[]
*/
@@ -105,7 +110,11 @@ class FieldDefFragment extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/FieldFragment.php b/src/Fragments/FieldFragment.php
index 9a69a2e..4adbba5 100644
--- a/src/Fragments/FieldFragment.php
+++ b/src/Fragments/FieldFragment.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses a reference to a field.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class FieldFragment extends Fragment
{
@@ -50,9 +55,9 @@ class FieldFragment extends Fragment
public $alias;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return FieldFragment
*/
@@ -60,20 +65,36 @@ class FieldFragment extends Fragment
{
$ret = new FieldFragment();
- /** @var bool Whether current tokens make an expression or a table reference. */
+ /**
+ * Whether current tokens make an expression or a table reference.
+ * @var bool
+ */
$isExpr = false;
- /** @var bool Whether a period was previously found. */
+ /**
+ * Whether a period was previously found.
+ * @var bool
+ */
$period = false;
- /** @var int Whether an alias is expected. Is 2 if `AS` keyword was found. */
+ /**
+ * Whether an alias is expected. Is 2 if `AS` keyword was found.
+ * @var int
+ */
$alias = 0;
- /** @var int Counts brackets. */
+ /**
+ * Counts brackets.
+ * @var int
+ */
$brackets = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
@@ -122,7 +143,8 @@ class FieldFragment extends Fragment
if (($token->type === Token::TYPE_NUMBER) || ($token->type === Token::TYPE_BOOL)
|| (($token->type === Token::TYPE_SYMBOL) && ($token->flags & Token::FLAG_SYMBOL_VARIABLE))
- || (($token->type === Token::TYPE_OPERATOR)) && ($token->value !== '.')) {
+ || (($token->type === Token::TYPE_OPERATOR)) && ($token->value !== '.')
+ ) {
// Numbers, booleans and operators are usually part of expressions.
$isExpr = true;
}
@@ -159,7 +181,7 @@ class FieldFragment extends Fragment
}
if ($alias === 2) {
- $parser->error('Alias was expected.', $token);
+ $parser->error('Alias was expected.');
}
if (empty($ret->expr)) {
diff --git a/src/Fragments/FromKeyword.php b/src/Fragments/FromKeyword.php
index c7dc624..aea9c3e 100644
--- a/src/Fragments/FromKeyword.php
+++ b/src/Fragments/FromKeyword.php
@@ -3,21 +3,26 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `FROM` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class FromKeyword extends Fragment
{
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return FieldFragment[]
*/
@@ -28,7 +33,11 @@ class FromKeyword extends Fragment
$expr = new FieldFragment();
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/IntoKeyword.php b/src/Fragments/IntoKeyword.php
index d56293a..c4211fd 100644
--- a/src/Fragments/IntoKeyword.php
+++ b/src/Fragments/IntoKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `INTO` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class IntoKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class IntoKeyword extends Fragment
public $fields;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return IntoKeyword
*/
@@ -55,7 +60,11 @@ class IntoKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/JoinKeyword.php b/src/Fragments/JoinKeyword.php
index 411d227..b6b2c22 100644
--- a/src/Fragments/JoinKeyword.php
+++ b/src/Fragments/JoinKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `JOIN` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class JoinKeyword extends Fragment
{
@@ -24,14 +29,14 @@ class JoinKeyword extends Fragment
/**
* Join conditions.
*
- * @var WhereKeyword
+ * @var WhereKeyword[]
*/
public $on;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return JoinKeyword
*/
@@ -55,7 +60,11 @@ class JoinKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/LimitKeyword.php b/src/Fragments/LimitKeyword.php
index 3e6f592..2e5b819 100644
--- a/src/Fragments/LimitKeyword.php
+++ b/src/Fragments/LimitKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `lIMIT` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class LimitKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class LimitKeyword extends Fragment
public $row_count;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return LimitKeyword
*/
@@ -42,7 +47,11 @@ class LimitKeyword extends Fragment
$offset = false;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/OptionsFragment.php b/src/Fragments/OptionsFragment.php
index 3317f10..f002f5b 100644
--- a/src/Fragments/OptionsFragment.php
+++ b/src/Fragments/OptionsFragment.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* Parses a list of options.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class OptionsFragment extends Fragment
{
@@ -22,9 +27,9 @@ class OptionsFragment extends Fragment
public $options = array();
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return OptionsFragment
*/
@@ -32,17 +37,27 @@ class OptionsFragment extends Fragment
{
$ret = new OptionsFragment();
- /** @var int The ID that will be assigned to duplicate options. */
+ /**
+ * The ID that will be assigned to duplicate options.
+ * @var int
+ */
$lastAssignedId = count($options) + 1;
- /** @var array The option that was processed last time. */
+ /**
+ * The option that was processed last time.
+ * @var array
+ */
$lastOption = null;
$lastOptionId = 0;
$brackets = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/OrderKeyword.php b/src/Fragments/OrderKeyword.php
index 4cebc1c..224a573 100644
--- a/src/Fragments/OrderKeyword.php
+++ b/src/Fragments/OrderKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `ORDER BY` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class OrderKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class OrderKeyword extends Fragment
public $type = 'ASC';
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return OrderKeyword[]
*/
@@ -42,7 +47,11 @@ class OrderKeyword extends Fragment
$expr = new OrderKeyword();
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/ParamDefFragment.php b/src/Fragments/ParamDefFragment.php
index 132898f..4756120 100644
--- a/src/Fragments/ParamDefFragment.php
+++ b/src/Fragments/ParamDefFragment.php
@@ -4,13 +4,18 @@ namespace SqlParser\Fragments;
use SqlParser\Context;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* The definition of a parameter of a function or procedure.
+ *
+ * @category Fragments
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class ParamDefFragment extends Fragment
{
@@ -37,9 +42,9 @@ class ParamDefFragment extends Fragment
public $type;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return ParamDefFragment[]
*/
@@ -69,7 +74,11 @@ class ParamDefFragment extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/RenameKeyword.php b/src/Fragments/RenameKeyword.php
index c38dae6..9e9969c 100644
--- a/src/Fragments/RenameKeyword.php
+++ b/src/Fragments/RenameKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `RENAME TABLE` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class RenameKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class RenameKeyword extends Fragment
public $new;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return RenameKeyword
*/
@@ -60,7 +65,11 @@ class RenameKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/SelectKeyword.php b/src/Fragments/SelectKeyword.php
index 8848815..fc59aa0 100644
--- a/src/Fragments/SelectKeyword.php
+++ b/src/Fragments/SelectKeyword.php
@@ -3,21 +3,26 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `SELECT` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class SelectKeyword extends Fragment
{
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return FieldFragment[]
*/
@@ -28,7 +33,11 @@ class SelectKeyword extends Fragment
$expr = null;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/SetKeyword.php b/src/Fragments/SetKeyword.php
index 284173e..82f9965 100644
--- a/src/Fragments/SetKeyword.php
+++ b/src/Fragments/SetKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `SET` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class SetKeyword extends Fragment
{
@@ -29,9 +34,9 @@ class SetKeyword extends Fragment
public $value;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return SetKeyword[]
*/
@@ -56,7 +61,11 @@ class SetKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/ValuesKeyword.php b/src/Fragments/ValuesKeyword.php
index db8c5fd..cb470dd 100644
--- a/src/Fragments/ValuesKeyword.php
+++ b/src/Fragments/ValuesKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `VALUES` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class ValuesKeyword extends Fragment
{
@@ -22,9 +27,9 @@ class ValuesKeyword extends Fragment
public $values;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return ValuesKeyword
*/
@@ -54,7 +59,11 @@ class ValuesKeyword extends Fragment
$state = 0;
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.
diff --git a/src/Fragments/WhereKeyword.php b/src/Fragments/WhereKeyword.php
index c9ce460..0bc60a7 100644
--- a/src/Fragments/WhereKeyword.php
+++ b/src/Fragments/WhereKeyword.php
@@ -3,13 +3,18 @@
namespace SqlParser\Fragments;
use SqlParser\Fragment;
-use SqlParser\Lexer;
use SqlParser\Parser;
use SqlParser\Token;
use SqlParser\TokensList;
/**
* `WHERE` keyword parser.
+ *
+ * @category Keywords
+ * @package SqlParser
+ * @subpackage Fragments
+ * @author Dan Ungureanu <udan1107@gmail.com>
+ * @license http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class WhereKeyword extends Fragment
{
@@ -19,7 +24,7 @@ class WhereKeyword extends Fragment
*
* @var array
*/
- private static $OPERATORS = array('&&', '(', ')', 'AND', 'OR', 'XOR', '||');
+ public static $OPERATORS = array('&&', '(', ')', 'AND', 'OR', 'XOR', '||');
/**
* Whether this fragment is an operator.
@@ -36,9 +41,9 @@ class WhereKeyword extends Fragment
public $condition;
/**
- * @param Parser $parser The parser that serves as context.
- * @param TokensList $list The list of tokens that are being parsed.
- * @param array $options Parameters for parsing.
+ * @param Parser $parser The parser that serves as context.
+ * @param TokensList $list The list of tokens that are being parsed.
+ * @param array $options Parameters for parsing.
*
* @return WhereKeyword[]
*/
@@ -49,7 +54,11 @@ class WhereKeyword extends Fragment
$expr = new WhereKeyword();
for (; $list->idx < $list->count; ++$list->idx) {
- /** @var Token Token parsed at this moment. */
+
+ /**
+ * Token parsed at this moment.
+ * @var Token
+ */
$token = $list->tokens[$list->idx];
// End of statement.