# README
parser
goyacc
基于 tidb 的 goyacc 版本:https://github.com/pingcap/parser/releases/tag/v2.1.5
使用
# 编译 goyacc
make goyacc
# 生成 parser.go
make parser
- 修改 parser.y 后请添加对应的测试用例,并保证测试通过
make test
# Packages
Package ast is the abstract syntax tree parsed from a SQL statement by parser.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
GetDBTable get the database name from token.
GetInsertDBTable get the database name from token.
No description provided by the author
New returns a Parser object.
NewScanner returns a new scanner object.
NodeToStringWithoutQuote get node text.
ParseErrorWith returns "You have a syntax error near..." error message compatible with mysql.
ParseSQL only for test, use ClientConn.parser for handling request.
Preview analyzes the beginning of the query using a simpler and faster textual comparison to identify the statement type.
SplitMarginComments pulls out any leading or trailing comments from a raw sql query.
SplitStatementToPieces split raw sql statement that may have multi sql pieces to sql pieces returns the sql pieces blob contains; or error if sql cannot be parsed.
StmtType returns the statement type as a string.
StripLeadingComments trims the SQL string and removes any leading comments.
Tokenize splits a SQL string into tokens.
TrimComment trim comment for special comment code of MySQL.
# Constants
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
These constants are used to identify the SQL statement type.
# Variables
ErrParse returns for sql parse error.
ErrSyntax returns for sql syntax error.
SpecFieldPattern special result field pattern.
No description provided by the author
# Structs
MarginComments holds the leading and trailing comments that surround a query.
Parser represents a parser instance.
Pos represents the position of a token.
Scanner implements the yyLexer interface.
# Type aliases
CommentDirectives is the parsed representation for execution directives conveyed in query comments.