X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4cc7be2f1b2212541321468f58762879985a5411..56beb0d2b20edc2f0ac8716c020053f8a103577d:/src/parse.c diff --git a/src/parse.c b/src/parse.c index f015958..05fbfbf 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* 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. 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 @@ -15,16 +17,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -105,6 +118,7 @@ OBJECT_TYPE = 307 }; #endif +/* Tokens. */ #define CLASS 258 #define FROM 259 #define CONST 260 @@ -819,17 +833,24 @@ ensure_property (void) # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE #line 668 "parse.y" -typedef union YYSTYPE { +{ char *id; GString *cbuf; GList *list; int line; int sigtype; -} YYSTYPE; -/* Line 190 of yacc.c. */ -#line 833 "y.tab.c" +} +/* Line 187 of yacc.c. */ +#line 853 "parse.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -840,17 +861,94 @@ typedef union YYSTYPE { /* Copy the second part of user declarations. */ -/* Line 213 of yacc.c. */ -#line 845 "y.tab.c" +/* Line 216 of yacc.c. */ +#line 866 "parse.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif -# ifndef YYFREE -# define YYFREE free +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int # endif -# ifndef YYMALLOC -# define YYMALLOC malloc +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif # endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -858,34 +956,76 @@ typedef union YYSTYPE { # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else # define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif +# else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short int yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -895,24 +1035,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -930,39 +1070,33 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 23 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 629 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 66 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 53 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 195 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 414 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 307 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1000,7 +1134,7 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short int yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 7, 10, 13, 15, 17, 19, 21, 23, 25, 27, 30, 33, 36, 39, 41, 43, 45, @@ -1024,8 +1158,8 @@ static const unsigned short int yyprhs[] = 725, 729, 731, 733, 736, 738 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { 67, 0, -1, 69, 70, 69, -1, 70, 69, -1, 69, 70, -1, 70, -1, 24, -1, 27, -1, 25, @@ -1104,7 +1238,7 @@ static const yysigned_char yyrhs[] = }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = +static const yytype_uint16 yyrline[] = { 0, 689, 689, 690, 691, 692, 695, 704, 713, 722, 731, 740, 751, 752, 753, 754, 755, 756, 757, 758, @@ -1129,9 +1263,9 @@ static const unsigned short int yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "CLASS", "FROM", "CONST", "VOID", @@ -1159,7 +1293,7 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -1172,7 +1306,7 @@ static const unsigned short int yytoknum[] = # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, @@ -1197,7 +1331,7 @@ static const unsigned char yyr1[] = }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, @@ -1224,7 +1358,7 @@ static const unsigned char yyr2[] = /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 0, 0, 0, 6, 8, 9, 7, 10, 11, 0, 0, 0, 16, 0, 5, 0, 17, 18, 19, 0, @@ -1270,8 +1404,8 @@ static const unsigned char yydefact[] = 177, 145, 141, 57 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { -1, 11, 12, 13, 14, 15, 100, 48, 49, 50, 183, 184, 185, 51, 52, 221, 53, 157, 214, 304, @@ -1284,7 +1418,7 @@ static const short int yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -325 -static const short int yypact[] = +static const yytype_int16 yypact[] = { 144, -5, 92, -325, -325, -325, -325, -325, -325, 98, 99, 123, -325, 144, 167, 78, -325, -325, -325, 161, @@ -1331,7 +1465,7 @@ static const short int yypact[] = }; /* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = +static const yytype_int16 yypgoto[] = { -325, -325, 103, 110, 549, -325, -188, -325, 527, -25, 382, 347, 387, -325, -325, -325, -325, -325, -325, 22, @@ -1346,7 +1480,7 @@ static const short int yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -157 -static const short int yytable[] = +static const yytype_int16 yytable[] = { 144, 87, 255, 118, 243, 218, 119, 344, 98, 92, 165, 66, 361, 168, 67, 250, 19, 122, 86, 280, @@ -1413,7 +1547,7 @@ static const short int yytable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 147 }; -static const short int yycheck[] = +static const yytype_int16 yycheck[] = { 101, 43, 190, 71, 181, 158, 71, 293, 50, 44, 5, 36, 336, 19, 36, 30, 21, 85, 43, 5, @@ -1482,7 +1616,7 @@ static const short int yycheck[] = /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 3, 9, 24, 25, 26, 27, 28, 29, 45, 46, 67, 68, 69, 70, 71, 111, 114, 116, 21, @@ -1528,22 +1662,6 @@ static const unsigned char yystos[] = 118, 101, 101, 57 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -1569,15 +1687,15 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) #define YYTERROR 1 @@ -1592,7 +1710,7 @@ while (0) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (N) \ + if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -1606,7 +1724,7 @@ while (0) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (0) + while (YYID (0)) #endif @@ -1618,8 +1736,8 @@ while (0) # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -1646,36 +1764,96 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short int *bottom, short int *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short int *bottom; - short int *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1684,37 +1862,45 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1736,7 +1922,7 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH @@ -1748,45 +1934,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -1796,53 +1984,171 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) { - default: - break; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -1853,8 +2159,7 @@ yydestruct (yymsg, yytype, yyvaluep) YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; @@ -1864,7 +2169,7 @@ yydestruct (yymsg, yytype, yyvaluep) { default: - break; + break; } } @@ -1872,13 +2177,13 @@ yydestruct (yymsg, yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -1903,14 +2208,18 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -1921,13 +2230,19 @@ yyparse () #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -1938,18 +2253,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -1958,9 +2273,9 @@ yyparse () YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1977,9 +2292,6 @@ yyparse () yyssp = yyss; yyvsp = yyvs; - - yyvsp[0] = yylval; - goto yysetstate; /*------------------------------------------------------------. @@ -1987,8 +2299,7 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -2001,18 +2312,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -2023,21 +2334,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -2068,12 +2379,10 @@ yyparse () `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -2115,22 +2424,21 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; goto yynewstate; @@ -2190,11 +2498,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", C_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2203,11 +2511,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", H_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2216,11 +2524,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", HT_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2229,11 +2537,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", PH_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2242,11 +2550,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", A_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2255,11 +2563,11 @@ yyreduce: { Node *node = node_new (CCODE_NODE, "cctype", AT_CCODE, - "cbuf:steal", ((yyvsp[0].cbuf))->str, + "cbuf:steal", ((yyvsp[(1) - (1)].cbuf))->str, "line_no", ccode_line, NULL); nodes = g_list_append(nodes,node); - g_string_free((yyvsp[0].cbuf),FALSE); + g_string_free((yyvsp[(1) - (1)].cbuf),FALSE); } break; @@ -2325,8 +2633,8 @@ yyreduce: #line 773 "parse.y" { class = node_new (CLASS_NODE, - "otype:steal", (yyvsp[-3].id), - "ptype:steal", (yyvsp[-1].id), + "otype:steal", (yyvsp[(2) - (5)].id), + "ptype:steal", (yyvsp[(4) - (5)].id), "bonobo_object_class:steal", bonobo_object_class, "glade_xml", glade_xml, "interfaces:steal", interfaces, @@ -2343,7 +2651,7 @@ yyreduce: case 24: #line 791 "parse.y" { - if(strcmp((yyvsp[-2].id),"abstract") == 0) { + if(strcmp((yyvsp[(2) - (4)].id),"abstract") == 0) { abstract = TRUE; } else { yyerror(_("parse error")); @@ -2355,12 +2663,12 @@ yyreduce: case 25: #line 799 "parse.y" { - if(strcmp((yyvsp[-3].id),"chunks") == 0) { + if(strcmp((yyvsp[(2) - (5)].id),"chunks") == 0) { g_free (chunk_size); - chunk_size = g_strdup((yyvsp[-2].id)); - } else if(strcmp((yyvsp[-3].id),"BonoboObject") == 0) { + chunk_size = g_strdup((yyvsp[(3) - (5)].id)); + } else if(strcmp((yyvsp[(2) - (5)].id),"BonoboObject") == 0) { g_free (bonobo_object_class); - bonobo_object_class = g_strdup((yyvsp[-2].id)); + bonobo_object_class = g_strdup((yyvsp[(3) - (5)].id)); } else { yyerror(_("parse error")); YYERROR; @@ -2371,9 +2679,9 @@ yyreduce: case 26: #line 811 "parse.y" { - if (strcmp ((yyvsp[-3].id), "interface") == 0) { + if (strcmp ((yyvsp[(2) - (5)].id), "interface") == 0) { interfaces = g_list_append (interfaces, - g_strdup ((yyvsp[-2].id))); + g_strdup ((yyvsp[(3) - (5)].id))); } else { yyerror(_("parse error")); YYERROR; @@ -2384,10 +2692,10 @@ yyreduce: case 27: #line 820 "parse.y" { - if(strcmp((yyvsp[-3].id),"chunks") == 0) { + if(strcmp((yyvsp[(2) - (5)].id),"chunks") == 0) { g_free (chunk_size); - if(atoi((yyvsp[-2].id)) != 0) - chunk_size = g_strdup((yyvsp[-2].id)); + if(atoi((yyvsp[(3) - (5)].id)) != 0) + chunk_size = g_strdup((yyvsp[(3) - (5)].id)); else chunk_size = NULL; } else { @@ -2400,9 +2708,9 @@ yyreduce: case 28: #line 832 "parse.y" { - if (strcmp ((yyvsp[-4].id), "GladeXML") == 0) { + if (strcmp ((yyvsp[(2) - (6)].id), "GladeXML") == 0) { glade_xml = TRUE; - add_construct_glade((yyvsp[-3].id), (yyvsp[-2].id), NULL); + add_construct_glade((yyvsp[(3) - (6)].id), (yyvsp[(4) - (6)].id), NULL); } else { yyerror(_("parse error")); YYERROR; @@ -2413,9 +2721,9 @@ yyreduce: case 29: #line 841 "parse.y" { - if (strcmp ((yyvsp[-5].id), "GladeXML") == 0) { + if (strcmp ((yyvsp[(2) - (7)].id), "GladeXML") == 0) { glade_xml = TRUE; - add_construct_glade((yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id)); + add_construct_glade((yyvsp[(3) - (7)].id), (yyvsp[(4) - (7)].id), (yyvsp[(5) - (7)].id)); } else { yyerror(_("parse error")); YYERROR; @@ -2426,9 +2734,9 @@ yyreduce: case 30: #line 850 "parse.y" { - if (strcmp ((yyvsp[-4].id), "GladeXML") == 0) { + if (strcmp ((yyvsp[(2) - (6)].id), "GladeXML") == 0) { glade_xml = TRUE; - add_construct_glade((yyvsp[-3].id), (yyvsp[-2].id), NULL); + add_construct_glade((yyvsp[(3) - (6)].id), (yyvsp[(4) - (6)].id), NULL); } else { yyerror(_("parse error")); YYERROR; @@ -2439,9 +2747,9 @@ yyreduce: case 31: #line 859 "parse.y" { - if (strcmp ((yyvsp[-5].id), "GladeXML") == 0) { + if (strcmp ((yyvsp[(2) - (7)].id), "GladeXML") == 0) { glade_xml = TRUE; - add_construct_glade((yyvsp[-4].id), (yyvsp[-3].id), (yyvsp[-2].id)); + add_construct_glade((yyvsp[(3) - (7)].id), (yyvsp[(4) - (7)].id), (yyvsp[(5) - (7)].id)); } else { yyerror(_("parse error")); YYERROR; @@ -2467,12 +2775,12 @@ yyreduce: case 35: #line 875 "parse.y" { - if (strcmp ((yyvsp[-1].id), "BonoboObject") != 0) { - g_free ((yyvsp[-1].id)); + if (strcmp ((yyvsp[(1) - (2)].id), "BonoboObject") != 0) { + g_free ((yyvsp[(1) - (2)].id)); yyerror (_("parse error")); YYERROR; } - g_free ((yyvsp[-1].id)); + g_free ((yyvsp[(1) - (2)].id)); last_added_method->bonobo_object_func = TRUE; } break; @@ -2480,15 +2788,15 @@ yyreduce: case 36: #line 884 "parse.y" { - if (strcmp ((yyvsp[-2].id), "interface") != 0) { - g_free ((yyvsp[-2].id)); - g_free ((yyvsp[-1].id)); + if (strcmp ((yyvsp[(1) - (3)].id), "interface") != 0) { + g_free ((yyvsp[(1) - (3)].id)); + g_free ((yyvsp[(2) - (3)].id)); yyerror (_("parse error")); YYERROR; } - g_free ((yyvsp[-2].id)); + g_free ((yyvsp[(1) - (3)].id)); node_set ((Node *)last_added_method, - "interface:steal", (yyvsp[-1].id), + "interface:steal", (yyvsp[(2) - (3)].id), NULL); } break; @@ -2536,21 +2844,21 @@ yyreduce: case 45: #line 908 "parse.y" { - if (strcmp ((yyvsp[-1].id), "destroywith") == 0) { - g_free ((yyvsp[-1].id)); + if (strcmp ((yyvsp[(1) - (2)].id), "destroywith") == 0) { + g_free ((yyvsp[(1) - (2)].id)); destructor_unref = FALSE; - destructor = (yyvsp[0].id); + destructor = (yyvsp[(2) - (2)].id); destructor_line = line_no; destructor_simple = TRUE; - } else if (strcmp ((yyvsp[-1].id), "unrefwith") == 0) { - g_free ((yyvsp[-1].id)); + } else if (strcmp ((yyvsp[(1) - (2)].id), "unrefwith") == 0) { + g_free ((yyvsp[(1) - (2)].id)); destructor_unref = TRUE; - destructor = (yyvsp[0].id); + destructor = (yyvsp[(2) - (2)].id); destructor_line = line_no; destructor_simple = TRUE; } else { - g_free ((yyvsp[-1].id)); - g_free ((yyvsp[0].id)); + g_free ((yyvsp[(1) - (2)].id)); + g_free ((yyvsp[(2) - (2)].id)); yyerror (_("parse error")); YYERROR; } @@ -2560,23 +2868,23 @@ yyreduce: case 46: #line 928 "parse.y" { - if (strcmp ((yyvsp[-2].id), "destroy") == 0) { - g_free((yyvsp[-2].id)); + if (strcmp ((yyvsp[(1) - (3)].id), "destroy") == 0) { + g_free((yyvsp[(1) - (3)].id)); destructor_unref = FALSE; - destructor = ((yyvsp[0].cbuf))->str; - g_string_free((yyvsp[0].cbuf), FALSE); + destructor = ((yyvsp[(3) - (3)].cbuf))->str; + g_string_free((yyvsp[(3) - (3)].cbuf), FALSE); destructor_line = ccode_line; destructor_simple = FALSE; - } else if (strcmp ((yyvsp[-2].id), "unref") == 0) { - g_free ((yyvsp[-2].id)); + } else if (strcmp ((yyvsp[(1) - (3)].id), "unref") == 0) { + g_free ((yyvsp[(1) - (3)].id)); destructor_unref = TRUE; - destructor = ((yyvsp[0].cbuf))->str; - g_string_free ((yyvsp[0].cbuf), FALSE); + destructor = ((yyvsp[(3) - (3)].cbuf))->str; + g_string_free ((yyvsp[(3) - (3)].cbuf), FALSE); destructor_line = ccode_line; destructor_simple = FALSE; } else { - g_free ((yyvsp[-2].id)); - g_string_free ((yyvsp[0].cbuf), TRUE); + g_free ((yyvsp[(1) - (3)].id)); + g_string_free ((yyvsp[(3) - (3)].cbuf), TRUE); yyerror (_("parse error")); YYERROR; } @@ -2586,7 +2894,7 @@ yyreduce: case 47: #line 952 "parse.y" { - initializer = (yyvsp[0].id); + initializer = (yyvsp[(2) - (2)].id); initializer_line = ccode_line; } break; @@ -2594,9 +2902,9 @@ yyreduce: case 48: #line 956 "parse.y" { - initializer = ((yyvsp[0].cbuf))->str; + initializer = ((yyvsp[(3) - (3)].cbuf))->str; initializer_line = ccode_line; - g_string_free((yyvsp[0].cbuf), FALSE); + g_string_free((yyvsp[(3) - (3)].cbuf), FALSE); } break; @@ -2623,7 +2931,7 @@ yyreduce: case 53: #line 968 "parse.y" { - if (strcmp ((yyvsp[0].id), "GladeXML") == 0) { + if (strcmp ((yyvsp[(1) - (1)].id), "GladeXML") == 0) { glade_widget = TRUE; } else { yyerror(_("parse error")); @@ -2643,14 +2951,14 @@ yyreduce: case 55: #line 982 "parse.y" { - push_variable((yyvsp[-2].id), the_scope,(yyvsp[-4].line), NULL); + push_variable((yyvsp[(3) - (5)].id), the_scope,(yyvsp[(1) - (5)].line), NULL); } break; case 56: #line 985 "parse.y" { - push_variable((yyvsp[-3].id), the_scope, (yyvsp[-5].line), (yyvsp[-2].id)); + push_variable((yyvsp[(3) - (6)].id), the_scope, (yyvsp[(1) - (6)].line), (yyvsp[(4) - (6)].id)); } break; @@ -2658,61 +2966,61 @@ yyreduce: #line 990 "parse.y" { Node *node = NULL; - if(strcmp((yyvsp[-6].id),"get")==0 && - strcmp((yyvsp[-3].id),"set")==0) { + if(strcmp((yyvsp[(6) - (12)].id),"get")==0 && + strcmp((yyvsp[(9) - (12)].id),"set")==0) { Type *type = pop_type(); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); + g_free ((yyvsp[(6) - (12)].id)); + g_free ((yyvsp[(9) - (12)].id)); node = node_new (ARGUMENT_NODE, - "gtktype:steal", (yyvsp[-9].id), + "gtktype:steal", (yyvsp[(3) - (12)].id), "atype:steal", type, - "flags:steal", (yyvsp[-10].list), - "name:steal", (yyvsp[-8].id), - "get:steal", ((yyvsp[-4].cbuf))->str, - "get_line", (yyvsp[-5].line), - "set:steal", ((yyvsp[-1].cbuf))->str, - "set_line", (yyvsp[-2].line), - "line_no", (yyvsp[-11].line), + "flags:steal", (yyvsp[(2) - (12)].list), + "name:steal", (yyvsp[(4) - (12)].id), + "get:steal", ((yyvsp[(8) - (12)].cbuf))->str, + "get_line", (yyvsp[(7) - (12)].line), + "set:steal", ((yyvsp[(11) - (12)].cbuf))->str, + "set_line", (yyvsp[(10) - (12)].line), + "line_no", (yyvsp[(1) - (12)].line), NULL); class_nodes = g_list_append(class_nodes,node); - g_string_free ((yyvsp[-4].cbuf), FALSE); - g_string_free ((yyvsp[-1].cbuf), FALSE); + g_string_free ((yyvsp[(8) - (12)].cbuf), FALSE); + g_string_free ((yyvsp[(11) - (12)].cbuf), FALSE); - } else if(strcmp((yyvsp[-6].id),"set")==0 && - strcmp((yyvsp[-3].id),"get")==0) { + } else if(strcmp((yyvsp[(6) - (12)].id),"set")==0 && + strcmp((yyvsp[(9) - (12)].id),"get")==0) { Type *type = pop_type(); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); + g_free ((yyvsp[(6) - (12)].id)); + g_free ((yyvsp[(9) - (12)].id)); node = node_new (ARGUMENT_NODE, - "gtktype:steal", (yyvsp[-9].id), + "gtktype:steal", (yyvsp[(3) - (12)].id), "atype:steal", type, - "flags:steal", (yyvsp[-10].list), - "name:steal", (yyvsp[-8].id), - "get:steal", ((yyvsp[-1].cbuf))->str, - "get_line", (yyvsp[-2].line), - "set:steal", ((yyvsp[-4].cbuf))->str, - "set_line", (yyvsp[-5].line), - "line_no", (yyvsp[-11].line), + "flags:steal", (yyvsp[(2) - (12)].list), + "name:steal", (yyvsp[(4) - (12)].id), + "get:steal", ((yyvsp[(11) - (12)].cbuf))->str, + "get_line", (yyvsp[(10) - (12)].line), + "set:steal", ((yyvsp[(8) - (12)].cbuf))->str, + "set_line", (yyvsp[(7) - (12)].line), + "line_no", (yyvsp[(1) - (12)].line), NULL); - g_string_free ((yyvsp[-1].cbuf), FALSE); - g_string_free ((yyvsp[-4].cbuf), FALSE); + g_string_free ((yyvsp[(11) - (12)].cbuf), FALSE); + g_string_free ((yyvsp[(8) - (12)].cbuf), FALSE); class_nodes = g_list_append(class_nodes,node); } else { - g_free ((yyvsp[-9].id)); - g_free ((yyvsp[-8].id)); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); - g_list_foreach ((yyvsp[-10].list), (GFunc)g_free, NULL); - g_list_free ((yyvsp[-10].list)); - g_string_free ((yyvsp[-1].cbuf), TRUE); - g_string_free ((yyvsp[-4].cbuf), TRUE); + g_free ((yyvsp[(3) - (12)].id)); + g_free ((yyvsp[(4) - (12)].id)); + g_free ((yyvsp[(6) - (12)].id)); + g_free ((yyvsp[(9) - (12)].id)); + g_list_foreach ((yyvsp[(2) - (12)].list), (GFunc)g_free, NULL); + g_list_free ((yyvsp[(2) - (12)].list)); + g_string_free ((yyvsp[(11) - (12)].cbuf), TRUE); + g_string_free ((yyvsp[(8) - (12)].cbuf), TRUE); yyerror (_("parse error")); YYERROR; } - if ((yyvsp[-7].id) != NULL) { + if ((yyvsp[(5) - (12)].id) != NULL) { Argument *arg = (Argument *)node; export_accessors (arg->name, arg->get != NULL, arg->get_line, @@ -2720,7 +3028,7 @@ yyreduce: arg->atype, arg->gtktype, arg->line_no); - g_free ((yyvsp[-7].id)); + g_free ((yyvsp[(5) - (12)].id)); } } @@ -2730,48 +3038,48 @@ yyreduce: #line 1058 "parse.y" { Node *node = NULL; - if(strcmp((yyvsp[-3].id), "get") == 0) { + if(strcmp((yyvsp[(6) - (9)].id), "get") == 0) { Type *type = pop_type(); - g_free ((yyvsp[-3].id)); + g_free ((yyvsp[(6) - (9)].id)); node = node_new (ARGUMENT_NODE, - "gtktype:steal", (yyvsp[-6].id), + "gtktype:steal", (yyvsp[(3) - (9)].id), "atype:steal", type, - "flags:steal", (yyvsp[-7].list), - "name:steal", (yyvsp[-5].id), - "get:steal", ((yyvsp[-1].cbuf))->str, - "get_line", (yyvsp[-2].line), - "line_no", (yyvsp[-8].line), + "flags:steal", (yyvsp[(2) - (9)].list), + "name:steal", (yyvsp[(4) - (9)].id), + "get:steal", ((yyvsp[(8) - (9)].cbuf))->str, + "get_line", (yyvsp[(7) - (9)].line), + "line_no", (yyvsp[(1) - (9)].line), NULL); - g_string_free ((yyvsp[-1].cbuf), FALSE); + g_string_free ((yyvsp[(8) - (9)].cbuf), FALSE); class_nodes = g_list_append(class_nodes, node); - } else if(strcmp((yyvsp[-3].id), "set") == 0) { + } else if(strcmp((yyvsp[(6) - (9)].id), "set") == 0) { Type *type = pop_type(); - g_free ((yyvsp[-3].id)); + g_free ((yyvsp[(6) - (9)].id)); node = node_new (ARGUMENT_NODE, - "gtktype:steal", (yyvsp[-6].id), + "gtktype:steal", (yyvsp[(3) - (9)].id), "atype:steal", type, - "flags:steal", (yyvsp[-7].list), - "name:steal", (yyvsp[-5].id), - "set:steal", ((yyvsp[-1].cbuf))->str, - "set_line", (yyvsp[-2].line), - "line_no", (yyvsp[-8].line), + "flags:steal", (yyvsp[(2) - (9)].list), + "name:steal", (yyvsp[(4) - (9)].id), + "set:steal", ((yyvsp[(8) - (9)].cbuf))->str, + "set_line", (yyvsp[(7) - (9)].line), + "line_no", (yyvsp[(1) - (9)].line), NULL); - g_string_free ((yyvsp[-1].cbuf), FALSE); + g_string_free ((yyvsp[(8) - (9)].cbuf), FALSE); class_nodes = g_list_append (class_nodes, node); } else { - g_free ((yyvsp[-3].id)); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-5].id)); - g_list_foreach ((yyvsp[-7].list), (GFunc)g_free, NULL); - g_list_free ((yyvsp[-7].list)); - g_string_free ((yyvsp[-1].cbuf), TRUE); + g_free ((yyvsp[(6) - (9)].id)); + g_free ((yyvsp[(3) - (9)].id)); + g_free ((yyvsp[(4) - (9)].id)); + g_list_foreach ((yyvsp[(2) - (9)].list), (GFunc)g_free, NULL); + g_list_free ((yyvsp[(2) - (9)].list)); + g_string_free ((yyvsp[(8) - (9)].cbuf), TRUE); yyerror(_("parse error")); YYERROR; } - if ((yyvsp[-4].id) != NULL) { + if ((yyvsp[(5) - (9)].id) != NULL) { Argument *arg = (Argument *)node; export_accessors (arg->name, arg->get != NULL, arg->get_line, @@ -2779,7 +3087,7 @@ yyreduce: arg->atype, arg->gtktype, arg->line_no); - g_free ((yyvsp[-4].id)); + g_free ((yyvsp[(5) - (9)].id)); } } break; @@ -2793,74 +3101,74 @@ yyreduce: Type *type; const char *root; - if(strcmp((yyvsp[0].id), "link")!=0 && - strcmp((yyvsp[0].id), "stringlink")!=0 && - strcmp((yyvsp[0].id), "objectlink")!=0) { - g_free((yyvsp[0].id)); - g_free((yyvsp[-3].id)); - g_free((yyvsp[-2].id)); - g_list_foreach((yyvsp[-4].list),(GFunc)g_free,NULL); - g_list_free((yyvsp[-4].list)); + if(strcmp((yyvsp[(6) - (6)].id), "link")!=0 && + strcmp((yyvsp[(6) - (6)].id), "stringlink")!=0 && + strcmp((yyvsp[(6) - (6)].id), "objectlink")!=0) { + g_free((yyvsp[(6) - (6)].id)); + g_free((yyvsp[(3) - (6)].id)); + g_free((yyvsp[(4) - (6)].id)); + g_list_foreach((yyvsp[(2) - (6)].list),(GFunc)g_free,NULL); + g_list_free((yyvsp[(2) - (6)].list)); yyerror(_("parse error")); YYERROR; } type = pop_type(); - var = find_var_or_die((yyvsp[-2].id), (yyvsp[-5].line)); + var = find_var_or_die((yyvsp[(4) - (6)].id), (yyvsp[(1) - (6)].line)); if(var->scope == PRIVATE_SCOPE) { root = "self->_priv"; } else if(var->scope == CLASS_SCOPE) { root = "SELF_GET_CLASS(self)"; if(no_self_alias) - error_print(GOB_ERROR, (yyvsp[-5].line), + error_print(GOB_ERROR, (yyvsp[(1) - (6)].line), _("Self aliases needed when autolinking to a classwide member")); } else { root = "self"; } - if(strcmp((yyvsp[0].id), "link")==0) { + if(strcmp((yyvsp[(6) - (6)].id), "link")==0) { set = g_strdup_printf("%s->%s = ARG;", - root, (yyvsp[-2].id)); - } else if(strcmp((yyvsp[0].id), "stringlink")==0) { + root, (yyvsp[(4) - (6)].id)); + } else if(strcmp((yyvsp[(6) - (6)].id), "stringlink")==0) { set = g_strdup_printf("g_free (%s->%s); " "%s->%s = g_strdup (ARG);", - root, (yyvsp[-2].id), - root, (yyvsp[-2].id)); - } else if(strcmp((yyvsp[0].id), "objectlink")==0) { + root, (yyvsp[(4) - (6)].id), + root, (yyvsp[(4) - (6)].id)); + } else if(strcmp((yyvsp[(6) - (6)].id), "objectlink")==0) { set = g_strdup_printf( "if (ARG != NULL) " "g_object_ref (G_OBJECT (ARG)); " "if (%s->%s != NULL) " "g_object_unref (G_OBJECT (%s->%s)); " "%s->%s = ARG;", - root, (yyvsp[-2].id), - root, (yyvsp[-2].id), - root, (yyvsp[-2].id)); + root, (yyvsp[(4) - (6)].id), + root, (yyvsp[(4) - (6)].id), + root, (yyvsp[(4) - (6)].id)); } else { g_assert_not_reached(); } - get = g_strdup_printf("ARG = %s->%s;", root, (yyvsp[-2].id)); + get = g_strdup_printf("ARG = %s->%s;", root, (yyvsp[(4) - (6)].id)); - g_free ((yyvsp[0].id)); + g_free ((yyvsp[(6) - (6)].id)); if (type == NULL) type = (Type *)node_copy ((Node *)var->vtype); node = node_new (ARGUMENT_NODE, - "gtktype:steal", (yyvsp[-3].id), + "gtktype:steal", (yyvsp[(3) - (6)].id), "atype:steal", type, - "flags:steal", (yyvsp[-4].list), - "name:steal", (yyvsp[-2].id), + "flags:steal", (yyvsp[(2) - (6)].list), + "name:steal", (yyvsp[(4) - (6)].id), "get:steal", get, - "get_line", (yyvsp[-5].line), + "get_line", (yyvsp[(1) - (6)].line), "set:steal", set, - "set_line", (yyvsp[-5].line), - "line_no", (yyvsp[-5].line), + "set_line", (yyvsp[(1) - (6)].line), + "line_no", (yyvsp[(1) - (6)].line), NULL); - if ((yyvsp[-1].id) != NULL) { + if ((yyvsp[(5) - (6)].id) != NULL) { Argument *arg = (Argument *)node; export_accessors (arg->name, arg->get != NULL, arg->get_line, @@ -2868,7 +3176,7 @@ yyreduce: arg->atype, arg->gtktype, arg->line_no); - g_free ((yyvsp[-1].id)); + g_free ((yyvsp[(5) - (6)].id)); } class_nodes = g_list_append (class_nodes, node); @@ -2878,12 +3186,12 @@ yyreduce: case 60: #line 1201 "parse.y" { - if (strcmp ((yyvsp[-1].id), "export")!=0) { - g_free ((yyvsp[-1].id)); + if (strcmp ((yyvsp[(2) - (3)].id), "export")!=0) { + g_free ((yyvsp[(2) - (3)].id)); yyerror (_("parse error")); YYERROR; } - (yyval.id) = (yyvsp[-1].id); + (yyval.id) = (yyvsp[(2) - (3)].id); } break; @@ -2899,39 +3207,39 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "line_no", (yyvsp[-10].line), - "gtktype:steal", debool ((yyvsp[-9].id)), - "name:steal", (yyvsp[-8].id), + "line_no", (yyvsp[(1) - (11)].line), + "gtktype:steal", debool ((yyvsp[(2) - (11)].id)), + "name:steal", (yyvsp[(3) - (11)].id), NULL); - if (strcmp ((yyvsp[-6].id), "get") == 0 && - strcmp ((yyvsp[-3].id), "set") == 0) { + if (strcmp ((yyvsp[(5) - (11)].id), "get") == 0 && + strcmp ((yyvsp[(8) - (11)].id), "set") == 0) { node_set ((Node *)property, - "get:steal", ((yyvsp[-4].cbuf))->str, - "get_line", (yyvsp[-5].line), - "set:steal", ((yyvsp[-1].cbuf))->str, - "set_line", (yyvsp[-2].line), + "get:steal", ((yyvsp[(7) - (11)].cbuf))->str, + "get_line", (yyvsp[(6) - (11)].line), + "set:steal", ((yyvsp[(10) - (11)].cbuf))->str, + "set_line", (yyvsp[(9) - (11)].line), NULL); - g_string_free ((yyvsp[-4].cbuf), FALSE); - g_string_free ((yyvsp[-1].cbuf), FALSE); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); - } else if (strcmp ((yyvsp[-6].id), "set") == 0 && - strcmp ((yyvsp[-3].id), "get") == 0) { + g_string_free ((yyvsp[(7) - (11)].cbuf), FALSE); + g_string_free ((yyvsp[(10) - (11)].cbuf), FALSE); + g_free ((yyvsp[(5) - (11)].id)); + g_free ((yyvsp[(8) - (11)].id)); + } else if (strcmp ((yyvsp[(5) - (11)].id), "set") == 0 && + strcmp ((yyvsp[(8) - (11)].id), "get") == 0) { node_set ((Node *)property, - "get:steal", ((yyvsp[-1].cbuf))->str, - "get_line", (yyvsp[-2].line), - "set:steal", ((yyvsp[-4].cbuf))->str, - "set_line", (yyvsp[-5].line), + "get:steal", ((yyvsp[(10) - (11)].cbuf))->str, + "get_line", (yyvsp[(9) - (11)].line), + "set:steal", ((yyvsp[(7) - (11)].cbuf))->str, + "set_line", (yyvsp[(6) - (11)].line), NULL); - g_string_free ((yyvsp[-4].cbuf), FALSE); - g_string_free ((yyvsp[-1].cbuf), FALSE); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); + g_string_free ((yyvsp[(7) - (11)].cbuf), FALSE); + g_string_free ((yyvsp[(10) - (11)].cbuf), FALSE); + g_free ((yyvsp[(5) - (11)].id)); + g_free ((yyvsp[(8) - (11)].id)); } else { - g_string_free ((yyvsp[-4].cbuf), TRUE); - g_string_free ((yyvsp[-1].cbuf), TRUE); - g_free ((yyvsp[-6].id)); - g_free ((yyvsp[-3].id)); + g_string_free ((yyvsp[(7) - (11)].cbuf), TRUE); + g_string_free ((yyvsp[(10) - (11)].cbuf), TRUE); + g_free ((yyvsp[(5) - (11)].id)); + g_free ((yyvsp[(8) - (11)].id)); node_free ((Node *)property); property = NULL; yyerror (_("parse error")); @@ -2951,27 +3259,27 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "line_no", (yyvsp[-7].line), - "gtktype:steal", debool ((yyvsp[-6].id)), - "name:steal", (yyvsp[-5].id), + "line_no", (yyvsp[(1) - (8)].line), + "gtktype:steal", debool ((yyvsp[(2) - (8)].id)), + "name:steal", (yyvsp[(3) - (8)].id), NULL); - if (strcmp ((yyvsp[-3].id), "get") == 0) { + if (strcmp ((yyvsp[(5) - (8)].id), "get") == 0) { node_set ((Node *)property, - "get:steal", ((yyvsp[-1].cbuf))->str, - "get_line", (yyvsp[-2].line), + "get:steal", ((yyvsp[(7) - (8)].cbuf))->str, + "get_line", (yyvsp[(6) - (8)].line), NULL); - g_string_free ((yyvsp[-1].cbuf), FALSE); - g_free ((yyvsp[-3].id)); - } else if (strcmp ((yyvsp[-3].id), "set") == 0) { + g_string_free ((yyvsp[(7) - (8)].cbuf), FALSE); + g_free ((yyvsp[(5) - (8)].id)); + } else if (strcmp ((yyvsp[(5) - (8)].id), "set") == 0) { node_set ((Node *)property, - "set:steal", ((yyvsp[-1].cbuf))->str, - "set_line", (yyvsp[-2].line), + "set:steal", ((yyvsp[(7) - (8)].cbuf))->str, + "set_line", (yyvsp[(6) - (8)].line), NULL); - g_string_free ((yyvsp[-1].cbuf), FALSE); - g_free ((yyvsp[-3].id)); + g_string_free ((yyvsp[(7) - (8)].cbuf), FALSE); + g_free ((yyvsp[(5) - (8)].id)); } else { - g_string_free ((yyvsp[-1].cbuf), TRUE); - g_free ((yyvsp[-3].id)); + g_string_free ((yyvsp[(7) - (8)].cbuf), TRUE); + g_free ((yyvsp[(5) - (8)].id)); node_free ((Node *)property); property = NULL; yyerror (_("parse error")); @@ -2991,9 +3299,9 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "line_no", (yyvsp[-4].line), - "gtktype:steal", debool ((yyvsp[-3].id)), - "name:steal", (yyvsp[-2].id), + "line_no", (yyvsp[(1) - (5)].line), + "gtktype:steal", debool ((yyvsp[(2) - (5)].id)), + "name:steal", (yyvsp[(3) - (5)].id), NULL); property_link_and_export ((Node *)property); if (property != NULL) { @@ -3026,31 +3334,31 @@ yyreduce: case 69: #line 1322 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 70: #line 1323 "parse.y" { - if (strcmp ((yyvsp[-3].id), "_") != 0) { - g_free ((yyvsp[-3].id)); + if (strcmp ((yyvsp[(1) - (4)].id), "_") != 0) { + g_free ((yyvsp[(1) - (4)].id)); yyerror(_("parse error")); YYERROR; } - g_free ((yyvsp[-3].id)); - (yyval.id) = g_strconcat ("_(", (yyvsp[-1].id), ")", NULL); - g_free ((yyvsp[-1].id)); + g_free ((yyvsp[(1) - (4)].id)); + (yyval.id) = g_strconcat ("_(", (yyvsp[(3) - (4)].id), ")", NULL); + g_free ((yyvsp[(3) - (4)].id)); } break; case 71: #line 1335 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 72: #line 1336 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 73: @@ -3058,7 +3366,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "nick:steal", (yyvsp[0].id), + "nick:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3068,7 +3376,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "blurb:steal", (yyvsp[0].id), + "blurb:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3078,7 +3386,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "maximum:steal", (yyvsp[0].id), + "maximum:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3088,7 +3396,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "minimum:steal", (yyvsp[0].id), + "minimum:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3098,7 +3406,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "default_value:steal", (yyvsp[0].id), + "default_value:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3108,7 +3416,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "flags:steal", (yyvsp[0].list), + "flags:steal", (yyvsp[(3) - (3)].list), NULL); } break; @@ -3129,7 +3437,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3139,7 +3447,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3149,7 +3457,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3159,7 +3467,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3169,7 +3477,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3179,7 +3487,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3189,7 +3497,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3199,7 +3507,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3209,7 +3517,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3219,7 +3527,7 @@ yyreduce: { ensure_property (); node_set ((Node *)property, - "extra_gtktype:steal", (yyvsp[0].id), + "extra_gtktype:steal", (yyvsp[(3) - (3)].id), NULL); } break; @@ -3228,23 +3536,23 @@ yyreduce: #line 1442 "parse.y" { ensure_property (); - if (strcmp ((yyvsp[0].id), "override") == 0) { - g_free((yyvsp[0].id)); + if (strcmp ((yyvsp[(1) - (1)].id), "override") == 0) { + g_free((yyvsp[(1) - (1)].id)); node_set ((Node *)property, "override", TRUE, NULL); - } else if (strcmp ((yyvsp[0].id), "link") == 0) { - g_free((yyvsp[0].id)); + } else if (strcmp ((yyvsp[(1) - (1)].id), "link") == 0) { + g_free((yyvsp[(1) - (1)].id)); node_set ((Node *)property, "link", TRUE, NULL); - } else if (strcmp ((yyvsp[0].id), "export") == 0) { - g_free((yyvsp[0].id)); + } else if (strcmp ((yyvsp[(1) - (1)].id), "export") == 0) { + g_free((yyvsp[(1) - (1)].id)); node_set ((Node *)property, "export", TRUE, NULL); } else { - g_free((yyvsp[0].id)); + g_free((yyvsp[(1) - (1)].id)); yyerror(_("parse error")); YYERROR; } @@ -3254,27 +3562,27 @@ yyreduce: case 91: #line 1467 "parse.y" { - if(strcmp((yyvsp[-2].id),"type")!=0) { - g_free((yyvsp[-4].id)); - g_free((yyvsp[-2].id)); + if(strcmp((yyvsp[(3) - (5)].id),"type")!=0) { + g_free((yyvsp[(1) - (5)].id)); + g_free((yyvsp[(3) - (5)].id)); yyerror(_("parse error")); YYERROR; } - (yyval.id) = debool ((yyvsp[-4].id)); + (yyval.id) = debool ((yyvsp[(1) - (5)].id)); } break; case 92: #line 1476 "parse.y" { - (yyval.id) = debool ((yyvsp[0].id)); + (yyval.id) = debool ((yyvsp[(1) - (1)].id)); typestack = g_list_prepend(typestack,NULL); } break; case 93: #line 1482 "parse.y" - { (yyval.list) = (yyvsp[-1].list); } + { (yyval.list) = (yyvsp[(2) - (3)].list); } break; case 94: @@ -3285,14 +3593,14 @@ yyreduce: case 95: #line 1486 "parse.y" { - (yyval.list) = g_list_append((yyvsp[0].list),(yyvsp[-2].id)); + (yyval.list) = g_list_append((yyvsp[(3) - (3)].list),(yyvsp[(1) - (3)].id)); } break; case 96: #line 1489 "parse.y" { - (yyval.list) = g_list_append(NULL,(yyvsp[0].id)); + (yyval.list) = g_list_append(NULL,(yyvsp[(1) - (1)].id)); } break; @@ -3300,8 +3608,8 @@ yyreduce: #line 1495 "parse.y" { Node *node = node_new (TYPE_NODE, - "name:steal", (yyvsp[-1].id), - "pointer:steal", (yyvsp[0].id), + "name:steal", (yyvsp[(1) - (2)].id), + "pointer:steal", (yyvsp[(2) - (2)].id), NULL); typestack = g_list_prepend(typestack,node); } @@ -3311,7 +3619,7 @@ yyreduce: #line 1502 "parse.y" { Node *node = node_new (TYPE_NODE, - "name:steal", (yyvsp[0].id), + "name:steal", (yyvsp[(1) - (1)].id), NULL); typestack = g_list_prepend(typestack,node); } @@ -3320,110 +3628,110 @@ yyreduce: case 99: #line 1511 "parse.y" { - (yyval.id) = (yyvsp[0].id); + (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 100: #line 1514 "parse.y" { - (yyval.id) = (yyvsp[0].id); + (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 101: #line 1517 "parse.y" { - (yyval.id) = g_strconcat("const ", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 102: #line 1521 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " const", NULL); - g_free((yyvsp[-1].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL); + g_free((yyvsp[(1) - (2)].id)); } break; case 103: #line 1525 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " ", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 104: #line 1529 "parse.y" { - (yyval.id) = g_strconcat("const ", (yyvsp[-1].id), " ", - (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (3)].id), " ", + (yyvsp[(3) - (3)].id), NULL); + g_free((yyvsp[(3) - (3)].id)); } break; case 105: #line 1534 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-2].id), " ", - (yyvsp[-1].id), " const", NULL); - g_free((yyvsp[-1].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (3)].id), " ", + (yyvsp[(2) - (3)].id), " const", NULL); + g_free((yyvsp[(2) - (3)].id)); } break; case 106: #line 1542 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " ", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 107: #line 1546 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " ", (yyvsp[0].id), NULL); - g_free((yyvsp[-1].id)); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " ", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(1) - (2)].id)); + g_free((yyvsp[(2) - (2)].id)); } break; case 108: #line 1551 "parse.y" { - (yyval.id) = g_strconcat("const ", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("const ", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 109: #line 1555 "parse.y" { - (yyval.id) = (yyvsp[0].id); + (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 110: #line 1558 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " const", NULL); - g_free((yyvsp[-1].id)); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL); + g_free((yyvsp[(1) - (2)].id)); } break; case 111: #line 1562 "parse.y" { - (yyval.id) = g_strdup((yyvsp[0].id)); + (yyval.id) = g_strdup((yyvsp[(1) - (1)].id)); } break; case 112: #line 1565 "parse.y" { - (yyval.id) = g_strconcat((yyvsp[-1].id), " const", NULL); + (yyval.id) = g_strconcat((yyvsp[(1) - (2)].id), " const", NULL); } break; @@ -3500,32 +3808,32 @@ yyreduce: case 127: #line 1588 "parse.y" { - (yyval.id) = g_strconcat("*", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("*", (yyvsp[(2) - (2)].id), NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 128: #line 1592 "parse.y" { - (yyval.id) = g_strconcat("* const", (yyvsp[0].id), NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("* const", (yyvsp[(3) - (3)].id), NULL); + g_free((yyvsp[(3) - (3)].id)); } break; case 129: #line 1599 "parse.y" { - if(strcmp((yyvsp[-1].id), "first")==0) + if(strcmp((yyvsp[(1) - (2)].id), "first")==0) (yyval.sigtype) = SIGNAL_FIRST_METHOD; - else if(strcmp((yyvsp[-1].id), "last")==0) + else if(strcmp((yyvsp[(1) - (2)].id), "last")==0) (yyval.sigtype) = SIGNAL_LAST_METHOD; else { yyerror(_("signal must be 'first' or 'last'")); - g_free((yyvsp[-1].id)); + g_free((yyvsp[(1) - (2)].id)); YYERROR; } - g_free((yyvsp[-1].id)); + g_free((yyvsp[(1) - (2)].id)); } break; @@ -3539,32 +3847,32 @@ yyreduce: case 131: #line 1617 "parse.y" { - if(strcmp((yyvsp[-1].id),"first")==0) + if(strcmp((yyvsp[(2) - (3)].id),"first")==0) (yyval.sigtype) = SIGNAL_FIRST_METHOD; - else if(strcmp((yyvsp[-1].id),"last")==0) + else if(strcmp((yyvsp[(2) - (3)].id),"last")==0) (yyval.sigtype) = SIGNAL_LAST_METHOD; else { yyerror(_("signal must be 'first' or 'last'")); - g_free((yyvsp[-1].id)); + g_free((yyvsp[(2) - (3)].id)); YYERROR; } - g_free((yyvsp[-1].id)); + g_free((yyvsp[(2) - (3)].id)); } break; case 132: #line 1629 "parse.y" { - if(strcmp((yyvsp[-2].id),"first")==0) + if(strcmp((yyvsp[(1) - (3)].id),"first")==0) (yyval.sigtype) = SIGNAL_FIRST_METHOD; - else if(strcmp((yyvsp[-2].id),"last")==0) + else if(strcmp((yyvsp[(1) - (3)].id),"last")==0) (yyval.sigtype) = SIGNAL_LAST_METHOD; else { yyerror(_("signal must be 'first' or 'last'")); - g_free((yyvsp[-2].id)); + g_free((yyvsp[(1) - (3)].id)); YYERROR; } - g_free((yyvsp[-2].id)); + g_free((yyvsp[(1) - (3)].id)); } break; @@ -3586,27 +3894,27 @@ yyreduce: case 135: #line 1650 "parse.y" { - gtktypes = g_list_prepend(gtktypes, debool ((yyvsp[-3].id))); + gtktypes = g_list_prepend(gtktypes, debool ((yyvsp[(1) - (4)].id))); } break; case 136: #line 1655 "parse.y" { - gtktypes = g_list_append(gtktypes, debool ((yyvsp[0].id))); + gtktypes = g_list_append(gtktypes, debool ((yyvsp[(3) - (3)].id))); } break; case 137: #line 1658 "parse.y" { - gtktypes = g_list_append(gtktypes, debool ((yyvsp[0].id))); + gtktypes = g_list_append(gtktypes, debool ((yyvsp[(1) - (1)].id))); } break; case 138: #line 1663 "parse.y" - { (yyval.cbuf) = (yyvsp[0].cbuf); } + { (yyval.cbuf) = (yyvsp[(2) - (2)].cbuf); } break; case 139: @@ -3628,9 +3936,9 @@ yyreduce: free_all_global_state(); YYERROR; } - push_function(the_scope, (yyvsp[-7].sigtype),NULL, - (yyvsp[-5].id), (yyvsp[0].cbuf),(yyvsp[-9].line), - ccode_line, vararg, (yyvsp[-8].list)); + push_function(the_scope, (yyvsp[(3) - (10)].sigtype),NULL, + (yyvsp[(5) - (10)].id), (yyvsp[(10) - (10)].cbuf),(yyvsp[(1) - (10)].line), + ccode_line, vararg, (yyvsp[(2) - (10)].list)); } break; @@ -3648,9 +3956,9 @@ yyreduce: free_all_global_state(); YYERROR; } - push_function(the_scope, (yyvsp[-7].sigtype), NULL, - (yyvsp[-5].id), (yyvsp[0].cbuf), (yyvsp[-9].line), - ccode_line, vararg, (yyvsp[-8].list)); + push_function(the_scope, (yyvsp[(4) - (11)].sigtype), NULL, + (yyvsp[(6) - (11)].id), (yyvsp[(11) - (11)].cbuf), (yyvsp[(2) - (11)].line), + ccode_line, vararg, (yyvsp[(3) - (11)].list)); } break; @@ -3668,8 +3976,8 @@ yyreduce: free_all_global_state(); YYERROR; } - push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[-5].id), - (yyvsp[0].cbuf), (yyvsp[-8].line), + push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[(4) - (9)].id), + (yyvsp[(9) - (9)].cbuf), (yyvsp[(1) - (9)].line), ccode_line, vararg, NULL); } break; @@ -3688,8 +3996,8 @@ yyreduce: free_all_global_state(); YYERROR; } - push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[-5].id), - (yyvsp[0].cbuf), (yyvsp[-7].line), + push_function(the_scope, VIRTUAL_METHOD, NULL, (yyvsp[(4) - (9)].id), + (yyvsp[(9) - (9)].cbuf), (yyvsp[(2) - (9)].line), ccode_line, vararg, NULL); } break; @@ -3704,7 +4012,7 @@ yyreduce: YYERROR; } push_function(PUBLIC_SCOPE, VIRTUAL_METHOD, NULL, - (yyvsp[-5].id), (yyvsp[0].cbuf), (yyvsp[-7].line), + (yyvsp[(3) - (8)].id), (yyvsp[(8) - (8)].cbuf), (yyvsp[(1) - (8)].line), ccode_line, vararg, NULL); } break; @@ -3712,9 +4020,9 @@ yyreduce: case 145: #line 1743 "parse.y" { - push_function(NO_SCOPE, OVERRIDE_METHOD, (yyvsp[-8].id), - (yyvsp[-5].id), (yyvsp[0].cbuf), - (yyvsp[-10].line), ccode_line, + push_function(NO_SCOPE, OVERRIDE_METHOD, (yyvsp[(3) - (11)].id), + (yyvsp[(6) - (11)].id), (yyvsp[(11) - (11)].cbuf), + (yyvsp[(1) - (11)].line), ccode_line, vararg, NULL); } break; @@ -3727,8 +4035,8 @@ yyreduce: free_all_global_state(); YYERROR; } - push_function(the_scope, REGULAR_METHOD, NULL, (yyvsp[-5].id), - (yyvsp[0].cbuf), (yyvsp[-7].line), ccode_line, + push_function(the_scope, REGULAR_METHOD, NULL, (yyvsp[(3) - (8)].id), + (yyvsp[(8) - (8)].cbuf), (yyvsp[(1) - (8)].line), ccode_line, vararg, NULL); } break; @@ -3736,20 +4044,20 @@ yyreduce: case 147: #line 1759 "parse.y" { - if(strcmp((yyvsp[-4].id), "init")==0) { - push_init_arg((yyvsp[-2].id),FALSE); + if(strcmp((yyvsp[(1) - (5)].id), "init")==0) { + push_init_arg((yyvsp[(3) - (5)].id),FALSE); push_function(NO_SCOPE, INIT_METHOD, NULL, - (yyvsp[-4].id), (yyvsp[0].cbuf), (yyvsp[-3].line), + (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line), ccode_line, FALSE, NULL); - } else if(strcmp((yyvsp[-4].id), "class_init")==0) { - push_init_arg((yyvsp[-2].id),TRUE); + } else if(strcmp((yyvsp[(1) - (5)].id), "class_init")==0) { + push_init_arg((yyvsp[(3) - (5)].id),TRUE); push_function(NO_SCOPE, CLASS_INIT_METHOD, NULL, - (yyvsp[-4].id), (yyvsp[0].cbuf), (yyvsp[-3].line), + (yyvsp[(1) - (5)].id), (yyvsp[(5) - (5)].cbuf), (yyvsp[(2) - (5)].line), ccode_line, FALSE, NULL); } else { - g_free((yyvsp[-4].id)); - g_free((yyvsp[-2].id)); - g_string_free((yyvsp[0].cbuf),TRUE); + g_free((yyvsp[(1) - (5)].id)); + g_free((yyvsp[(3) - (5)].id)); + g_string_free((yyvsp[(5) - (5)].cbuf),TRUE); yyerror(_("parse error " "(untyped blocks must be init or " "class_init)")); @@ -3763,13 +4071,13 @@ yyreduce: { g_free(onerror); onerror = NULL; g_free(defreturn); defreturn = NULL; - if(!set_return_value((yyvsp[-1].id), (yyvsp[0].id))) { - g_free((yyvsp[-1].id)); - g_free((yyvsp[0].id)); + if(!set_return_value((yyvsp[(1) - (2)].id), (yyvsp[(2) - (2)].id))) { + g_free((yyvsp[(1) - (2)].id)); + g_free((yyvsp[(2) - (2)].id)); yyerror(_("parse error")); YYERROR; } - g_free((yyvsp[-1].id)); + g_free((yyvsp[(1) - (2)].id)); } break; @@ -3778,21 +4086,21 @@ yyreduce: { g_free(onerror); onerror = NULL; g_free(defreturn); defreturn = NULL; - if(!set_return_value((yyvsp[-3].id), (yyvsp[-2].id))) { - g_free((yyvsp[-3].id)); g_free((yyvsp[-2].id)); - g_free((yyvsp[-1].id)); g_free((yyvsp[0].id)); + if(!set_return_value((yyvsp[(1) - (4)].id), (yyvsp[(2) - (4)].id))) { + g_free((yyvsp[(1) - (4)].id)); g_free((yyvsp[(2) - (4)].id)); + g_free((yyvsp[(3) - (4)].id)); g_free((yyvsp[(4) - (4)].id)); yyerror(_("parse error")); YYERROR; } - if(!set_return_value((yyvsp[-1].id), (yyvsp[0].id))) { + if(!set_return_value((yyvsp[(3) - (4)].id), (yyvsp[(4) - (4)].id))) { onerror = defreturn = NULL; - g_free((yyvsp[-3].id)); g_free((yyvsp[-2].id)); - g_free((yyvsp[-1].id)); g_free((yyvsp[0].id)); + g_free((yyvsp[(1) - (4)].id)); g_free((yyvsp[(2) - (4)].id)); + g_free((yyvsp[(3) - (4)].id)); g_free((yyvsp[(4) - (4)].id)); yyerror(_("parse error")); YYERROR; } - g_free((yyvsp[-3].id)); - g_free((yyvsp[-1].id)); + g_free((yyvsp[(1) - (4)].id)); + g_free((yyvsp[(3) - (4)].id)); } break; @@ -3806,14 +4114,14 @@ yyreduce: case 151: #line 1818 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 152: #line 1819 "parse.y" { - (yyval.id) = ((yyvsp[0].cbuf))->str; - g_string_free((yyvsp[0].cbuf), FALSE); + (yyval.id) = ((yyvsp[(2) - (2)].cbuf))->str; + g_string_free((yyvsp[(2) - (2)].cbuf), FALSE); } break; @@ -3827,10 +4135,10 @@ yyreduce: { vararg = FALSE; has_self = TRUE; - if(strcmp((yyvsp[0].id),"self")==0) - push_self((yyvsp[0].id), FALSE); + if(strcmp((yyvsp[(1) - (1)].id),"self")==0) + push_self((yyvsp[(1) - (1)].id), FALSE); else { - g_free((yyvsp[0].id)); + g_free((yyvsp[(1) - (1)].id)); yyerror(_("parse error")); YYERROR; } @@ -3842,10 +4150,10 @@ yyreduce: { vararg = FALSE; has_self = TRUE; - if(strcmp((yyvsp[-1].id),"self")==0) - push_self((yyvsp[-1].id), TRUE); + if(strcmp((yyvsp[(1) - (2)].id),"self")==0) + push_self((yyvsp[(1) - (2)].id), TRUE); else { - g_free((yyvsp[-1].id)); + g_free((yyvsp[(1) - (2)].id)); yyerror(_("parse error")); YYERROR; } @@ -3857,10 +4165,10 @@ yyreduce: { vararg = FALSE; has_self = TRUE; - if(strcmp((yyvsp[0].id),"self")==0) - push_self((yyvsp[0].id), TRUE); + if(strcmp((yyvsp[(2) - (2)].id),"self")==0) + push_self((yyvsp[(2) - (2)].id), TRUE); else { - g_free((yyvsp[0].id)); + g_free((yyvsp[(2) - (2)].id)); yyerror(_("parse error")); YYERROR; } @@ -3871,10 +4179,10 @@ yyreduce: #line 1859 "parse.y" { has_self = TRUE; - if(strcmp((yyvsp[-2].id),"self")==0) - push_self((yyvsp[-2].id), FALSE); + if(strcmp((yyvsp[(1) - (3)].id),"self")==0) + push_self((yyvsp[(1) - (3)].id), FALSE); else { - g_free((yyvsp[-2].id)); + g_free((yyvsp[(1) - (3)].id)); yyerror(_("parse error")); YYERROR; } @@ -3885,10 +4193,10 @@ yyreduce: #line 1869 "parse.y" { has_self = TRUE; - if(strcmp((yyvsp[-3].id),"self")==0) - push_self((yyvsp[-3].id), TRUE); + if(strcmp((yyvsp[(1) - (4)].id),"self")==0) + push_self((yyvsp[(1) - (4)].id), TRUE); else { - g_free((yyvsp[-3].id)); + g_free((yyvsp[(1) - (4)].id)); yyerror(_("parse error")); YYERROR; } @@ -3899,10 +4207,10 @@ yyreduce: #line 1879 "parse.y" { has_self = TRUE; - if(strcmp((yyvsp[-2].id),"self")==0) - push_self((yyvsp[-2].id), TRUE); + if(strcmp((yyvsp[(2) - (4)].id),"self")==0) + push_self((yyvsp[(2) - (4)].id), TRUE); else { - g_free((yyvsp[-2].id)); + g_free((yyvsp[(2) - (4)].id)); yyerror(_("parse error")); YYERROR; } @@ -3937,38 +4245,38 @@ yyreduce: case 165: #line 1900 "parse.y" { - push_funcarg((yyvsp[0].id),NULL); + push_funcarg((yyvsp[(2) - (2)].id),NULL); } break; case 166: #line 1903 "parse.y" { - push_funcarg((yyvsp[-1].id),(yyvsp[0].id)); + push_funcarg((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].id)); } break; case 167: #line 1906 "parse.y" { - if(strcmp((yyvsp[-2].id),"check")!=0) { + if(strcmp((yyvsp[(4) - (6)].id),"check")!=0) { yyerror(_("parse error")); YYERROR; } - g_free((yyvsp[-2].id)); - push_funcarg((yyvsp[-4].id),NULL); + g_free((yyvsp[(4) - (6)].id)); + push_funcarg((yyvsp[(2) - (6)].id),NULL); } break; case 168: #line 1914 "parse.y" { - if(strcmp((yyvsp[-2].id),"check")!=0) { + if(strcmp((yyvsp[(5) - (7)].id),"check")!=0) { yyerror(_("parse error")); YYERROR; } - g_free((yyvsp[-2].id)); - push_funcarg((yyvsp[-5].id),(yyvsp[-4].id)); + g_free((yyvsp[(5) - (7)].id)); + push_funcarg((yyvsp[(2) - (7)].id),(yyvsp[(3) - (7)].id)); } break; @@ -3985,12 +4293,12 @@ yyreduce: case 171: #line 1928 "parse.y" { - if(strcmp((yyvsp[0].id),"type")==0) { + if(strcmp((yyvsp[(1) - (1)].id),"type")==0) { Node *node = node_new (CHECK_NODE, "chtype", TYPE_CHECK, NULL); checks = g_list_append(checks,node); - } else if(strcmp((yyvsp[0].id),"null")==0) { + } else if(strcmp((yyvsp[(1) - (1)].id),"null")==0) { Node *node = node_new (CHECK_NODE, "chtype", NULL_CHECK, NULL); @@ -3999,7 +4307,7 @@ yyreduce: yyerror(_("parse error")); YYERROR; } - g_free((yyvsp[0].id)); + g_free((yyvsp[(1) - (1)].id)); } break; @@ -4008,7 +4316,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", GT_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(2) - (2)].id), NULL); checks = g_list_append(checks,node); } @@ -4019,7 +4327,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", LT_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(2) - (2)].id), NULL); checks = g_list_append(checks,node); } @@ -4030,7 +4338,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", GE_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(3) - (3)].id), NULL); checks = g_list_append(checks,node); } @@ -4041,7 +4349,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", LE_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(3) - (3)].id), NULL); checks = g_list_append(checks,node); } @@ -4052,7 +4360,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", EQ_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(3) - (3)].id), NULL); checks = g_list_append(checks,node); } @@ -4063,7 +4371,7 @@ yyreduce: { Node *node = node_new (CHECK_NODE, "chtype", NE_CHECK, - "number:steal", (yyvsp[0].id), + "number:steal", (yyvsp[(3) - (3)].id), NULL); checks = g_list_append(checks,node); } @@ -4073,8 +4381,8 @@ yyreduce: #line 1989 "parse.y" { Node *node = node_new (ENUMDEF_NODE, - "etype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-5].id), + "etype:steal", (yyvsp[(6) - (7)].id), + "prefix:steal", (yyvsp[(2) - (7)].id), "values:steal", enum_vals, NULL); enum_vals = NULL; @@ -4086,8 +4394,8 @@ yyreduce: #line 1998 "parse.y" { Node *node = node_new (ENUMDEF_NODE, - "etype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-6].id), + "etype:steal", (yyvsp[(7) - (8)].id), + "prefix:steal", (yyvsp[(2) - (8)].id), "values:steal", enum_vals, NULL); enum_vals = NULL; @@ -4109,20 +4417,20 @@ yyreduce: #line 2013 "parse.y" { Node *node; - char *num = (yyvsp[0].id); + char *num = (yyvsp[(3) - (3)].id); /* A float value, that's a bad enum */ if (num[0] >= '0' && num[0] <= '9' && strchr (num, '.') != NULL) { - g_free ((yyvsp[-2].id)); + g_free ((yyvsp[(1) - (3)].id)); g_free (num); yyerror(_("parse error (enumerator value not integer constant)")); YYERROR; } node = node_new (ENUMVALUE_NODE, - "name:steal", (yyvsp[-2].id), + "name:steal", (yyvsp[(1) - (3)].id), "value:steal", num, NULL); enum_vals = g_list_append (enum_vals, node); @@ -4135,7 +4443,7 @@ yyreduce: Node *node; node = node_new (ENUMVALUE_NODE, - "name:steal", (yyvsp[0].id), + "name:steal", (yyvsp[(1) - (1)].id), NULL); enum_vals = g_list_append (enum_vals, node); } @@ -4145,8 +4453,8 @@ yyreduce: #line 2043 "parse.y" { Node *node = node_new (FLAGS_NODE, - "ftype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-5].id), + "ftype:steal", (yyvsp[(6) - (7)].id), + "prefix:steal", (yyvsp[(2) - (7)].id), "values:steal", flag_vals, NULL); flag_vals = NULL; @@ -4158,8 +4466,8 @@ yyreduce: #line 2052 "parse.y" { Node *node = node_new (FLAGS_NODE, - "ftype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-6].id), + "ftype:steal", (yyvsp[(7) - (8)].id), + "prefix:steal", (yyvsp[(2) - (8)].id), "values:steal", flag_vals, NULL); flag_vals = NULL; @@ -4170,14 +4478,14 @@ yyreduce: case 186: #line 2063 "parse.y" { - flag_vals = g_list_append (flag_vals, (yyvsp[0].id)); + flag_vals = g_list_append (flag_vals, (yyvsp[(3) - (3)].id)); } break; case 187: #line 2066 "parse.y" { - flag_vals = g_list_append (flag_vals, (yyvsp[0].id)); + flag_vals = g_list_append (flag_vals, (yyvsp[(1) - (1)].id)); } break; @@ -4185,8 +4493,8 @@ yyreduce: #line 2071 "parse.y" { Node *node = node_new (ERROR_NODE, - "etype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-5].id), + "etype:steal", (yyvsp[(6) - (7)].id), + "prefix:steal", (yyvsp[(2) - (7)].id), "values:steal", error_vals, NULL); error_vals = NULL; @@ -4198,8 +4506,8 @@ yyreduce: #line 2080 "parse.y" { Node *node = node_new (ERROR_NODE, - "etype:steal", (yyvsp[-1].id), - "prefix:steal", (yyvsp[-6].id), + "etype:steal", (yyvsp[(7) - (8)].id), + "prefix:steal", (yyvsp[(2) - (8)].id), "values:steal", error_vals, NULL); error_vals = NULL; @@ -4210,50 +4518,49 @@ yyreduce: case 190: #line 2091 "parse.y" { - error_vals = g_list_append (error_vals, (yyvsp[0].id)); + error_vals = g_list_append (error_vals, (yyvsp[(3) - (3)].id)); } break; case 191: #line 2094 "parse.y" { - error_vals = g_list_append (error_vals, (yyvsp[0].id)); + error_vals = g_list_append (error_vals, (yyvsp[(1) - (1)].id)); } break; case 192: #line 2100 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 193: #line 2101 "parse.y" { - (yyval.id) = g_strconcat("-",(yyvsp[0].id),NULL); - g_free((yyvsp[0].id)); + (yyval.id) = g_strconcat("-",(yyvsp[(2) - (2)].id),NULL); + g_free((yyvsp[(2) - (2)].id)); } break; case 194: #line 2105 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; case 195: #line 2106 "parse.y" - { (yyval.id) = (yyvsp[0].id); } + { (yyval.id) = (yyvsp[(1) - (1)].id); } break; +/* Line 1267 of yacc.c. */ +#line 4558 "parse.c" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 1037 of yacc.c. */ -#line 4252 "y.tab.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -4282,66 +4589,41 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + } - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } @@ -4352,23 +4634,15 @@ yyerrlab: error, discard it. */ if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + { + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp); - } - } + YYABORT; + } else { - yydestruct ("Error: discarding", yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; } } @@ -4383,15 +4657,17 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) goto yyerrorlab; -#endif -yyvsp -= yylen; - yyssp -= yylen; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; @@ -4421,8 +4697,9 @@ yyerrlab1: YYABORT; - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -4433,7 +4710,7 @@ yyerrlab1: *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -4451,28 +4728,43 @@ yyacceptlab: | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval); - yychar = YYEMPTY; yyresult = 1; goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); }