feat/schema: add ast and test

This commit is contained in:
mae
2026-01-27 21:57:38 -06:00
parent 5f9467e851
commit 1fd09335cd
9 changed files with 198 additions and 492 deletions

View File

@@ -1,2 +1,18 @@
//go:generate gocc -a azschema.bnf
package schema
import (
"azalea/schema/ast"
"azalea/schema/lexer"
"azalea/schema/parser"
)
func CreateSchema(in string) (schema ast.Schema, err error) {
s := lexer.NewLexer([]byte(in))
p := parser.NewParser()
a, err := p.Parse(s)
if err == nil {
schema = ast.Schema(a.(ast.ExprList))
}
return
}