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) ident(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) ident(t) operator(()ident(md5)operator(\)) reserved(values) operator(()hex(0xad65)operator(\))operator(;) reserved(SELECT) operator(*) reserved(FROM) ident(SomeTable) reserved(WHERE) ident(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(\\)ident(N)operator(;) reserved(SELECT) error(\\)ident(n)operator(;) comment(# invalid!) comment(# bit-field) reserved(CREATE) reserved(TABLE) ident(t) operator(()ident(b) pre_type(BIT)operator(()integer(8)operator(\))operator(\))operator(;) reserved(INSERT) reserved(INTO) ident(t) reserved(SET) ident(b) operator(=) stringoperator(;) reserved(INSERT) reserved(INTO) ident(t) reserved(SET) ident(b) operator(=) stringoperator(;) reserved(INSERT) reserved(INTO) ident(t) reserved(SET) ident(b) operator(=) stringoperator(;) reserved(SELECT) ident(b)operator(+)integer(0)operator(,) pre_type(BIN)operator(()ident(b)operator(+)integer(0)operator(\))operator(,) pre_type(OCT)operator(()ident(b)operator(+)integer(0)operator(\))operator(,) pre_type(HEX)operator(()ident(b)operator(+)integer(0)operator(\)) reserved(FROM) ident(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) ident(my_table) operator(()ident(phone)operator(\)) reserved(VALUES) operator(()pre_constant(NULL)operator(\))operator(;) reserved(INSERT) reserved(INTO) ident(my_table) operator(()ident(phone)operator(\)) reserved(VALUES) operator(()stringoperator(\))operator(;) comment(# schema object names) reserved(SELECT) operator(*) reserved(FROM) string reserved(WHERE) stringoperator(.)ident(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) ident(foo) reserved(from) ident(foo)operator(;) reserved(select) string reserved(from) ident(foo)operator(;) reserved(select) ident(foo)operator(.)ident(bar) reserved(from) ident(foo)operator(;) reserved(select) stringoperator(.)ident(bar) reserved(from) ident(foo)operator(;) reserved(select) ident(foo)operator(.)string reserved(from) ident(foo)operator(;) reserved(select) string reserved(from) ident(foo)operator(;) reserved(select) stringoperator(.)string reserved(from) ident(foo)operator(;) comment(# How to handle ANSI_QUOTES?) reserved(CREATE) reserved(TABLE) string operator(()ident(col) pre_type(INT)operator(\))operator(;) reserved(SET) ident(sql_mode)operator(=)stringoperator(;) reserved(CREATE) reserved(TABLE) string operator(()ident(col) pre_type(INT)operator(\))operator(;) comment(# identifiers) reserved(SELECT) operator(*) reserved(FROM) ident(my_table) reserved(WHERE) ident(MY_TABLE)operator(.)ident(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) ident(mytable)operator(;) comment(-- the first reference to count is a function call) reserved(CREATE) reserved(TABLE) predefined(count) operator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- whereas the second reference is a table name) reserved(CREATE) reserved(TABLE) stringoperator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- this too) reserved(CREATE) reserved(TABLE) string operator(()ident(i) pre_type(INT)operator(\))operator(;) comment(-- this too) comment(# IGNORE_SPACE) reserved(SELECT) predefined(COUNT)operator(()operator(*)operator(\)) reserved(FROM) ident(mytable)operator(;) reserved(SELECT) predefined(COUNT) operator(()operator(*)operator(\)) reserved(FROM) ident(mytable)operator(;) comment(# reserved words) reserved(CREATE) reserved(TABLE) ident(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) ident(mydb)operator(.)ident(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)