glcpp: Refresh autogenerated lexer and parser.

This commit is contained in:
Kenneth Graunke
2010-08-03 20:25:13 -07:00
parent 1ffc1cd861
commit 0ef79a5f11
3 changed files with 148 additions and 155 deletions

View File

@@ -54,6 +54,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -159,15 +158,7 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -691,7 +682,7 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
} while(0);
#define YY_USER_INIT yylineno = 0; yycolumn = 0;
#line 695 "glcpp/glcpp-lex.c"
#line 686 "glcpp/glcpp-lex.c"
#define INITIAL 0
#define DONE 1
@@ -846,12 +837,7 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -859,7 +845,7 @@ static int input (yyscan_t yyscanner );
/* 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,
@@ -870,7 +856,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -962,7 +948,7 @@ YY_DECL
/* Single-line comments */
#line 966 "glcpp/glcpp-lex.c"
#line 952 "glcpp/glcpp-lex.c"
yylval = yylval_param;
@@ -1133,7 +1119,7 @@ case 8:
YY_RULE_SETUP
#line 90 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
yyextra->space_tokens = 0;
@@ -1146,7 +1132,7 @@ case 9:
YY_RULE_SETUP
#line 100 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
yylineno++;
yycolumn = 0;
return OTHER;
@@ -1283,7 +1269,7 @@ case 22:
YY_RULE_SETUP
#line 188 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1291,7 +1277,7 @@ case 23:
YY_RULE_SETUP
#line 193 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1299,7 +1285,7 @@ case 24:
YY_RULE_SETUP
#line 198 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
return INTEGER_STRING;
}
YY_BREAK
@@ -1377,7 +1363,7 @@ case 35:
YY_RULE_SETUP
#line 243 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
return IDENTIFIER;
}
YY_BREAK
@@ -1392,7 +1378,7 @@ case 37:
YY_RULE_SETUP
#line 252 "glcpp/glcpp-lex.l"
{
yylval->str = xtalloc_strdup (yyextra, yytext);
yylval->str = talloc_strdup (yyextra, yytext);
return OTHER;
}
YY_BREAK
@@ -1442,7 +1428,7 @@ YY_RULE_SETUP
#line 286 "glcpp/glcpp-lex.l"
ECHO;
YY_BREAK
#line 1446 "glcpp/glcpp-lex.c"
#line 1432 "glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(UNREACHABLE):
@@ -2181,8 +2167,8 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner)
/** Setup the input buffer state to scan the given bytes. The next call to glcpp_lex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/

View File

@@ -1,10 +1,9 @@
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.4.1"
#define YYBISON_VERSION "2.4.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -209,7 +208,7 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
/* Line 189 of yacc.c */
#line 213 "glcpp/glcpp-parse.c"
#line 212 "glcpp/glcpp-parse.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -297,7 +296,7 @@ typedef struct YYLTYPE
/* Line 264 of yacc.c */
#line 301 "glcpp/glcpp-parse.c"
#line 300 "glcpp/glcpp-parse.c"
#ifdef short
# undef short
@@ -347,7 +346,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -934,9 +933,18 @@ static const yytype_uint8 yystos[] =
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
Once GCC version 2 has supplanted version 1, this can go. However,
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -993,7 +1001,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -1582,7 +1590,7 @@ YYLTYPE yylloc;
yyvsp = yyvs;
yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
@@ -1772,7 +1780,7 @@ yyreduce:
{
case 4:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 175 "glcpp/glcpp-parse.y"
{
glcpp_print(parser->output, "\n");
@@ -1781,7 +1789,7 @@ yyreduce:
case 5:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 178 "glcpp/glcpp-parse.y"
{
_glcpp_parser_print_expanded_token_list (parser, (yyvsp[(1) - (1)].token_list));
@@ -1792,7 +1800,7 @@ yyreduce:
case 8:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 188 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), (yyvsp[(2) - (3)].ival));
@@ -1801,7 +1809,7 @@ yyreduce:
case 9:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 191 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", (yyvsp[(2) - (3)].ival));
@@ -1810,7 +1818,7 @@ yyreduce:
case 10:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 197 "glcpp/glcpp-parse.y"
{
_define_object_macro (parser, & (yylsp[(2) - (4)]), (yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].token_list));
@@ -1819,7 +1827,7 @@ yyreduce:
case 11:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 200 "glcpp/glcpp-parse.y"
{
_define_function_macro (parser, & (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].str), NULL, (yyvsp[(5) - (6)].token_list));
@@ -1828,7 +1836,7 @@ yyreduce:
case 12:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 203 "glcpp/glcpp-parse.y"
{
_define_function_macro (parser, & (yylsp[(2) - (7)]), (yyvsp[(2) - (7)].str), (yyvsp[(4) - (7)].string_list), (yyvsp[(6) - (7)].token_list));
@@ -1837,7 +1845,7 @@ yyreduce:
case 13:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 206 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (3)].str));
@@ -1851,7 +1859,7 @@ yyreduce:
case 14:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 214 "glcpp/glcpp-parse.y"
{
token_list_t *expanded;
@@ -1869,7 +1877,7 @@ yyreduce:
case 15:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 226 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str));
@@ -1880,7 +1888,7 @@ yyreduce:
case 16:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 231 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str));
@@ -1891,7 +1899,7 @@ yyreduce:
case 17:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 236 "glcpp/glcpp-parse.y"
{
token_list_t *expanded;
@@ -1909,7 +1917,7 @@ yyreduce:
case 18:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 248 "glcpp/glcpp-parse.y"
{
/* #elif without an expression results in a warning if the
@@ -1926,7 +1934,7 @@ yyreduce:
case 19:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 259 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (2)]), "else", 1);
@@ -1935,7 +1943,7 @@ yyreduce:
case 20:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 262 "glcpp/glcpp-parse.y"
{
_glcpp_parser_skip_stack_pop (parser, & (yylsp[(1) - (2)]));
@@ -1944,7 +1952,7 @@ yyreduce:
case 21:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 265 "glcpp/glcpp-parse.y"
{
macro_t *macro = hash_table_find (parser->defines, "__VERSION__");
@@ -1959,7 +1967,7 @@ yyreduce:
case 23:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 278 "glcpp/glcpp-parse.y"
{
if (strlen ((yyvsp[(1) - (1)].str)) >= 3 && strncmp ((yyvsp[(1) - (1)].str), "0x", 2) == 0) {
@@ -1974,7 +1982,7 @@ yyreduce:
case 24:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 287 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (1)].ival);
@@ -1983,7 +1991,7 @@ yyreduce:
case 26:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 293 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival);
@@ -1992,7 +2000,7 @@ yyreduce:
case 27:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 296 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival);
@@ -2001,7 +2009,7 @@ yyreduce:
case 28:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 299 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival);
@@ -2010,7 +2018,7 @@ yyreduce:
case 29:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 302 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) ^ (yyvsp[(3) - (3)].ival);
@@ -2019,7 +2027,7 @@ yyreduce:
case 30:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 305 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) & (yyvsp[(3) - (3)].ival);
@@ -2028,7 +2036,7 @@ yyreduce:
case 31:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 308 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival);
@@ -2037,7 +2045,7 @@ yyreduce:
case 32:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 311 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival);
@@ -2046,7 +2054,7 @@ yyreduce:
case 33:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 314 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival);
@@ -2055,7 +2063,7 @@ yyreduce:
case 34:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 317 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival);
@@ -2064,7 +2072,7 @@ yyreduce:
case 35:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 320 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival);
@@ -2073,7 +2081,7 @@ yyreduce:
case 36:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 323 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival);
@@ -2082,7 +2090,7 @@ yyreduce:
case 37:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 326 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) >> (yyvsp[(3) - (3)].ival);
@@ -2091,7 +2099,7 @@ yyreduce:
case 38:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 329 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) << (yyvsp[(3) - (3)].ival);
@@ -2100,7 +2108,7 @@ yyreduce:
case 39:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 332 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival);
@@ -2109,7 +2117,7 @@ yyreduce:
case 40:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 335 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival);
@@ -2118,7 +2126,7 @@ yyreduce:
case 41:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 338 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) % (yyvsp[(3) - (3)].ival);
@@ -2127,7 +2135,7 @@ yyreduce:
case 42:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 341 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) / (yyvsp[(3) - (3)].ival);
@@ -2136,7 +2144,7 @@ yyreduce:
case 43:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 344 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(1) - (3)].ival) * (yyvsp[(3) - (3)].ival);
@@ -2145,7 +2153,7 @@ yyreduce:
case 44:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 347 "glcpp/glcpp-parse.y"
{
(yyval.ival) = ! (yyvsp[(2) - (2)].ival);
@@ -2154,7 +2162,7 @@ yyreduce:
case 45:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 350 "glcpp/glcpp-parse.y"
{
(yyval.ival) = ~ (yyvsp[(2) - (2)].ival);
@@ -2163,7 +2171,7 @@ yyreduce:
case 46:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 353 "glcpp/glcpp-parse.y"
{
(yyval.ival) = - (yyvsp[(2) - (2)].ival);
@@ -2172,7 +2180,7 @@ yyreduce:
case 47:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 356 "glcpp/glcpp-parse.y"
{
(yyval.ival) = + (yyvsp[(2) - (2)].ival);
@@ -2181,7 +2189,7 @@ yyreduce:
case 48:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 359 "glcpp/glcpp-parse.y"
{
(yyval.ival) = (yyvsp[(2) - (3)].ival);
@@ -2190,7 +2198,7 @@ yyreduce:
case 49:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 365 "glcpp/glcpp-parse.y"
{
(yyval.string_list) = _string_list_create (parser);
@@ -2201,7 +2209,7 @@ yyreduce:
case 50:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 370 "glcpp/glcpp-parse.y"
{
(yyval.string_list) = (yyvsp[(1) - (3)].string_list);
@@ -2212,14 +2220,14 @@ yyreduce:
case 51:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 378 "glcpp/glcpp-parse.y"
{ (yyval.token_list) = NULL; ;}
break;
case 53:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 383 "glcpp/glcpp-parse.y"
{
yyerror (& (yylsp[(1) - (2)]), parser, "Invalid tokens after #");
@@ -2228,14 +2236,14 @@ yyreduce:
case 54:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 389 "glcpp/glcpp-parse.y"
{ (yyval.token_list) = NULL; ;}
break;
case 57:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 395 "glcpp/glcpp-parse.y"
{
glcpp_warning(&(yylsp[(1) - (1)]), parser, "extra tokens at end of directive");
@@ -2244,7 +2252,7 @@ yyreduce:
case 58:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 402 "glcpp/glcpp-parse.y"
{
int v = hash_table_find (parser->defines, (yyvsp[(2) - (2)].str)) ? 1 : 0;
@@ -2254,7 +2262,7 @@ yyreduce:
case 59:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 406 "glcpp/glcpp-parse.y"
{
int v = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)) ? 1 : 0;
@@ -2264,7 +2272,7 @@ yyreduce:
case 61:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 415 "glcpp/glcpp-parse.y"
{
parser->space_tokens = 1;
@@ -2276,7 +2284,7 @@ yyreduce:
case 62:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 421 "glcpp/glcpp-parse.y"
{
(yyval.token_list) = (yyvsp[(1) - (2)].token_list);
@@ -2287,7 +2295,7 @@ yyreduce:
case 63:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 429 "glcpp/glcpp-parse.y"
{
parser->space_tokens = 1;
@@ -2299,7 +2307,7 @@ yyreduce:
case 64:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 435 "glcpp/glcpp-parse.y"
{
(yyval.token_list) = (yyvsp[(1) - (2)].token_list);
@@ -2310,7 +2318,7 @@ yyreduce:
case 65:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 443 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[(1) - (1)].str));
@@ -2320,7 +2328,7 @@ yyreduce:
case 66:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 447 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[(1) - (1)].str));
@@ -2330,7 +2338,7 @@ yyreduce:
case 67:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 451 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_ival (parser, (yyvsp[(1) - (1)].ival), (yyvsp[(1) - (1)].ival));
@@ -2340,7 +2348,7 @@ yyreduce:
case 68:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 455 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_str (parser, OTHER, (yyvsp[(1) - (1)].str));
@@ -2350,7 +2358,7 @@ yyreduce:
case 69:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 459 "glcpp/glcpp-parse.y"
{
(yyval.token) = _token_create_ival (parser, SPACE, SPACE);
@@ -2360,225 +2368,225 @@ yyreduce:
case 70:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 466 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '['; ;}
break;
case 71:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 467 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ']'; ;}
break;
case 72:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 468 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '('; ;}
break;
case 73:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 469 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ')'; ;}
break;
case 74:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 470 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '{'; ;}
break;
case 75:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 471 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '}'; ;}
break;
case 76:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 472 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '.'; ;}
break;
case 77:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 473 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '&'; ;}
break;
case 78:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 474 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '*'; ;}
break;
case 79:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 475 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '+'; ;}
break;
case 80:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 476 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '-'; ;}
break;
case 81:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 477 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '~'; ;}
break;
case 82:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 478 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '!'; ;}
break;
case 83:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 479 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '/'; ;}
break;
case 84:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 480 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '%'; ;}
break;
case 85:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 481 "glcpp/glcpp-parse.y"
{ (yyval.ival) = LEFT_SHIFT; ;}
break;
case 86:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 482 "glcpp/glcpp-parse.y"
{ (yyval.ival) = RIGHT_SHIFT; ;}
break;
case 87:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 483 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '<'; ;}
break;
case 88:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 484 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '>'; ;}
break;
case 89:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 485 "glcpp/glcpp-parse.y"
{ (yyval.ival) = LESS_OR_EQUAL; ;}
break;
case 90:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 486 "glcpp/glcpp-parse.y"
{ (yyval.ival) = GREATER_OR_EQUAL; ;}
break;
case 91:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 487 "glcpp/glcpp-parse.y"
{ (yyval.ival) = EQUAL; ;}
break;
case 92:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 488 "glcpp/glcpp-parse.y"
{ (yyval.ival) = NOT_EQUAL; ;}
break;
case 93:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 489 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '^'; ;}
break;
case 94:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 490 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '|'; ;}
break;
case 95:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 491 "glcpp/glcpp-parse.y"
{ (yyval.ival) = AND; ;}
break;
case 96:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 492 "glcpp/glcpp-parse.y"
{ (yyval.ival) = OR; ;}
break;
case 97:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 493 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ';'; ;}
break;
case 98:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 494 "glcpp/glcpp-parse.y"
{ (yyval.ival) = ','; ;}
break;
case 99:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 495 "glcpp/glcpp-parse.y"
{ (yyval.ival) = '='; ;}
break;
case 100:
/* Line 1455 of yacc.c */
/* Line 1464 of yacc.c */
#line 496 "glcpp/glcpp-parse.y"
{ (yyval.ival) = PASTE; ;}
break;
/* Line 1455 of yacc.c */
#line 2582 "glcpp/glcpp-parse.c"
/* Line 1464 of yacc.c */
#line 2590 "glcpp/glcpp-parse.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2796,7 +2804,7 @@ yyreturn:
/* Line 1675 of yacc.c */
/* Line 1684 of yacc.c */
#line 499 "glcpp/glcpp-parse.y"
@@ -2805,7 +2813,7 @@ _string_list_create (void *ctx)
{
string_list_t *list;
list = xtalloc (ctx, string_list_t);
list = talloc (ctx, string_list_t);
list->head = NULL;
list->tail = NULL;
@@ -2817,8 +2825,8 @@ _string_list_append_item (string_list_t *list, const char *str)
{
string_node_t *node;
node = xtalloc (list, string_node_t);
node->str = xtalloc_strdup (node, str);
node = talloc (list, string_node_t);
node->str = talloc_strdup (node, str);
node->next = NULL;
@@ -2871,7 +2879,7 @@ _argument_list_create (void *ctx)
{
argument_list_t *list;
list = xtalloc (ctx, argument_list_t);
list = talloc (ctx, argument_list_t);
list->head = NULL;
list->tail = NULL;
@@ -2883,7 +2891,7 @@ _argument_list_append (argument_list_t *list, token_list_t *argument)
{
argument_node_t *node;
node = xtalloc (list, argument_node_t);
node = talloc (list, argument_node_t);
node->argument = argument;
node->next = NULL;
@@ -2940,7 +2948,7 @@ _token_create_str (void *ctx, int type, char *str)
{
token_t *token;
token = xtalloc (ctx, token_t);
token = talloc (ctx, token_t);
token->type = type;
token->value.str = talloc_steal (token, str);
@@ -2952,7 +2960,7 @@ _token_create_ival (void *ctx, int type, int ival)
{
token_t *token;
token = xtalloc (ctx, token_t);
token = talloc (ctx, token_t);
token->type = type;
token->value.ival = ival;
@@ -2964,7 +2972,7 @@ _token_list_create (void *ctx)
{
token_list_t *list;
list = xtalloc (ctx, token_list_t);
list = talloc (ctx, token_list_t);
list->head = NULL;
list->tail = NULL;
list->non_space_tail = NULL;
@@ -2977,8 +2985,8 @@ _token_list_append (token_list_t *list, token_t *token)
{
token_node_t *node;
node = xtalloc (list, token_node_t);
node->token = xtalloc_reference (list, token);
node = talloc (list, token_node_t);
node->token = talloc_reference (list, token);
node->next = NULL;
@@ -3173,8 +3181,8 @@ _token_paste (glcpp_parser_t *parser, token_t *token, token_t *other)
{
char *str;
str = xtalloc_asprintf (token, "%s%s",
token->value.str, other->value.str);
str = talloc_asprintf (token, "%s%s", token->value.str,
other->value.str);
combined = _token_create_str (token, token->type, str);
combined->location = token->location;
return combined;
@@ -3229,7 +3237,7 @@ glcpp_parser_create (const struct gl_extensions *extensions)
glcpp_parser_t *parser;
int language_version;
parser = xtalloc (NULL, glcpp_parser_t);
parser = talloc (NULL, glcpp_parser_t);
glcpp_lex_init_extra (parser, &parser->scanner);
parser->defines = hash_table_ctor (32, hash_table_string_hash,
@@ -3596,7 +3604,7 @@ _glcpp_parser_expand_node (glcpp_parser_t *parser,
token_list_t *expansion;
token_t *final;
str = xtalloc_strdup (parser, token->value.str);
str = talloc_strdup (parser, token->value.str);
final = _token_create_str (parser, OTHER, str);
expansion = _token_list_create (parser);
_token_list_append (expansion, final);
@@ -3632,8 +3640,8 @@ _active_list_push (active_list_t *list,
{
active_list_t *node;
node = xtalloc (list, active_list_t);
node->identifier = xtalloc_strdup (node, identifier);
node = talloc (list, active_list_t);
node->identifier = talloc_strdup (node, identifier);
node->marker = marker;
node->next = list;
@@ -3783,7 +3791,7 @@ _define_object_macro (glcpp_parser_t *parser,
if (loc != NULL)
_check_for_reserved_macro_name(parser, loc, identifier);
macro = xtalloc (parser, macro_t);
macro = talloc (parser, macro_t);
macro->is_function = 0;
macro->parameters = NULL;
@@ -3804,7 +3812,7 @@ _define_function_macro (glcpp_parser_t *parser,
_check_for_reserved_macro_name(parser, loc, identifier);
macro = xtalloc (parser, macro_t);
macro = talloc (parser, macro_t);
macro->is_function = 1;
macro->parameters = talloc_steal (macro, parameters);
@@ -3930,7 +3938,7 @@ _glcpp_parser_skip_stack_push_if (glcpp_parser_t *parser, YYLTYPE *loc,
if (parser->skip_stack)
current = parser->skip_stack->type;
node = xtalloc (parser, skip_node_t);
node = talloc (parser, skip_node_t);
node->loc = *loc;
if (current == SKIP_NO_SKIP) {

View File

@@ -1,10 +1,9 @@
/* A Bison parser, made by GNU Bison 2.4.1. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by