~ubuntu-branches/ubuntu/trusty/libnih/trusty

« back to all changes in this revision

Viewing changes to intl/plural.c

  • Committer: Dmitrijs Ledkovs
  • Date: 2013-11-12 13:20:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1081.
  • Revision ID: dmitrijs.ledkovs@canonical.com-20131112132053-27y2f89g6whr5bna
releasing package libnih version 1.0.3-4ubuntu24

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/* A Bison parser, made by GNU Bison 2.4.1.  */
 
1
/* A Bison parser, made by GNU Bison 2.3a.  */
3
2
 
4
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
5
 
   
6
 
      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
4
 
 
5
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7
6
   Free Software Foundation, Inc.
8
 
   
9
 
   This program is free software: you can redistribute it and/or modify
 
7
 
 
8
   This program is free software; you can redistribute it and/or modify
10
9
   it under the terms of the GNU General Public License as published by
11
 
   the Free Software Foundation, either version 3 of the License, or
12
 
   (at your option) any later version.
13
 
   
 
10
   the Free Software Foundation; either version 2, or (at your option)
 
11
   any later version.
 
12
 
14
13
   This program is distributed in the hope that it will be useful,
15
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
16
   GNU General Public License for more details.
18
 
   
 
17
 
19
18
   You should have received a copy of the GNU General Public License
20
 
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
   Boston, MA 02110-1301, USA.  */
21
22
 
22
23
/* As a special exception, you may create a larger work that contains
23
24
   part or all of the Bison parser skeleton and distribute that work
28
29
   special exception, which will cause the skeleton and the resulting
29
30
   Bison output files to be licensed under the GNU General Public
30
31
   License without this special exception.
31
 
   
 
32
 
32
33
   This special exception was added by the Free Software Foundation in
33
34
   version 2.2 of Bison.  */
34
35
 
46
47
#define YYBISON 1
47
48
 
48
49
/* Bison version.  */
49
 
#define YYBISON_VERSION "2.4.1"
 
50
#define YYBISON_VERSION "2.3a"
50
51
 
51
52
/* Skeleton name.  */
52
53
#define YYSKELETON_NAME "yacc.c"
54
55
/* Pure parsers.  */
55
56
#define YYPURE 1
56
57
 
57
 
/* Push parsers.  */
58
 
#define YYPUSH 0
59
 
 
60
 
/* Pull parsers.  */
61
 
#define YYPULL 1
62
 
 
63
58
/* Using locations.  */
64
59
#define YYLSP_NEEDED 0
65
60
 
66
61
/* Substitute the variable and function names.  */
67
 
#define yyparse         __gettextparse
68
 
#define yylex           __gettextlex
69
 
#define yyerror         __gettexterror
70
 
#define yylval          __gettextlval
71
 
#define yychar          __gettextchar
72
 
#define yydebug         __gettextdebug
73
 
#define yynerrs         __gettextnerrs
 
62
#define yyparse __gettextparse
 
63
#define yylex   __gettextlex
 
64
#define yyerror __gettexterror
 
65
#define yylval  __gettextlval
 
66
#define yychar  __gettextchar
 
67
#define yydebug __gettextdebug
 
68
#define yynerrs __gettextnerrs
74
69
 
75
70
 
76
71
/* Copy the first part of user declarations.  */
77
 
 
78
 
/* Line 189 of yacc.c  */
 
72
/* Line 164 of yacc.c.  */
79
73
#line 1 "plural.y"
80
74
 
81
75
/* Expression parsing for plural form selection.
125
119
#define YYPARSE_PARAM   arg
126
120
 
127
121
 
128
 
/* Line 189 of yacc.c  */
129
 
#line 130 "plural.c"
130
 
 
131
122
/* Enabling traces.  */
132
123
#ifndef YYDEBUG
133
124
# define YYDEBUG 0
172
163
 
173
164
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
174
165
typedef union YYSTYPE
175
 
{
176
 
 
177
 
/* Line 214 of yacc.c  */
 
166
{/* Line 191 of yacc.c.  */
178
167
#line 51 "plural.y"
179
168
 
180
169
  unsigned long int num;
181
170
  enum expression_operator op;
182
171
  struct expression *exp;
183
 
 
184
 
 
185
 
 
186
 
/* Line 214 of yacc.c  */
187
 
#line 188 "plural.c"
188
 
} YYSTYPE;
 
172
}
 
173
/* Line 191 of yacc.c.  */
 
174
#line 175 "plural.c"
 
175
        YYSTYPE;
189
176
# define YYSTYPE_IS_TRIVIAL 1
190
177
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
191
178
# define YYSTYPE_IS_DECLARED 1
192
179
#endif
193
180
 
194
181
 
 
182
 
 
183
 
195
184
/* Copy the second part of user declarations.  */
196
 
 
197
 
/* Line 264 of yacc.c  */
 
185
/* Line 221 of yacc.c.  */
198
186
#line 57 "plural.y"
199
187
 
200
188
/* Prototypes for local functions.  */
272
260
}
273
261
 
274
262
 
275
 
 
276
 
/* Line 264 of yacc.c  */
277
 
#line 278 "plural.c"
 
263
/* Line 221 of yacc.c.  */
 
264
#line 265 "plural.c"
278
265
 
279
266
#ifdef short
280
267
# undef short
437
424
/* A type that is properly aligned for any stack member.  */
438
425
union yyalloc
439
426
{
440
 
  yytype_int16 yyss_alloc;
441
 
  YYSTYPE yyvs_alloc;
442
 
};
 
427
  yytype_int16 yyss;
 
428
  YYSTYPE yyvs;
 
429
  };
443
430
 
444
431
/* The size of the maximum gap between one aligned stack and the next.  */
445
432
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
473
460
   elements in the stack, and YYPTR gives the new location of the
474
461
   stack.  Advance YYPTR to a properly aligned location for the next
475
462
   stack.  */
476
 
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
 
463
# define YYSTACK_RELOCATE(Stack)                                        \
477
464
    do                                                                  \
478
465
      {                                                                 \
479
466
        YYSIZE_T yynewbytes;                                            \
480
 
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
481
 
        Stack = &yyptr->Stack_alloc;                                    \
 
467
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
468
        Stack = &yyptr->Stack;                                          \
482
469
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
483
470
        yyptr += yynewbytes / sizeof (*yyptr);                          \
484
471
      }                                                                 \
896
883
  /* The symbols being reduced.  */
897
884
  for (yyi = 0; yyi < yynrhs; yyi++)
898
885
    {
899
 
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 
886
      fprintf (stderr, "   $%d = ", yyi + 1);
900
887
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
901
888
                       &(yyvsp[(yyi + 1) - (yynrhs)])
902
889
                                       );
903
 
      YYFPRINTF (stderr, "\n");
 
890
      fprintf (stderr, "\n");
904
891
    }
905
892
}
906
893
 
1180
1167
        break;
1181
1168
    }
1182
1169
}
 
1170
 
1183
1171
 
1184
1172
/* Prevent warnings from -Wmissing-prototypes.  */
 
1173
 
1185
1174
#ifdef YYPARSE_PARAM
1186
1175
#if defined __STDC__ || defined __cplusplus
1187
1176
int yyparse (void *YYPARSE_PARAM);
1200
1189
 
1201
1190
 
1202
1191
 
1203
 
/*-------------------------.
1204
 
| yyparse or yypush_parse.  |
1205
 
`-------------------------*/
 
1192
 
 
1193
/*----------.
 
1194
| yyparse.  |
 
1195
`----------*/
1206
1196
 
1207
1197
#ifdef YYPARSE_PARAM
1208
1198
#if (defined __STDC__ || defined __C99__FUNC__ \
1226
1216
#endif
1227
1217
#endif
1228
1218
{
1229
 
/* The lookahead symbol.  */
 
1219
  /* The lookahead symbol.  */
1230
1220
int yychar;
1231
1221
 
1232
1222
/* The semantic value of the lookahead symbol.  */
1233
1223
YYSTYPE yylval;
1234
1224
 
1235
 
    /* Number of syntax errors so far.  */
1236
 
    int yynerrs;
1237
 
 
1238
 
    int yystate;
1239
 
    /* Number of tokens to shift before error messages enabled.  */
1240
 
    int yyerrstatus;
1241
 
 
1242
 
    /* The stacks and their tools:
1243
 
       `yyss': related to states.
1244
 
       `yyvs': related to semantic values.
1245
 
 
1246
 
       Refer to the stacks thru separate pointers, to allow yyoverflow
1247
 
       to reallocate them elsewhere.  */
1248
 
 
1249
 
    /* The state stack.  */
1250
 
    yytype_int16 yyssa[YYINITDEPTH];
1251
 
    yytype_int16 *yyss;
1252
 
    yytype_int16 *yyssp;
1253
 
 
1254
 
    /* The semantic value stack.  */
1255
 
    YYSTYPE yyvsa[YYINITDEPTH];
1256
 
    YYSTYPE *yyvs;
1257
 
    YYSTYPE *yyvsp;
1258
 
 
1259
 
    YYSIZE_T yystacksize;
1260
 
 
 
1225
/* Number of syntax errors so far.  */
 
1226
int yynerrs;
 
1227
 
 
1228
  int yystate;
1261
1229
  int yyn;
1262
1230
  int yyresult;
 
1231
  /* Number of tokens to shift before error messages enabled.  */
 
1232
  int yyerrstatus;
1263
1233
  /* Lookahead token as an internal (translated) token number.  */
1264
 
  int yytoken;
1265
 
  /* The variables used to return semantic value and location from the
1266
 
     action routines.  */
1267
 
  YYSTYPE yyval;
1268
 
 
 
1234
  int yytoken = 0;
1269
1235
#if YYERROR_VERBOSE
1270
1236
  /* Buffer for error messages, and its allocated size.  */
1271
1237
  char yymsgbuf[128];
1273
1239
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1274
1240
#endif
1275
1241
 
 
1242
  /* Three stacks and their tools:
 
1243
     `yyss': related to states,
 
1244
     `yyvs': related to semantic values,
 
1245
     `yyls': related to locations.
 
1246
 
 
1247
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1248
     to reallocate them elsewhere.  */
 
1249
 
 
1250
  /* The state stack.  */
 
1251
  yytype_int16 yyssa[YYINITDEPTH];
 
1252
  yytype_int16 *yyss = yyssa;
 
1253
  yytype_int16 *yyssp;
 
1254
 
 
1255
  /* The semantic value stack.  */
 
1256
  YYSTYPE yyvsa[YYINITDEPTH];
 
1257
  YYSTYPE *yyvs = yyvsa;
 
1258
  YYSTYPE *yyvsp;
 
1259
 
 
1260
 
 
1261
 
1276
1262
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1277
1263
 
 
1264
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1265
 
 
1266
  /* The variables used to return semantic value and location from the
 
1267
     action routines.  */
 
1268
  YYSTYPE yyval;
 
1269
 
 
1270
 
1278
1271
  /* The number of symbols on the RHS of the reduced rule.
1279
1272
     Keep to zero when no symbol should be popped.  */
1280
1273
  int yylen = 0;
1281
1274
 
1282
 
  yytoken = 0;
1283
 
  yyss = yyssa;
1284
 
  yyvs = yyvsa;
1285
 
  yystacksize = YYINITDEPTH;
1286
 
 
1287
1275
  YYDPRINTF ((stderr, "Starting parse\n"));
1288
1276
 
1289
1277
  yystate = 0;
1290
1278
  yyerrstatus = 0;
1291
1279
  yynerrs = 0;
1292
 
  yychar = YYEMPTY; /* Cause a token to be read.  */
 
1280
  yychar = YYEMPTY;             /* Cause a token to be read.  */
1293
1281
 
1294
1282
  /* Initialize stack pointers.
1295
1283
     Waste one element of value and location stack
1296
1284
     so that they stay on the same level as the state stack.
1297
1285
     The wasted elements are never initialized.  */
 
1286
 
1298
1287
  yyssp = yyss;
1299
1288
  yyvsp = yyvs;
1300
1289
 
1324
1313
        YYSTYPE *yyvs1 = yyvs;
1325
1314
        yytype_int16 *yyss1 = yyss;
1326
1315
 
 
1316
 
1327
1317
        /* Each stack pointer address is followed by the size of the
1328
1318
           data in use in that stack, in bytes.  This used to be a
1329
1319
           conditional around just the two extra args, but that might
1331
1321
        yyoverflow (YY_("memory exhausted"),
1332
1322
                    &yyss1, yysize * sizeof (*yyssp),
1333
1323
                    &yyvs1, yysize * sizeof (*yyvsp),
 
1324
 
1334
1325
                    &yystacksize);
1335
1326
 
1336
1327
        yyss = yyss1;
1353
1344
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1354
1345
        if (! yyptr)
1355
1346
          goto yyexhaustedlab;
1356
 
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1357
 
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
 
1347
        YYSTACK_RELOCATE (yyss);
 
1348
        YYSTACK_RELOCATE (yyvs);
 
1349
 
1358
1350
#  undef YYSTACK_RELOCATE
1359
1351
        if (yyss1 != yyssa)
1360
1352
          YYSTACK_FREE (yyss1);
1365
1357
      yyssp = yyss + yysize - 1;
1366
1358
      yyvsp = yyvs + yysize - 1;
1367
1359
 
 
1360
 
1368
1361
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1369
1362
                  (unsigned long int) yystacksize));
1370
1363
 
1475
1468
  switch (yyn)
1476
1469
    {
1477
1470
        case 2:
1478
 
 
1479
 
/* Line 1455 of yacc.c  */
 
1471
/* Line 1269 of yacc.c.  */
1480
1472
#line 155 "plural.y"
1481
1473
    {
1482
1474
            if ((yyvsp[(1) - (1)].exp) == NULL)
1486
1478
    break;
1487
1479
 
1488
1480
  case 3:
1489
 
 
1490
 
/* Line 1455 of yacc.c  */
 
1481
/* Line 1269 of yacc.c.  */
1491
1482
#line 163 "plural.y"
1492
1483
    {
1493
1484
            (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
1495
1486
    break;
1496
1487
 
1497
1488
  case 4:
1498
 
 
1499
 
/* Line 1455 of yacc.c  */
 
1489
/* Line 1269 of yacc.c.  */
1500
1490
#line 167 "plural.y"
1501
1491
    {
1502
1492
            (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1504
1494
    break;
1505
1495
 
1506
1496
  case 5:
1507
 
 
1508
 
/* Line 1455 of yacc.c  */
 
1497
/* Line 1269 of yacc.c.  */
1509
1498
#line 171 "plural.y"
1510
1499
    {
1511
1500
            (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1513
1502
    break;
1514
1503
 
1515
1504
  case 6:
1516
 
 
1517
 
/* Line 1455 of yacc.c  */
 
1505
/* Line 1269 of yacc.c.  */
1518
1506
#line 175 "plural.y"
1519
1507
    {
1520
1508
            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1522
1510
    break;
1523
1511
 
1524
1512
  case 7:
1525
 
 
1526
 
/* Line 1455 of yacc.c  */
 
1513
/* Line 1269 of yacc.c.  */
1527
1514
#line 179 "plural.y"
1528
1515
    {
1529
1516
            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1531
1518
    break;
1532
1519
 
1533
1520
  case 8:
1534
 
 
1535
 
/* Line 1455 of yacc.c  */
 
1521
/* Line 1269 of yacc.c.  */
1536
1522
#line 183 "plural.y"
1537
1523
    {
1538
1524
            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1540
1526
    break;
1541
1527
 
1542
1528
  case 9:
1543
 
 
1544
 
/* Line 1455 of yacc.c  */
 
1529
/* Line 1269 of yacc.c.  */
1545
1530
#line 187 "plural.y"
1546
1531
    {
1547
1532
            (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
1549
1534
    break;
1550
1535
 
1551
1536
  case 10:
1552
 
 
1553
 
/* Line 1455 of yacc.c  */
 
1537
/* Line 1269 of yacc.c.  */
1554
1538
#line 191 "plural.y"
1555
1539
    {
1556
1540
            (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
1558
1542
    break;
1559
1543
 
1560
1544
  case 11:
1561
 
 
1562
 
/* Line 1455 of yacc.c  */
 
1545
/* Line 1269 of yacc.c.  */
1563
1546
#line 195 "plural.y"
1564
1547
    {
1565
1548
            (yyval.exp) = new_exp_0 (var);
1567
1550
    break;
1568
1551
 
1569
1552
  case 12:
1570
 
 
1571
 
/* Line 1455 of yacc.c  */
 
1553
/* Line 1269 of yacc.c.  */
1572
1554
#line 199 "plural.y"
1573
1555
    {
1574
1556
            if (((yyval.exp) = new_exp_0 (num)) != NULL)
1577
1559
    break;
1578
1560
 
1579
1561
  case 13:
1580
 
 
1581
 
/* Line 1455 of yacc.c  */
 
1562
/* Line 1269 of yacc.c.  */
1582
1563
#line 204 "plural.y"
1583
1564
    {
1584
1565
            (yyval.exp) = (yyvsp[(2) - (3)].exp);
1586
1567
    break;
1587
1568
 
1588
1569
 
1589
 
 
1590
 
/* Line 1455 of yacc.c  */
1591
 
#line 1592 "plural.c"
 
1570
/* Line 1269 of yacc.c.  */
 
1571
#line 1572 "plural.c"
1592
1572
      default: break;
1593
1573
    }
1594
1574
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1599
1579
 
1600
1580
  *++yyvsp = yyval;
1601
1581
 
 
1582
 
1602
1583
  /* Now `shift' the result of the reduction.  Determine what state
1603
1584
     that goes to, based on the state we popped back to and the rule
1604
1585
     number reduced by.  */
1761
1742
  yyresult = 1;
1762
1743
  goto yyreturn;
1763
1744
 
1764
 
#if !defined(yyoverflow) || YYERROR_VERBOSE
 
1745
#ifndef yyoverflow
1765
1746
/*-------------------------------------------------.
1766
1747
| yyexhaustedlab -- memory exhaustion comes here.  |
1767
1748
`-------------------------------------------------*/
1798
1779
}
1799
1780
 
1800
1781
 
1801
 
 
1802
 
/* Line 1675 of yacc.c  */
 
1782
/* Line 1486 of yacc.c.  */
1803
1783
#line 209 "plural.y"
1804
1784
 
1805
1785