diff options
author | Brad King <brad.king@kitware.com> | 2016-05-17 14:31:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-17 14:56:37 (GMT) |
commit | e4a92dab3fa81a893a52dd1a774db79c4363fda6 (patch) | |
tree | 24afab8ec537e65a0939cfc10c4c59b3a9000258 /Source/cmListFileLexer.in.l | |
parent | 7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (diff) | |
download | CMake-e4a92dab3fa81a893a52dd1a774db79c4363fda6.zip CMake-e4a92dab3fa81a893a52dd1a774db79c4363fda6.tar.gz CMake-e4a92dab3fa81a893a52dd1a774db79c4363fda6.tar.bz2 |
cmListFileLexer: 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.
Update our own implementation to avoid warnings with flex types.
Diffstat (limited to 'Source/cmListFileLexer.in.l')
-rw-r--r-- | Source/cmListFileLexer.in.l | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmListFileLexer.in.l b/Source/cmListFileLexer.in.l index a520c72..aab1ac5 100644 --- a/Source/cmListFileLexer.in.l +++ b/Source/cmListFileLexer.in.l @@ -14,19 +14,16 @@ This file must be translated to C and modified to build everywhere. -Run flex like this: +Run flex >= 2.6 like this: flex --prefix=cmListFileLexer_yy -ocmListFileLexer.c cmListFileLexer.in.l Modify cmListFileLexer.c: - - remove TABs - - remove use of the 'register' storage class specifier - - remove the yyunput function - - add a statement "(void)yyscanner;" to the top of these methods: - yy_fatal_error, cmListFileLexer_yyalloc, cmListFileLexer_yyrealloc, cmListFileLexer_yyfree + - remove trailing whitespace: sed -i 's/\s*$//' cmListFileLexer.c + - remove blank lines at end of file - remove statement "yyscanner = NULL;" from cmListFileLexer_yylex_destroy - remove all YY_BREAK lines occurring right after return statements - - remove the isatty forward declaration + - remove unnecessary cast to (int) in yy_get_next_buffer */ @@ -45,7 +42,7 @@ Modify cmListFileLexer.c: struct cmListFileLexer_s { cmListFileLexer_Token token; - int bracket; + yy_size_t bracket; int comment; int line; int column; @@ -112,7 +109,7 @@ LEGACY {MAKEVAR}|{UNQUOTED}|\"({MAKEVAR}|{UNQUOTED}|[ \t[=])*\" lexer->token.type = cmListFileLexer_Token_ArgumentBracket; } cmListFileLexerSetToken(lexer, "", 0); - lexer->bracket = (int)(strchr(bracket+1, '[') - bracket); + lexer->bracket = strchr(bracket+1, '[') - bracket; if(yytext[yyleng-1] == '\n') { ++lexer->line; |