summaryrefslogtreecommitdiffstats
path: root/Source/cmFortranLexer.in.l
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-05 19:20:09 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-06 19:52:40 (GMT)
commitf70c71c5a9759324d9e610bc919832b7500fd116 (patch)
treec1e36fa0024024dd06f5da08e99c265ef05b863b /Source/cmFortranLexer.in.l
parente11cd31fa0cce8210577ee46b6a33ee371f4fe64 (diff)
downloadCMake-f70c71c5a9759324d9e610bc919832b7500fd116.zip
CMake-f70c71c5a9759324d9e610bc919832b7500fd116.tar.gz
CMake-f70c71c5a9759324d9e610bc919832b7500fd116.tar.bz2
cmFortranLexer: Update to flex 2.6
Revise the documented modifications we need to make to the flex-generated source file according to the needs of the new version. Also drop the duplicate copyright notice block from the generated file.
Diffstat (limited to 'Source/cmFortranLexer.in.l')
-rw-r--r--Source/cmFortranLexer.in.l17
1 files changed, 5 insertions, 12 deletions
diff --git a/Source/cmFortranLexer.in.l b/Source/cmFortranLexer.in.l
index e59ff5f..aa879e8 100644
--- a/Source/cmFortranLexer.in.l
+++ b/Source/cmFortranLexer.in.l
@@ -24,28 +24,21 @@
This file must be translated to C and modified to build everywhere.
-Run flex like this:
+Run flex >= 2.6 like this:
flex -i --prefix=cmFortran_yy --header-file=cmFortranLexer.h -ocmFortranLexer.cxx cmFortranLexer.in.l
Modify cmFortranLexer.cxx:
- - remove TABs
- - remove use of the 'register' storage class specifier
- - remove "yyscanner" argument from these methods:
- yy_fatal_error, cmFortran_yyalloc, cmFortran_yyrealloc, cmFortran_yyfree
+ - remove trailing whitespace: sed -i 's/\s*$//' cmFortranLexer.h cmFortranLexer.cxx
+ - remove blank lines at end of file
- remove "yyscanner = NULL" from end of cmFortran_yylex_destroy
- remove all YY_BREAK lines occurring right after return statements
- - change while ( 1 ) to for(;;)
-
-Modify cmFortranLexer.h:
- - remove TABs
- - remove the yy_init_globals function
- - remove the block that includes unistd.h
- - remove #line directives (avoids bogus warning on old Sun)
+ - add cast in yy_scan_bytes for loop condition of _yybytes_len to size_t
*/
#include "cmStandardLexer.h"
+#undef YY_NO_UNPUT
#define cmFortranLexer_cxx
#include "cmFortranParser.h" /* Interface to parser object. */