summaryrefslogtreecommitdiffstats
path: root/Source/LexerParser/cmListFileLexer.in.l
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-08-24 21:48:48 (GMT)
committerMatthias Maennich <matthias@maennich.net>2017-08-25 14:54:41 (GMT)
commitef41bf8531d012a727ed173c56dfc1435b905a80 (patch)
tree3f9bdadebf20438cd493038866d65c41aa1c7544 /Source/LexerParser/cmListFileLexer.in.l
parent9cacb0cba43188f4fe39b042581579c54cca44ba (diff)
downloadCMake-ef41bf8531d012a727ed173c56dfc1435b905a80.zip
CMake-ef41bf8531d012a727ed173c56dfc1435b905a80.tar.gz
CMake-ef41bf8531d012a727ed173c56dfc1435b905a80.tar.bz2
cmListFileLexer: regenerate with flex 2.6.4 (previously 2.6.1)
flex 2.6.3 introduces symbol remapping through macro definitions. hence the change appears bigger than one would expect from a minor version upgrade. In addition some manual cleanup that had to be done previously is now obsolete. namely: - the size_t cast of _yybytes_len in yy_scan_bytes (i is now also defined int and not size_t anymore) - the redefinition of yyl within yy_find_action (yyl is now already defined as int) Line number preprocessor directives (#line) were previously generated into the c source file. This actually breaks debugging as debuggers have a hard time finding the original cmListFileLexer.in.l and mapping the current instruction to a meaningful location within that file. The prefix "cmListFileLexer_yy" can already be set as %option directly. For convenience also provide a sed command for all the manual steps that need to be done after generating. Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source/LexerParser/cmListFileLexer.in.l')
-rw-r--r--Source/LexerParser/cmListFileLexer.in.l12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l
index 8ec82cc..6ec8da4 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -7,14 +7,12 @@ This file must be translated to C and modified to build everywhere.
Run flex >= 2.6 like this:
- flex --nounistd -DFLEXINT_H --prefix=cmListFileLexer_yy -ocmListFileLexer.c cmListFileLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline -ocmListFileLexer.c cmListFileLexer.in.l
Modify cmListFileLexer.c:
- - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
- - remove blank lines at end of file
- - #include "cmStandardLexer.h" at the top
- - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
- - change type of variable yyl under yy_find_action from yy_size_t to int
+ - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmListFileLexer.c
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmListFileLexer.c
*/
@@ -64,6 +62,8 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmListFileLexer_yy"
+
%option reentrant
%option yylineno
%option noyywrap