Dear Richard,

This has been very helpful, I have the parse.sql file. I feel very flattered that you took the time to answer my question. My boss says you are the one that should win a nobel prize.

This has been much appreciated!!


I completely understand if you won't answer anymore but I can try.

From what I can understand:

 * the symbol table lists all keywords that can be typed in a query
   where [isTerminal] = 1.
 * The other rows where [isTerminal] = 0 are some kind of
   commands/placeholders. This I do not really know.
 * There is never a direct connection from an [isTerminal] = 1 row to
   an [isTerminal] = 0 row.
 * I think but I am not sure that [pos] means position. But maybe I am
   wrong because if I look at for example the FROM keyword I see [pos]
   = 0 with lowwercase 'from' and from what I understand you cannot use
   the FROM keyword in the first position.


Could you perhaps explain what pos means and what the [isTerminal] = 0 rows mean.

If you have not time for these things I completely understand, thanks anyway!


Laurent

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.  Seehttps://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