diff options
author | Brad King <brad.king@kitware.com> | 2016-09-05 19:54:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-08 13:40:02 (GMT) |
commit | 695f0d0d3a2db22d2ee3a426df8a1ec502cd471b (patch) | |
tree | 430d7aafdf9c1f28ffed28d0ed569d842f51695f /Source/cmFortranParserTokens.h | |
parent | 1619fb46a88accd1e6864f0c9de27ae2fd46541a (diff) | |
download | CMake-695f0d0d3a2db22d2ee3a426df8a1ec502cd471b.zip CMake-695f0d0d3a2db22d2ee3a426df8a1ec502cd471b.tar.gz CMake-695f0d0d3a2db22d2ee3a426df8a1ec502cd471b.tar.bz2 |
cmFortranParser: Parse keywords as lexical tokens
Teach the lexer to match and return specific Fortran keywords as tokens.
Update the parser to use these instead of always using a WORD token and
then checking the text. This avoids extra string comparisons and will
allow more grammar productions to be unambiguously added later for
additional Fortran statements.
Diffstat (limited to 'Source/cmFortranParserTokens.h')
-rw-r--r-- | Source/cmFortranParserTokens.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/cmFortranParserTokens.h b/Source/cmFortranParserTokens.h index 176f6fe..e988df4 100644 --- a/Source/cmFortranParserTokens.h +++ b/Source/cmFortranParserTokens.h @@ -73,7 +73,12 @@ extern int cmFortran_yydebug; UNTERMINATED_STRING = 283, STRING = 284, WORD = 285, - CPP_INCLUDE_ANGLE = 286 + CPP_INCLUDE_ANGLE = 286, + END = 287, + INCLUDE = 288, + INTERFACE = 289, + MODULE = 290, + USE = 291 }; #endif /* Tokens. */ @@ -106,17 +111,22 @@ extern int cmFortran_yydebug; #define STRING 284 #define WORD 285 #define CPP_INCLUDE_ANGLE 286 +#define END 287 +#define INCLUDE 288 +#define INTERFACE 289 +#define MODULE 290 +#define USE 291 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 81 "cmFortranParser.y" /* yacc.c:1909 */ +#line 75 "cmFortranParser.y" /* yacc.c:1909 */ char* string; -#line 120 "cmFortranParserTokens.h" /* yacc.c:1909 */ +#line 130 "cmFortranParserTokens.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; |