diff options
author | Matthias Maennich <matthias@maennich.net> | 2017-08-24 21:48:48 (GMT) |
---|---|---|
committer | Matthias Maennich <matthias@maennich.net> | 2017-08-28 22:34:36 (GMT) |
commit | 376c13958d84bd23f3a9f32aab9692df1f2d47fe (patch) | |
tree | 6d93eec1631a55c0289e27deca3471864b3a079c /Source/LexerParser/cmFortranLexer.in.l | |
parent | 80c08c7c0ad14bbc7c004fff4c0363b7369927e0 (diff) | |
download | CMake-376c13958d84bd23f3a9f32aab9692df1f2d47fe.zip CMake-376c13958d84bd23f3a9f32aab9692df1f2d47fe.tar.gz CMake-376c13958d84bd23f3a9f32aab9692df1f2d47fe.tar.bz2 |
cmFortranLexer: 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 cmFortranLexer.in.l and mapping the current
instruction to a meaningful location within that file.
The prefix "cmFortran_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/cmFortranLexer.in.l')
-rw-r--r-- | Source/LexerParser/cmFortranLexer.in.l | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l index 1121210..9acba4c 100644 --- a/Source/LexerParser/cmFortranLexer.in.l +++ b/Source/LexerParser/cmFortranLexer.in.l @@ -17,14 +17,12 @@ This file must be translated to C++ and modified to build everywhere. Run flex >= 2.6 like this: - flex -i --nounistd -DFLEXINT_H --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l + flex -i --nounistd -DFLEXINT_H --noline --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l Modify cmFortranLexer.cxx: - - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.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*$//' cmFortranLexer.h cmFortranLexer.cxx + - remove blank lines at end of file: sed -i '${/^$/d;}' cmFortranLexer.h cmFortranLexer.cxx + - #include "cmStandardLexer.h" at the top: sed -i '1i#include "cmStandardLexer.h"' cmFortranLexer.cxx */ /* IWYU pragma: no_forward_declare yyguts_t */ @@ -45,6 +43,7 @@ Modify cmFortranLexer.cxx: /*--------------------------------------------------------------------------*/ %} +%option prefix="cmFortran_yy" %option reentrant %option noyywrap |