7#define yyparse tdeprint_foomatic2parse
8#define yylex tdeprint_foomatic2lex
9#define yyerror tdeprint_foomatic2error
10#define yylval tdeprint_foomatic2lval
11#define yychar tdeprint_foomatic2char
12#define yydebug tdeprint_foomatic2debug
13#define yynerrs tdeprint_foomatic2nerrs
21#line 1 "./fooparser.y"
42#define YYSTYPE TQVariant
43#define YYPARSE_PARAM fooloader
48#include "foomatic2loader.h"
50void yyerror(
const char*) {}
69#define YYTRANSLATE(x) ((unsigned)(x) <= 262 ? yytranslate[x] : 23)
71static const char yytranslate[] = { 0,
72 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
73 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
74 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
75 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
76 2, 2, 2, 13, 2, 2, 2, 2, 2, 2,
77 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
78 9, 14, 2, 2, 2, 2, 2, 2, 2, 2,
79 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
80 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
81 15, 2, 16, 2, 2, 2, 2, 2, 2, 2,
82 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
83 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
84 2, 2, 10, 2, 11, 2, 2, 2, 2, 2,
85 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
86 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
87 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
88 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
89 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
90 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
91 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
92 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
93 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
94 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
95 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
96 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
97 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
102static const short yyprhs[] = { 0,
103 0, 2, 5, 12, 17, 19, 23, 28, 30, 34,
104 36, 38, 40, 44, 48, 51
107static const short yyrhs[] = { 18,
108 0, 17, 18, 0, 3, 9, 10, 19, 11, 12,
109 0, 7, 9, 8, 12, 0, 20, 0, 19, 13,
110 20, 0, 4, 9, 14, 22, 0, 22, 0, 21,
111 13, 22, 0, 6, 0, 4, 0, 5, 0, 15,
112 21, 16, 0, 10, 19, 11, 0, 15, 16, 0,
119static const short yyrline[] = { 0,
120 42, 43, 46, 47, 50, 51, 54, 57, 58, 61,
121 62, 63, 64, 65, 66, 67
126#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
128static const char *
const yytname[] = {
"$",
"error",
"$undefined.",
"VAR",
"STRING",
129"NUMBER",
"UNDEF",
"POSTPIPE",
"QUOTED",
"'='",
"'{'",
"'}'",
"';'",
"','",
"'>'",
"'['",
130"']'",
"foo",
"foodata",
"fieldlist",
"assignment",
"valuelist",
"value", NULL
134static const short yyr1[] = { 0,
135 17, 17, 18, 18, 19, 19, 20, 21, 21, 22,
136 22, 22, 22, 22, 22, 22
139static const short yyr2[] = { 0,
140 1, 2, 6, 4, 1, 3, 4, 1, 3, 1,
144static const short yydefact[] = { 0,
145 0, 0, 0, 1, 0, 0, 2, 0, 0, 0,
146 0, 5, 4, 0, 0, 0, 0, 3, 6, 11,
147 12, 10, 0, 0, 7, 16, 0, 15, 0, 8,
151static const short yydefgoto[] = { 3,
155static const short yypact[] = { 15,
156 11, 20, 10,-32768, -2, 18,-32768, 27, 7, 23,
157 14,-32768,-32768, 19, 22, 27, -1,-32768,-32768,-32768,
158-32768,-32768, 12, -4,-32768,-32768, 17,-32768, 8,-32768,
159-32768, -1,-32768,-32768, 35,-32768
162static const short yypgoto[] = {-32768,
163 33, 16, 21,-32768, -17
170static const short yytable[] = { 20,
171 21, 22, 20, 21, 22, 23, 30, 8, 23, 35,
172 24, 28, 1, 24, 34, 10, 2, 1, 13, 5,
173 32, 2, 26, 33, 15, 9, 16, 31, 6, 16,
174 10, 14, 17, 18, 36, 7, 19, 0, 27
177static const short yycheck[] = { 4,
178 5, 6, 4, 5, 6, 10, 24, 10, 10, 0,
179 15, 16, 3, 15, 32, 4, 7, 3, 12, 9,
180 13, 7, 11, 16, 11, 8, 13, 11, 9, 13,
181 4, 9, 14, 12, 0, 3, 16, -1, 23
184#line 3 "/usr/lib/bison.simple"
215#ifndef YYSTACK_USE_ALLOCA
217#define YYSTACK_USE_ALLOCA
220#define YYSTACK_USE_ALLOCA
221#define alloca __builtin_alloca
223#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
224#define YYSTACK_USE_ALLOCA
230#if defined (_MSDOS) || defined (_MSDOS_)
241#define YYSTACK_USE_ALLOCA
250#ifdef YYSTACK_USE_ALLOCA
251#define YYSTACK_ALLOC alloca
253#define YYSTACK_ALLOC malloc
260#define yyerrok (yyerrstatus = 0)
261#define yyclearin (yychar = YYEMPTY)
264#define YYACCEPT goto yyacceptlab
265#define YYABORT goto yyabortlab
266#define YYERROR goto yyerrlab1
271#define YYFAIL goto yyerrlab
272#define YYRECOVERING() (!!yyerrstatus)
273#define YYBACKUP(token, value) \
275 if (yychar == YYEMPTY && yylen == 1) \
276 { yychar = (token), yylval = (value); \
277 yychar1 = YYTRANSLATE (yychar); \
282 { yyerror ("syntax error: cannot back up"); YYERROR; } \
295#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
297#define YYLEX yylex(&yylval, &yylloc)
301#define YYLEX yylex(&yylval, YYLEX_PARAM)
303#define YYLEX yylex(&yylval)
333#define YYINITDEPTH 200
344#define YYMAXDEPTH 10000
353#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
360__yy_memcpy (to, from, count)
378__yy_memcpy (
char *to,
char *from,
unsigned int count)
391#line 217 "/usr/lib/bison.simple"
401#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
402#define YYPARSE_PARAM_DECL
404#define YYPARSE_PARAM_ARG YYPARSE_PARAM
405#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
408#define YYPARSE_PARAM_ARG
409#define YYPARSE_PARAM_DECL
422yyparse(YYPARSE_PARAM_ARG)
432 short yyssa[YYINITDEPTH];
433 YYSTYPE yyvsa[YYINITDEPTH];
436 YYSTYPE *yyvs = yyvsa;
439 YYLTYPE yylsa[YYINITDEPTH];
440 YYLTYPE *yyls = yylsa;
443#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
445#define YYPOPSTACK (yyvsp--, yyssp--)
448 int yystacksize = YYINITDEPTH;
449 int yyfree_stacks = 0;
468 fprintf(stderr,
"Starting parse\n");
494 if (yyssp >= yyss + yystacksize - 1)
498 YYSTYPE *yyvs1 = yyvs;
501 YYLTYPE *yyls1 = yyls;
505 int size = yyssp - yyss + 1;
513 yyoverflow(
"parser stack overflow",
514 &yyss1, size *
sizeof (*yyssp),
515 &yyvs1, size *
sizeof (*yyvsp),
516 &yyls1, size *
sizeof (*yylsp),
519 yyoverflow(
"parser stack overflow",
520 &yyss1, size *
sizeof (*yyssp),
521 &yyvs1, size *
sizeof (*yyvsp),
525 yyss = yyss1; yyvs = yyvs1;
531 if (yystacksize >= YYMAXDEPTH)
533 yyerror(
"parser stack overflow");
545 if (yystacksize > YYMAXDEPTH)
546 yystacksize = YYMAXDEPTH;
547#ifndef YYSTACK_USE_ALLOCA
550 yyss = (
short *) YYSTACK_ALLOC (yystacksize *
sizeof (*yyssp));
551 __yy_memcpy ((
char *)yyss, (
char *)yyss1,
552 size * (
unsigned int)
sizeof (*yyssp));
553 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize *
sizeof (*yyvsp));
554 __yy_memcpy ((
char *)yyvs, (
char *)yyvs1,
555 size * (
unsigned int)
sizeof (*yyvsp));
557 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize *
sizeof (*yylsp));
558 __yy_memcpy ((
char *)yyls, (
char *)yyls1,
559 size * (
unsigned int)
sizeof (*yylsp));
563 yyssp = yyss + size - 1;
564 yyvsp = yyvs + size - 1;
566 yylsp = yyls + size - 1;
571 fprintf(stderr,
"Stack size increased to %d\n", yystacksize);
574 if (yyssp >= yyss + yystacksize - 1)
580 fprintf(stderr,
"Entering state %d\n", yystate);
592 yyn = yypact[yystate];
601 if (yychar == YYEMPTY)
605 fprintf(stderr,
"Reading a token: ");
619 fprintf(stderr,
"Now at end of input.\n");
624 yychar1 = YYTRANSLATE(yychar);
629 fprintf (stderr,
"Next token is %d (%s", yychar, yytname[yychar1]);
633 YYPRINT (stderr, yychar, yylval);
635 fprintf (stderr,
")\n");
641 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
670 fprintf(stderr,
"Shifting token %d (%s), ", yychar, yytname[yychar1]);
683 if (yyerrstatus) yyerrstatus--;
691 yyn = yydefact[yystate];
699 yyval = yyvsp[1-yylen];
706 fprintf (stderr,
"Reducing via rule %d (line %d), ",
710 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
711 fprintf (stderr,
"%s ", yytname[yyrhs[i]]);
712 fprintf (stderr,
" -> %s\n", yytname[yyr1[yyn]]);
720#line 46 "./fooparser.y"
721{
static_cast<Foomatic2Loader*
>(fooloader)->m_foodata.insert(
"VAR",yyvsp[-2]); ;
724#line 47 "./fooparser.y"
725{
static_cast<Foomatic2Loader*
>(fooloader)->m_foodata.insert(
"POSTPIPE",yyvsp[-1]); ;
728#line 50 "./fooparser.y"
732#line 51 "./fooparser.y"
733{ TQStringVariantMap::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ;
736#line 54 "./fooparser.y"
737{ yyval.asMap().insert(yyvsp[-3].toString(), yyvsp[0]); ;
740#line 57 "./fooparser.y"
741{ yyval.asList().append(yyvsp[0]); ;
744#line 58 "./fooparser.y"
745{ yyvsp[-2].asList().append(yyvsp[0]); yyval = yyvsp[-2]; ;
748#line 61 "./fooparser.y"
749{ yyval = TQVariant(); ;
752#line 62 "./fooparser.y"
756#line 63 "./fooparser.y"
760#line 64 "./fooparser.y"
761{ yyval = yyvsp[-1]; ;
764#line 65 "./fooparser.y"
765{ yyval = yyvsp[-1]; ;
768#line 66 "./fooparser.y"
769{ yyval = TQVariant(); ;
772#line 67 "./fooparser.y"
773{ yyval = TQVariant(); ;
777#line 543 "/usr/lib/bison.simple"
788 short *ssp1 = yyss - 1;
789 fprintf (stderr,
"state stack now");
790 while (ssp1 != yyssp)
791 fprintf (stderr,
" %d", *++ssp1);
792 fprintf (stderr,
"\n");
802 yylsp->first_line = yylloc.first_line;
803 yylsp->first_column = yylloc.first_column;
804 yylsp->last_line = (yylsp-1)->last_line;
805 yylsp->last_column = (yylsp-1)->last_column;
810 yylsp->last_line = (yylsp+yylen-1)->last_line;
811 yylsp->last_column = (yylsp+yylen-1)->last_column;
822 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
823 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
824 yystate = yytable[yystate];
826 yystate = yydefgoto[yyn - YYNTBASE];
837#ifdef YYERROR_VERBOSE
838 yyn = yypact[yystate];
840 if (yyn > YYFLAG && yyn < YYLAST)
848 for (x = (yyn < 0 ? -yyn : 0);
849 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
850 if (yycheck[x + yyn] == x)
851 size += strlen(yytname[x]) + 15, count++;
852 msg = (
char *) malloc(size + 15);
855 strcpy(msg,
"parse error");
860 for (x = (yyn < 0 ? -yyn : 0);
861 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
862 if (yycheck[x + yyn] == x)
864 strcat(msg, count == 0 ?
", expecting `" :
" or `");
865 strcat(msg, yytname[x]);
874 yyerror (
"parse error; also virtual memory exceeded");
878 yyerror(
"parse error");
884 if (yyerrstatus == 3)
894 fprintf(stderr,
"Discarding token %d (%s).\n", yychar, yytname[yychar1]);
912 yyn = yydefact[yystate];
913 if (yyn)
goto yydefault;
918 if (yyssp == yyss) YYABORT;
928 short *ssp1 = yyss - 1;
929 fprintf (stderr,
"Error: state stack now");
930 while (ssp1 != yyssp)
931 fprintf (stderr,
" %d", *++ssp1);
932 fprintf (stderr,
"\n");
938 yyn = yypact[yystate];
943 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
962 fprintf(stderr,
"Shifting error token, ");
997#line 70 "./fooparser.y"