diff options
Diffstat (limited to 'cpp/demo/Freeze/library/Scanner.cpp')
-rw-r--r-- | cpp/demo/Freeze/library/Scanner.cpp | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/cpp/demo/Freeze/library/Scanner.cpp b/cpp/demo/Freeze/library/Scanner.cpp index 95dd5848dd5..7f3ceb08ad0 100644 --- a/cpp/demo/Freeze/library/Scanner.cpp +++ b/cpp/demo/Freeze/library/Scanner.cpp @@ -512,17 +512,23 @@ char *yytext; #include <Parser.h> #include <Grammar.h> -#if defined(_MSC_VER) && defined(ICE_64) +#if defined(_MSC_VER) +#if defined(ICE_64) // // '=' : conversion from 'size_t' to 'int', possible loss of data // The result of fread() is a size_t and gets inserted into an int // -# pragma warning( 4 : 4267 ) +# pragma warning( disable : 4267) // // 'initializing' : conversion from '__int64' to 'int', possible loss of data // Puts a pointer-difference into an int // -# pragma warning( 4 : 4244 ) +# pragma warning( disable : 4244) +#endif +// +// conditional expression is constant +// +# pragma warning( disable : 4127) #endif using namespace std; @@ -547,7 +553,7 @@ using namespace std; #define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) -#line 550 "lex.yy.c" +#line 556 "lex.yy.c" #define INITIAL 0 @@ -636,7 +642,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -647,7 +653,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -729,10 +735,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 58 "Scanner.l" +#line 64 "Scanner.l" -#line 735 "lex.yy.c" +#line 741 "lex.yy.c" if ( !(yy_init) ) { @@ -817,7 +823,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 60 "Scanner.l" +#line 66 "Scanner.l" { // C++-style comment int c; @@ -830,7 +836,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 70 "Scanner.l" +#line 76 "Scanner.l" { // C-style comment while(true) @@ -858,84 +864,84 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 95 "Scanner.l" +#line 101 "Scanner.l" { return TOK_HELP; } YY_BREAK case 4: YY_RULE_SETUP -#line 99 "Scanner.l" +#line 105 "Scanner.l" { return TOK_EXIT; } YY_BREAK case 5: YY_RULE_SETUP -#line 103 "Scanner.l" +#line 109 "Scanner.l" { return TOK_ADD_BOOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 107 "Scanner.l" +#line 113 "Scanner.l" { return TOK_FIND_ISBN; } YY_BREAK case 7: YY_RULE_SETUP -#line 111 "Scanner.l" +#line 117 "Scanner.l" { return TOK_FIND_AUTHORS; } YY_BREAK case 8: YY_RULE_SETUP -#line 115 "Scanner.l" +#line 121 "Scanner.l" { return TOK_NEXT_FOUND_BOOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 119 "Scanner.l" +#line 125 "Scanner.l" { return TOK_PRINT_CURRENT; } YY_BREAK case 10: YY_RULE_SETUP -#line 123 "Scanner.l" +#line 129 "Scanner.l" { return TOK_RENT_BOOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 127 "Scanner.l" +#line 133 "Scanner.l" { return TOK_RETURN_BOOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 131 "Scanner.l" +#line 137 "Scanner.l" { return TOK_REMOVE_CURRENT; } YY_BREAK case 13: YY_RULE_SETUP -#line 135 "Scanner.l" +#line 141 "Scanner.l" { return TOK_SET_EVICTOR_SIZE; } YY_BREAK case 14: YY_RULE_SETUP -#line 139 "Scanner.l" +#line 145 "Scanner.l" { return TOK_SHUTDOWN; } @@ -943,7 +949,7 @@ YY_RULE_SETUP case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 143 "Scanner.l" +#line 149 "Scanner.l" { size_t len = strlen(yytext); for(size_t i = 0; i < len; ++i) @@ -958,14 +964,14 @@ YY_RULE_SETUP case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 154 "Scanner.l" +#line 160 "Scanner.l" { return ';'; } YY_BREAK case 17: YY_RULE_SETUP -#line 158 "Scanner.l" +#line 164 "Scanner.l" { // "..."-type strings string s; @@ -992,13 +998,13 @@ YY_RULE_SETUP s += next; break; } - + case 'n': { s += '\n'; break; } - + case 'r': { s += '\r'; @@ -1010,19 +1016,19 @@ YY_RULE_SETUP s += '\t'; break; } - + case 'v': { s += '\v'; break; } - + case 'f': { s += '\f'; break; } - + default: { s += c; @@ -1042,7 +1048,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 232 "Scanner.l" +#line 238 "Scanner.l" { // '...'-type strings string s; @@ -1070,7 +1076,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 257 "Scanner.l" +#line 263 "Scanner.l" { // Simple strings string s; @@ -1087,7 +1093,7 @@ YY_RULE_SETUP unput(c); break; } - + s += c; } yylvalp->clear(); @@ -1097,10 +1103,10 @@ YY_RULE_SETUP YY_BREAK case 20: YY_RULE_SETUP -#line 281 "Scanner.l" +#line 287 "Scanner.l" ECHO; YY_BREAK -#line 1103 "lex.yy.c" +#line 1109 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2094,7 +2100,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 281 "Scanner.l" +#line 287 "Scanner.l" |