2 /* A Bison parser, made from quote_fmt.y
3 by GNU Bison version 1.28 */
5 #define YYBISON 1 /* Identify Bison output. */
7 #define yyparse quote_fmtparse
8 #define yylex quote_fmtlex
9 #define yyerror quote_fmterror
10 #define yylval quote_fmtlval
11 #define yychar quote_fmtchar
12 #define yydebug quote_fmtdebug
13 #define yynerrs quote_fmtnerrs
14 #define SHOW_NEWSGROUPS 257
17 #define SHOW_FULLNAME 260
18 #define SHOW_FIRST_NAME 261
19 #define SHOW_SENDER_INITIAL 262
20 #define SHOW_SUBJECT 263
22 #define SHOW_MESSAGEID 265
23 #define SHOW_PERCENT 266
25 #define SHOW_REFERENCES 268
26 #define SHOW_MESSAGE 269
27 #define SHOW_QUOTED_MESSAGE 270
28 #define SHOW_BACKSLASH 271
31 #define SHOW_QUESTION_MARK 274
32 #define SHOW_OPARENT 275
33 #define SHOW_CPARENT 276
34 #define QUERY_DATE 277
35 #define QUERY_FROM 278
36 #define QUERY_FULLNAME 279
37 #define QUERY_SUBJECT 280
39 #define QUERY_NEWSGROUPS 282
40 #define QUERY_MESSAGEID 283
42 #define QUERY_REFERENCES 285
59 #include "quote_fmt.tab.h"
61 #include "lex.quote_fmt.c"
66 bison -p quote_fmt quote_fmt.y
69 static MsgInfo * msginfo = NULL;
70 static gboolean * visible = NULL;
71 static gint maxsize = 0;
72 static gint stacksize = 0;
74 static gchar * buffer = NULL;
75 static gint bufmax = 0;
76 static gint bufsize = 0;
77 static gchar * quote_str = NULL;
78 static gint error = 0;
80 static void add_visibility(gboolean val)
83 if (maxsize < stacksize) {
85 visible = g_realloc(visible, maxsize * sizeof(gboolean));
90 visible[stacksize - 1] = val;
93 static void remove_visibility()
99 static void add_buffer(gchar * s)
101 gint len = strlen(s);
103 if (bufsize + len + 1 > bufmax) {
106 while (bufsize + len + 1 > bufmax)
108 buffer = g_realloc(buffer, bufmax);
110 strcpy(buffer + bufsize, s);
114 static void flush_buffer()
121 gchar * quote_fmt_get_buffer()
129 #define INSERT(buf) \
130 if (stacksize != 0 && visible[stacksize - 1]) \
133 void quote_fmt_init(MsgInfo * info, gchar * my_quote_str)
135 quote_str = my_quote_str;
138 add_visibility(TRUE);
145 void quote_fmterror(char * str)
147 g_warning(_("Error %s\n"), str);
151 int quote_fmtwrap(void)
156 static int isseparator(char ch)
158 return isspace(ch) || ch == '.' || ch == '-';
161 #line 115 "quote_fmt.y"
176 #define YYFLAG -32768
179 #define YYTRANSLATE(x) ((unsigned)(x) <= 288 ? yytranslate[x] : 50)
181 static const char yytranslate[] = { 0,
182 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
183 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
184 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
185 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
186 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
187 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
190 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
191 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
192 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
193 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
194 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
195 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
197 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
198 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
199 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
200 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
201 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
202 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
203 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
204 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
205 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
206 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
207 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
208 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
209 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
210 27, 28, 29, 30, 31, 32, 33, 34
214 static const short yyprhs[] = { 0,
215 0, 2, 5, 7, 9, 11, 13, 15, 17, 19,
216 21, 23, 25, 27, 29, 31, 33, 35, 37, 39,
217 41, 43, 45, 47, 49, 51, 53, 55, 56, 62,
218 63, 69, 70, 76, 77, 83, 84, 90, 91, 97,
219 98, 104, 105, 111, 112
222 static const short yyrhs[] = { 36,
223 0, 37, 36, 0, 37, 0, 39, 0, 38, 0,
224 40, 0, 34, 0, 3, 0, 4, 0, 5, 0,
225 6, 0, 7, 0, 8, 0, 9, 0, 10, 0,
226 11, 0, 12, 0, 13, 0, 14, 0, 15, 0,
227 16, 0, 17, 0, 18, 0, 19, 0, 20, 0,
228 21, 0, 22, 0, 0, 23, 41, 32, 35, 33,
229 0, 0, 24, 42, 32, 35, 33, 0, 0, 25,
230 43, 32, 35, 33, 0, 0, 26, 44, 32, 35,
231 33, 0, 0, 27, 45, 32, 35, 33, 0, 0,
232 28, 46, 32, 35, 33, 0, 0, 29, 47, 32,
233 35, 33, 0, 0, 30, 48, 32, 35, 33, 0,
234 0, 31, 49, 32, 35, 33, 0
240 static const short yyrline[] = { 0,
241 137, 140, 142, 144, 146, 150, 153, 159, 165, 170,
242 175, 180, 196, 224, 229, 234, 239, 243, 248, 253,
243 265, 279, 283, 287, 291, 295, 299, 304, 309, 313,
244 317, 321, 325, 329, 333, 337, 341, 345, 349, 353,
245 357, 361, 365, 369, 373
250 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
252 static const char * const yytname[] = { "$","error","$undefined.","SHOW_NEWSGROUPS",
253 "SHOW_DATE","SHOW_FROM","SHOW_FULLNAME","SHOW_FIRST_NAME","SHOW_SENDER_INITIAL",
254 "SHOW_SUBJECT","SHOW_TO","SHOW_MESSAGEID","SHOW_PERCENT","SHOW_CC","SHOW_REFERENCES",
255 "SHOW_MESSAGE","SHOW_QUOTED_MESSAGE","SHOW_BACKSLASH","SHOW_TAB","SHOW_EOL",
256 "SHOW_QUESTION_MARK","SHOW_OPARENT","SHOW_CPARENT","QUERY_DATE","QUERY_FROM",
257 "QUERY_FULLNAME","QUERY_SUBJECT","QUERY_TO","QUERY_NEWSGROUPS","QUERY_MESSAGEID",
258 "QUERY_CC","QUERY_REFERENCES","OPARENT","CPARENT","CHARACTER","quote_fmt","character_or_special_or_query_list",
259 "character_or_special_or_query","character","special","query","@1","@2","@3",
260 "@4","@5","@6","@7","@8","@9", NULL
264 static const short yyr1[] = { 0,
265 35, 36, 36, 37, 37, 37, 38, 39, 39, 39,
266 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
267 39, 39, 39, 39, 39, 39, 39, 41, 40, 42,
268 40, 43, 40, 44, 40, 45, 40, 46, 40, 47,
272 static const short yyr2[] = { 0,
273 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
274 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
275 1, 1, 1, 1, 1, 1, 1, 0, 5, 0,
276 5, 0, 5, 0, 5, 0, 5, 0, 5, 0,
280 static const short yydefact[] = { 0,
281 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
282 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
283 28, 30, 32, 34, 36, 38, 40, 42, 44, 7,
284 1, 3, 5, 4, 6, 0, 0, 0, 0, 0,
285 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
286 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
287 0, 0, 0, 29, 31, 33, 35, 37, 39, 41,
291 static const short yydefgoto[] = { 55,
292 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
296 static const short yypact[] = { -2,
297 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
298 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
299 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
300 -32768, -2,-32768,-32768,-32768, -1, 1, 2, 3, 4,
301 5, 6, 7, 8,-32768, -2, -2, -2, -2, -2,
302 -2, -2, -2, -2, -3, 9, 10, 11, 12, 13,
303 22, 23, 24,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
304 -32768,-32768, 41, 58,-32768
307 static const short yypgoto[] = { 0,
308 27,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
309 -32768,-32768,-32768,-32768
316 static const short yytable[] = { 73,
317 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
318 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
319 21, 22, 23, 24, 25, 26, 27, 28, 29, 64,
320 46, 30, 47, 48, 49, 50, 51, 52, 53, 54,
321 74, 65, 66, 67, 68, 69, 56, 57, 58, 59,
322 60, 61, 62, 63, 70, 71, 72, 75, 45
325 static const short yycheck[] = { 0,
326 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
327 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
328 23, 24, 25, 26, 27, 28, 29, 30, 31, 33,
329 32, 34, 32, 32, 32, 32, 32, 32, 32, 32,
330 0, 33, 33, 33, 33, 33, 47, 48, 49, 50,
331 51, 52, 53, 54, 33, 33, 33, 0, 32
333 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
334 #line 3 "/usr/share/bison/bison.simple"
335 /* This file comes from bison-1.28. */
337 /* Skeleton output parser for bison,
338 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
340 This program is free software; you can redistribute it and/or modify
341 it under the terms of the GNU General Public License as published by
342 the Free Software Foundation; either version 2, or (at your option)
345 This program is distributed in the hope that it will be useful,
346 but WITHOUT ANY WARRANTY; without even the implied warranty of
347 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
348 GNU General Public License for more details.
350 You should have received a copy of the GNU General Public License
351 along with this program; if not, write to the Free Software
352 Foundation, Inc., 59 Temple Place - Suite 330,
353 Boston, MA 02111-1307, USA. */
355 /* As a special exception, when this file is copied by Bison into a
356 Bison output file, you may use that output file without restriction.
357 This special exception was added by the Free Software Foundation
358 in version 1.24 of Bison. */
360 /* This is the parser code that is written into each bison parser
361 when the %semantic_parser declaration is not specified in the grammar.
362 It was written by Richard Stallman by simplifying the hairy parser
363 used when %semantic_parser is specified. */
365 #ifndef YYSTACK_USE_ALLOCA
367 #define YYSTACK_USE_ALLOCA
368 #else /* alloca not defined */
370 #define YYSTACK_USE_ALLOCA
371 #define alloca __builtin_alloca
372 #else /* not GNU C. */
373 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
374 #define YYSTACK_USE_ALLOCA
376 #else /* not sparc */
377 /* We think this test detects Watcom and Microsoft C. */
378 /* This used to test MSDOS, but that is a bad idea
379 since that symbol is in the user namespace. */
380 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
381 #if 0 /* No need for malloc.h, which pollutes the namespace;
382 instead, just don't use alloca. */
385 #else /* not MSDOS, or __TURBOC__ */
387 /* I don't know what this was needed for, but it pollutes the namespace.
388 So I turned it off. rms, 2 May 1997. */
389 /* #include <malloc.h> */
391 #define YYSTACK_USE_ALLOCA
392 #else /* not MSDOS, or __TURBOC__, or _AIX */
394 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
395 and on HPUX 10. Eventually we can turn this on. */
396 #define YYSTACK_USE_ALLOCA
397 #define alloca __builtin_alloca
400 #endif /* not _AIX */
401 #endif /* not MSDOS, or __TURBOC__ */
402 #endif /* not sparc */
403 #endif /* not GNU C */
404 #endif /* alloca not defined */
405 #endif /* YYSTACK_USE_ALLOCA not defined */
407 #ifdef YYSTACK_USE_ALLOCA
408 #define YYSTACK_ALLOC alloca
410 #define YYSTACK_ALLOC malloc
413 /* Note: there must be only one dollar sign in this file.
414 It is replaced by the list of actions, each action
415 as one case of the switch. */
417 #define yyerrok (yyerrstatus = 0)
418 #define yyclearin (yychar = YYEMPTY)
421 #define YYACCEPT goto yyacceptlab
422 #define YYABORT goto yyabortlab
423 #define YYERROR goto yyerrlab1
424 /* Like YYERROR except do call yyerror.
425 This remains here temporarily to ease the
426 transition to the new meaning of YYERROR, for GCC.
427 Once GCC version 2 has supplanted version 1, this can go. */
428 #define YYFAIL goto yyerrlab
429 #define YYRECOVERING() (!!yyerrstatus)
430 #define YYBACKUP(token, value) \
432 if (yychar == YYEMPTY && yylen == 1) \
433 { yychar = (token), yylval = (value); \
434 yychar1 = YYTRANSLATE (yychar); \
439 { yyerror ("syntax error: cannot back up"); YYERROR; } \
443 #define YYERRCODE 256
446 #define YYLEX yylex()
452 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
454 #define YYLEX yylex(&yylval, &yylloc)
456 #else /* not YYLSP_NEEDED */
458 #define YYLEX yylex(&yylval, YYLEX_PARAM)
460 #define YYLEX yylex(&yylval)
462 #endif /* not YYLSP_NEEDED */
465 /* If nonreentrant, generate the variables here */
469 int yychar; /* the lookahead symbol */
470 YYSTYPE yylval; /* the semantic value of the */
471 /* lookahead symbol */
474 YYLTYPE yylloc; /* location data for the lookahead */
478 int yynerrs; /* number of parse errors so far */
479 #endif /* not YYPURE */
482 int yydebug; /* nonzero means print parse trace */
483 /* Since this is uninitialized, it does not stop multiple parsers
487 /* YYINITDEPTH indicates the initial size of the parser's stacks */
490 #define YYINITDEPTH 200
493 /* YYMAXDEPTH is the maximum size the stacks can grow to
494 (effective only if the built-in stack extension method is used). */
501 #define YYMAXDEPTH 10000
504 /* Define __yy_memcpy. Note that the size argument
505 should be passed with type unsigned int, because that is what the non-GCC
506 definitions require. With GCC, __builtin_memcpy takes an arg
507 of type size_t, but it can handle unsigned int. */
509 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
510 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
511 #else /* not GNU C or C++ */
514 /* This is the most reliable way to avoid incompatibilities
515 in available built-in functions on various systems. */
517 __yy_memcpy (to, from, count)
522 register char *f = from;
523 register char *t = to;
524 register int i = count;
530 #else /* __cplusplus */
532 /* This is the most reliable way to avoid incompatibilities
533 in available built-in functions on various systems. */
535 __yy_memcpy (char *to, char *from, unsigned int count)
537 register char *t = to;
538 register char *f = from;
539 register int i = count;
548 #line 217 "/usr/share/bison/bison.simple"
550 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
551 into yyparse. The argument should have type void *.
552 It should actually point to an object.
553 Grammar actions can access the variable by casting it
554 to the proper pointer type. */
558 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
559 #define YYPARSE_PARAM_DECL
560 #else /* not __cplusplus */
561 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
562 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
563 #endif /* not __cplusplus */
564 #else /* not YYPARSE_PARAM */
565 #define YYPARSE_PARAM_ARG
566 #define YYPARSE_PARAM_DECL
567 #endif /* not YYPARSE_PARAM */
569 /* Prevent warning if -Wstrict-prototypes. */
572 int yyparse (void *);
579 yyparse(YYPARSE_PARAM_ARG)
582 register int yystate;
584 register short *yyssp;
585 register YYSTYPE *yyvsp;
586 int yyerrstatus; /* number of tokens to shift before error messages enabled */
587 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
589 short yyssa[YYINITDEPTH]; /* the state stack */
590 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
592 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
593 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
596 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
597 YYLTYPE *yyls = yylsa;
600 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
602 #define YYPOPSTACK (yyvsp--, yyssp--)
605 int yystacksize = YYINITDEPTH;
606 int yyfree_stacks = 0;
617 YYSTYPE yyval; /* the variable used to return */
618 /* semantic values from the action */
625 fprintf(stderr, "Starting parse\n");
631 yychar = YYEMPTY; /* Cause a token to be read. */
633 /* Initialize stack pointers.
634 Waste one element of value and location stack
635 so that they stay on the same level as the state stack.
636 The wasted elements are never initialized. */
644 /* Push a new state, which is found in yystate . */
645 /* In all cases, when you get here, the value and location stacks
646 have just been pushed. so pushing a state here evens the stacks. */
651 if (yyssp >= yyss + yystacksize - 1)
653 /* Give user a chance to reallocate the stack */
654 /* Use copies of these so that the &'s don't force the real ones into memory. */
655 YYSTYPE *yyvs1 = yyvs;
658 YYLTYPE *yyls1 = yyls;
661 /* Get the current used size of the three stacks, in elements. */
662 int size = yyssp - yyss + 1;
665 /* Each stack pointer address is followed by the size of
666 the data in use in that stack, in bytes. */
668 /* This used to be a conditional around just the two extra args,
669 but that might be undefined if yyoverflow is a macro. */
670 yyoverflow("parser stack overflow",
671 &yyss1, size * sizeof (*yyssp),
672 &yyvs1, size * sizeof (*yyvsp),
673 &yyls1, size * sizeof (*yylsp),
676 yyoverflow("parser stack overflow",
677 &yyss1, size * sizeof (*yyssp),
678 &yyvs1, size * sizeof (*yyvsp),
682 yyss = yyss1; yyvs = yyvs1;
686 #else /* no yyoverflow */
687 /* Extend the stack our own way. */
688 if (yystacksize >= YYMAXDEPTH)
690 yyerror("parser stack overflow");
702 if (yystacksize > YYMAXDEPTH)
703 yystacksize = YYMAXDEPTH;
704 #ifndef YYSTACK_USE_ALLOCA
707 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
708 __yy_memcpy ((char *)yyss, (char *)yyss1,
709 size * (unsigned int) sizeof (*yyssp));
710 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
711 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
712 size * (unsigned int) sizeof (*yyvsp));
714 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
715 __yy_memcpy ((char *)yyls, (char *)yyls1,
716 size * (unsigned int) sizeof (*yylsp));
718 #endif /* no yyoverflow */
720 yyssp = yyss + size - 1;
721 yyvsp = yyvs + size - 1;
723 yylsp = yyls + size - 1;
728 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
731 if (yyssp >= yyss + yystacksize - 1)
737 fprintf(stderr, "Entering state %d\n", yystate);
743 /* Do appropriate processing given the current state. */
744 /* Read a lookahead token if we need one and don't already have one. */
747 /* First try to decide what to do without reference to lookahead token. */
749 yyn = yypact[yystate];
753 /* Not known => get a lookahead token if don't already have one. */
755 /* yychar is either YYEMPTY or YYEOF
756 or a valid token in external form. */
758 if (yychar == YYEMPTY)
762 fprintf(stderr, "Reading a token: ");
767 /* Convert token to internal form (in yychar1) for indexing tables with */
769 if (yychar <= 0) /* This means end of input. */
772 yychar = YYEOF; /* Don't call YYLEX any more */
776 fprintf(stderr, "Now at end of input.\n");
781 yychar1 = YYTRANSLATE(yychar);
786 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
787 /* Give the individual parser a way to print the precise meaning
788 of a token, for further debugging info. */
790 YYPRINT (stderr, yychar, yylval);
792 fprintf (stderr, ")\n");
798 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
803 /* yyn is what to do for this token type in this state.
804 Negative => reduce, -yyn is rule number.
805 Positive => shift, yyn is new state.
806 New state is final state => don't bother to shift,
808 0, or most negative number => error. */
823 /* Shift the lookahead token. */
827 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
830 /* Discard the token being shifted unless it is eof. */
839 /* count tokens shifted since error; after three, turn off error status. */
840 if (yyerrstatus) yyerrstatus--;
845 /* Do the default action for the current state. */
848 yyn = yydefact[yystate];
852 /* Do a reduction. yyn is the number of a rule to reduce with. */
856 yyval = yyvsp[1-yylen]; /* implement default value of the action */
863 fprintf (stderr, "Reducing via rule %d (line %d), ",
866 /* Print the symbols being reduced, and their result. */
867 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
868 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
869 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
877 #line 147 "quote_fmt.y"
879 INSERT(yyvsp[0].str);
883 #line 155 "quote_fmt.y"
889 #line 161 "quote_fmt.y"
891 if (msginfo->newsgroups)
892 INSERT(msginfo->newsgroups);
896 #line 166 "quote_fmt.y"
899 INSERT(msginfo->date);
903 #line 171 "quote_fmt.y"
906 INSERT(msginfo->from);
910 #line 176 "quote_fmt.y"
912 if (msginfo->fromname)
913 INSERT(msginfo->fromname);
917 #line 181 "quote_fmt.y"
919 if (msginfo->fromname) {
923 str = alloca(strlen(msginfo->fromname) + 1);
925 strcpy(str, msginfo->fromname);
927 while (*p && !isspace(*p)) p++;
935 #line 197 "quote_fmt.y"
937 #define MAX_SENDER_INITIAL 20
938 if (msginfo->fromname) {
939 gchar tmp[MAX_SENDER_INITIAL];
944 p = msginfo->fromname;
947 if (*p && isalnum(*p)) {
951 if (len >= MAX_SENDER_INITIAL - 1)
956 while (*p && !isseparator(*p)) p++;
957 while (*p && isseparator(*p)) p++;
965 #line 225 "quote_fmt.y"
967 if (msginfo->subject)
968 INSERT(msginfo->subject);
972 #line 230 "quote_fmt.y"
979 #line 235 "quote_fmt.y"
982 INSERT(msginfo->msgid);
986 #line 240 "quote_fmt.y"
992 #line 244 "quote_fmt.y"
999 #line 249 "quote_fmt.y"
1001 if (msginfo->references)
1002 INSERT(msginfo->references);
1006 #line 254 "quote_fmt.y"
1008 gchar buf[BUFFSIZE];
1011 if ((fp = procmime_get_text_part(msginfo)) == NULL)
1012 g_warning(_("Can't get text part\n"));
1013 while (fgets(buf, sizeof(buf), fp) != NULL) {
1020 #line 266 "quote_fmt.y"
1022 gchar buf[BUFFSIZE];
1025 if ((fp = procmime_get_text_part(msginfo)) == NULL)
1026 g_warning(_("Can't get text part\n"));
1027 while (fgets(buf, sizeof(buf), fp) != NULL) {
1036 #line 280 "quote_fmt.y"
1042 #line 284 "quote_fmt.y"
1048 #line 288 "quote_fmt.y"
1054 #line 292 "quote_fmt.y"
1060 #line 296 "quote_fmt.y"
1066 #line 300 "quote_fmt.y"
1072 #line 306 "quote_fmt.y"
1074 add_visibility(msginfo->date != NULL);
1078 #line 310 "quote_fmt.y"
1080 remove_visibility();
1084 #line 314 "quote_fmt.y"
1086 add_visibility(msginfo->from != NULL);
1090 #line 318 "quote_fmt.y"
1092 remove_visibility();
1096 #line 322 "quote_fmt.y"
1098 add_visibility(msginfo->fromname != NULL);
1102 #line 326 "quote_fmt.y"
1104 remove_visibility();
1108 #line 330 "quote_fmt.y"
1110 add_visibility(msginfo->subject != NULL);
1114 #line 334 "quote_fmt.y"
1116 remove_visibility();
1120 #line 338 "quote_fmt.y"
1122 add_visibility(msginfo->to != NULL);
1126 #line 342 "quote_fmt.y"
1128 remove_visibility();
1132 #line 346 "quote_fmt.y"
1134 add_visibility(msginfo->newsgroups != NULL);
1138 #line 350 "quote_fmt.y"
1140 remove_visibility();
1144 #line 354 "quote_fmt.y"
1146 add_visibility(msginfo->msgid != NULL);
1150 #line 358 "quote_fmt.y"
1152 remove_visibility();
1156 #line 362 "quote_fmt.y"
1158 add_visibility(msginfo->cc != NULL);
1162 #line 366 "quote_fmt.y"
1164 remove_visibility();
1168 #line 370 "quote_fmt.y"
1170 add_visibility(msginfo->references != NULL);
1174 #line 374 "quote_fmt.y"
1176 remove_visibility();
1180 /* the action file gets copied in in place of this dollarsign */
1181 #line 543 "/usr/share/bison/bison.simple"
1192 short *ssp1 = yyss - 1;
1193 fprintf (stderr, "state stack now");
1194 while (ssp1 != yyssp)
1195 fprintf (stderr, " %d", *++ssp1);
1196 fprintf (stderr, "\n");
1206 yylsp->first_line = yylloc.first_line;
1207 yylsp->first_column = yylloc.first_column;
1208 yylsp->last_line = (yylsp-1)->last_line;
1209 yylsp->last_column = (yylsp-1)->last_column;
1214 yylsp->last_line = (yylsp+yylen-1)->last_line;
1215 yylsp->last_column = (yylsp+yylen-1)->last_column;
1219 /* Now "shift" the result of the reduction.
1220 Determine what state that goes to,
1221 based on the state we popped back to
1222 and the rule number reduced by. */
1226 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1227 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1228 yystate = yytable[yystate];
1230 yystate = yydefgoto[yyn - YYNTBASE];
1234 yyerrlab: /* here on detecting error */
1237 /* If not already recovering from an error, report this error. */
1241 #ifdef YYERROR_VERBOSE
1242 yyn = yypact[yystate];
1244 if (yyn > YYFLAG && yyn < YYLAST)
1251 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1252 for (x = (yyn < 0 ? -yyn : 0);
1253 x < (sizeof(yytname) / sizeof(char *)); x++)
1254 if (yycheck[x + yyn] == x)
1255 size += strlen(yytname[x]) + 15, count++;
1256 msg = (char *) malloc(size + 15);
1259 strcpy(msg, "parse error");
1264 for (x = (yyn < 0 ? -yyn : 0);
1265 x < (sizeof(yytname) / sizeof(char *)); x++)
1266 if (yycheck[x + yyn] == x)
1268 strcat(msg, count == 0 ? ", expecting `" : " or `");
1269 strcat(msg, yytname[x]);
1278 yyerror ("parse error; also virtual memory exceeded");
1281 #endif /* YYERROR_VERBOSE */
1282 yyerror("parse error");
1286 yyerrlab1: /* here on error raised explicitly by an action */
1288 if (yyerrstatus == 3)
1290 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1292 /* return failure if at end of input */
1293 if (yychar == YYEOF)
1298 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1304 /* Else will try to reuse lookahead token
1305 after shifting the error token. */
1307 yyerrstatus = 3; /* Each real token shifted decrements this */
1311 yyerrdefault: /* current state does not do anything special for the error token. */
1314 /* This is wrong; only states that explicitly want error tokens
1315 should shift them. */
1316 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1317 if (yyn) goto yydefault;
1320 yyerrpop: /* pop the current state because it cannot handle the error token */
1322 if (yyssp == yyss) YYABORT;
1332 short *ssp1 = yyss - 1;
1333 fprintf (stderr, "Error: state stack now");
1334 while (ssp1 != yyssp)
1335 fprintf (stderr, " %d", *++ssp1);
1336 fprintf (stderr, "\n");
1342 yyn = yypact[yystate];
1347 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1366 fprintf(stderr, "Shifting error token, ");
1378 /* YYACCEPT comes here. */
1390 /* YYABORT comes here. */
1401 #line 377 "quote_fmt.y"