comment(# All of the values below are valid MySQL syntax accoring to) comment(# the Reference Manual:) comment(# http://dev.mysql.com/doc/refman/5.1/en/language-structure.html) comment(# unless stated otherwise.) comment(# strings) reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) reserved(SELECT) string reserved(COLLATE) (latin1_danish_ci)operator(;) reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) comment(# ") reserved(SELECT) stringoperator(;) comment(# ') reserved(SELECT) stringoperator(;) comment(# ") reserved(SELECT) stringoperator(;) comment(# ') reserved(SELECT) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(;) comment(-- ') reserved(SELECT) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(;) comment(-- ") reserved(SELECT) stringoperator(;) reserved(SELECT) stringoperator(;) comment(# numbers) reserved(select) integer(1221)operator(;) reserved(select) integer(0)operator(;) reserved(select) operator(-)integer(32)error(:) reserved(select) float(294.42)error(:) reserved(select) operator(-)float(32032.6809e+10)operator(;) reserved(select) float(148.00)operator(;) reserved(select) float(10e+10)operator(;) reserved(select) float(10e10)operator(;) comment(# hexadecimal) reserved(SELECT) stringoperator(;) reserved(SELECT) hex(0x0a)operator(+)integer(0)operator(;) reserved(SELECT) hex(0x5061756c)operator(;) reserved(SELECT) hex(0x41)operator(,) predefined(CAST)operator(()hex(0x41) reserved(AS) pre_type(UNSIGNED)operator(\))operator(;) reserved(SELECT) pre_type(HEX)operator(()stringoperator(\))operator(;) reserved(SELECT) hex(0x636174)operator(;) reserved(insert) reserved(into) (t) operator(()(md5)operator(\)) reserved(values) operator(()hex(0xad65)operator(\))operator(;) reserved(SELECT) operator(*) reserved(FROM) (SomeTable) reserved(WHERE) (BinaryColumn) operator(=) predefined(CAST)operator(() string reserved(AS) pre_type(BINARY) operator(\))operator(;) reserved(select) stringoperator(,) stringoperator(;) reserved(SELECT) pre_constant(TRUE)operator(,) pre_constant(true)operator(,) pre_constant(FALSE)operator(,) pre_constant(false)operator(;) reserved(SELECT) pre_constant(NULL)operator(,) pre_constant(null)operator(,) pre_constant(nuLL)operator(,) error(\\)(N)operator(;) reserved(SELECT) error(\\)(n)operator(;) comment(# invalid!) comment(# bit-field) reserved(CREATE) reserved(TABLE) (t) operator(()(b) pre_type(BIT)operator(()integer(8)operator(\))operator(\))operator(;) reserved(INSERT) reserved(INTO) (t) reserved(SET) (b) operator(=) stringoperator(;) reserved(INSERT) reserved(INTO) (t) reserved(SET) (b) operator(=) stringoperator(;) reserved(INSERT) reserved(INTO) (t) reserved(SET) (b) operator(=) stringoperator(;) reserved(SELECT) (b)operator(+)integer(0)operator(,) pre_type(BIN)operator(()(b)operator(+)integer(0)operator(\))operator(,) pre_type(OCT)operator(()(b)operator(+)integer(0)operator(\))operator(,) pre_type(HEX)operator(()(b)operator(+)integer(0)operator(\)) reserved(FROM) (t)operator(;) reserved(SET) variable(@v1) operator(=) stringoperator(;) reserved(SET) variable(@v2) operator(=) predefined(CAST)operator(()string reserved(AS) pre_type(UNSIGNED)operator(\))operator(,) variable(@v3) operator(=) stringoperator(+)integer(0)operator(;) reserved(SELECT) variable(@v1)operator(,) variable(@v2)operator(,) variable(@v3)operator(;) reserved(INSERT) reserved(INTO) (my_table) operator(()(phone)operator(\)) reserved(VALUES) operator(()pre_constant(NULL)operator(\))operator(;) reserved(INSERT) reserved(INTO) (my_table) operator(()(phone)operator(\)) reserved(VALUES) operator(()stringoperator(\))operator(;) comment(# schema object names) reserved(SELECT) operator(*) reserved(FROM) string reserved(WHERE) stringoperator(.)(id) operator(>) integer(100)operator(;) reserved(CREATE) reserved(TABLE) string operator(()string pre_type(INT)operator(\))operator(;) reserved(SELECT) integer(1) reserved(AS) stringoperator(,) integer(2) reserved(AS) stringoperator(;) reserved(select) (foo) reserved(from) (foo)operator(;) reserved(select) string reserved(from) (foo)operator(;) reserved(select) (foo)operator(.)(bar) reserved(from) (foo)operator(;) reserved(select) stringoperator(.)(bar) reserved(from) (foo)operator(;) reserved(select) (foo)operator(.)string reserved(from) (foo)operator(;) reserved(select) string reserved(from) (foo)operator(;) reserved(select) stringoperator(.)string reserved(from) (foo)operator(;) comment(# How to handle ANSI_QUOTES?) reserved(CREATE) reserved(TABLE) string operator(()(col) pre_type(INT)operator(\))operator(;) reserved(SET) (sql_mode)operator(=)stringoperator(;) reserved(CREATE) reserved(TABLE) string operator(()(col) pre_type(INT)operator(\))operator(;) comment(# identifiers) reserved(SELECT) operator(*) reserved(FROM) (my_table) reserved(WHERE) (MY_TABLE)operator(.)(col)operator(=)integer(1)operator(;) reserved(SHOW) reserved(COLUMNS) reserved(FROM) stringoperator(;) comment(# Function Name Parsing and Resolution) reserved(SELECT) predefined(COUNT)operator(()operator(*)operator(\)) reserved(FROM) (mytable)operator(;) comment(-- the first reference to count is a function call) reserved(CREATE) reserved(TABLE) predefined(count) operator(()(i) pre_type(INT)operator(\))operator(;) comment(-- whereas the second reference is a table name) reserved(CREATE) reserved(TABLE) stringoperator(()(i) pre_type(INT)operator(\))operator(;) comment(-- this too) reserved(CREATE) reserved(TABLE) string operator(()(i) pre_type(INT)operator(\))operator(;) comment(-- this too) comment(# IGNORE_SPACE) reserved(SELECT) predefined(COUNT)operator(()operator(*)operator(\)) reserved(FROM) (mytable)operator(;) reserved(SELECT) predefined(COUNT) operator(()operator(*)operator(\)) reserved(FROM) (mytable)operator(;) comment(# reserved words) reserved(CREATE) reserved(TABLE) (interval) operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- errror) reserved(CREATE) reserved(TABLE) string operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- valid) reserved(CREATE) reserved(TABLE) (mydb)operator(.)(interval) operator(()reserved(begin) pre_type(INT)operator(,) reserved(end) pre_type(INT)operator(\))operator(;) comment(-- valid) reserved(SELECT) stringoperator(,) string reserved(FROM) string reserved(WHERE) string operator(=) stringoperator(;) comment(-- valid)