diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2017-10-25 15:34:01 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2017-10-25 17:56:33 (GMT) |
commit | 576c079faadbff2bd5fafcbc9cecc03797625922 (patch) | |
tree | 46c285dd0443d7fdc50b38dae524a765b42bde3f /Source/LexerParser | |
parent | 98cb9f3ee98261d0e7a591ba3b1971d49f1a2ee8 (diff) | |
download | CMake-576c079faadbff2bd5fafcbc9cecc03797625922.zip CMake-576c079faadbff2bd5fafcbc9cecc03797625922.tar.gz CMake-576c079faadbff2bd5fafcbc9cecc03797625922.tar.bz2 |
cmCommandArgumentParser: remove the variable tokens from the class
Make them local constants in the lexer file.
Diffstat (limited to 'Source/LexerParser')
-rw-r--r-- | Source/LexerParser/cmCommandArgumentLexer.cxx | 21 | ||||
-rw-r--r-- | Source/LexerParser/cmCommandArgumentLexer.in.l | 21 |
2 files changed, 28 insertions, 14 deletions
diff --git a/Source/LexerParser/cmCommandArgumentLexer.cxx b/Source/LexerParser/cmCommandArgumentLexer.cxx index bf6bc2f..6b4fc85 100644 --- a/Source/LexerParser/cmCommandArgumentLexer.cxx +++ b/Source/LexerParser/cmCommandArgumentLexer.cxx @@ -674,6 +674,13 @@ Modify cmCommandArgumentLexer.cxx: /* Include the set of tokens from the parser. */ #include "cmCommandArgumentParserTokens.h" +static const char *DCURLYVariable = "${"; +static const char *RCURLYVariable = "}"; +static const char *ATVariable = "@"; +static const char *DOLLARVariable = "$"; +static const char *LCURLYVariable = "{"; +static const char *BSLASHVariable = "\\"; + /*--------------------------------------------------------------------------*/ #define INITIAL 0 @@ -1011,7 +1018,7 @@ YY_RULE_SETUP { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->DCURLYVariable; + yylvalp->str = DCURLYVariable; return cal_DCURLY; } YY_BREAK @@ -1020,7 +1027,7 @@ YY_RULE_SETUP { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->RCURLYVariable; + yylvalp->str = RCURLYVariable; return cal_RCURLY; } YY_BREAK @@ -1029,7 +1036,7 @@ YY_RULE_SETUP { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->ATVariable; + yylvalp->str = ATVariable; return cal_AT; } YY_BREAK @@ -1064,7 +1071,7 @@ case 10: YY_RULE_SETUP { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->DOLLARVariable; + yylvalp->str = DOLLARVariable; return cal_DOLLAR; } YY_BREAK @@ -1072,7 +1079,7 @@ case 11: YY_RULE_SETUP { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->LCURLYVariable; + yylvalp->str = LCURLYVariable; return cal_LCURLY; } YY_BREAK @@ -1080,7 +1087,7 @@ case 12: YY_RULE_SETUP { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->BSLASHVariable; + yylvalp->str = BSLASHVariable; return cal_BSLASH; } YY_BREAK @@ -1088,7 +1095,7 @@ case 13: YY_RULE_SETUP { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->BSLASHVariable; + yylvalp->str = BSLASHVariable; return cal_SYMBOL; } YY_BREAK diff --git a/Source/LexerParser/cmCommandArgumentLexer.in.l b/Source/LexerParser/cmCommandArgumentLexer.in.l index acf18f3..5927b9e 100644 --- a/Source/LexerParser/cmCommandArgumentLexer.in.l +++ b/Source/LexerParser/cmCommandArgumentLexer.in.l @@ -28,6 +28,13 @@ Modify cmCommandArgumentLexer.cxx: /* Include the set of tokens from the parser. */ #include "cmCommandArgumentParserTokens.h" +static const char *DCURLYVariable = "${"; +static const char *RCURLYVariable = "}"; +static const char *ATVariable = "@"; +static const char *DOLLARVariable = "$"; +static const char *LCURLYVariable = "{"; +static const char *BSLASHVariable = "\\"; + /*--------------------------------------------------------------------------*/ %} @@ -63,21 +70,21 @@ Modify cmCommandArgumentLexer.cxx: "${" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->DCURLYVariable; + yylvalp->str = DCURLYVariable; return cal_DCURLY; } "}" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->RCURLYVariable; + yylvalp->str = RCURLYVariable; return cal_RCURLY; } "@" { //std::cerr << __LINE__ << " here: [" << yytext << "]" << std::endl; //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->ATVariable; + yylvalp->str = ATVariable; return cal_AT; } @@ -103,25 +110,25 @@ Modify cmCommandArgumentLexer.cxx: "$" { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->DOLLARVariable; + yylvalp->str = DOLLARVariable; return cal_DOLLAR; } "{" { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->LCURLYVariable; + yylvalp->str = LCURLYVariable; return cal_LCURLY; } <ESCAPES>"\\" { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->BSLASHVariable; + yylvalp->str = BSLASHVariable; return cal_BSLASH; } <NOESCAPES>"\\" { //yyextra->AllocateParserType(yylvalp, yytext, strlen(yytext)); - yylvalp->str = yyextra->BSLASHVariable; + yylvalp->str = BSLASHVariable; return cal_SYMBOL; } |