Vitess houses its own SQL parser that is used to parse the queries users send us both at Vtgate and Vttablet. The output of the parser is stored in a Abstract Syntax Tree which is used for further processing by the planner.
The code for the Abstract Syntax Tree lives in the file ast.go. The formatting functions for these structs live in the file ast_format.go. Any additional functions for the AST structs reside in the file ast_funcs.go.
Vitess also uses some generated code for creating functions used to clone the AST, compare its equality etc. If any change is made to any of the AST structs or their formatting functions, then the following command should be run in the root Vitess directory to update all the generated files.