diff options
author | Damian Dlugosz <bigfootdd@gmail.com> | 2017-01-06 00:48:57 +0100 |
---|---|---|
committer | Damian Dlugosz <bigfootdd@gmail.com> | 2017-01-06 00:48:57 +0100 |
commit | 18989fecc94e31c67a7ad053fe16f09dae6402a8 (patch) | |
tree | c5e1382c3fcc11895e7d1a47973bd0d751c450f0 | |
parent | a6e45c5e2e006bbd90306e1e947e25e601965657 (diff) | |
download | sql-parser-18989fecc94e31c67a7ad053fe16f09dae6402a8.zip sql-parser-18989fecc94e31c67a7ad053fe16f09dae6402a8.tar.gz sql-parser-18989fecc94e31c67a7ad053fe16f09dae6402a8.tar.bz2 |
Update ContextGenerator.php
-rw-r--r-- | src/Contexts/ContextMySql50000.php | 11 | ||||
-rw-r--r-- | src/Contexts/ContextMySql50100.php | 11 | ||||
-rw-r--r-- | src/Contexts/ContextMySql50500.php | 11 | ||||
-rw-r--r-- | src/Contexts/ContextMySql50600.php | 11 | ||||
-rw-r--r-- | src/Contexts/ContextMySql50700.php | 11 | ||||
-rw-r--r-- | tools/ContextGenerator.php | 18 |
6 files changed, 24 insertions, 49 deletions
diff --git a/src/Contexts/ContextMySql50000.php b/src/Contexts/ContextMySql50000.php index 798057b..5044ad7 100644 --- a/src/Contexts/ContextMySql50000.php +++ b/src/Contexts/ContextMySql50000.php @@ -5,10 +5,9 @@ * * This file was auto-generated. * - * @package SqlParser - * @subpackage Contexts - * @link https://dev.mysql.com/doc/refman/5.0/en/keywords.html + * @see https://dev.mysql.com/doc/refman/5.0/en/keywords.html */ + namespace SqlParser\Contexts; use SqlParser\Context; @@ -17,13 +16,11 @@ use SqlParser\Context; * Context for MySQL 5. * * @category Contexts - * @package SqlParser - * @subpackage Contexts + * * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+ */ class ContextMySql50000 extends Context { - /** * List of keywords. * @@ -34,7 +31,6 @@ class ContextMySql50000 extends Context * @var array */ public static $KEYWORDS = array( - 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, @@ -283,6 +279,5 @@ class ContextMySql50000 extends Context 'CHAR' => 43, 'BINARY' => 43, 'INTERVAL' => 43, - ); } diff --git a/src/Contexts/ContextMySql50100.php b/src/Contexts/ContextMySql50100.php index c87198d..cb1c0cd 100644 --- a/src/Contexts/ContextMySql50100.php +++ b/src/Contexts/ContextMySql50100.php @@ -5,10 +5,9 @@ * * This file was auto-generated. * - * @package SqlParser - * @subpackage Contexts - * @link https://dev.mysql.com/doc/refman/5.1/en/keywords.html + * @see https://dev.mysql.com/doc/refman/5.1/en/keywords.html */ + namespace SqlParser\Contexts; use SqlParser\Context; @@ -17,13 +16,11 @@ use SqlParser\Context; * Context for MySQL 5.1. * * @category Contexts - * @package SqlParser - * @subpackage Contexts + * * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+ */ class ContextMySql50100 extends Context { - /** * List of keywords. * @@ -34,7 +31,6 @@ class ContextMySql50100 extends Context * @var array */ public static $KEYWORDS = array( - 'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, @@ -308,6 +304,5 @@ class ContextMySql50100 extends Context 'CHAR' => 43, 'BINARY' => 43, 'INTERVAL' => 43, - ); } diff --git a/src/Contexts/ContextMySql50500.php b/src/Contexts/ContextMySql50500.php index 7028429..ed4dd1f 100644 --- a/src/Contexts/ContextMySql50500.php +++ b/src/Contexts/ContextMySql50500.php @@ -5,10 +5,9 @@ * * This file was auto-generated. * - * @package SqlParser - * @subpackage Contexts - * @link https://dev.mysql.com/doc/refman/5.5/en/keywords.html + * @see https://dev.mysql.com/doc/refman/5.5/en/keywords.html */ + namespace SqlParser\Contexts; use SqlParser\Context; @@ -17,13 +16,11 @@ use SqlParser\Context; * Context for MySQL 5.5. * * @category Contexts - * @package SqlParser - * @subpackage Contexts + * * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+ */ class ContextMySql50500 extends Context { - /** * List of keywords. * @@ -34,7 +31,6 @@ class ContextMySql50500 extends Context * @var array */ public static $KEYWORDS = array( - 'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, @@ -313,6 +309,5 @@ class ContextMySql50500 extends Context 'CHAR' => 43, 'BINARY' => 43, 'INTERVAL' => 43, - ); } diff --git a/src/Contexts/ContextMySql50600.php b/src/Contexts/ContextMySql50600.php index f9264b3..af7fe40 100644 --- a/src/Contexts/ContextMySql50600.php +++ b/src/Contexts/ContextMySql50600.php @@ -5,10 +5,9 @@ * * This file was auto-generated. * - * @package SqlParser - * @subpackage Contexts - * @link https://dev.mysql.com/doc/refman/5.6/en/keywords.html + * @see https://dev.mysql.com/doc/refman/5.6/en/keywords.html */ + namespace SqlParser\Contexts; use SqlParser\Context; @@ -17,13 +16,11 @@ use SqlParser\Context; * Context for MySQL 5.6. * * @category Contexts - * @package SqlParser - * @subpackage Contexts + * * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+ */ class ContextMySql50600 extends Context { - /** * List of keywords. * @@ -34,7 +31,6 @@ class ContextMySql50600 extends Context * @var array */ public static $KEYWORDS = array( - 'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, @@ -342,6 +338,5 @@ class ContextMySql50600 extends Context 'CHAR' => 43, 'BINARY' => 43, 'INTERVAL' => 43, - ); } diff --git a/src/Contexts/ContextMySql50700.php b/src/Contexts/ContextMySql50700.php index 8f761f3..3905760 100644 --- a/src/Contexts/ContextMySql50700.php +++ b/src/Contexts/ContextMySql50700.php @@ -5,10 +5,9 @@ * * This file was auto-generated. * - * @package SqlParser - * @subpackage Contexts - * @link https://dev.mysql.com/doc/refman/5.7/en/keywords.html + * @see https://dev.mysql.com/doc/refman/5.7/en/keywords.html */ + namespace SqlParser\Contexts; use SqlParser\Context; @@ -17,13 +16,11 @@ use SqlParser\Context; * Context for MySQL 5.7. * * @category Contexts - * @package SqlParser - * @subpackage Contexts + * * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+ */ class ContextMySql50700 extends Context { - /** * List of keywords. * @@ -34,7 +31,6 @@ class ContextMySql50700 extends Context * @var array */ public static $KEYWORDS = array( - 'AT' => 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, 'XID' => 1, @@ -354,6 +350,5 @@ class ContextMySql50700 extends Context 'CHAR' => 43, 'BINARY' => 43, 'INTERVAL' => 43, - ); } diff --git a/tools/ContextGenerator.php b/tools/ContextGenerator.php index e34d862..5876b86 100644 --- a/tools/ContextGenerator.php +++ b/tools/ContextGenerator.php @@ -2,7 +2,7 @@ namespace SqlParser\Tools; -require_once '../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; /** * Used for context generation. @@ -57,10 +57,9 @@ class ContextGenerator ' *' . "\n" . ' * This file was auto-generated.' . "\n" . ' *' . "\n" . - ' * @package SqlParser' . "\n" . - ' * @subpackage Contexts' . "\n" . - ' * @link %3$s' . "\n" . + ' * @see %3$s' . "\n" . ' */' . "\n" . + '' . "\n" . 'namespace SqlParser\\Contexts;' . "\n" . '' . "\n" . 'use SqlParser\\Context;' . "\n" . @@ -69,13 +68,11 @@ class ContextGenerator ' * Context for %1$s.' . "\n" . ' *' . "\n" . ' * @category Contexts' . "\n" . - ' * @package SqlParser' . "\n" . - ' * @subpackage Contexts' . "\n" . + ' *' . "\n" . ' * @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+' . "\n" . ' */' . "\n" . 'class %2$s extends Context' . "\n" . '{' . "\n" . - '' . "\n" . ' /**' . "\n" . ' * List of keywords.' . "\n" . ' *' . "\n" . @@ -86,7 +83,6 @@ class ContextGenerator ' * @var array' . "\n" . ' */' . "\n" . ' public static $KEYWORDS = array(' . "\n" . - '' . "\n" . '%4$s' . ' );' . "\n" . '}' . "\n"; @@ -184,7 +180,9 @@ class ContextGenerator */ public static function printWords($words, $spaces = 8, $line = 80) { + $typesCount = count($words); $ret = ''; + $j = 0; foreach ($words as $type => $wordsByType) { foreach ($wordsByType as $len => $wordsByLen) { @@ -207,7 +205,9 @@ class ContextGenerator } } - $ret .= "\n"; + if (++$j < $typesCount) { + $ret .= "\n"; + } } // Trim trailing spaces and return. |