1
/* A Bison parser, made by GNU Bison 2.3. */
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6
Free Software Foundation, Inc.
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2, or (at your option)
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
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. */
23
/* As a special exception, you may create a larger work that contains
24
part or all of the Bison parser skeleton and distribute that work
25
under terms of your choice, so long as that work isn't itself a
26
parser generator using the skeleton or a modified version thereof
27
as a parser skeleton. Alternatively, if you modify or redistribute
28
the parser skeleton itself, you may (at your option) remove this
29
special exception, which will cause the skeleton and the resulting
30
Bison output files to be licensed under the GNU General Public
31
License without this special exception.
33
This special exception was added by the Free Software Foundation in
34
version 2.2 of Bison. */
36
/* C LALR(1) parser skeleton written by Richard Stallman, by
37
simplifying the original so-called "semantic" parser. */
39
/* All symbols defined below should begin with yy or YY, to avoid
40
infringing on user name space. This should be done even for local
41
variables, as they might otherwise be expanded by user macros.
42
There are some unavoidable exceptions within include files to
43
define necessary library symbols; they are noted "INFRINGES ON
44
USER NAME SPACE" below. */
46
/* Identify Bison output. */
50
#define YYBISON_VERSION "2.3"
53
#define YYSKELETON_NAME "yacc.c"
58
/* Using locations. */
59
#define YYLSP_NEEDED 0
61
/* Substitute the variable and function names. */
62
#define yyparse addrparse
64
#define yyerror addrerror
65
#define yylval addrlval
66
#define yychar addrchar
67
#define yydebug addrdebug
68
#define yynerrs addrnerrs
74
/* Put the tokens into the symbol table, so that GDB and other debuggers
90
/* Copy the first part of user declarations. */
94
* addr.y -- RFC 822 address parser
98
/***********************************************************
99
Copyright 1999 by Carnegie Mellon University
103
Permission to use, copy, modify, and distribute this software and its
104
documentation for any purpose and without fee is hereby granted,
105
provided that the above copyright notice appear in all copies and that
106
both that copyright notice and this permission notice appear in
107
supporting documentation, and that the name of Carnegie Mellon
108
University not be used in advertising or publicity pertaining to
109
distribution of the software without specific, written prior
112
CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
113
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
114
FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR
115
ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
116
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
117
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
118
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
119
******************************************************************/
128
int addrerror(char *msg);
129
extern int yylex(void);
131
#define YYERROR_VERBOSE /* i want better error messages! */
134
/* Enabling traces. */
139
/* Enabling verbose error messages. */
140
#ifdef YYERROR_VERBOSE
141
# undef YYERROR_VERBOSE
142
# define YYERROR_VERBOSE 1
144
# define YYERROR_VERBOSE 0
147
/* Enabling the token table. */
148
#ifndef YYTOKEN_TABLE
149
# define YYTOKEN_TABLE 0
152
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
154
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
155
# define YYSTYPE_IS_DECLARED 1
156
# define YYSTYPE_IS_TRIVIAL 1
161
/* Copy the second part of user declarations. */
164
/* Line 216 of yacc.c. */
172
typedef YYTYPE_UINT8 yytype_uint8;
174
typedef unsigned char yytype_uint8;
178
typedef YYTYPE_INT8 yytype_int8;
179
#elif (defined __STDC__ || defined __C99__FUNC__ \
180
|| defined __cplusplus || defined _MSC_VER)
181
typedef signed char yytype_int8;
183
typedef short int yytype_int8;
187
typedef YYTYPE_UINT16 yytype_uint16;
189
typedef unsigned short int yytype_uint16;
193
typedef YYTYPE_INT16 yytype_int16;
195
typedef short int yytype_int16;
199
# ifdef __SIZE_TYPE__
200
# define YYSIZE_T __SIZE_TYPE__
201
# elif defined size_t
202
# define YYSIZE_T size_t
203
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
204
|| defined __cplusplus || defined _MSC_VER)
205
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
206
# define YYSIZE_T size_t
208
# define YYSIZE_T unsigned int
212
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
217
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
218
# define YY_(msgid) dgettext ("bison-runtime", msgid)
222
# define YY_(msgid) msgid
226
/* Suppress unused-variable warnings by "using" E. */
227
#if ! defined lint || defined __GNUC__
228
# define YYUSE(e) ((void) (e))
230
# define YYUSE(e) /* empty */
233
/* Identity function, used to suppress warnings about constant conditions. */
237
#if (defined __STDC__ || defined __C99__FUNC__ \
238
|| defined __cplusplus || defined _MSC_VER)
251
#if ! defined yyoverflow || YYERROR_VERBOSE
253
/* The parser invokes alloca or malloc; define the necessary symbols. */
255
# ifdef YYSTACK_USE_ALLOCA
256
# if YYSTACK_USE_ALLOCA
258
# define YYSTACK_ALLOC __builtin_alloca
259
# elif defined __BUILTIN_VA_ARG_INCR
260
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
262
# define YYSTACK_ALLOC __alloca
263
# elif defined _MSC_VER
264
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
265
# define alloca _alloca
267
# define YYSTACK_ALLOC alloca
268
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
269
|| defined __cplusplus || defined _MSC_VER)
270
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
279
# ifdef YYSTACK_ALLOC
280
/* Pacify GCC's `empty if-body' warning. */
281
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
282
# ifndef YYSTACK_ALLOC_MAXIMUM
283
/* The OS might guarantee only one guard page at the bottom of the stack,
284
and a page size can be as small as 4096 bytes. So we cannot safely
285
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
286
to allow for a few compiler-allocated temporary stack slots. */
287
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
290
# define YYSTACK_ALLOC YYMALLOC
291
# define YYSTACK_FREE YYFREE
292
# ifndef YYSTACK_ALLOC_MAXIMUM
293
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
295
# if (defined __cplusplus && ! defined _STDLIB_H \
296
&& ! ((defined YYMALLOC || defined malloc) \
297
&& (defined YYFREE || defined free)))
298
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
304
# define YYMALLOC malloc
305
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
306
|| defined __cplusplus || defined _MSC_VER)
307
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
312
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
313
|| defined __cplusplus || defined _MSC_VER)
314
void free (void *); /* INFRINGES ON USER NAME SPACE */
318
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
321
#if (! defined yyoverflow \
322
&& (! defined __cplusplus \
323
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
325
/* A type that is properly aligned for any stack member. */
332
/* The size of the maximum gap between one aligned stack and the next. */
333
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
335
/* The size of an array large to enough to hold all stacks, each with
337
# define YYSTACK_BYTES(N) \
338
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
339
+ YYSTACK_GAP_MAXIMUM)
341
/* Copy COUNT objects from FROM to TO. The source and destination do
344
# if defined __GNUC__ && 1 < __GNUC__
345
# define YYCOPY(To, From, Count) \
346
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
348
# define YYCOPY(To, From, Count) \
352
for (yyi = 0; yyi < (Count); yyi++) \
353
(To)[yyi] = (From)[yyi]; \
359
/* Relocate STACK from its old location to the new one. The
360
local variables YYSIZE and YYSTACKSIZE give the old and new number of
361
elements in the stack, and YYPTR gives the new location of the
362
stack. Advance YYPTR to a properly aligned location for the next
364
# define YYSTACK_RELOCATE(Stack) \
367
YYSIZE_T yynewbytes; \
368
YYCOPY (&yyptr->Stack, Stack, yysize); \
369
Stack = &yyptr->Stack; \
370
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
371
yyptr += yynewbytes / sizeof (*yyptr); \
377
/* YYFINAL -- State number of the termination state. */
379
/* YYLAST -- Last index in YYTABLE. */
382
/* YYNTOKENS -- Number of terminals. */
384
/* YYNNTS -- Number of nonterminals. */
386
/* YYNRULES -- Number of rules. */
388
/* YYNRULES -- Number of states. */
391
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
393
#define YYMAXUTOK 260
395
#define YYTRANSLATE(YYX) \
396
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
398
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
399
static const yytype_uint8 yytranslate[] =
401
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
402
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
403
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
404
2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
405
2, 2, 2, 2, 2, 2, 9, 2, 2, 2,
406
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407
6, 2, 7, 2, 8, 2, 2, 2, 2, 2,
408
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410
2, 10, 2, 11, 2, 2, 2, 2, 2, 2,
411
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
431
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
433
static const yytype_uint8 yyprhs[] =
435
0, 0, 3, 5, 10, 14, 16, 20, 22, 26,
436
28, 30, 32, 36, 38, 41, 43, 45
439
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
440
static const yytype_int8 yyrhs[] =
442
14, 0, -1, 15, -1, 21, 6, 15, 7, -1,
443
16, 8, 17, -1, 22, -1, 22, 9, 16, -1,
444
18, -1, 18, 9, 17, -1, 19, -1, 20, -1,
445
3, -1, 10, 5, 11, -1, 22, -1, 22, 21,
446
-1, 3, -1, 23, -1, 12, 4, 12, -1
449
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
450
static const yytype_uint8 yyrline[] =
452
0, 46, 46, 47, 50, 53, 54, 57, 58, 61,
453
62, 65, 68, 71, 72, 75, 76, 79
457
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
458
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
459
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
460
static const char *const yytname[] =
462
"$end", "error", "$undefined", "ATOM", "QTEXT", "DTEXT", "'<'", "'>'",
463
"'@'", "'.'", "'['", "']'", "'\"'", "$accept", "sieve_address",
464
"addrspec", "localpart", "domain", "subdomain", "domainref", "domainlit",
465
"phrase", "word", "qstring", 0
470
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
472
static const yytype_uint16 yytoknum[] =
474
0, 256, 257, 258, 259, 260, 60, 62, 64, 46,
479
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
480
static const yytype_uint8 yyr1[] =
482
0, 13, 14, 14, 15, 16, 16, 17, 17, 18,
483
18, 19, 20, 21, 21, 22, 22, 23
486
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
487
static const yytype_uint8 yyr2[] =
489
0, 2, 1, 4, 3, 1, 3, 1, 3, 1,
490
1, 1, 3, 1, 2, 1, 1, 3
493
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
494
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
495
means the default is an error. */
496
static const yytype_uint8 yydefact[] =
498
0, 15, 0, 0, 2, 0, 0, 5, 16, 0,
499
1, 0, 0, 0, 14, 13, 17, 11, 0, 4,
500
7, 9, 10, 0, 5, 6, 0, 0, 3, 12,
504
/* YYDEFGOTO[NTERM-NUM]. */
505
static const yytype_int8 yydefgoto[] =
507
-1, 3, 4, 5, 19, 20, 21, 22, 14, 15,
511
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
513
#define YYPACT_NINF -7
514
static const yytype_int8 yypact[] =
516
-1, -7, 1, 3, -7, 6, 10, -2, -7, -6,
517
-7, 5, -1, -1, -7, -1, -7, -7, 4, -7,
518
8, -7, -7, 11, 12, -7, 9, 5, -7, -7,
522
/* YYPGOTO[NTERM-NUM]. */
523
static const yytype_int8 yypgoto[] =
525
-7, -7, 7, 13, -5, -7, -7, -7, 23, 0,
529
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
530
positive, shift that token. If negative, reduce the rule which
531
number is the opposite. If zero, do what YYDEFACT says.
532
If YYTABLE_NINF, syntax error. */
533
#define YYTABLE_NINF -14
534
static const yytype_int8 yytable[] =
536
7, 1, 1, 10, -13, 9, 16, 13, 17, 26,
537
2, 2, 24, 24, 11, 18, 12, 27, 28, 23,
538
29, 13, 30, 6, 0, 0, 25
541
static const yytype_int8 yycheck[] =
543
0, 3, 3, 0, 6, 4, 12, 9, 3, 5,
544
12, 12, 12, 13, 8, 10, 6, 9, 7, 12,
545
11, 9, 27, 0, -1, -1, 13
548
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
549
symbol of state STATE-NUM. */
550
static const yytype_uint8 yystos[] =
552
0, 3, 12, 14, 15, 16, 21, 22, 23, 4,
553
0, 8, 6, 9, 21, 22, 12, 3, 10, 17,
554
18, 19, 20, 15, 22, 16, 5, 9, 7, 11,
558
#define yyerrok (yyerrstatus = 0)
559
#define yyclearin (yychar = YYEMPTY)
563
#define YYACCEPT goto yyacceptlab
564
#define YYABORT goto yyabortlab
565
#define YYERROR goto yyerrorlab
568
/* Like YYERROR except do call yyerror. This remains here temporarily
569
to ease the transition to the new meaning of YYERROR, for GCC.
570
Once GCC version 2 has supplanted version 1, this can go. */
572
#define YYFAIL goto yyerrlab
574
#define YYRECOVERING() (!!yyerrstatus)
576
#define YYBACKUP(Token, Value) \
578
if (yychar == YYEMPTY && yylen == 1) \
582
yytoken = YYTRANSLATE (yychar); \
588
yyerror (YY_("syntax error: cannot back up")); \
595
#define YYERRCODE 256
598
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
599
If N is 0, then set CURRENT to the empty location which ends
600
the previous symbol: RHS[0] (always defined). */
602
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
603
#ifndef YYLLOC_DEFAULT
604
# define YYLLOC_DEFAULT(Current, Rhs, N) \
608
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
609
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
610
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
611
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
615
(Current).first_line = (Current).last_line = \
616
YYRHSLOC (Rhs, 0).last_line; \
617
(Current).first_column = (Current).last_column = \
618
YYRHSLOC (Rhs, 0).last_column; \
624
/* YY_LOCATION_PRINT -- Print the location on the stream.
625
This macro was not mandated originally: define only if we know
626
we won't break user code: when these are the locations we know. */
628
#ifndef YY_LOCATION_PRINT
629
# if YYLTYPE_IS_TRIVIAL
630
# define YY_LOCATION_PRINT(File, Loc) \
631
fprintf (File, "%d.%d-%d.%d", \
632
(Loc).first_line, (Loc).first_column, \
633
(Loc).last_line, (Loc).last_column)
635
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
640
/* YYLEX -- calling `yylex' with the right arguments. */
643
# define YYLEX yylex (YYLEX_PARAM)
645
# define YYLEX yylex ()
648
/* Enable debugging if requested. */
652
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
653
# define YYFPRINTF fprintf
656
# define YYDPRINTF(Args) \
662
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
666
YYFPRINTF (stderr, "%s ", Title); \
667
yy_symbol_print (stderr, \
669
YYFPRINTF (stderr, "\n"); \
674
/*--------------------------------.
675
| Print this symbol on YYOUTPUT. |
676
`--------------------------------*/
679
#if (defined __STDC__ || defined __C99__FUNC__ \
680
|| defined __cplusplus || defined _MSC_VER)
682
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
685
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
688
YYSTYPE const * const yyvaluep;
694
if (yytype < YYNTOKENS)
695
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
707
/*--------------------------------.
708
| Print this symbol on YYOUTPUT. |
709
`--------------------------------*/
711
#if (defined __STDC__ || defined __C99__FUNC__ \
712
|| defined __cplusplus || defined _MSC_VER)
714
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
717
yy_symbol_print (yyoutput, yytype, yyvaluep)
720
YYSTYPE const * const yyvaluep;
723
if (yytype < YYNTOKENS)
724
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
726
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
728
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
729
YYFPRINTF (yyoutput, ")");
732
/*------------------------------------------------------------------.
733
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
735
`------------------------------------------------------------------*/
737
#if (defined __STDC__ || defined __C99__FUNC__ \
738
|| defined __cplusplus || defined _MSC_VER)
740
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
743
yy_stack_print (bottom, top)
744
yytype_int16 *bottom;
748
YYFPRINTF (stderr, "Stack now");
749
for (; bottom <= top; ++bottom)
750
YYFPRINTF (stderr, " %d", *bottom);
751
YYFPRINTF (stderr, "\n");
754
# define YY_STACK_PRINT(Bottom, Top) \
757
yy_stack_print ((Bottom), (Top)); \
761
/*------------------------------------------------.
762
| Report that the YYRULE is going to be reduced. |
763
`------------------------------------------------*/
765
#if (defined __STDC__ || defined __C99__FUNC__ \
766
|| defined __cplusplus || defined _MSC_VER)
768
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
771
yy_reduce_print (yyvsp, yyrule)
776
int yynrhs = yyr2[yyrule];
778
unsigned long int yylno = yyrline[yyrule];
779
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
781
/* The symbols being reduced. */
782
for (yyi = 0; yyi < yynrhs; yyi++)
784
fprintf (stderr, " $%d = ", yyi + 1);
785
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
786
&(yyvsp[(yyi + 1) - (yynrhs)])
788
fprintf (stderr, "\n");
792
# define YY_REDUCE_PRINT(Rule) \
795
yy_reduce_print (yyvsp, Rule); \
798
/* Nonzero means print parse trace. It is left uninitialized so that
799
multiple parsers can coexist. */
802
# define YYDPRINTF(Args)
803
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
804
# define YY_STACK_PRINT(Bottom, Top)
805
# define YY_REDUCE_PRINT(Rule)
806
#endif /* !YYDEBUG */
809
/* YYINITDEPTH -- initial size of the parser's stacks. */
811
# define YYINITDEPTH 200
814
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
815
if the built-in stack extension method is used).
817
Do not make this value too large; the results are undefined if
818
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
819
evaluated with infinite-precision integer arithmetic. */
822
# define YYMAXDEPTH 10000
830
# if defined __GLIBC__ && defined _STRING_H
831
# define yystrlen strlen
833
/* Return the length of YYSTR. */
834
#if (defined __STDC__ || defined __C99__FUNC__ \
835
|| defined __cplusplus || defined _MSC_VER)
837
yystrlen (const char *yystr)
845
for (yylen = 0; yystr[yylen]; yylen++)
853
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
854
# define yystpcpy stpcpy
856
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
858
#if (defined __STDC__ || defined __C99__FUNC__ \
859
|| defined __cplusplus || defined _MSC_VER)
861
yystpcpy (char *yydest, const char *yysrc)
864
yystpcpy (yydest, yysrc)
870
const char *yys = yysrc;
872
while ((*yyd++ = *yys++) != '\0')
881
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
882
quotes and backslashes, so that it's suitable for yyerror. The
883
heuristic is that double-quoting is unnecessary unless the string
884
contains an apostrophe, a comma, or backslash (other than
885
backslash-backslash). YYSTR is taken from yytname. If YYRES is
886
null, do not copy; instead, return the length of what the result
889
yytnamerr (char *yyres, const char *yystr)
894
char const *yyp = yystr;
901
goto do_not_strip_quotes;
905
goto do_not_strip_quotes;
918
do_not_strip_quotes: ;
922
return yystrlen (yystr);
924
return yystpcpy (yyres, yystr) - yyres;
928
/* Copy into YYRESULT an error message about the unexpected token
929
YYCHAR while in state YYSTATE. Return the number of bytes copied,
930
including the terminating null byte. If YYRESULT is null, do not
931
copy anything; just return the number of bytes that would be
932
copied. As a special case, return 0 if an ordinary "syntax error"
933
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
936
yysyntax_error (char *yyresult, int yystate, int yychar)
938
int yyn = yypact[yystate];
940
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
944
int yytype = YYTRANSLATE (yychar);
945
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
946
YYSIZE_T yysize = yysize0;
948
int yysize_overflow = 0;
949
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
950
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
954
/* This is so xgettext sees the translatable formats that are
955
constructed on the fly. */
956
YY_("syntax error, unexpected %s");
957
YY_("syntax error, unexpected %s, expecting %s");
958
YY_("syntax error, unexpected %s, expecting %s or %s");
959
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
960
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
964
static char const yyunexpected[] = "syntax error, unexpected %s";
965
static char const yyexpecting[] = ", expecting %s";
966
static char const yyor[] = " or %s";
967
char yyformat[sizeof yyunexpected
968
+ sizeof yyexpecting - 1
969
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
970
* (sizeof yyor - 1))];
971
char const *yyprefix = yyexpecting;
973
/* Start YYX at -YYN if negative to avoid negative indexes in
975
int yyxbegin = yyn < 0 ? -yyn : 0;
977
/* Stay within bounds of both yycheck and yytname. */
978
int yychecklim = YYLAST - yyn + 1;
979
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
982
yyarg[0] = yytname[yytype];
983
yyfmt = yystpcpy (yyformat, yyunexpected);
985
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
986
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
988
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
992
yyformat[sizeof yyunexpected - 1] = '\0';
995
yyarg[yycount++] = yytname[yyx];
996
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
997
yysize_overflow |= (yysize1 < yysize);
999
yyfmt = yystpcpy (yyfmt, yyprefix);
1003
yyf = YY_(yyformat);
1004
yysize1 = yysize + yystrlen (yyf);
1005
yysize_overflow |= (yysize1 < yysize);
1008
if (yysize_overflow)
1009
return YYSIZE_MAXIMUM;
1013
/* Avoid sprintf, as that infringes on the user's name space.
1014
Don't have undefined behavior even if the translation
1015
produced a string with the wrong number of "%s"s. */
1016
char *yyp = yyresult;
1018
while ((*yyp = *yyf) != '\0')
1020
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1022
yyp += yytnamerr (yyp, yyarg[yyi++]);
1035
#endif /* YYERROR_VERBOSE */
1038
/*-----------------------------------------------.
1039
| Release the memory associated to this symbol. |
1040
`-----------------------------------------------*/
1043
#if (defined __STDC__ || defined __C99__FUNC__ \
1044
|| defined __cplusplus || defined _MSC_VER)
1046
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1049
yydestruct (yymsg, yytype, yyvaluep)
1059
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1070
/* Prevent warnings from -Wmissing-prototypes. */
1072
#ifdef YYPARSE_PARAM
1073
#if defined __STDC__ || defined __cplusplus
1074
int yyparse (void *YYPARSE_PARAM);
1078
#else /* ! YYPARSE_PARAM */
1079
#if defined __STDC__ || defined __cplusplus
1084
#endif /* ! YYPARSE_PARAM */
1088
/* The look-ahead symbol. */
1091
/* The semantic value of the look-ahead symbol. */
1094
/* Number of syntax errors so far. */
1103
#ifdef YYPARSE_PARAM
1104
#if (defined __STDC__ || defined __C99__FUNC__ \
1105
|| defined __cplusplus || defined _MSC_VER)
1107
yyparse (void *YYPARSE_PARAM)
1110
yyparse (YYPARSE_PARAM)
1111
void *YYPARSE_PARAM;
1113
#else /* ! YYPARSE_PARAM */
1114
#if (defined __STDC__ || defined __C99__FUNC__ \
1115
|| defined __cplusplus || defined _MSC_VER)
1129
/* Number of tokens to shift before error messages enabled. */
1131
/* Look-ahead token as an internal (translated) token number. */
1134
/* Buffer for error messages, and its allocated size. */
1136
char *yymsg = yymsgbuf;
1137
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1140
/* Three stacks and their tools:
1141
`yyss': related to states,
1142
`yyvs': related to semantic values,
1143
`yyls': related to locations.
1145
Refer to the stacks thru separate pointers, to allow yyoverflow
1146
to reallocate them elsewhere. */
1148
/* The state stack. */
1149
yytype_int16 yyssa[YYINITDEPTH];
1150
yytype_int16 *yyss = yyssa;
1151
yytype_int16 *yyssp;
1153
/* The semantic value stack. */
1154
YYSTYPE yyvsa[YYINITDEPTH];
1155
YYSTYPE *yyvs = yyvsa;
1160
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1162
YYSIZE_T yystacksize = YYINITDEPTH;
1164
/* The variables used to return semantic value and location from the
1169
/* The number of symbols on the RHS of the reduced rule.
1170
Keep to zero when no symbol should be popped. */
1173
YYDPRINTF ((stderr, "Starting parse\n"));
1178
yychar = YYEMPTY; /* Cause a token to be read. */
1180
/* Initialize stack pointers.
1181
Waste one element of value and location stack
1182
so that they stay on the same level as the state stack.
1183
The wasted elements are never initialized. */
1190
/*------------------------------------------------------------.
1191
| yynewstate -- Push a new state, which is found in yystate. |
1192
`------------------------------------------------------------*/
1194
/* In all cases, when you get here, the value and location stacks
1195
have just been pushed. So pushing a state here evens the stacks. */
1201
if (yyss + yystacksize - 1 <= yyssp)
1203
/* Get the current used size of the three stacks, in elements. */
1204
YYSIZE_T yysize = yyssp - yyss + 1;
1208
/* Give user a chance to reallocate the stack. Use copies of
1209
these so that the &'s don't force the real ones into
1211
YYSTYPE *yyvs1 = yyvs;
1212
yytype_int16 *yyss1 = yyss;
1215
/* Each stack pointer address is followed by the size of the
1216
data in use in that stack, in bytes. This used to be a
1217
conditional around just the two extra args, but that might
1218
be undefined if yyoverflow is a macro. */
1219
yyoverflow (YY_("memory exhausted"),
1220
&yyss1, yysize * sizeof (*yyssp),
1221
&yyvs1, yysize * sizeof (*yyvsp),
1228
#else /* no yyoverflow */
1229
# ifndef YYSTACK_RELOCATE
1230
goto yyexhaustedlab;
1232
/* Extend the stack our own way. */
1233
if (YYMAXDEPTH <= yystacksize)
1234
goto yyexhaustedlab;
1236
if (YYMAXDEPTH < yystacksize)
1237
yystacksize = YYMAXDEPTH;
1240
yytype_int16 *yyss1 = yyss;
1241
union yyalloc *yyptr =
1242
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1244
goto yyexhaustedlab;
1245
YYSTACK_RELOCATE (yyss);
1246
YYSTACK_RELOCATE (yyvs);
1248
# undef YYSTACK_RELOCATE
1250
YYSTACK_FREE (yyss1);
1253
#endif /* no yyoverflow */
1255
yyssp = yyss + yysize - 1;
1256
yyvsp = yyvs + yysize - 1;
1259
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1260
(unsigned long int) yystacksize));
1262
if (yyss + yystacksize - 1 <= yyssp)
1266
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1275
/* Do appropriate processing given the current state. Read a
1276
look-ahead token if we need one and don't already have one. */
1278
/* First try to decide what to do without reference to look-ahead token. */
1279
yyn = yypact[yystate];
1280
if (yyn == YYPACT_NINF)
1283
/* Not known => get a look-ahead token if don't already have one. */
1285
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1286
if (yychar == YYEMPTY)
1288
YYDPRINTF ((stderr, "Reading a token: "));
1292
if (yychar <= YYEOF)
1294
yychar = yytoken = YYEOF;
1295
YYDPRINTF ((stderr, "Now at end of input.\n"));
1299
yytoken = YYTRANSLATE (yychar);
1300
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1303
/* If the proper action on seeing token YYTOKEN is to reduce or to
1304
detect an error, take that action. */
1306
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1311
if (yyn == 0 || yyn == YYTABLE_NINF)
1320
/* Count tokens shifted since error; after three, turn off error
1325
/* Shift the look-ahead token. */
1326
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1328
/* Discard the shifted token unless it is eof. */
1329
if (yychar != YYEOF)
1338
/*-----------------------------------------------------------.
1339
| yydefault -- do the default action for the current state. |
1340
`-----------------------------------------------------------*/
1342
yyn = yydefact[yystate];
1348
/*-----------------------------.
1349
| yyreduce -- Do a reduction. |
1350
`-----------------------------*/
1352
/* yyn is the number of a rule to reduce with. */
1355
/* If YYLEN is nonzero, implement the default value of the action:
1358
Otherwise, the following line sets YYVAL to garbage.
1359
This behavior is undocumented and Bison
1360
users should not rely upon it. Assigning to YYVAL
1361
unconditionally makes the parser a bit smaller, and it avoids a
1362
GCC warning that YYVAL may be used uninitialized. */
1363
yyval = yyvsp[1-yylen];
1366
YY_REDUCE_PRINT (yyn);
1370
/* Line 1267 of yacc.c. */
1374
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1378
YY_STACK_PRINT (yyss, yyssp);
1383
/* Now `shift' the result of the reduction. Determine what state
1384
that goes to, based on the state we popped back to and the rule
1385
number reduced by. */
1389
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1390
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1391
yystate = yytable[yystate];
1393
yystate = yydefgoto[yyn - YYNTOKENS];
1398
/*------------------------------------.
1399
| yyerrlab -- here on detecting error |
1400
`------------------------------------*/
1402
/* If not already recovering from an error, report this error. */
1406
#if ! YYERROR_VERBOSE
1407
yyerror (YY_("syntax error"));
1410
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1411
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1413
YYSIZE_T yyalloc = 2 * yysize;
1414
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1415
yyalloc = YYSTACK_ALLOC_MAXIMUM;
1416
if (yymsg != yymsgbuf)
1417
YYSTACK_FREE (yymsg);
1418
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1420
yymsg_alloc = yyalloc;
1424
yymsg_alloc = sizeof yymsgbuf;
1428
if (0 < yysize && yysize <= yymsg_alloc)
1430
(void) yysyntax_error (yymsg, yystate, yychar);
1435
yyerror (YY_("syntax error"));
1437
goto yyexhaustedlab;
1445
if (yyerrstatus == 3)
1447
/* If just tried and failed to reuse look-ahead token after an
1448
error, discard it. */
1450
if (yychar <= YYEOF)
1452
/* Return failure if at end of input. */
1453
if (yychar == YYEOF)
1458
yydestruct ("Error: discarding",
1464
/* Else will try to reuse look-ahead token after shifting the error
1469
/*---------------------------------------------------.
1470
| yyerrorlab -- error raised explicitly by YYERROR. |
1471
`---------------------------------------------------*/
1474
/* Pacify compilers like GCC when the user code never invokes
1475
YYERROR and the label yyerrorlab therefore never appears in user
1477
if (/*CONSTCOND*/ 0)
1480
/* Do not reclaim the symbols of the rule which action triggered
1484
YY_STACK_PRINT (yyss, yyssp);
1489
/*-------------------------------------------------------------.
1490
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1491
`-------------------------------------------------------------*/
1493
yyerrstatus = 3; /* Each real token shifted decrements this. */
1497
yyn = yypact[yystate];
1498
if (yyn != YYPACT_NINF)
1501
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1509
/* Pop the current state because it cannot handle the error token. */
1514
yydestruct ("Error: popping",
1515
yystos[yystate], yyvsp);
1518
YY_STACK_PRINT (yyss, yyssp);
1527
/* Shift the error token. */
1528
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1534
/*-------------------------------------.
1535
| yyacceptlab -- YYACCEPT comes here. |
1536
`-------------------------------------*/
1541
/*-----------------------------------.
1542
| yyabortlab -- YYABORT comes here. |
1543
`-----------------------------------*/
1549
/*-------------------------------------------------.
1550
| yyexhaustedlab -- memory exhaustion comes here. |
1551
`-------------------------------------------------*/
1553
yyerror (YY_("memory exhausted"));
1559
if (yychar != YYEOF && yychar != YYEMPTY)
1560
yydestruct ("Cleanup: discarding lookahead",
1562
/* Do not reclaim the symbols of the rule which action triggered
1563
this YYABORT or YYACCEPT. */
1565
YY_STACK_PRINT (yyss, yyssp);
1566
while (yyssp != yyss)
1568
yydestruct ("Cleanup: popping",
1569
yystos[*yyssp], yyvsp);
1574
YYSTACK_FREE (yyss);
1577
if (yymsg != yymsgbuf)
1578
YYSTACK_FREE (yymsg);
1580
/* Make sure YYID is used. */
1581
return YYID (yyresult);
1588
/* copy address error message into buffer provided by sieve parser */
1589
int addrerror(char *s)
1591
extern char addrerr[ADDRERR_SIZE];
1593
strlcpy(addrerr, s, sizeof(addrerr));