Hi folks. I am attempting to make a private fork of some of the content, with some possible grammar changes. My need is only for the parser and the parse-tree, not the full cockroachdb engine.
When attempting to make grammar changes, my first thought is that I want to be able to reproduce the existing sql.go from sql.y
The sql.go generated file has this content:
// Code generated by goyacc. DO NOT EDIT.
// GENERATED FILE DO NOT EDIT
// Code generated by goyacc -p sql -o sql.go.tmp sql-gen.y. DO NOT EDIT.
So naturally, I attempted:
goyacc -p sql -o sql.go.tmp sql.y
(there is no file sql-gen.y, so of course, I used sql.y). I end up with this error:
sql.y:459:9: unexpected ‘*’, expected identifier
The line number may be off from what you expect, but I looked at the latest sql.y, and it generally has the same problem:
Line 459 is the first place that we see the ‘*’ operator:
// Non-keyword token types.
%token IDENT SCONST BCONST BITCONST
%token <*tree.NumVal> ICONST FCONST
It is failing on the <*tree.NumVal>.
What step am I missing in getting goyacc to work with this? I am invoking goyacc directly from the directory containing these files.
Are there environment variables that I am missing?
Is there something special I need to do to let goyacc be aware of pkg/sql/sem/tree?