diff options
author | Brad King <brad.king@kitware.com> | 2005-02-01 15:42:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-01 15:42:52 (GMT) |
commit | 04e56bf7ff622e9dd741b1ff28b3cbcb87b3a620 (patch) | |
tree | 6733f3e2da83fc880fd5bcad5926bfe6abc03158 /Source/cmDependsFortranParser.y | |
parent | 51db85934fd0a0b879cdb880ccbf1eca1dd28c35 (diff) | |
download | CMake-04e56bf7ff622e9dd741b1ff28b3cbcb87b3a620.zip CMake-04e56bf7ff622e9dd741b1ff28b3cbcb87b3a620.tar.gz CMake-04e56bf7ff622e9dd741b1ff28b3cbcb87b3a620.tar.bz2 |
ENH: Changed over to using C++ for building flex/bison generated files. It reduces the number of changes that need to be made after generation.
Diffstat (limited to 'Source/cmDependsFortranParser.y')
-rw-r--r-- | Source/cmDependsFortranParser.y | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/Source/cmDependsFortranParser.y b/Source/cmDependsFortranParser.y index 190a33a..4ba4117 100644 --- a/Source/cmDependsFortranParser.y +++ b/Source/cmDependsFortranParser.y @@ -31,31 +31,34 @@ This file must be translated to C and modified to build everywhere. Run bison like this: - bison --yacc --name-prefix=cmDependsFortran_yy --defines=cmDependsFortranParserTokens.h -ocmDependsFortranParser.c cmDependsFortranParser.y + bison --yacc --name-prefix=cmDependsFortran_yy --defines=cmDependsFortranParserTokens.h -ocmDependsFortranParser.cxx cmDependsFortranParser.y -Modify cmDependsFortranParser.c: +Modify cmDependsFortranParser.cxx: - remove TABs */ +/*-------------------------------------------------------------------------*/ +#define cmDependsFortranParser_cxx +#include "cmDependsFortranParser.h" /* Interface to parser object. */ +#include "cmDependsFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */ + /* Configure the parser to use a lexer object. */ #define YYPARSE_PARAM yyscanner #define YYLEX_PARAM yyscanner -#define YY_DECL int cmDependsFortran_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner) #define YYERROR_VERBOSE 1 #define cmDependsFortran_yyerror(x) \ cmDependsFortranError(yyscanner, x) -/*-------------------------------------------------------------------------*/ -#include "cmDependsFortranLexer.h" /* Interface to lexer object. */ -#include "cmDependsFortranParser.h" /* Interface to parser object. */ -#include "cmDependsFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */ - /* Forward declare the lexer entry point. */ YY_DECL; -/* Internal utility functions. */ -static void cmDependsFortranError(yyscan_t yyscanner, const char* message); +/* Helper function to forward error callback. */ +static void cmDependsFortranError(yyscan_t yyscanner, const char* message) +{ + cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); + cmDependsFortranParser_Error(parser, message); +} /* Disable some warnings in the generated code. */ #ifdef __BORLANDC__ @@ -176,10 +179,3 @@ misc_code: %% /* End of grammar */ - -/*--------------------------------------------------------------------------*/ -void cmDependsFortranError(yyscan_t yyscanner, const char* message) -{ - cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner); - cmDependsFortranParser_Error(parser, message); -} |