• 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 (__sgi) || (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_)) && !defined (__TURBOC__)
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, or __TURBOC__ */
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 __TURBOC__, or _AIX */
243 #if 0
244 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
245  and on HPUX 10. Eventually we can turn this on. */
246 #define YYSTACK_USE_ALLOCA
247 #define alloca __builtin_alloca
248 #endif /* __hpux */
249 #endif
250 #endif /* not _AIX */
251 #endif /* not MSDOS, or __TURBOC__ */
252 #endif /* not sparc */
253 #endif /* not GNU C */
254 #endif /* alloca not defined */
255 #endif /* YYSTACK_USE_ALLOCA not defined */
256 
257 #ifdef YYSTACK_USE_ALLOCA
258 #define YYSTACK_ALLOC alloca
259 #else
260 #define YYSTACK_ALLOC malloc
261 #endif
262 
263 /* Note: there must be only one dollar sign in this file.
264  It is replaced by the list of actions, each action
265  as one case of the switch. */
266 
267 #define yyerrok (yyerrstatus = 0)
268 #define yyclearin (yychar = YYEMPTY)
269 #define YYEMPTY -2
270 #define YYEOF 0
271 #define YYACCEPT goto yyacceptlab
272 #define YYABORT goto yyabortlab
273 #define YYERROR goto yyerrlab1
274 /* Like YYERROR except do call yyerror.
275  This remains here temporarily to ease the
276  transition to the new meaning of YYERROR, for GCC.
277  Once GCC version 2 has supplanted version 1, this can go. */
278 #define YYFAIL goto yyerrlab
279 #define YYRECOVERING() (!!yyerrstatus)
280 #define YYBACKUP(token, value) \
281 do \
282  if (yychar == YYEMPTY && yylen == 1) \
283  { yychar = (token), yylval = (value); \
284  yychar1 = YYTRANSLATE (yychar); \
285  YYPOPSTACK; \
286  goto yybackup; \
287  } \
288  else \
289  { yyerror ("syntax error: cannot back up"); YYERROR; } \
290 while (0)
291 
292 #define YYTERROR 1
293 #define YYERRCODE 256
294 
295 #ifndef YYPURE
296 #define YYLEX yylex()
297 #endif
298 
299 #ifdef YYPURE
300 #ifdef YYLSP_NEEDED
301 #ifdef YYLEX_PARAM
302 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
303 #else
304 #define YYLEX yylex(&yylval, &yylloc)
305 #endif
306 #else /* not YYLSP_NEEDED */
307 #ifdef YYLEX_PARAM
308 #define YYLEX yylex(&yylval, YYLEX_PARAM)
309 #else
310 #define YYLEX yylex(&yylval)
311 #endif
312 #endif /* not YYLSP_NEEDED */
313 #endif
314 
315 /* If nonreentrant, generate the variables here */
316 
317 #ifndef YYPURE
318 
319 int yychar; /* the lookahead symbol */
320 YYSTYPE yylval; /* the semantic value of the */
321  /* lookahead symbol */
322 
323 #ifdef YYLSP_NEEDED
324 YYLTYPE yylloc; /* location data for the lookahead */
325  /* symbol */
326 #endif
327 
328 int yynerrs; /* number of parse errors so far */
329 #endif /* not YYPURE */
330 
331 #if YYDEBUG != 0
332 int yydebug; /* nonzero means print parse trace */
333 /* Since this is uninitialized, it does not stop multiple parsers
334  from coexisting. */
335 #endif
336 
337 /* YYINITDEPTH indicates the initial size of the parser's stacks */
338 
339 #ifndef YYINITDEPTH
340 #define YYINITDEPTH 200
341 #endif
342 
343 /* YYMAXDEPTH is the maximum size the stacks can grow to
344  (effective only if the built-in stack extension method is used). */
345 
346 #if YYMAXDEPTH == 0
347 #undef YYMAXDEPTH
348 #endif
349 
350 #ifndef YYMAXDEPTH
351 #define YYMAXDEPTH 10000
352 #endif
353 
354 /* Define __yy_memcpy. Note that the size argument
355  should be passed with type unsigned int, because that is what the non-GCC
356  definitions require. With GCC, __builtin_memcpy takes an arg
357  of type size_t, but it can handle unsigned int. */
358 
359 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
360 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
361 #else /* not GNU C or C++ */
362 #ifndef __cplusplus
363 
364 /* This is the most reliable way to avoid incompatibilities
365  in available built-in functions on various systems. */
366 static void
367 __yy_memcpy (to, from, count)
368  char *to;
369  char *from;
370  unsigned int count;
371 {
372  char *f = from;
373  char *t = to;
374  int i = count;
375 
376  while (i-- > 0)
377  *t++ = *f++;
378 }
379 
380 #else /* __cplusplus */
381 
382 /* This is the most reliable way to avoid incompatibilities
383  in available built-in functions on various systems. */
384 static void
385 __yy_memcpy (char *to, char *from, unsigned int count)
386 {
387  char *t = to;
388  char *f = from;
389  int i = count;
390 
391  while (i-- > 0)
392  *t++ = *f++;
393 }
394 
395 #endif
396 #endif
397 
398 #line 217 "/usr/lib/bison.simple"
399 
400 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
401  into yyparse. The argument should have type void *.
402  It should actually point to an object.
403  Grammar actions can access the variable by casting it
404  to the proper pointer type. */
405 
406 #ifdef YYPARSE_PARAM
407 #ifdef __cplusplus
408 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
409 #define YYPARSE_PARAM_DECL
410 #else /* not __cplusplus */
411 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
412 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
413 #endif /* not __cplusplus */
414 #else /* not YYPARSE_PARAM */
415 #define YYPARSE_PARAM_ARG
416 #define YYPARSE_PARAM_DECL
417 #endif /* not YYPARSE_PARAM */
418 
419 /* Prevent warning if -Wstrict-prototypes. */
420 #ifdef __GNUC__
421 #ifdef YYPARSE_PARAM
422 int yyparse (void *);
423 #else
424 int yyparse (void);
425 #endif
426 #endif
427 
428 int
429 yyparse(YYPARSE_PARAM_ARG)
430  YYPARSE_PARAM_DECL
431 {
432  int yystate;
433  int yyn;
434  short *yyssp;
435  YYSTYPE *yyvsp;
436  int yyerrstatus; /* number of tokens to shift before error messages enabled */
437  int yychar1 = 0; /* lookahead token as an internal (translated) token number */
438 
439  short yyssa[YYINITDEPTH]; /* the state stack */
440  YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
441 
442  short *yyss = yyssa; /* refer to the stacks thru separate pointers */
443  YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
444 
445 #ifdef YYLSP_NEEDED
446  YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
447  YYLTYPE *yyls = yylsa;
448  YYLTYPE *yylsp;
449 
450 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
451 #else
452 #define YYPOPSTACK (yyvsp--, yyssp--)
453 #endif
454 
455  int yystacksize = YYINITDEPTH;
456  int yyfree_stacks = 0;
457 
458 #ifdef YYPURE
459  int yychar;
460  YYSTYPE yylval;
461  int yynerrs;
462 #ifdef YYLSP_NEEDED
463  YYLTYPE yylloc;
464 #endif
465 #endif
466 
467  YYSTYPE yyval; /* the variable used to return */
468  /* semantic values from the action */
469  /* routines */
470 
471  int yylen;
472 
473 #if YYDEBUG != 0
474  if (yydebug)
475  fprintf(stderr, "Starting parse\n");
476 #endif
477 
478  yystate = 0;
479  yyerrstatus = 0;
480  yynerrs = 0;
481  yychar = YYEMPTY; /* Cause a token to be read. */
482 
483  /* Initialize stack pointers.
484  Waste one element of value and location stack
485  so that they stay on the same level as the state stack.
486  The wasted elements are never initialized. */
487 
488  yyssp = yyss - 1;
489  yyvsp = yyvs;
490 #ifdef YYLSP_NEEDED
491  yylsp = yyls;
492 #endif
493 
494 /* Push a new state, which is found in yystate . */
495 /* In all cases, when you get here, the value and location stacks
496  have just been pushed. so pushing a state here evens the stacks. */
497 yynewstate:
498 
499  *++yyssp = yystate;
500 
501  if (yyssp >= yyss + yystacksize - 1)
502  {
503  /* Give user a chance to reallocate the stack */
504  /* Use copies of these so that the &'s don't force the real ones into memory. */
505  YYSTYPE *yyvs1 = yyvs;
506  short *yyss1 = yyss;
507 #ifdef YYLSP_NEEDED
508  YYLTYPE *yyls1 = yyls;
509 #endif
510 
511  /* Get the current used size of the three stacks, in elements. */
512  int size = yyssp - yyss + 1;
513 
514 #ifdef yyoverflow
515  /* Each stack pointer address is followed by the size of
516  the data in use in that stack, in bytes. */
517 #ifdef YYLSP_NEEDED
518  /* This used to be a conditional around just the two extra args,
519  but that might be undefined if yyoverflow is a macro. */
520  yyoverflow("parser stack overflow",
521  &yyss1, size * sizeof (*yyssp),
522  &yyvs1, size * sizeof (*yyvsp),
523  &yyls1, size * sizeof (*yylsp),
524  &yystacksize);
525 #else
526  yyoverflow("parser stack overflow",
527  &yyss1, size * sizeof (*yyssp),
528  &yyvs1, size * sizeof (*yyvsp),
529  &yystacksize);
530 #endif
531 
532  yyss = yyss1; yyvs = yyvs1;
533 #ifdef YYLSP_NEEDED
534  yyls = yyls1;
535 #endif
536 #else /* no yyoverflow */
537  /* Extend the stack our own way. */
538  if (yystacksize >= YYMAXDEPTH)
539  {
540  yyerror("parser stack overflow");
541  if (yyfree_stacks)
542  {
543  free (yyss);
544  free (yyvs);
545 #ifdef YYLSP_NEEDED
546  free (yyls);
547 #endif
548  }
549  return 2;
550  }
551  yystacksize *= 2;
552  if (yystacksize > YYMAXDEPTH)
553  yystacksize = YYMAXDEPTH;
554 #ifndef YYSTACK_USE_ALLOCA
555  yyfree_stacks = 1;
556 #endif
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));
563 #ifdef YYLSP_NEEDED
564  yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
565  __yy_memcpy ((char *)yyls, (char *)yyls1,
566  size * (unsigned int) sizeof (*yylsp));
567 #endif
568 #endif /* no yyoverflow */
569 
570  yyssp = yyss + size - 1;
571  yyvsp = yyvs + size - 1;
572 #ifdef YYLSP_NEEDED
573  yylsp = yyls + size - 1;
574 #endif
575 
576 #if YYDEBUG != 0
577  if (yydebug)
578  fprintf(stderr, "Stack size increased to %d\n", yystacksize);
579 #endif
580 
581  if (yyssp >= yyss + yystacksize - 1)
582  YYABORT;
583  }
584 
585 #if YYDEBUG != 0
586  if (yydebug)
587  fprintf(stderr, "Entering state %d\n", yystate);
588 #endif
589 
590  goto yybackup;
591  yybackup:
592 
593 /* Do appropriate processing given the current state. */
594 /* Read a lookahead token if we need one and don't already have one. */
595 /* yyresume: */
596 
597  /* First try to decide what to do without reference to lookahead token. */
598 
599  yyn = yypact[yystate];
600  if (yyn == YYFLAG)
601  goto yydefault;
602 
603  /* Not known => get a lookahead token if don't already have one. */
604 
605  /* yychar is either YYEMPTY or YYEOF
606  or a valid token in external form. */
607 
608  if (yychar == YYEMPTY)
609  {
610 #if YYDEBUG != 0
611  if (yydebug)
612  fprintf(stderr, "Reading a token: ");
613 #endif
614  yychar = YYLEX;
615  }
616 
617  /* Convert token to internal form (in yychar1) for indexing tables with */
618 
619  if (yychar <= 0) /* This means end of input. */
620  {
621  yychar1 = 0;
622  yychar = YYEOF; /* Don't call YYLEX any more */
623 
624 #if YYDEBUG != 0
625  if (yydebug)
626  fprintf(stderr, "Now at end of input.\n");
627 #endif
628  }
629  else
630  {
631  yychar1 = YYTRANSLATE(yychar);
632 
633 #if YYDEBUG != 0
634  if (yydebug)
635  {
636  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
637  /* Give the individual parser a way to print the precise meaning
638  of a token, for further debugging info. */
639 #ifdef YYPRINT
640  YYPRINT (stderr, yychar, yylval);
641 #endif
642  fprintf (stderr, ")\n");
643  }
644 #endif
645  }
646 
647  yyn += yychar1;
648  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
649  goto yydefault;
650 
651  yyn = yytable[yyn];
652 
653  /* yyn is what to do for this token type in this state.
654  Negative => reduce, -yyn is rule number.
655  Positive => shift, yyn is new state.
656  New state is final state => don't bother to shift,
657  just return success.
658  0, or most negative number => error. */
659 
660  if (yyn < 0)
661  {
662  if (yyn == YYFLAG)
663  goto yyerrlab;
664  yyn = -yyn;
665  goto yyreduce;
666  }
667  else if (yyn == 0)
668  goto yyerrlab;
669 
670  if (yyn == YYFINAL)
671  YYACCEPT;
672 
673  /* Shift the lookahead token. */
674 
675 #if YYDEBUG != 0
676  if (yydebug)
677  fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
678 #endif
679 
680  /* Discard the token being shifted unless it is eof. */
681  if (yychar != YYEOF)
682  yychar = YYEMPTY;
683 
684  *++yyvsp = yylval;
685 #ifdef YYLSP_NEEDED
686  *++yylsp = yylloc;
687 #endif
688 
689  /* count tokens shifted since error; after three, turn off error status. */
690  if (yyerrstatus) yyerrstatus--;
691 
692  yystate = yyn;
693  goto yynewstate;
694 
695 /* Do the default action for the current state. */
696 yydefault:
697 
698  yyn = yydefact[yystate];
699  if (yyn == 0)
700  goto yyerrlab;
701 
702 /* Do a reduction. yyn is the number of a rule to reduce with. */
703 yyreduce:
704  yylen = yyr2[yyn];
705  if (yylen > 0)
706  yyval = yyvsp[1-yylen]; /* implement default value of the action */
707 
708 #if YYDEBUG != 0
709  if (yydebug)
710  {
711  int i;
712 
713  fprintf (stderr, "Reducing via rule %d (line %d), ",
714  yyn, yyrline[yyn]);
715 
716  /* Print the symbols being reduced, and their result. */
717  for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
718  fprintf (stderr, "%s ", yytname[yyrhs[i]]);
719  fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
720  }
721 #endif
722 
723 
724  switch (yyn) {
725 
726 case 3:
727 #line 46 "./fooparser.y"
728 { static_cast<Foomatic2Loader*>(fooloader)->m_foodata.insert("VAR",yyvsp[-2]); ;
729  break;}
730 case 4:
731 #line 47 "./fooparser.y"
732 { static_cast<Foomatic2Loader*>(fooloader)->m_foodata.insert("POSTPIPE",yyvsp[-1]); ;
733  break;}
734 case 5:
735 #line 50 "./fooparser.y"
736 { yyval = yyvsp[0]; ;
737  break;}
738 case 6:
739 #line 51 "./fooparser.y"
740 { TQMap<TQString,TQVariant>::ConstIterator it = yyvsp[0].mapBegin(); yyvsp[-2].asMap().insert(it.key(), it.data()); yyval = yyvsp[-2]; ;
741  break;}
742 case 7:
743 #line 54 "./fooparser.y"
744 { yyval.asMap().insert(yyvsp[-3].toString(), yyvsp[0]); ;
745  break;}
746 case 8:
747 #line 57 "./fooparser.y"
748 { yyval.asList().append(yyvsp[0]); ;
749  break;}
750 case 9:
751 #line 58 "./fooparser.y"
752 { yyvsp[-2].asList().append(yyvsp[0]); yyval = yyvsp[-2]; ;
753  break;}
754 case 10:
755 #line 61 "./fooparser.y"
756 { yyval = TQVariant(); ;
757  break;}
758 case 11:
759 #line 62 "./fooparser.y"
760 { yyval = yyvsp[0]; ;
761  break;}
762 case 12:
763 #line 63 "./fooparser.y"
764 { yyval = yyvsp[0]; ;
765  break;}
766 case 13:
767 #line 64 "./fooparser.y"
768 { yyval = yyvsp[-1]; ;
769  break;}
770 case 14:
771 #line 65 "./fooparser.y"
772 { yyval = yyvsp[-1]; ;
773  break;}
774 case 15:
775 #line 66 "./fooparser.y"
776 { yyval = TQVariant(); ;
777  break;}
778 case 16:
779 #line 67 "./fooparser.y"
780 { yyval = TQVariant(); ;
781  break;}
782 }
783  /* the action file gets copied in in place of this dollarsign */
784 #line 543 "/usr/lib/bison.simple"
785 
786  yyvsp -= yylen;
787  yyssp -= yylen;
788 #ifdef YYLSP_NEEDED
789  yylsp -= yylen;
790 #endif
791 
792 #if YYDEBUG != 0
793  if (yydebug)
794  {
795  short *ssp1 = yyss - 1;
796  fprintf (stderr, "state stack now");
797  while (ssp1 != yyssp)
798  fprintf (stderr, " %d", *++ssp1);
799  fprintf (stderr, "\n");
800  }
801 #endif
802 
803  *++yyvsp = yyval;
804 
805 #ifdef YYLSP_NEEDED
806  yylsp++;
807  if (yylen == 0)
808  {
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;
813  yylsp->text = 0;
814  }
815  else
816  {
817  yylsp->last_line = (yylsp+yylen-1)->last_line;
818  yylsp->last_column = (yylsp+yylen-1)->last_column;
819  }
820 #endif
821 
822  /* Now "shift" the result of the reduction.
823  Determine what state that goes to,
824  based on the state we popped back to
825  and the rule number reduced by. */
826 
827  yyn = yyr1[yyn];
828 
829  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
830  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
831  yystate = yytable[yystate];
832  else
833  yystate = yydefgoto[yyn - YYNTBASE];
834 
835  goto yynewstate;
836 
837 yyerrlab: /* here on detecting error */
838 
839  if (! yyerrstatus)
840  /* If not already recovering from an error, report this error. */
841  {
842  ++yynerrs;
843 
844 #ifdef YYERROR_VERBOSE
845  yyn = yypact[yystate];
846 
847  if (yyn > YYFLAG && yyn < YYLAST)
848  {
849  int size = 0;
850  char *msg;
851  int x, count;
852 
853  count = 0;
854  /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
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);
860  if (msg != 0)
861  {
862  strcpy(msg, "parse error");
863 
864  if (count < 5)
865  {
866  count = 0;
867  for (x = (yyn < 0 ? -yyn : 0);
868  x < (sizeof(yytname) / sizeof(char *)); x++)
869  if (yycheck[x + yyn] == x)
870  {
871  strcat(msg, count == 0 ? ", expecting `" : " or `");
872  strcat(msg, yytname[x]);
873  strcat(msg, "'");
874  count++;
875  }
876  }
877  yyerror(msg);
878  free(msg);
879  }
880  else
881  yyerror ("parse error; also virtual memory exceeded");
882  }
883  else
884 #endif /* YYERROR_VERBOSE */
885  yyerror("parse error");
886  }
887 
888  goto yyerrlab1;
889 yyerrlab1: /* here on error raised explicitly by an action */
890 
891  if (yyerrstatus == 3)
892  {
893  /* if just tried and failed to reuse lookahead token after an error, discard it. */
894 
895  /* return failure if at end of input */
896  if (yychar == YYEOF)
897  YYABORT;
898 
899 #if YYDEBUG != 0
900  if (yydebug)
901  fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
902 #endif
903 
904  yychar = YYEMPTY;
905  }
906 
907  /* Else will try to reuse lookahead token
908  after shifting the error token. */
909 
910  yyerrstatus = 3; /* Each real token shifted decrements this */
911 
912  goto yyerrhandle;
913 
914 yyerrdefault: /* current state does not do anything special for the error token. */
915 
916 #if 0
917  /* This is wrong; only states that explicitly want error tokens
918  should shift them. */
919  yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
920  if (yyn) goto yydefault;
921 #endif
922 
923 yyerrpop: /* pop the current state because it cannot handle the error token */
924 
925  if (yyssp == yyss) YYABORT;
926  yyvsp--;
927  yystate = *--yyssp;
928 #ifdef YYLSP_NEEDED
929  yylsp--;
930 #endif
931 
932 #if YYDEBUG != 0
933  if (yydebug)
934  {
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");
940  }
941 #endif
942 
943 yyerrhandle:
944 
945  yyn = yypact[yystate];
946  if (yyn == YYFLAG)
947  goto yyerrdefault;
948 
949  yyn += YYTERROR;
950  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
951  goto yyerrdefault;
952 
953  yyn = yytable[yyn];
954  if (yyn < 0)
955  {
956  if (yyn == YYFLAG)
957  goto yyerrpop;
958  yyn = -yyn;
959  goto yyreduce;
960  }
961  else if (yyn == 0)
962  goto yyerrpop;
963 
964  if (yyn == YYFINAL)
965  YYACCEPT;
966 
967 #if YYDEBUG != 0
968  if (yydebug)
969  fprintf(stderr, "Shifting error token, ");
970 #endif
971 
972  *++yyvsp = yylval;
973 #ifdef YYLSP_NEEDED
974  *++yylsp = yylloc;
975 #endif
976 
977  yystate = yyn;
978  goto yynewstate;
979 
980  yyacceptlab:
981  /* YYACCEPT comes here. */
982  if (yyfree_stacks)
983  {
984  free (yyss);
985  free (yyvs);
986 #ifdef YYLSP_NEEDED
987  free (yyls);
988 #endif
989  }
990  return 0;
991 
992  yyabortlab:
993  /* YYABORT comes here. */
994  if (yyfree_stacks)
995  {
996  free (yyss);
997  free (yyvs);
998 #ifdef YYLSP_NEEDED
999  free (yyls);
1000 #endif
1001  }
1002  return 1;
1003 }
1004 #line 70 "./fooparser.y"
1005 

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.