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
47 #include <tqvariant.h>
48 #include "foomatic2loader.h"
50 void yyerror(
const char*) {}
69 #define YYTRANSLATE(x) ((unsigned)(x) <= 262 ? yytranslate[x] : 23)
71 static 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,
102 static const short yyprhs[] = { 0,
103 0, 2, 5, 12, 17, 19, 23, 28, 30, 34,
104 36, 38, 40, 44, 48, 51
107 static 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,
119 static 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)
128 static const char *
const yytname[] = {
"$",
"error",
"$undefined.",
"VAR",
"STRING",
129 "NUMBER",
"UNDEF",
"POSTPIPE",
"QUOTED",
"'='",
"'{'",
"'}'",
"';'",
"','",
"'>'",
"'['",
130 "']'",
"foo",
"foodata",
"fieldlist",
"assignment",
"valuelist",
"value", NULL
134 static const short yyr1[] = { 0,
135 17, 17, 18, 18, 19, 19, 20, 21, 21, 22,
136 22, 22, 22, 22, 22, 22
139 static const short yyr2[] = { 0,
140 1, 2, 6, 4, 1, 3, 4, 1, 3, 1,
144 static 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,
151 static const short yydefgoto[] = { 3,
155 static 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
162 static const short yypgoto[] = {-32768,
163 33, 16, 21,-32768, -17
170 static 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
177 static 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
246 #define YYSTACK_USE_ALLOCA
247 #define alloca __builtin_alloca
257 #ifdef YYSTACK_USE_ALLOCA
258 #define YYSTACK_ALLOC alloca
260 #define YYSTACK_ALLOC malloc
267 #define yyerrok (yyerrstatus = 0)
268 #define yyclearin (yychar = YYEMPTY)
271 #define YYACCEPT goto yyacceptlab
272 #define YYABORT goto yyabortlab
273 #define YYERROR goto yyerrlab1
278 #define YYFAIL goto yyerrlab
279 #define YYRECOVERING() (!!yyerrstatus)
280 #define YYBACKUP(token, value) \
282 if (yychar == YYEMPTY && yylen == 1) \
283 { yychar = (token), yylval = (value); \
284 yychar1 = YYTRANSLATE (yychar); \
289 { yyerror ("syntax error: cannot back up"); YYERROR; } \
293 #define YYERRCODE 256
296 #define YYLEX yylex()
302 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
304 #define YYLEX yylex(&yylval, &yylloc)
308 #define YYLEX yylex(&yylval, YYLEX_PARAM)
310 #define YYLEX yylex(&yylval)
340 #define YYINITDEPTH 200
351 #define YYMAXDEPTH 10000
360 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
367 __yy_memcpy (to, from, count)
385 __yy_memcpy (
char *to,
char *from,
unsigned int count)
398 #line 217 "/usr/lib/bison.simple"
408 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
409 #define YYPARSE_PARAM_DECL
411 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
412 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
415 #define YYPARSE_PARAM_ARG
416 #define YYPARSE_PARAM_DECL
422 int yyparse (
void *);
429 yyparse(YYPARSE_PARAM_ARG)
439 short yyssa[YYINITDEPTH];
440 YYSTYPE yyvsa[YYINITDEPTH];
443 YYSTYPE *yyvs = yyvsa;
446 YYLTYPE yylsa[YYINITDEPTH];
447 YYLTYPE *yyls = yylsa;
450 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
452 #define YYPOPSTACK (yyvsp--, yyssp--)
455 int yystacksize = YYINITDEPTH;
456 int yyfree_stacks = 0;
475 fprintf(stderr,
"Starting parse\n");
501 if (yyssp >= yyss + yystacksize - 1)
505 YYSTYPE *yyvs1 = yyvs;
508 YYLTYPE *yyls1 = yyls;
512 int size = yyssp - yyss + 1;
520 yyoverflow(
"parser stack overflow",
521 &yyss1, size *
sizeof (*yyssp),
522 &yyvs1, size *
sizeof (*yyvsp),
523 &yyls1, size *
sizeof (*yylsp),
526 yyoverflow(
"parser stack overflow",
527 &yyss1, size *
sizeof (*yyssp),
528 &yyvs1, size *
sizeof (*yyvsp),
532 yyss = yyss1; yyvs = yyvs1;
538 if (yystacksize >= YYMAXDEPTH)
540 yyerror(
"parser stack overflow");
552 if (yystacksize > YYMAXDEPTH)
553 yystacksize = YYMAXDEPTH;
554 #ifndef YYSTACK_USE_ALLOCA
557 yyss = (
short *) YYSTACK_ALLOC (yystacksize *
sizeof (*yyssp));
558 __yy_memcpy ((
char *)yyss, (
char *)yyss1,
559 size * (
unsigned int)
sizeof (*yyssp));
560 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize *
sizeof (*yyvsp));
561 __yy_memcpy ((
char *)yyvs, (
char *)yyvs1,
562 size * (
unsigned int)
sizeof (*yyvsp));
564 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize *
sizeof (*yylsp));
565 __yy_memcpy ((
char *)yyls, (
char *)yyls1,
566 size * (
unsigned int)
sizeof (*yylsp));
570 yyssp = yyss + size - 1;
571 yyvsp = yyvs + size - 1;
573 yylsp = yyls + size - 1;
578 fprintf(stderr,
"Stack size increased to %d\n", yystacksize);
581 if (yyssp >= yyss + yystacksize - 1)
587 fprintf(stderr,
"Entering state %d\n", yystate);
599 yyn = yypact[yystate];
608 if (yychar == YYEMPTY)
612 fprintf(stderr,
"Reading a token: ");
626 fprintf(stderr,
"Now at end of input.\n");
631 yychar1 = YYTRANSLATE(yychar);
636 fprintf (stderr,
"Next token is %d (%s", yychar, yytname[yychar1]);
640 YYPRINT (stderr, yychar, yylval);
642 fprintf (stderr,
")\n");
648 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
677 fprintf(stderr,
"Shifting token %d (%s), ", yychar, yytname[yychar1]);
690 if (yyerrstatus) yyerrstatus--;
698 yyn = yydefact[yystate];
706 yyval = yyvsp[1-yylen];
713 fprintf (stderr,
"Reducing via rule %d (line %d), ",
717 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
718 fprintf (stderr,
"%s ", yytname[yyrhs[i]]);
719 fprintf (stderr,
" -> %s\n", yytname[yyr1[yyn]]);
727 #line 46 "./fooparser.y"
728 {
static_cast<Foomatic2Loader*
>(fooloader)->m_foodata.insert(
"VAR",yyvsp[-2]); ;
731 #line 47 "./fooparser.y"
732 {
static_cast<Foomatic2Loader*
>(fooloader)->m_foodata.insert(
"POSTPIPE",yyvsp[-1]); ;
735 #line 50 "./fooparser.y"
736 { yyval = yyvsp[0]; ;
739 #line 51 "./fooparser.y"
740 { TQStringVariantMap::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ;
743 #line 54 "./fooparser.y"
744 { yyval.asMap().insert(yyvsp[-3].toString(), yyvsp[0]); ;
747 #line 57 "./fooparser.y"
748 { yyval.asList().append(yyvsp[0]); ;
751 #line 58 "./fooparser.y"
752 { yyvsp[-2].asList().append(yyvsp[0]); yyval = yyvsp[-2]; ;
755 #line 61 "./fooparser.y"
756 { yyval = TQVariant(); ;
759 #line 62 "./fooparser.y"
760 { yyval = yyvsp[0]; ;
763 #line 63 "./fooparser.y"
764 { yyval = yyvsp[0]; ;
767 #line 64 "./fooparser.y"
768 { yyval = yyvsp[-1]; ;
771 #line 65 "./fooparser.y"
772 { yyval = yyvsp[-1]; ;
775 #line 66 "./fooparser.y"
776 { yyval = TQVariant(); ;
779 #line 67 "./fooparser.y"
780 { yyval = TQVariant(); ;
784 #line 543 "/usr/lib/bison.simple"
795 short *ssp1 = yyss - 1;
796 fprintf (stderr,
"state stack now");
797 while (ssp1 != yyssp)
798 fprintf (stderr,
" %d", *++ssp1);
799 fprintf (stderr,
"\n");
809 yylsp->first_line = yylloc.first_line;
810 yylsp->first_column = yylloc.first_column;
811 yylsp->last_line = (yylsp-1)->last_line;
812 yylsp->last_column = (yylsp-1)->last_column;
817 yylsp->last_line = (yylsp+yylen-1)->last_line;
818 yylsp->last_column = (yylsp+yylen-1)->last_column;
829 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
830 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
831 yystate = yytable[yystate];
833 yystate = yydefgoto[yyn - YYNTBASE];
844 #ifdef YYERROR_VERBOSE
845 yyn = yypact[yystate];
847 if (yyn > YYFLAG && yyn < YYLAST)
855 for (x = (yyn < 0 ? -yyn : 0);
856 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
857 if (yycheck[x + yyn] == x)
858 size += strlen(yytname[x]) + 15, count++;
859 msg = (
char *) malloc(size + 15);
862 strcpy(msg,
"parse error");
867 for (x = (yyn < 0 ? -yyn : 0);
868 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
869 if (yycheck[x + yyn] == x)
871 strcat(msg, count == 0 ?
", expecting `" :
" or `");
872 strcat(msg, yytname[x]);
881 yyerror (
"parse error; also virtual memory exceeded");
885 yyerror(
"parse error");
891 if (yyerrstatus == 3)
901 fprintf(stderr,
"Discarding token %d (%s).\n", yychar, yytname[yychar1]);
919 yyn = yydefact[yystate];
920 if (yyn)
goto yydefault;
925 if (yyssp == yyss) YYABORT;
935 short *ssp1 = yyss - 1;
936 fprintf (stderr,
"Error: state stack now");
937 while (ssp1 != yyssp)
938 fprintf (stderr,
" %d", *++ssp1);
939 fprintf (stderr,
"\n");
945 yyn = yypact[yystate];
950 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
969 fprintf(stderr,
"Shifting error token, ");
1004 #line 70 "./fooparser.y"