classLeafNoise
final class LeafNoise
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.
The noise and synonym token positions of the shared leaf productions: names, optional keywords and variables.
Only a token with no influence on meaning in its production may be listed as noise, and only terminals the manual defines as synonyms may share a key. Every entry is listed in the method documentation with its reason and the manual page that states it.
Methods§
public static function positions(): array<string, list<int>>Answers the noise positions by production signature.
opt_as: AS: the keyword before the query of CREATE TABLE ... SELECT (5.6, 5.7) is optional and changes nothing (https://dev.mysql.com/doc/refman/5.7/en/create-table-select.html: "[AS] query_expression"). Before a table alias (8.0 and later) the model keeps the keyword as written (AliasMark), since it can be part of the text MySQL names an unaliased select list expression after.equal: EQ,equal: SET_VAR: an option is writtenname [=] value, and in SET and UPDATE assignments:=and=are the same assignment operator; where the rule is mandatory the token cannot be left out, so dropping its key loses nothing (https://dev.mysql.com/doc/refman/8.4/en/create-table.html, https://dev.mysql.com/doc/refman/8.4/en/assignment-operators.html).opt_default: DEFAULT,opt_default: DEFAULT_SYM:[DEFAULT] CHARACTER SET,[DEFAULT] COLLATEand[DEFAULT] ENCRYPTIONare the same option with or without the keyword (https://dev.mysql.com/doc/refman/8.4/en/create-database.html, https://dev.mysql.com/doc/refman/8.4/en/create-table.html).opt_wild: . *:tbl_name.*in a multiple-table DELETE is the table name; the suffix is accepted for compatibility with Access (https://dev.mysql.com/doc/refman/8.4/en/delete.html).opt_comma: ,: options in an option list are separated by an optional comma (https://dev.mysql.com/doc/refman/8.4/en/create-table.html: "table_option [[,] table_option]").opt_storage: STORAGE_SYM:[STORAGE] ENGINEandSHOW [STORAGE] ENGINES(https://dev.mysql.com/doc/refman/8.4/en/show-engines.html, https://dev.mysql.com/doc/refman/8.4/en/create-tablespace.html).opt_table: TABLE_SYM:TRUNCATE [TABLE] tbl_name, and TABLE is the default object type of GRANT and REVOKE (https://dev.mysql.com/doc/refman/8.4/en/truncate-table.html, https://dev.mysql.com/doc/refman/8.4/en/grant.html).table_ident: . identandfield_ident: . ident, position 0: a leading dot names the default database, as an unqualified name does (https://dev.mysql.com/doc/refman/5.7/en/identifier-qualifiers.html). A table of a FROM clause and a column of an expression keep the dot (TableReference, ColumnUse), since it is part of the text MySQL names an unaliased select list expression after.charset: CHAR_SYM SETandcharacter_set: CHAR_SYM SET_SYM, position 1: with the synonym key of position 0, the two keywords are the one keyword CHARSET (https://dev.mysql.com/doc/refman/8.4/en/create-table.html: "CHARSET is a synonym for CHARACTER SET"). The character set attribute of a type keeps the two-word form (CharsetForm::CharacterSet), since a cast target is part of the text MySQL names an unaliased select list expression after.
Returns
array<string, list<int>>Test cases 3
public static function synonyms(): array<string, array<int, string>>Answers the key of each synonym position by production signature.
charset: CHAR_SYM SET,character_set: CHAR_SYM SET_SYM: CHARACTER SET is CHARSET (https://dev.mysql.com/doc/refman/8.4/en/create-table.html).key_or_index: KEY_SYM: KEY is a synonym for INDEX (https://dev.mysql.com/doc/refman/8.4/en/create-table.html: "KEY is normally a synonym for INDEX").keys_or_index: KEYS,keys_or_index: INDEX_SYM: SHOW INDEX, SHOW INDEXES and SHOW KEYS are one statement (https://dev.mysql.com/doc/refman/8.4/en/show-index.html).table_or_tables: TABLES:{TABLE | TABLES}(https://dev.mysql.com/doc/refman/8.4/en/lock-tables.html, https://dev.mysql.com/doc/refman/8.4/en/flush.html).not: NOT2_SYM: under HIGH_NOT_PRECEDENCE the lexer reads every NOT as this terminal; outside an expression, as in IF NOT EXISTS and NOT NULL, it is the keyword NOT (https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_high_not_precedence).opt_no_write_to_binlog: LOCAL_SYM: LOCAL is an alias of NO_WRITE_TO_BINLOG (https://dev.mysql.com/doc/refman/8.4/en/analyze-table.html).- the
LOCAL_SYM .alternatives of the scope rules: LOCAL is a synonym of SESSION (https://dev.mysql.com/doc/refman/8.4/en/using-system-variables.html). lvalue_variable: DEFAULT_SYM . ident:DEFAULT.namenames the instancedefaultof a structured system variable (https://dev.mysql.com/doc/refman/8.4/en/structured-system-variables.html).- the BINARY alternatives of the character set and collation name rules: the keyword is the name
binary(https://dev.mysql.com/doc/refman/8.4/en/charset-binary-set.html).
Returns
array<string, array<int, string>>Test cases 3
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
LeafNoiseTest::testPositionsDeclareTheOptionalLeafKeywordsAsNoisecallsLeafNoiseTest::testPositionsNameOnlyTerminalPositionsOfProductionsOfTheGrammarscallsLeafNoiseTest::testSynonymsMergeTheTerminalsTheManualDefinesAsSynonymscallsLeafNoiseTest::testSynonymsNameOnlyTerminalPositionsOfProductionsOfTheGrammarscalls