class ContextMySql50600 extends Context (View source)

Context for MySQL 5.6.

This class was auto-generated from tools/contexts/*.txt. Use tools/run_generators.sh for update.

Constants

KEYWORD_MAX_LENGTH

The maximum length of a keyword.

LABEL_MAX_LENGTH

The maximum length of a label.

OPERATOR_MAX_LENGTH

The maximum length of an operator.

SQL_MODE_COMPAT_MYSQL

SQL_MODE_ALLOW_INVALID_DATES

SQL_MODE_ANSI_QUOTES

SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO

SQL_MODE_HIGH_NOT_PRECEDENCE

SQL_MODE_IGNORE_SPACE

SQL_MODE_NO_AUTO_CREATE_USER

SQL_MODE_NO_AUTO_VALUE_ON_ZERO

SQL_MODE_NO_BACKSLASH_ESCAPES

SQL_MODE_NO_DIR_IN_CREATE

SQL_MODE_NO_ENGINE_SUBSTITUTION

SQL_MODE_NO_FIELD_OPTIONS

SQL_MODE_NO_KEY_OPTIONS

SQL_MODE_NO_TABLE_OPTIONS

SQL_MODE_NO_UNSIGNED_SUBTRACTION

SQL_MODE_NO_ZERO_DATE

SQL_MODE_NO_ZERO_IN_DATE

SQL_MODE_ONLY_FULL_GROUP_BY

SQL_MODE_PIPES_AS_CONCAT

SQL_MODE_REAL_AS_FLOAT

SQL_MODE_STRICT_ALL_TABLES

SQL_MODE_STRICT_TRANS_TABLES

SQL_MODE_NO_ENCLOSING_QUOTES

SQL_MODE_ANSI

SQL_MODE_DB2

SQL_MODE_MAXDB

SQL_MODE_MSSQL

SQL_MODE_ORACLE

SQL_MODE_POSTGRESQL

SQL_MODE_TRADITIONAL

Properties

static string $defaultContext The name of the default content. from  Context
static string $loadedContext The name of the loaded context. from  Context
static string $contextPrefix The prefix concatenated to the context name when an incomplete class name is specified. from  Context
static array $KEYWORDS List of keywords.
static array $OPERATORS List of operators and their flags. from  Context
static int $MODE The mode of the MySQL server that will be used in lexing, parsing and building the statements. from  Context

Methods

static int|null
isKeyword(string $str, bool $isReserved = false)

Checks if the given string is a keyword.

from  Context
static int|null
isOperator(string $str)

Checks if the given string is an operator.

from  Context
static bool
isWhitespace(string $str)

Checks if the given character is a whitespace.

from  Context
static int|null
isComment(string $str, mixed $end = false)

Checks if the given string is the beginning of a whitespace.

from  Context
static bool
isBool(string $str)

Checks if the given string is a boolean value.

from  Context
static bool
isNumber(string $str)

Checks if the given character can be a part of a number.

from  Context
static int|null
isSymbol(string $str)

Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.

from  Context
static int|null
isString(string $str)

Checks if the given character is the beginning of a string.

from  Context
static bool
isSeparator(string $str)

Checks if the given character can be a separator for two lexeme.

from  Context
static 
load(string $context = '')

Loads the specified context.

from  Context
static string|null
loadClosest(string $context = '')

Loads the context with the closest version to the one specified.

from  Context
static 
setMode(string $mode = '')

Sets the SQL mode.

from  Context
static string|array
escape(array|string $str, string $quote = '`')

Escapes the symbol by adding surrounding backticks.

from  Context
static string
getIdentifierQuote()

Returns char used to quote identifiers based on currently set SQL Mode (ie. standard or ANSI_QUOTES)

from  Context
static bool
hasMode(int $flag = null)

Function verifies that given SQL Mode constant is currently set

from  Context

Details

static int|null isKeyword(string $str, bool $isReserved = false)

Checks if the given string is a keyword.

Parameters

string $str string to be checked
bool $isReserved checks if the keyword is reserved

Return Value

int|null

static int|null isOperator(string $str)

Checks if the given string is an operator.

Parameters

string $str string to be checked

Return Value

int|null

static bool isWhitespace(string $str)

Checks if the given character is a whitespace.

Parameters

string $str string to be checked

Return Value

bool

static int|null isComment(string $str, mixed $end = false)

Checks if the given string is the beginning of a whitespace.

Parameters

string $str string to be checked
mixed $end

Return Value

int|null

static bool isBool(string $str)

Checks if the given string is a boolean value.

This actually check only for TRUE and FALSE because 1 or 0 are actually numbers and are parsed by specific methods.

Parameters

string $str string to be checked

Return Value

bool

static bool isNumber(string $str)

Checks if the given character can be a part of a number.

Parameters

string $str string to be checked

Return Value

bool

static int|null isSymbol(string $str)

Checks if the given character is the beginning of a symbol. A symbol can be either a variable or a field name.

Parameters

string $str string to be checked

Return Value

int|null

static int|null isString(string $str)

Checks if the given character is the beginning of a string.

Parameters

string $str string to be checked

Return Value

int|null

static bool isSeparator(string $str)

Checks if the given character can be a separator for two lexeme.

Parameters

string $str string to be checked

Return Value

bool

static load(string $context = '')

Loads the specified context.

Contexts may be used by accessing the context directly.

Parameters

string $context name of the context or full class name that defines the context

Exceptions

LoaderException if the specified context doesn't exist.

static string|null loadClosest(string $context = '')

Loads the context with the closest version to the one specified.

The closest context is found by replacing last digits with zero until one is loaded successfully.

Parameters

string $context name of the context or full class name that defines the context

Return Value

string|null

See also

\Context::load()

static setMode(string $mode = '')

Sets the SQL mode.

Parameters

string $mode The list of modes. If empty, the mode is reset.

static string|array escape(array|string $str, string $quote = '`')

Escapes the symbol by adding surrounding backticks.

Parameters

array|string $str the string to be escaped
string $quote quote to be used when escaping

Return Value

string|array

static string getIdentifierQuote()

Returns char used to quote identifiers based on currently set SQL Mode (ie. standard or ANSI_QUOTES)

Return Value

string

static bool hasMode(int $flag = null)

Function verifies that given SQL Mode constant is currently set

Parameters

int $flag for example Context::SQL_MODE_ANSI_QUOTES

Return Value

bool