drh
51b3b402c4
Revert Lemon so that it only shows -D options that are actually used. Though
...
the change to display the options in sorted order is retained.
FossilOrigin-Name: e54eb217c9508c19aee085b111a1323c9009f014ba4db6019918e27002c4ca8c
2024-06-19 18:54:04 +00:00
drh
8cf7bd5448
In lemon, show all the -D options in the generated header, even if none of them
...
are used.
FossilOrigin-Name: 2aa009c38bb207ac59b9bbd6f8e0d7315697b3fd6a01f9431f29a3c7ccad53e7
2024-06-19 18:46:44 +00:00
drh
199f091a95
Enhance lemon.c so that when it shows the compile-time options in the header
...
comment of the generated output file, it shows all options, even those not
used, and it shows them in sorted order.
FossilOrigin-Name: eed76e6698eabe47c6bf9696599ce1c2f7aa428cf60f39d0566fbd0d1f6c4c62
2024-06-19 16:38:17 +00:00
drh
825596481f
Fix (totally harmless) memory leaks in Lemon to avoid warnings during ASAN
...
builds.
FossilOrigin-Name: ce009205a8edc02b7d45ac01bd0e692c3d2c3ffeadb68e4f1bad20c39075e692
2024-03-15 17:04:55 +00:00
mistachkin
3ab9c021ff
Fix harmless compiler warnings seen with MSVC.
...
FossilOrigin-Name: e52c87420b072fa68d921eda66069542d50accbfaf1110ac4cc1543a4162200d
2024-02-04 04:01:11 +00:00
drh
7659ce22c5
Optimizations to ParseFinalize() to make up for the extra cleanup associated
...
with the allocated parser stack. This branch now runs faster than trunk
and is less than 300 bytes larger.
FossilOrigin-Name: f7290db63cc2568090c14dffc4ea4eadfacb5b94b50a1852ef6eefd9e2e32533
2024-01-27 02:21:25 +00:00
drh
82bf13796a
Experimental changes that prevent parser stack overflows by growing the
...
parser stack with heap memory when it reaches its limit.
FossilOrigin-Name: 3fd062905fc20507b7cfc97fa976ac5b57c5b68926bf9136bd5ea4265d2d6528
2024-01-26 20:34:48 +00:00
drh
4fa5952090
Enhance Lemon so that it remembers which -D command-line options are actually
...
used in the grammar and includes a list of all such options in the header
of the generated output file.
FossilOrigin-Name: c47a4dbd24b8277c57b7a83a8c0aeac2bc8f6ab75d1b65ba5e1fa83d1868d95f
2023-06-08 12:52:28 +00:00
drh
db08a6d13c
Fix the parsing of C-style comments in Lemon, as reported by
...
[forum:/forumpost/b6edc69548|forum post b6edc69548]. This has no affect
on SQLite itself.
FossilOrigin-Name: 201569e09b000919ccb463bd581fb2ecd5320e7f584fdb1bc2aaba111061d5c3
2022-04-07 14:13:32 +00:00
drh
ddbb3cb5ec
Remove code from lemon.c that was made superfluous by
...
[1b22b42e59793af1|check-in 1b22b42e59793af1] in late 2017.
FossilOrigin-Name: 6d2f95a474a0c196f36317d88557bfb449ce125c1d012fc1844378c450697a05
2022-01-14 23:28:11 +00:00
drh
1076130a5d
Fix harmless static analyzer warnings in auxiliary build tools, mkkeywordhash.c
...
and lemon.c. No changes to the SQLite core.
FossilOrigin-Name: f2f279b2cc1c8b3b162058c33956be4037cd519715ac0c4290f10c58d2528f0a
2021-10-04 16:14:51 +00:00
drh
6d77a2948e
Patch lemon to fix "error" token handling, according ot
...
[forum:/forumpost/e680f42f53090061|forum post e680f42f53090061].
FossilOrigin-Name: 106b5e5355a3836a9756333e6dcbb13f0878a5352dab00973b8f0900879bd724
2021-08-27 11:26:37 +00:00
drh
9cffb0ffb9
Document the "%token" directive for Lemon. This directive has been in place
...
for a while, but was previously undocumented.
FossilOrigin-Name: 36624d3740a8d095eee061bcc5037deabddb88a53444ec1a956a8af7684efa43
2021-03-28 20:44:01 +00:00
drh
c2dbf35f49
Fix harmless typos in comments per
...
[forum:/forumpost/7849e58dd5|forum post 7849e58dd5]
FossilOrigin-Name: d1e22e2f76cce7eb9f9029646176daef2d9e41c7bb1d3e1da182fbdd0096605c
2021-01-07 16:10:14 +00:00
mistachkin
273ee15121
Fix harmless compiler warning seen with MSVC.
...
FossilOrigin-Name: 4591ee03d7a1ef3f0f6ad0629493fdb7a1c0ddb3277a9e87aa244cb0ca770593
2020-09-21 20:18:44 +00:00
drh
79d9af960b
Attempt to silence harmless static analyzer warnings in Lemon and in the
...
Lemon-generated parser.
FossilOrigin-Name: de8ce22a46c90afa5475cd24c28b7a82b26410dc72d662af2f9d9e5e528e0eec
2020-09-20 12:10:28 +00:00
drh
18ef40e563
Fix harmless compiler warnings in Lemon.
...
FossilOrigin-Name: 6c94ba4b1c16b676978808dcb24f63c2f22915af5dcfe9f635c037011affcf4b
2020-09-16 16:55:56 +00:00
drh
2b75d3beb0
Fix a bug in Fossil that might cause it to crash if there is
...
a multi-terminal token with a space following the "|" separator.
This does not affect SQLite.
FossilOrigin-Name: 430c5d1da57af452f236cc862139d84ab97b6020f6d327dae5268c58e6e83a87
2020-09-05 06:21:54 +00:00
mistachkin
52cfe0312a
Fix harmless compiler warning.
...
FossilOrigin-Name: a711e8cd2c7b64e06241736ecef478ac64ddbe7b58e0933b6febba63f7fb06e1
2020-09-01 19:02:52 +00:00
drh
512aa78ca2
In the Lemon output, add a prefix comment that explains that the output file
...
is automatically generated and shows the name of the source file.
FossilOrigin-Name: d34caf3bb63d0512ea116a8c8c8343b76aa39441bd4b3e98231747a705b91d54
2020-09-01 12:26:55 +00:00
drh
60c71b02ca
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
2020-09-01 11:20:03 +00:00
drh
0a34cf551c
In lemon, add "%if" and "%else" and allow boolean expressions as the
...
argument to "%if", "%ifdef", and "%ifndef".
FossilOrigin-Name: 951d22b72f80de9e23df645abcc3d88ca1a275b46ea23b84152ef48716922b37
2020-07-03 15:41:08 +00:00
drh
59c5679691
Fix incorrect SQL generated by the Lemon change of the previous check-in.
...
FossilOrigin-Name: fccfb8a9ed3c1df9f23762bb8df6fdf36a21118899e3fae41f451169a5f2c08e
2019-12-19 13:17:07 +00:00
drh
3e5f7fef33
Modify the parse.sql output file from Lemon so that the RULE table contains
...
a column with the complete text of the rule.
FossilOrigin-Name: 329cbb372d4d77f774f01a87d104c40ef42d713afbe76195b65f5ca205c5ea7b
2019-12-19 12:29:31 +00:00
drh
3ecc05bc3f
Fix goofy string formatting in lemon.c that dates from the K&R-C days.
...
FossilOrigin-Name: 48ba5e5a2227257cebafacbb09e9dd91d9b89ab2d52a8b4e4113c1d017d95f41
2019-12-12 00:20:40 +00:00
drh
ce678c297b
Improved tracing output from the LEMON-generated parser.
...
FossilOrigin-Name: 4d6d2fc046d586a1e5989bbb2757f13d0371fbfad0acf45a0e2fd77dffd8d8f9
2019-12-11 18:53:51 +00:00
drh
e94006eb42
Enhance LEMON to provide the ability to mark a rules as one that will never
...
reduce due to intervention of actions. Use this new capability to designate
the EXPLAIN rule as NEVER-REDUCES.
FossilOrigin-Name: 136cdefb2f7b582ff1771ac7f9e733dc24c357605526cbfb1834937697c8a922
2019-12-10 20:41:48 +00:00
drh
61cb4ed7f1
Add comments in the parse.sql file to help demonstrate how rules are
...
encoded.
FossilOrigin-Name: 2c4f714892327a1a9a303267b1f9685e310cca5dcea9c61287d95e26291b0506
2019-11-29 13:01:57 +00:00
drh
1417c2f77f
Fix the parse.sql output file so that it is readable into a database where
...
foreign keys are enforced.
FossilOrigin-Name: 3a82c554c3bde4640df6865686f8f70e2c1e07c581fed4772b6b0a8ec1b10bb6
2019-11-29 12:51:00 +00:00
drh
fe03dac236
Add the new -S option to the lemon parser generator to cause it to output
...
SQL that describes the input grammar.
FossilOrigin-Name: 4dbd398d640852d4a696d68c72ee039968023d402a8053b5e6b4ef1d75e982a8
2019-11-26 02:22:39 +00:00
mistachkin
acf6e08d20
Fix typo for one instance of line number handling in the Lemon tool.
...
FossilOrigin-Name: 980be1730dc1239c63a107923bf2e32b4ec7d4bc31b9190e711cc35f18cc2bb4
2019-09-11 15:25:26 +00:00
drh
010bdb4c79
Further improvements to parser speed by enlarging lookup tables to eliminate
...
the need to do range checking on the index prior to lookup.
FossilOrigin-Name: 47d3e091ae49eb7947af5abef9b5b96b16b86d349e51fe0677795649be6db473
2019-08-28 11:31:11 +00:00
drh
2e51716b15
Increase the size of the yy_lookahead table so that it is never necessary to
...
down bounds checking on the index.
FossilOrigin-Name: bafd872398e58766e996963372c7acc03a1e20a6d39a3867ca45d3ea0ed2ac1d
2019-08-28 02:09:47 +00:00
mistachkin
17df761a84
Fix harmless compiler warning in lemon.
...
FossilOrigin-Name: 2da0eea02d128c37f2fbe764227ac526d3e993284516544adc0a216a035c5676
2019-06-03 15:09:25 +00:00
mistachkin
d9bc6e8973
Fix some harmless compiler warnings.
...
FossilOrigin-Name: ca068d82387fc3cda9d2050cedb4f9c61b6d9dc54f89015b4b2ee492243ed5c9
2019-05-10 16:16:19 +00:00
drh
f135cb7d7f
Fix an error message in the Lemon parser generator.
...
FossilOrigin-Name: b6d7d42b7426622a26b67809cd1f21285fea120aa1897377b9946840463b41f1
2019-04-30 14:26:31 +00:00
drh
e2dcc42e1f
Fix a harmless memory leak in the Lemon parser generator utility program.
...
FossilOrigin-Name: 1caff0fb0b2051e205e7a8cfd5dadf92680c52a88a441ded95b1ea6542db5f83
2019-01-15 14:44:23 +00:00
drh
cfc45b1021
Reduce the size of the parser tables generated by Lemon by splitting the
...
yyRuleInfo structure into separate yyRuleInfoLhs and yyRuleInfoNRhs arrays.
FossilOrigin-Name: 70fe8ec2ae3099b8773834c7ac2e56768addbecd57956ac523e71a7dc264049c
2018-12-03 23:57:27 +00:00
mistachkin
c93c614543
Add a missing call to free() in Lemon.
...
FossilOrigin-Name: 8b4cf33aafe09d9009119dcbd464b54be9605af5701002ee458819efa6e2e1f9
2018-09-08 16:55:18 +00:00
drh
539e741e50
Enhance LEMON to track which symbols actually carry semantic content.
...
Output the list of symbols that do not carry content at the end of the
report, but do not (yet) do anything else with the information.
FossilOrigin-Name: dcf2bafc159179859b91ffea3a4ebd70b5ca6de9e1d515eaf9afde8cfff26c6c
2018-04-21 20:24:19 +00:00
drh
fb32c44e41
Add the %extra_context directive to lemon, as an alternative to %extra_argument.
...
Use this to improve the performance of the parser.
FossilOrigin-Name: be47a6f5262a43f477700579512fe7112a0872faedcbbe5c3383d13a08af6440
2018-04-21 13:51:42 +00:00
drh
9f88e6d861
Add the -dDIRECTORY command-line option to LEMON.
...
FossilOrigin-Name: 9cd20475ff3b2ca1a58e441194c921780d25bdb9b9c744a6b4541b888194efb8
2018-04-20 20:47:49 +00:00
drh
ed0c15b52e
Lemon enhancements: (1) Do not allocate space for the 'error' non-terminal
...
if it is not used. (2) Fix an off-by-one problem so that 'unsigned char' can
be used for symbol numbers if the number of symbols is 256.
FossilOrigin-Name: 3b7801acff91905d0e78e06121ebcf2664f6de5f605699dc8726ec9bcb558eb8
2018-04-16 14:31:34 +00:00
drh
12f6839380
Enhance LEMON to show precendence of symbols and all rules in the report
...
that is generated in parallel to the parser.
FossilOrigin-Name: 602fbd8149b53d8f0e9a223cc1aec912e7df03fca35071e8d707776ce225371c
2018-04-06 19:12:55 +00:00
drh
4396c61959
In LEMON, fix an off-by-one error that can make the lookahead table one
...
byte too smal.
FossilOrigin-Name: 93792bc58a2eccc7e07b14307388350bb376db32c5055b79a44e4fa8ff91d58e
2017-12-27 15:21:16 +00:00
drh
0d9de99c5c
Add support for measuring and reporting coverage of the parser state machine
...
using the SQLITE_TESTCTRL_PARSER_COVERAGE test-control.
FossilOrigin-Name: 1253a872dbf48656d4efd588ab61223a5ac550d9b2b932249d6ba585276ba573
2017-12-26 18:04:23 +00:00
drh
3a9d6c7156
Enhance LEMON so that it generates the action table in such a way that no
...
range check is needed on the lookahead table to verify that the next input
token is valid. This makes the lookahead table slightly larger (about 120
bytes) but helps the parser to run faster.
FossilOrigin-Name: 7eb0198d0102e97e4b7ad9e359d95985e55e09c510ea4b360265ac8feb9ed814
2017-12-25 04:15:38 +00:00
drh
5c8241b875
In the LEMON-generated parser, rearrange the meanings of integer action codes
...
so that reduce actions occur last. This means that the most common case
(reduce actions) can be recognized with a single comparison operation, thus
speeding up the main parser loop, slightly.
FossilOrigin-Name: 7bfe7a360261ac7227840db49487c2f0fe338a2f1b868fcaada1e04a8d2b8f7a
2017-12-24 23:38:10 +00:00
drh
59c435a015
Add the "%token" control to the lemon parser. Not currently used by SQLite.
...
FossilOrigin-Name: a6e4c5ae8f29bc2e7f2088426341254e9281d19db9dc9a14abc376d56dad4c4b
2017-08-02 03:21:11 +00:00
drh
6be95366c7
In the lemon-generated parser, store the number of symbols on the RHS of each
...
rule as a negative number and add it to the stack pointer, rather than storing
the value as a positive and subtracting it. This makes the parser faster.
FossilOrigin-Name: b362f0d8ed34839bf3b29d10ed0853ab94245fba135ccd28e619caa6ee6992d5
2017-06-28 13:47:56 +00:00