• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
fooparser.cpp
1 
2 /* A Bison parser, made from ./fooparser.y
3  by GNU Bison version 1.28 */
4 
5 #define YYBISON 1 /* Identify Bison output. */
6 
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
14 #define VAR 257
15 #define STRING 258
16 #define NUMBER 259
17 #define UNDEF 260
18 #define POSTPIPE 261
19 #define QUOTED 262
20 
21 #line 1 "./fooparser.y"
22 
23 /*
24  * This file is part of the KDE libraries
25  * Copyright (c) 2001-2003 Michael Goffioul <tdeprint@swing.be>
26  *
27  * This library is free software; you can redistribute it and/or
28  * modify it under the terms of the GNU Library General Public
29  * License version 2 as published by the Free Software Foundation.
30  *
31  * This library is distributed in the hope that it will be useful,
32  * but WITHOUT ANY WARRANTY; without even the implied warranty of
33  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34  * Library General Public License for more details.
35  *
36  * You should have received a copy of the GNU Library General Public License
37  * along with this library; see the file COPYING.LIB. If not, write to
38  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
39  * Boston, MA 02110-1301, USA.
40  **/
41 
42 #define YYSTYPE TQVariant
43 #define YYPARSE_PARAM fooloader
44 #define YYDEBUG 1
45 
46 #include <stdlib.h>
47 #include <tqvariant.h>
48 #include "foomatic2loader.h"
49 
50 void yyerror(const char*) {}
51 int yylex();
52 #ifndef YYSTYPE
53 #define YYSTYPE int
54 #endif
55 #include <stdio.h>
56 
57 #ifndef __cplusplus
58 #ifndef __STDC__
59 #define const
60 #endif
61 #endif
62 
63 
64 
65 #define YYFINAL 36
66 #define YYFLAG -32768
67 #define YYNTBASE 17
68 
69 #define YYTRANSLATE(x) ((unsigned)(x) <= 262 ? yytranslate[x] : 23)
70 
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,
98  7, 8
99 };
100 
101 #if YYDEBUG != 0
102 static const short yyprhs[] = { 0,
103  0, 2, 5, 12, 17, 19, 23, 28, 30, 34,
104  36, 38, 40, 44, 48, 51
105 };
106 
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,
113  10, 11, 0
114 };
115 
116 #endif
117 
118 #if YYDEBUG != 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
122 };
123 #endif
124 
125 
126 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
127 
128 static const char * const yytname[] = { "$","error","$undefined.","VAR","STRING",
129 "NUMBER","UNDEF","POSTPIPE","QUOTED","'='","'{'","'}'","';'","','","'>'","'['",
130 "']'","foo","foodata","fieldlist","assignment","valuelist","value", NULL
131 };
132 #endif
133 
134 static const short yyr1[] = { 0,
135  17, 17, 18, 18, 19, 19, 20, 21, 21, 22,
136  22, 22, 22, 22, 22, 22
137 };
138 
139 static const short yyr2[] = { 0,
140  1, 2, 6, 4, 1, 3, 4, 1, 3, 1,
141  1, 1, 3, 3, 2, 2
142 };
143 
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,
148  14, 0, 13, 9, 0, 0
149 };
150 
151 static const short yydefgoto[] = { 3,
152  4, 11, 12, 29, 25
153 };
154 
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
160 };
161 
162 static const short yypgoto[] = {-32768,
163  33, 16, 21,-32768, -17
164 };
165 
166 
167 #define YYLAST 39
168 
169 
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
175 };
176 
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
182 };
183 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
184 #line 3 "/usr/lib/bison.simple"
185 /* This file comes from bison-1.28. */
186 
187 /* Skeleton output parser for bison,
188  Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
189 
190  This program is free software; you can redistribute it and/or modify
191  it under the terms of the GNU General Public License as published by
192  the Free Software Foundation; either version 2, or (at your option)
193  any later version.
194 
195  This program is distributed in the hope that it will be useful,
196  but WITHOUT ANY WARRANTY; without even the implied warranty of
197  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
198  GNU General Public License for more details.
199 
200  You should have received a copy of the GNU General Public License
201  along with this program; if not, write to the Free Software
202  Foundation, Inc., 51 Franklin Street, Fifth Floor,
203  Boston, MA 02110-1301, USA. */
204 
205 /* As a special exception, when this file is copied by Bison into a
206  Bison output file, you may use that output file without restriction.
207  This special exception was added by the Free Software Foundation
208  in version 1.24 of Bison. */
209 
210 /* This is the parser code that is written into each bison parser
211  when the %semantic_parser declaration is not specified in the grammar.
212  It was written by Richard Stallman by simplifying the hairy parser
213  used when %semantic_parser is specified. */
214 
215 #ifndef YYSTACK_USE_ALLOCA
216 #ifdef alloca
217 #define YYSTACK_USE_ALLOCA
218 #else /* alloca not defined */
219 #ifdef __GNUC__
220 #define YYSTACK_USE_ALLOCA
221 #define alloca __builtin_alloca
222 #else /* not GNU C. */
223 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || (defined (__sun) && defined (__i386))
224 #define YYSTACK_USE_ALLOCA
225 #include <alloca.h>
226 #else /* not sparc */
227 /* We think this test detects Watcom and Microsoft C. */
228 /* This used to test MSDOS, but that is a bad idea
229  since that symbol is in the user namespace. */
230 #if defined (_MSDOS) || defined (_MSDOS_)
231 #if 0 /* No need for malloc.h, which pollutes the namespace;
232  instead, just don't use alloca. */
233 #include <malloc.h>
234 #endif
235 #else /* not MSDOS */
236 #if defined(_AIX)
237 /* I don't know what this was needed for, but it pollutes the namespace.
238  So I turned it off. rms, 2 May 1997. */
239 /* #include <malloc.h> */
240  #pragma alloca
241 #define YYSTACK_USE_ALLOCA
242 #else /* not MSDOS or _AIX */
243 #endif /* not _AIX */
244 #endif /* not MSDOS */
245 #endif /* not sparc */
246 #endif /* not GNU C */
247 #endif /* alloca not defined */
248 #endif /* YYSTACK_USE_ALLOCA not defined */
249 
250 #ifdef YYSTACK_USE_ALLOCA
251 #define YYSTACK_ALLOC alloca
252 #else
253 #define YYSTACK_ALLOC malloc
254 #endif
255 
256 /* Note: there must be only one dollar sign in this file.
257  It is replaced by the list of actions, each action
258  as one case of the switch. */
259 
260 #define yyerrok (yyerrstatus = 0)
261 #define yyclearin (yychar = YYEMPTY)
262 #define YYEMPTY -2
263 #define YYEOF 0
264 #define YYACCEPT goto yyacceptlab
265 #define YYABORT goto yyabortlab
266 #define YYERROR goto yyerrlab1
267 /* Like YYERROR except do call yyerror.
268  This remains here temporarily to ease the
269  transition to the new meaning of YYERROR, for GCC.
270  Once GCC version 2 has supplanted version 1, this can go. */
271 #define YYFAIL goto yyerrlab
272 #define YYRECOVERING() (!!yyerrstatus)
273 #define YYBACKUP(token, value) \
274 do \
275  if (yychar == YYEMPTY && yylen == 1) \
276  { yychar = (token), yylval = (value); \
277  yychar1 = YYTRANSLATE (yychar); \
278  YYPOPSTACK; \
279  goto yybackup; \
280  } \
281  else \
282  { yyerror ("syntax error: cannot back up"); YYERROR; } \
283 while (0)
284 
285 #define YYTERROR 1
286 #define YYERRCODE 256
287 
288 #ifndef YYPURE
289 #define YYLEX yylex()
290 #endif
291 
292 #ifdef YYPURE
293 #ifdef YYLSP_NEEDED
294 #ifdef YYLEX_PARAM
295 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
296 #else
297 #define YYLEX yylex(&yylval, &yylloc)
298 #endif
299 #else /* not YYLSP_NEEDED */
300 #ifdef YYLEX_PARAM
301 #define YYLEX yylex(&yylval, YYLEX_PARAM)
302 #else
303 #define YYLEX yylex(&yylval)
304 #endif
305 #endif /* not YYLSP_NEEDED */
306 #endif
307 
308 /* If nonreentrant, generate the variables here */
309 
310 #ifndef YYPURE
311 
312 int yychar; /* the lookahead symbol */
313 YYSTYPE yylval; /* the semantic value of the */
314  /* lookahead symbol */
315 
316 #ifdef YYLSP_NEEDED
317 YYLTYPE yylloc; /* location data for the lookahead */
318  /* symbol */
319 #endif
320 
321 int yynerrs; /* number of parse errors so far */
322 #endif /* not YYPURE */
323 
324 #if YYDEBUG != 0
325 int yydebug; /* nonzero means print parse trace */
326 /* Since this is uninitialized, it does not stop multiple parsers
327  from coexisting. */
328 #endif
329 
330 /* YYINITDEPTH indicates the initial size of the parser's stacks */
331 
332 #ifndef YYINITDEPTH
333 #define YYINITDEPTH 200
334 #endif
335 
336 /* YYMAXDEPTH is the maximum size the stacks can grow to
337  (effective only if the built-in stack extension method is used). */
338 
339 #if YYMAXDEPTH == 0
340 #undef YYMAXDEPTH
341 #endif
342 
343 #ifndef YYMAXDEPTH
344 #define YYMAXDEPTH 10000
345 #endif
346 ␌
347 /* Define __yy_memcpy. Note that the size argument
348  should be passed with type unsigned int, because that is what the non-GCC
349  definitions require. With GCC, __builtin_memcpy takes an arg
350  of type size_t, but it can handle unsigned int. */
351 
352 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
353 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
354 #else /* not GNU C or C++ */
355 #ifndef __cplusplus
356 
357 /* This is the most reliable way to avoid incompatibilities
358  in available built-in functions on various systems. */
359 static void
360 __yy_memcpy (to, from, count)
361  char *to;
362  char *from;
363  unsigned int count;
364 {
365  char *f = from;
366  char *t = to;
367  int i = count;
368 
369  while (i-- > 0)
370  *t++ = *f++;
371 }
372 
373 #else /* __cplusplus */
374 
375 /* This is the most reliable way to avoid incompatibilities
376  in available built-in functions on various systems. */
377 static void
378 __yy_memcpy (char *to, char *from, unsigned int count)
379 {
380  char *t = to;
381  char *f = from;
382  int i = count;
383 
384  while (i-- > 0)
385  *t++ = *f++;
386 }
387 
388 #endif
389 #endif
390 ␌
391 #line 217 "/usr/lib/bison.simple"
392 
393 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
394  into yyparse. The argument should have type void *.
395  It should actually point to an object.
396  Grammar actions can access the variable by casting it
397  to the proper pointer type. */
398 
399 #ifdef YYPARSE_PARAM
400 #ifdef __cplusplus
401 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
402 #define YYPARSE_PARAM_DECL
403 #else /* not __cplusplus */
404 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
405 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
406 #endif /* not __cplusplus */
407 #else /* not YYPARSE_PARAM */
408 #define YYPARSE_PARAM_ARG
409 #define YYPARSE_PARAM_DECL
410 #endif /* not YYPARSE_PARAM */
411 
412 /* Prevent warning if -Wstrict-prototypes. */
413 #ifdef __GNUC__
414 #ifdef YYPARSE_PARAM
415 int yyparse (void *);
416 #else
417 int yyparse (void);
418 #endif
419 #endif
420 
421 int
422 yyparse(YYPARSE_PARAM_ARG)
423  YYPARSE_PARAM_DECL
424 {
425  int yystate;
426  int yyn;
427  short *yyssp;
428  YYSTYPE *yyvsp;
429  int yyerrstatus; /* number of tokens to shift before error messages enabled */
430  int yychar1 = 0; /* lookahead token as an internal (translated) token number */
431 
432  short yyssa[YYINITDEPTH]; /* the state stack */
433  YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
434 
435  short *yyss = yyssa; /* refer to the stacks thru separate pointers */
436  YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
437 
438 #ifdef YYLSP_NEEDED
439  YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
440  YYLTYPE *yyls = yylsa;
441  YYLTYPE *yylsp;
442 
443 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
444 #else
445 #define YYPOPSTACK (yyvsp--, yyssp--)
446 #endif
447 
448  int yystacksize = YYINITDEPTH;
449  int yyfree_stacks = 0;
450 
451 #ifdef YYPURE
452  int yychar;
453  YYSTYPE yylval;
454  int yynerrs;
455 #ifdef YYLSP_NEEDED
456  YYLTYPE yylloc;
457 #endif
458 #endif
459 
460  YYSTYPE yyval; /* the variable used to return */
461  /* semantic values from the action */
462  /* routines */
463 
464  int yylen;
465 
466 #if YYDEBUG != 0
467  if (yydebug)
468  fprintf(stderr, "Starting parse\n");
469 #endif
470 
471  yystate = 0;
472  yyerrstatus = 0;
473  yynerrs = 0;
474  yychar = YYEMPTY; /* Cause a token to be read. */
475 
476  /* Initialize stack pointers.
477  Waste one element of value and location stack
478  so that they stay on the same level as the state stack.
479  The wasted elements are never initialized. */
480 
481  yyssp = yyss - 1;
482  yyvsp = yyvs;
483 #ifdef YYLSP_NEEDED
484  yylsp = yyls;
485 #endif
486 
487 /* Push a new state, which is found in yystate . */
488 /* In all cases, when you get here, the value and location stacks
489  have just been pushed. so pushing a state here evens the stacks. */
490 yynewstate:
491 
492  *++yyssp = yystate;
493 
494  if (yyssp >= yyss + yystacksize - 1)
495  {
496  /* Give user a chance to reallocate the stack */
497  /* Use copies of these so that the &'s don't force the real ones into memory. */
498  YYSTYPE *yyvs1 = yyvs;
499  short *yyss1 = yyss;
500 #ifdef YYLSP_NEEDED
501  YYLTYPE *yyls1 = yyls;
502 #endif
503 
504  /* Get the current used size of the three stacks, in elements. */
505  int size = yyssp - yyss + 1;
506 
507 #ifdef yyoverflow
508  /* Each stack pointer address is followed by the size of
509  the data in use in that stack, in bytes. */
510 #ifdef YYLSP_NEEDED
511  /* This used to be a conditional around just the two extra args,
512  but that might be undefined if yyoverflow is a macro. */
513  yyoverflow("parser stack overflow",
514  &yyss1, size * sizeof (*yyssp),
515  &yyvs1, size * sizeof (*yyvsp),
516  &yyls1, size * sizeof (*yylsp),
517  &yystacksize);
518 #else
519  yyoverflow("parser stack overflow",
520  &yyss1, size * sizeof (*yyssp),
521  &yyvs1, size * sizeof (*yyvsp),
522  &yystacksize);
523 #endif
524 
525  yyss = yyss1; yyvs = yyvs1;
526 #ifdef YYLSP_NEEDED
527  yyls = yyls1;
528 #endif
529 #else /* no yyoverflow */
530  /* Extend the stack our own way. */
531  if (yystacksize >= YYMAXDEPTH)
532  {
533  yyerror("parser stack overflow");
534  if (yyfree_stacks)
535  {
536  free (yyss);
537  free (yyvs);
538 #ifdef YYLSP_NEEDED
539  free (yyls);
540 #endif
541  }
542  return 2;
543  }
544  yystacksize *= 2;
545  if (yystacksize > YYMAXDEPTH)
546  yystacksize = YYMAXDEPTH;
547 #ifndef YYSTACK_USE_ALLOCA
548  yyfree_stacks = 1;
549 #endif
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));
556 #ifdef YYLSP_NEEDED
557  yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
558  __yy_memcpy ((char *)yyls, (char *)yyls1,
559  size * (unsigned int) sizeof (*yylsp));
560 #endif
561 #endif /* no yyoverflow */
562 
563  yyssp = yyss + size - 1;
564  yyvsp = yyvs + size - 1;
565 #ifdef YYLSP_NEEDED
566  yylsp = yyls + size - 1;
567 #endif
568 
569 #if YYDEBUG != 0
570  if (yydebug)
571  fprintf(stderr, "Stack size increased to %d\n", yystacksize);
572 #endif
573 
574  if (yyssp >= yyss + yystacksize - 1)
575  YYABORT;
576  }
577 
578 #if YYDEBUG != 0
579  if (yydebug)
580  fprintf(stderr, "Entering state %d\n", yystate);
581 #endif
582 
583  goto yybackup;
584  yybackup:
585 
586 /* Do appropriate processing given the current state. */
587 /* Read a lookahead token if we need one and don't already have one. */
588 /* yyresume: */
589 
590  /* First try to decide what to do without reference to lookahead token. */
591 
592  yyn = yypact[yystate];
593  if (yyn == YYFLAG)
594  goto yydefault;
595 
596  /* Not known => get a lookahead token if don't already have one. */
597 
598  /* yychar is either YYEMPTY or YYEOF
599  or a valid token in external form. */
600 
601  if (yychar == YYEMPTY)
602  {
603 #if YYDEBUG != 0
604  if (yydebug)
605  fprintf(stderr, "Reading a token: ");
606 #endif
607  yychar = YYLEX;
608  }
609 
610  /* Convert token to internal form (in yychar1) for indexing tables with */
611 
612  if (yychar <= 0) /* This means end of input. */
613  {
614  yychar1 = 0;
615  yychar = YYEOF; /* Don't call YYLEX any more */
616 
617 #if YYDEBUG != 0
618  if (yydebug)
619  fprintf(stderr, "Now at end of input.\n");
620 #endif
621  }
622  else
623  {
624  yychar1 = YYTRANSLATE(yychar);
625 
626 #if YYDEBUG != 0
627  if (yydebug)
628  {
629  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
630  /* Give the individual parser a way to print the precise meaning
631  of a token, for further debugging info. */
632 #ifdef YYPRINT
633  YYPRINT (stderr, yychar, yylval);
634 #endif
635  fprintf (stderr, ")\n");
636  }
637 #endif
638  }
639 
640  yyn += yychar1;
641  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
642  goto yydefault;
643 
644  yyn = yytable[yyn];
645 
646  /* yyn is what to do for this token type in this state.
647  Negative => reduce, -yyn is rule number.
648  Positive => shift, yyn is new state.
649  New state is final state => don't bother to shift,
650  just return success.
651  0, or most negative number => error. */
652 
653  if (yyn < 0)
654  {
655  if (yyn == YYFLAG)
656  goto yyerrlab;
657  yyn = -yyn;
658  goto yyreduce;
659  }
660  else if (yyn == 0)
661  goto yyerrlab;
662 
663  if (yyn == YYFINAL)
664  YYACCEPT;
665 
666  /* Shift the lookahead token. */
667 
668 #if YYDEBUG != 0
669  if (yydebug)
670  fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
671 #endif
672 
673  /* Discard the token being shifted unless it is eof. */
674  if (yychar != YYEOF)
675  yychar = YYEMPTY;
676 
677  *++yyvsp = yylval;
678 #ifdef YYLSP_NEEDED
679  *++yylsp = yylloc;
680 #endif
681 
682  /* count tokens shifted since error; after three, turn off error status. */
683  if (yyerrstatus) yyerrstatus--;
684 
685  yystate = yyn;
686  goto yynewstate;
687 
688 /* Do the default action for the current state. */
689 yydefault:
690 
691  yyn = yydefact[yystate];
692  if (yyn == 0)
693  goto yyerrlab;
694 
695 /* Do a reduction. yyn is the number of a rule to reduce with. */
696 yyreduce:
697  yylen = yyr2[yyn];
698  if (yylen > 0)
699  yyval = yyvsp[1-yylen]; /* implement default value of the action */
700 
701 #if YYDEBUG != 0
702  if (yydebug)
703  {
704  int i;
705 
706  fprintf (stderr, "Reducing via rule %d (line %d), ",
707  yyn, yyrline[yyn]);
708 
709  /* Print the symbols being reduced, and their result. */
710  for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
711  fprintf (stderr, "%s ", yytname[yyrhs[i]]);
712  fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
713  }
714 #endif
715 
716 
717  switch (yyn) {
718 
719 case 3:
720 #line 46 "./fooparser.y"
721 { static_cast<Foomatic2Loader*>(fooloader)->m_foodata.insert("VAR",yyvsp[-2]); ;
722  break;}
723 case 4:
724 #line 47 "./fooparser.y"
725 { static_cast<Foomatic2Loader*>(fooloader)->m_foodata.insert("POSTPIPE",yyvsp[-1]); ;
726  break;}
727 case 5:
728 #line 50 "./fooparser.y"
729 { yyval = yyvsp[0]; ;
730  break;}
731 case 6:
732 #line 51 "./fooparser.y"
733 { TQStringVariantMap::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ;
734  break;}
735 case 7:
736 #line 54 "./fooparser.y"
737 { yyval.asMap().insert(yyvsp[-3].toString(), yyvsp[0]); ;
738  break;}
739 case 8:
740 #line 57 "./fooparser.y"
741 { yyval.asList().append(yyvsp[0]); ;
742  break;}
743 case 9:
744 #line 58 "./fooparser.y"
745 { yyvsp[-2].asList().append(yyvsp[0]); yyval = yyvsp[-2]; ;
746  break;}
747 case 10:
748 #line 61 "./fooparser.y"
749 { yyval = TQVariant(); ;
750  break;}
751 case 11:
752 #line 62 "./fooparser.y"
753 { yyval = yyvsp[0]; ;
754  break;}
755 case 12:
756 #line 63 "./fooparser.y"
757 { yyval = yyvsp[0]; ;
758  break;}
759 case 13:
760 #line 64 "./fooparser.y"
761 { yyval = yyvsp[-1]; ;
762  break;}
763 case 14:
764 #line 65 "./fooparser.y"
765 { yyval = yyvsp[-1]; ;
766  break;}
767 case 15:
768 #line 66 "./fooparser.y"
769 { yyval = TQVariant(); ;
770  break;}
771 case 16:
772 #line 67 "./fooparser.y"
773 { yyval = TQVariant(); ;
774  break;}
775 }
776  /* the action file gets copied in in place of this dollarsign */
777 #line 543 "/usr/lib/bison.simple"
778 ␌
779  yyvsp -= yylen;
780  yyssp -= yylen;
781 #ifdef YYLSP_NEEDED
782  yylsp -= yylen;
783 #endif
784 
785 #if YYDEBUG != 0
786  if (yydebug)
787  {
788  short *ssp1 = yyss - 1;
789  fprintf (stderr, "state stack now");
790  while (ssp1 != yyssp)
791  fprintf (stderr, " %d", *++ssp1);
792  fprintf (stderr, "\n");
793  }
794 #endif
795 
796  *++yyvsp = yyval;
797 
798 #ifdef YYLSP_NEEDED
799  yylsp++;
800  if (yylen == 0)
801  {
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;
806  yylsp->text = 0;
807  }
808  else
809  {
810  yylsp->last_line = (yylsp+yylen-1)->last_line;
811  yylsp->last_column = (yylsp+yylen-1)->last_column;
812  }
813 #endif
814 
815  /* Now "shift" the result of the reduction.
816  Determine what state that goes to,
817  based on the state we popped back to
818  and the rule number reduced by. */
819 
820  yyn = yyr1[yyn];
821 
822  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
823  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
824  yystate = yytable[yystate];
825  else
826  yystate = yydefgoto[yyn - YYNTBASE];
827 
828  goto yynewstate;
829 
830 yyerrlab: /* here on detecting error */
831 
832  if (! yyerrstatus)
833  /* If not already recovering from an error, report this error. */
834  {
835  ++yynerrs;
836 
837 #ifdef YYERROR_VERBOSE
838  yyn = yypact[yystate];
839 
840  if (yyn > YYFLAG && yyn < YYLAST)
841  {
842  int size = 0;
843  char *msg;
844  int x, count;
845 
846  count = 0;
847  /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
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);
853  if (msg != 0)
854  {
855  strcpy(msg, "parse error");
856 
857  if (count < 5)
858  {
859  count = 0;
860  for (x = (yyn < 0 ? -yyn : 0);
861  x < (sizeof(yytname) / sizeof(char *)); x++)
862  if (yycheck[x + yyn] == x)
863  {
864  strcat(msg, count == 0 ? ", expecting `" : " or `");
865  strcat(msg, yytname[x]);
866  strcat(msg, "'");
867  count++;
868  }
869  }
870  yyerror(msg);
871  free(msg);
872  }
873  else
874  yyerror ("parse error; also virtual memory exceeded");
875  }
876  else
877 #endif /* YYERROR_VERBOSE */
878  yyerror("parse error");
879  }
880 
881  goto yyerrlab1;
882 yyerrlab1: /* here on error raised explicitly by an action */
883 
884  if (yyerrstatus == 3)
885  {
886  /* if just tried and failed to reuse lookahead token after an error, discard it. */
887 
888  /* return failure if at end of input */
889  if (yychar == YYEOF)
890  YYABORT;
891 
892 #if YYDEBUG != 0
893  if (yydebug)
894  fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
895 #endif
896 
897  yychar = YYEMPTY;
898  }
899 
900  /* Else will try to reuse lookahead token
901  after shifting the error token. */
902 
903  yyerrstatus = 3; /* Each real token shifted decrements this */
904 
905  goto yyerrhandle;
906 
907 yyerrdefault: /* current state does not do anything special for the error token. */
908 
909 #if 0
910  /* This is wrong; only states that explicitly want error tokens
911  should shift them. */
912  yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
913  if (yyn) goto yydefault;
914 #endif
915 
916 yyerrpop: /* pop the current state because it cannot handle the error token */
917 
918  if (yyssp == yyss) YYABORT;
919  yyvsp--;
920  yystate = *--yyssp;
921 #ifdef YYLSP_NEEDED
922  yylsp--;
923 #endif
924 
925 #if YYDEBUG != 0
926  if (yydebug)
927  {
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");
933  }
934 #endif
935 
936 yyerrhandle:
937 
938  yyn = yypact[yystate];
939  if (yyn == YYFLAG)
940  goto yyerrdefault;
941 
942  yyn += YYTERROR;
943  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
944  goto yyerrdefault;
945 
946  yyn = yytable[yyn];
947  if (yyn < 0)
948  {
949  if (yyn == YYFLAG)
950  goto yyerrpop;
951  yyn = -yyn;
952  goto yyreduce;
953  }
954  else if (yyn == 0)
955  goto yyerrpop;
956 
957  if (yyn == YYFINAL)
958  YYACCEPT;
959 
960 #if YYDEBUG != 0
961  if (yydebug)
962  fprintf(stderr, "Shifting error token, ");
963 #endif
964 
965  *++yyvsp = yylval;
966 #ifdef YYLSP_NEEDED
967  *++yylsp = yylloc;
968 #endif
969 
970  yystate = yyn;
971  goto yynewstate;
972 
973  yyacceptlab:
974  /* YYACCEPT comes here. */
975  if (yyfree_stacks)
976  {
977  free (yyss);
978  free (yyvs);
979 #ifdef YYLSP_NEEDED
980  free (yyls);
981 #endif
982  }
983  return 0;
984 
985  yyabortlab:
986  /* YYABORT comes here. */
987  if (yyfree_stacks)
988  {
989  free (yyss);
990  free (yyvs);
991 #ifdef YYLSP_NEEDED
992  free (yyls);
993 #endif
994  }
995  return 1;
996 }
997 #line 70 "./fooparser.y"
998 

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.1
This website is maintained by Timothy Pearson.