lbadd
lbadd copied to clipboard
parser: AST validator
The validator should reside in internal/parser/ast/validate
. The tool should provide a validation method for every Statement of the ast. Upon calling, the tool shall validate, if the ast is a valid production of the SQLite grammar. This validation shall go beyond parsing, i.e. validating token values, validating escape sequences inside string literals, checking bounds on numeric literals etc. The highest priority for this tool is a minimalistic API. The second highest priority is performance, as this will be used before compiling.
Most important feature right now:
ast.Validate(*ast.SQLStmt) error
All other methods should be exported too and should have the form ast.ValidateXXX(*ast.XXX) error
.