Lemon updates: (1) include the #defines for all tokens in the generated C

file, so that the C-file can be stand-alone.  (2) If the grammar begins with
a %include {...} directive on line one, make that directive the header for
the generated C file.  (3) Enhance the lemon.html documentation.

FossilOrigin-Name: 84d54eb35716174195ee7e5ac846f47308e5dbb0056e8ff568daa133860bab74
This commit is contained in:
drh
2020-09-01 11:20:03 +00:00
parent fa17e134b2
commit 60c71b02ca
6 changed files with 270 additions and 76 deletions
+11 -5
View File
@@ -1,5 +1,6 @@
%include {
/*
** 2001 September 15
** 2001-09-15
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
@@ -9,11 +10,16 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains SQLite's grammar for SQL. Process this file
** using the lemon parser generator to generate C code that runs
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
** This file contains SQLite's SQL parser.
**
** The canonical source code to this file ("parse.y") is a Lemon grammar
** file that specifies the input grammar and actions to take while parsing.
** That input file is processed by Lemon to generate a C-language
** implementation of a parser for the given grammer. You might be reading
** this comment as part of the translated C-code. Edits should be made
** to the original parse.y sources.
*/
}
// All token codes are small integers with #defines that begin with "TK_"
%token_prefix TK_