Hello Richard !

I just looked at it and I have some doubts about the generated parse.sql, as I see it there is this table:

====

CREATE TABLE symbol(
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  isTerminal BOOLEAN NOT NULL,
  fallback INTEGER REFERENCES symbol
);

--and this entries

--...

INSERT INTO symbol(id,name,isTerminal,fallback)VALUES(2,'EXPLAIN',TRUE,59);

--...

INSERT INTO symbol(id,name,isTerminal,fallback)VALUES(185,'explain',FALSE,NULL);

====

Wouldn't it be better to have:

====

CREATE TABLE symbol(
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL COLLATE NOCASE UNIQUE,
  isTerminal BOOLEAN NOT NULL,
  fallback INTEGER REFERENCES symbol
);

--and this entries

--...

INSERT INTO symbol(id,name,isTerminal,fallback)VALUES(2,'EXPLAIN',TRUE,FALSE);

====

This way we can search for any combination of individual letter cases and find a unique match ?

Cheers !

On 28/11/19 23:54, Richard Hipp wrote:
On 11/28/19, Laurent Dhont <dhontlaur...@hotmail.com> wrote:
is there an API to
get this information in a format that is not an image?
By coincidence, I checked in a change two days ago that might be
helpful.  See https://www.sqlite.org/src/timeline?c=4dbd398d640852d4
for the specific check-in.  If you now build SQLite from canonical
sources, the file "parse.sql" will be left in the build directory.
That file contains SQL text that initializes three SQL tables, the
content of which describe the context-free language grammar that
SQLite uses to parse its SQL input.

There is no documentation of this, but if you have some familiarity
with grammars and parsing and tools like Yacc/Bison or Lemon, then you
should be able to figure it out.

To be clear, I do not expect that the parse.sql file is directly
usable by your application in its current form.  But it is a
machine-readable grammar description, that you can perhaps transform
into a useful format using a script.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to