summaryrefslogtreecommitdiffstats
path: root/Source/LexerParser/cmDependsJavaLexer.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-28 22:25:02 (GMT)
commit59f78dcb2369aaab3db7fa5de9f48b25d801003d (patch)
treec31ecdc3b752edc9c76590d89c5db74378168f2e /Source/LexerParser/cmDependsJavaLexer.in.l
parentd2e8351a4dc4bf2255942eabf16d4376c4a48c50 (diff)
downloadCMake-59f78dcb2369aaab3db7fa5de9f48b25d801003d.zip
CMake-59f78dcb2369aaab3db7fa5de9f48b25d801003d.tar.gz
CMake-59f78dcb2369aaab3db7fa5de9f48b25d801003d.tar.bz2
cmDependsJavaLexer: 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 cmDependsJavaLexer.in.l and mapping the current instruction to a meaningful location within that file. The prefix "cmDependsJava_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/cmDependsJavaLexer.in.l')
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.in.l11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/LexerParser/cmDependsJavaLexer.in.l b/Source/LexerParser/cmDependsJavaLexer.in.l
index 8cb42b1..01a0fa3 100644
--- a/Source/LexerParser/cmDependsJavaLexer.in.l
+++ b/Source/LexerParser/cmDependsJavaLexer.in.l
@@ -7,13 +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=cmDependsJava_yy --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
+ flex --nounistd -DFLEXINT_H --noline --header-file=cmDependsJavaLexer.h -ocmDependsJavaLexer.cxx cmDependsJavaLexer.in.l
Modify cmDependsJavaLexer.cxx:
- - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
- - 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
+ - remove trailing whitespace: sed -i 's/\s*$//' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - remove blank lines at end of file: sed -i '${/^$/d;}' cmDependsJavaLexer.h cmDependsJavaLexer.cxx
+ - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmDependsJavaLexer.cxx
*/
@@ -38,6 +37,8 @@ Modify cmDependsJavaLexer.cxx:
/*--------------------------------------------------------------------------*/
%}
+%option prefix="cmDependsJava_yy"
+
%option reentrant
%option noyywrap
%pointer