Commit Graph

42 Commits

Author SHA1 Message Date
Jaap Keuter 27acec97e9 Lemon: import fresh lemon from upstream
- get latest lemon from upstream (SQLite)
- update and apply the patches
- introduce CC0-1.0 license indication
- update documentation
2020-12-04 08:32:58 +00:00
Peter Wu 7ce9081fdc lemon: sync with upstream (2018-09-08)
Changes:
- Drop the old basename modification that was present in the Wireshark
  version of lemon.c. Use a new option available since 2018-04-20
  ("Add the -dDIRECTORY command-line option to LEMON.")
- Redo the static analyzer warning fixes, identifying the root causes
  and adding assertions instead of hiding code with __clang_analyzer__.
- Ignore compiler warnings instead of adding config.h, _U_, extra const
  keywords, unsigned/signed changes, etc.
- Remove lemon.html, it is out-of-date and external links are available.

In order to make future updates easier, document the exact steps that
were followed to create the lemon.c and lempar.c files. Future changes
SHOULD follow the same process.

My process to reach this updated lemon version:
1. Identify previous sync. Found v2.5.2rc0-147-g653af0f6d0 ("lemon: Sync
   with latest trunk.") which seems based on sqlite commit 2b3d584ffe.
2. Check successive Wireshark patches. Identified many non-functional
   changes to silence compiler warnings and static analyzer issues.
   Found one feature (basename) that can be replaced with upstream -d.
3. Write minimal patches and document changes.

Upstream typos and coding style issues (other than trailing whitespace)
were deliberately not fixed to remain as close as possible to upstream.

Change-Id: I606f46dede86e34520f962a9e7163912392aad57
Reviewed-on: https://code.wireshark.org/review/30290
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-21 07:00:05 +00:00
Anders 653af0f6d0 lemon: Sync with latest trunk.
Change-Id: Iab0d64f675b482eee97b300d419ffa1e8090632e
Reviewed-on: https://code.wireshark.org/review/26676
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-28 16:20:24 +00:00
Anders 85a0646490 lemon: Sync with upstream, Jun 28, 2017
Change-Id: I4c6dbd018302fdf176e955e0e5e735a7aee22b10
Reviewed-on: https://code.wireshark.org/review/26669
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-28 07:10:47 +00:00
Alexis La Goutte 905e0c08ee lempar: set ParseInit/ParseFinalize static
grammar.c:471:6: warning: no previous prototype for ‘DfilterInit’ [-Wmissing-prototypes]
grammar.c:646:6: warning: no previous prototype for ‘DfilterFinalize’ [-Wmissing-prototypes]
dtd_grammar.c:502:6: warning: no previous prototype for ‘DtdParseInit’ [-Wmissing-prototypes]
dtd_grammar.c:637:6: warning: no previous prototype for ‘DtdParseFinalize’ [-Wmissing-prototypes]

Change-Id: I9c43fb4d5ad50992e8e55163333793b20319aa74
Reviewed-on: https://code.wireshark.org/review/21516
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05 21:42:28 +00:00
Guy Harris c2386c5b01 Update to the current lempar.c in the SQLite repository.
Change-Id: I86ca187a7c698541d70bab558c4073fdff28dea3
Reviewed-on: https://code.wireshark.org/review/21108
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15 07:47:42 +00:00
Alexis La Goutte 60551ea55a Lemon: resync with upstream
lemon: Tue Aug 16 16:46:40 2016
lempar: Tue Dec 6 17:59:05 2016 +0000

a copy of all Wireshark changes are available https://github.com/alagoutte/sqlite/tree/wireshark

Change-Id: I144d0f983e4ac960b5a7a2fd8cd379f6282579f8
Reviewed-on: https://code.wireshark.org/review/15987
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-24 19:35:59 +00:00
Guy Harris 43d595ec39 Fix another warning on 64-bit platforms.
Change-Id: I5cdf55cdaef048d9d564a5fca39027dae3b78bab
Reviewed-on: https://code.wireshark.org/review/13242
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-12 20:29:44 +00:00
Alexis La Goutte 9a09f36807 Lemon: resync with upstream
lemon: Thu Oct 29 13:48:15 2015
lempar: Tue Nov 10 14:51:22 2015

a copy of all Wireshark changes are available https://github.com/alagoutte/sqlite/tree/wireshark

Change-Id: I51f8b40a7087362502f6ce2156820a9f107ddf15
Reviewed-on: https://code.wireshark.org/review/13033
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-12 05:42:57 +00:00
Alexis La Goutte 9d8b810127 Lemon: Update lemon tools
Update from SQLite trunk (19 April 2015)

Add include <config.h>

Fix warning: unused parameter 'argc' [-Wunused-parameter] (using _U_)

Fix implicit conversion loses integer precision

Fix comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

Fix function declaration isn’t a prototype [-Wstrict-prototypes]

Fix warning: old-style function definition [-Wold-style-definition]

Fix trailing whitespace

Fix use -T for template for epan\Makefile.nmake, epan\dfilter\Makefile.nmake, plugins\mate\Makefile.nmake, plugins\tpg\Makefile.nmake and cmake/modules/UseLemon.cmake

Fix -Wmissing-prototypes Remove unused function (acttab_free)

Add basename the filename with only filename (no path...)

Fix lemon.c:3435: warning: implicit conversion shortens 64-bit value into a 32-bit value

Add "new" version of lempar.c (3 November 2009).

LEMPAR: fix trailing whitespace

LEMPAR: fix -Wunused-parameter

Change-Id: I2df7e39c9a6846de26743a981fb76aca423fe813
Reviewed-on: https://code.wireshark.org/review/6502
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-02 08:49:02 +00:00
Dario Lombardo 63ebe918d9 Removed duplicated #include lines
Change-Id: I9cafa3cd5c74121168777d8c656e7e94e89efd3c
Reviewed-on: https://code.wireshark.org/review/6065
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-28 00:02:39 +00:00
Alexis La Goutte 09cd306d1c Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\* \$Id\$/,+1 d') (no space before star)

Change-Id: I318968db2b8512ba1303b5fc5c624c66441658f0
Reviewed-on: https://code.wireshark.org/review/879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:30:52 +00:00
Evan Huus 2322bd3122 Fix lemon FSF address and add license exception for the generated mate grammar
files. One of them has no license (it is just defines) and the other gets picked
up as LGPL for no reason I can discern.

svn path=/trunk/; revision=52675
2013-10-18 18:10:46 +00:00
Chris Maynard fdead4df94 Fix Coverity CID 660 (Negative array index read) by holding off the assignment to yytos until after we check that pParser->yyidx is non-negative.
See also: http://cwe.mitre.org/data/definitions/129.html
#BACKPORT(1.10)

svn path=/trunk/; revision=50336
2013-07-03 02:28:26 +00:00
Gerald Combs c0702583d3 Make the minimum supported GLib version 2.16.
svn path=/trunk/; revision=49444
2013-05-20 17:27:05 +00:00
Anders Broman 3dc702e2a8 Align a bit more with upstream.
svn path=/trunk/; revision=48559
2013-03-26 05:36:27 +00:00
Anders Broman f20eeffb18 Align lempar somewhat with upstream.
svn path=/trunk/; revision=48071
2013-03-04 22:04:58 +00:00
Chris Maynard c236db55fe Don't use pParser->yyidx as an index into pParser->yystack[] until after it is
verified that it is non-negative.  Should resolve CID 619.

svn path=/trunk/; revision=36431
2011-04-01 16:55:59 +00:00
Stig Bjørlykke 7678317238 Move declaration of yymx.
svn path=/trunk/; revision=28660
2009-06-08 11:54:38 +00:00
Anders Broman 27111e59f3 Update to sqlite lemon.c 1.60 and lempar.c 1.36
svn path=/trunk/; revision=25858
2008-07-29 12:40:03 +00:00
Guy Harris 9fb914942a Suppress some unused-argument warnings.
svn path=/trunk/; revision=25422
2008-06-04 00:35:30 +00:00
Anders Broman 25b308442d Update Lemon to v1.54 and lempar to v 1.31 from sqlite http://www.sqlite.org/cvstrac/dir?d=sqlite/tool
svn path=/trunk/; revision=24845
2008-04-08 09:54:19 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Jaap Keuter 098d297303 Running glib 2.16 on 32 bit platform requires this lempar.c change in addition to revision 24710.
Makefiles updated to make new lempar.c effective in build rules.

svn path=/trunk/; revision=24718
2008-03-23 08:58:52 +00:00
Ulf Lamping 3dfa722849 fix warnings of (generated) grammar.c
svn path=/trunk/; revision=21146
2007-03-23 03:45:18 +00:00
Luis Ontanon 0006c73c8d squelch a warning generated by generated code
svn path=/trunk/; revision=21134
2007-03-22 23:39:02 +00:00
Anders Broman a0b76c2fa2 Update to the latest versions from sqlite.
svn path=/trunk/; revision=19932
2006-11-19 16:24:18 +00:00
Anders Broman 903a75ff72 Update lempar to sqlittes version 1.18
http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lempar.c

svn path=/trunk/; revision=18815
2006-08-01 21:29:05 +00:00
Anders Broman b5f2bdac77 Upadates to squlite:s lemon 1.36
svn path=/trunk/; revision=17691
2006-03-21 18:56:34 +00:00
Anders Broman bc7e69cc09 Try again, this should take us to lemon version 1.16 http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c
svn path=/trunk/; revision=17683
2006-03-20 19:40:09 +00:00
Anders Broman 17cee445d7 Back out the previous changes (:
svn path=/trunk/; revision=17680
2006-03-20 08:16:03 +00:00
Anders Broman 4edc146c8d Insert the code from sqlite http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c:
2002-Mar-10 21:21    1.11    Check-in [425] : Bug fix: updates within a transaction would fail if there was existed a temporary table. By drh. (diff)  
2002-Mar-03 02:49    1.10    Check-in [411] : Bug fixes and additional tests for the subquery flattener. By drh. (diff)  

svn path=/trunk/; revision=17679
2006-03-20 06:41:08 +00:00
Anders Broman 5d20a3ba36 Sqlite lemon 1.8 ( 1.7 Make lemon 64-bit clean skipped) :
Bugfix Check-in [388] : Bug fix in lemon: 3-way conflicts (SHIFT/REDUCE/REDUCE) were not detected or resolved. This is now fixed. Also, table compression works a little better. By drh. (diff) 

http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lemon.c 


svn path=/trunk/; revision=17668
2006-03-19 13:59:44 +00:00
Anders Broman 94d4d822da Align lemon/lempar.c with Squlite ver 1.2 http://www.sqlite.org/cvstrac/rlog?f=sqlite/tool/lempar.c
svn path=/trunk/; revision=17666
2006-03-19 08:54:00 +00:00
Jörg Mayer cee545d958 Albert Chin:
"config.h" should always be included first. However, lemon
        includes <stdio.h> first.


svn path=/trunk/; revision=15208
2005-08-04 20:41:52 +00:00
Jörg Mayer 30a8557868 More 'char*' -> 'const char*' changes to fix warnings.
svn path=/trunk/; revision=15015
2005-07-23 11:41:25 +00:00
Gerald Combs 655dd8d96b Fix up the declaration of yy_accept().
svn path=/trunk/; revision=11521
2004-07-25 17:35:57 +00:00
Jörg Mayer e869dbb17d Trivial warning fixes:
- comma at end of enum
- function declarations with empty args instead of void
- c++ style comments

svn path=/trunk/; revision=11492
2004-07-23 23:28:08 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 6744433452 From Joerg Mayer: mark possibly-unused arguments as unused.
svn path=/trunk/; revision=5388
2002-05-04 10:19:20 +00:00
Guy Harris 352eec3037 More prototype fun - make the Lemon parser allocate and free routines
take fully-prototyped function arguments with types appropriate to
"g_malloc()" and "g_free()", and change the calls to the functions
pointed to by those arguments not pass the extra __FILE__ and __LINE__
arguments.

svn path=/trunk/; revision=3039
2001-02-15 06:22:46 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00