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

tdeprint

  • tdeprint
ppdscanner.cpp
1 #define yy_create_buffer tdeprint_ppd_create_buffer
2 #define yy_delete_buffer tdeprint_ppd_delete_buffer
3 #define yy_scan_buffer tdeprint_ppd_scan_buffer
4 #define yy_scan_string tdeprint_ppd_scan_string
5 #define yy_scan_bytes tdeprint_ppd_scan_bytes
6 #define yy_flex_debug tdeprint_ppd_flex_debug
7 #define yy_init_buffer tdeprint_ppd_init_buffer
8 #define yy_flush_buffer tdeprint_ppd_flush_buffer
9 #define yy_load_buffer_state tdeprint_ppd_load_buffer_state
10 #define yy_switch_to_buffer tdeprint_ppd_switch_to_buffer
11 #define yyin tdeprint_ppdin
12 #define yyleng tdeprint_ppdleng
13 #define yylex tdeprint_ppdlex
14 #define yyout tdeprint_ppdout
15 #define yyrestart tdeprint_ppdrestart
16 #define yytext tdeprint_ppdtext
17 
18 #line 19 "./ppdscanner.cpp"
19 /* A lexical scanner generated by flex */
20 
21 /* Scanner skeleton version:
22  * $Header$
23  */
24 
25 #define FLEX_SCANNER
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
28 
29 #include <stdio.h>
30 #include <unistd.h>
31 
32 
33 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
34 #ifdef c_plusplus
35 #ifndef __cplusplus
36 #define __cplusplus
37 #endif
38 #endif
39 
40 
41 #ifdef __cplusplus
42 
43 #include <stdlib.h>
44 
45 /* Use prototypes in function declarations. */
46 #define YY_USE_PROTOS
47 
48 /* The "const" storage-class-modifier is valid. */
49 #define YY_USE_CONST
50 
51 #else /* ! __cplusplus */
52 
53 #if __STDC__
54 
55 #define YY_USE_PROTOS
56 #define YY_USE_CONST
57 
58 #endif /* __STDC__ */
59 #endif /* ! __cplusplus */
60 
61 #ifdef YY_USE_CONST
62 #define yyconst const
63 #else
64 #define yyconst
65 #endif
66 
67 
68 #ifdef YY_USE_PROTOS
69 #define YY_PROTO(proto) proto
70 #else
71 #define YY_PROTO(proto) ()
72 #endif
73 
74 /* Returned upon end-of-file. */
75 #define YY_NULL 0
76 
77 /* Promotes a possibly negative, possibly signed char to an unsigned
78  * integer for use as an array index. If the signed char is negative,
79  * we want to instead treat it as an 8-bit unsigned char, hence the
80  * double cast.
81  */
82 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83 
84 /* Enter a start condition. This macro really ought to take a parameter,
85  * but we do it the disgusting crufty way forced on us by the ()-less
86  * definition of BEGIN.
87  */
88 #define BEGIN yy_start = 1 + 2 *
89 
90 /* Translate the current start state into a value that can be later handed
91  * to BEGIN to return to the state. The YYSTATE alias is for lex
92  * compatibility.
93  */
94 #define YY_START ((yy_start - 1) / 2)
95 #define YYSTATE YY_START
96 
97 /* Action number for EOF rule of a given start state. */
98 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99 
100 /* Special action meaning "start processing a new file". */
101 #define YY_NEW_FILE yyrestart( yyin )
102 
103 #define YY_END_OF_BUFFER_CHAR 0
104 
105 /* Size of default input buffer. */
106 #define YY_BUF_SIZE 16384
107 
108 typedef struct yy_buffer_state *YY_BUFFER_STATE;
109 
110 extern int yyleng;
111 extern FILE *yyin, *yyout;
112 
113 #define EOB_ACT_CONTINUE_SCAN 0
114 #define EOB_ACT_END_OF_FILE 1
115 #define EOB_ACT_LAST_MATCH 2
116 
117 /* The funky do-while in the following #define is used to turn the definition
118  * int a single C statement (which needs a semi-colon terminator). This
119  * avoids problems with code like:
120  *
121  * if ( condition_holds )
122  * yyless( 5 );
123  * else
124  * do_something_else();
125  *
126  * Prior to using the do-while the compiler would get upset at the
127  * "else" because it interpreted the "if" statement as being all
128  * done when it reached the ';' after the yyless() call.
129  */
130 
131 /* Return all but the first 'n' matched characters back to the input stream. */
132 
133 #define yyless(n) \
134  do \
135  { \
136  /* Undo effects of setting up yytext. */ \
137  *yy_cp = yy_hold_char; \
138  YY_RESTORE_YY_MORE_OFFSET \
139  yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
140  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
141  } \
142  while ( 0 )
143 
144 #define unput(c) yyunput( c, yytext_ptr )
145 
146 /* The following is because we cannot portably get our hands on size_t
147  * (without autoconf's help, which isn't available because we want
148  * flex-generated scanners to compile on their own).
149  */
150 typedef unsigned int yy_size_t;
151 
152 
153 struct yy_buffer_state
154  {
155  FILE *yy_input_file;
156 
157  char *yy_ch_buf; /* input buffer */
158  char *yy_buf_pos; /* current position in input buffer */
159 
160  /* Size of input buffer in bytes, not including room for EOB
161  * characters.
162  */
163  yy_size_t yy_buf_size;
164 
165  /* Number of characters read into yy_ch_buf, not including EOB
166  * characters.
167  */
168  int yy_n_chars;
169 
170  /* Whether we "own" the buffer - i.e., we know we created it,
171  * and can realloc() it to grow it, and should free() it to
172  * delete it.
173  */
174  int yy_is_our_buffer;
175 
176  /* Whether this is an "interactive" input source; if so, and
177  * if we're using stdio for input, then we want to use getc()
178  * instead of fread(), to make sure we stop fetching input after
179  * each newline.
180  */
181  int yy_is_interactive;
182 
183  /* Whether we're considered to be at the beginning of a line.
184  * If so, '^' rules will be active on the next match, otherwise
185  * not.
186  */
187  int yy_at_bol;
188 
189  /* Whether to try to fill the input buffer when we reach the
190  * end of it.
191  */
192  int yy_fill_buffer;
193 
194  int yy_buffer_status;
195 #define YY_BUFFER_NEW 0
196 #define YY_BUFFER_NORMAL 1
197  /* When an EOF's been seen but there's still some text to process
198  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
199  * shouldn't try reading from the input source any more. We might
200  * still have a bunch of tokens to match, though, because of
201  * possible backing-up.
202  *
203  * When we actually see the EOF, we change the status to "new"
204  * (via yyrestart()), so that the user can continue scanning by
205  * just pointing yyin at a new input file.
206  */
207 #define YY_BUFFER_EOF_PENDING 2
208  };
209 
210 static YY_BUFFER_STATE yy_current_buffer = 0;
211 
212 /* We provide macros for accessing buffer states in case in the
213  * future we want to put the buffer states in a more general
214  * "scanner state".
215  */
216 #define YY_CURRENT_BUFFER yy_current_buffer
217 
218 
219 /* yy_hold_char holds the character lost when yytext is formed. */
220 static char yy_hold_char;
221 
222 static int yy_n_chars; /* number of characters read into yy_ch_buf */
223 
224 
225 int yyleng;
226 
227 /* Points to current character in buffer. */
228 static char *yy_c_buf_p = (char *) 0;
229 static int yy_init = 1; /* whether we need to initialize */
230 static int yy_start = 0; /* start state number */
231 
232 /* Flag which is used to allow yywrap()'s to do buffer switches
233  * instead of setting up a fresh yyin. A bit of a hack ...
234  */
235 static int yy_did_buffer_switch_on_eof;
236 
237 void yyrestart YY_PROTO(( FILE *input_file ));
238 
239 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
240 void yy_load_buffer_state YY_PROTO(( void ));
241 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
242 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
244 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
245 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
246 
247 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
248 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
249 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
250 
251 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
252 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
253 static void yy_flex_free YY_PROTO(( void * ));
254 
255 #define yy_new_buffer yy_create_buffer
256 
257 #define yy_set_interactive(is_interactive) \
258  { \
259  if ( ! yy_current_buffer ) \
260  yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
261  yy_current_buffer->yy_is_interactive = is_interactive; \
262  }
263 
264 #define yy_set_bol(at_bol) \
265  { \
266  if ( ! yy_current_buffer ) \
267  yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
268  yy_current_buffer->yy_at_bol = at_bol; \
269  }
270 
271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
272 
273 
274 #define yywrap() 1
275 #define YY_SKIP_YYWRAP
276 typedef unsigned char YY_CHAR;
277 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
278 typedef int yy_state_type;
279 extern char *yytext;
280 #define yytext_ptr yytext
281 
282 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
283 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
284 static int yy_get_next_buffer YY_PROTO(( void ));
285 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
286 
287 /* Done after the current pattern has been matched and before the
288  * corresponding action - sets up yytext.
289  */
290 #define YY_DO_BEFORE_ACTION \
291  yytext_ptr = yy_bp; \
292  yyleng = (int) (yy_cp - yy_bp); \
293  yy_hold_char = *yy_cp; \
294  *yy_cp = '\0'; \
295  yy_c_buf_p = yy_cp;
296 
297 #define YY_NUM_RULES 37
298 #define YY_END_OF_BUFFER 38
299 static yyconst short int yy_accept[172] =
300  { 0,
301  0, 0, 0, 0, 0, 0, 21, 21, 29, 29,
302  0, 0, 38, 36, 35, 36, 19, 17, 20, 18,
303  27, 25, 25, 26, 28, 21, 23, 22, 29, 30,
304  34, 33, 36, 31, 16, 15, 16, 16, 16, 16,
305  16, 16, 16, 16, 16, 17, 25, 0, 25, 24,
306  21, 29, 33, 32, 15, 15, 15, 16, 16, 16,
307  16, 16, 16, 16, 16, 16, 24, 15, 16, 16,
308  13, 16, 16, 16, 16, 16, 16, 15, 16, 16,
309  16, 16, 16, 16, 16, 16, 16, 15, 16, 16,
310  16, 16, 16, 16, 16, 16, 16, 16, 15, 16,
311 
312  16, 16, 16, 16, 16, 16, 16, 2, 16, 16,
313  15, 16, 4, 16, 16, 16, 16, 16, 16, 2,
314  16, 16, 15, 16, 4, 8, 8, 16, 16, 16,
315  16, 16, 16, 16, 15, 16, 7, 16, 16, 1,
316  16, 5, 16, 16, 15, 6, 16, 3, 16, 16,
317  16, 15, 16, 16, 16, 16, 15, 14, 16, 16,
318  16, 16, 12, 16, 16, 9, 16, 11, 16, 10,
319  0
320  } ;
321 
322 static yyconst int yy_ec[256] =
323  { 0,
324  1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
325  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327  1, 3, 4, 5, 6, 4, 7, 4, 4, 4,
328  4, 8, 4, 4, 4, 4, 9, 10, 10, 10,
329  10, 10, 10, 10, 10, 10, 10, 11, 4, 4,
330  4, 4, 4, 4, 12, 10, 13, 14, 15, 10,
331  16, 10, 17, 18, 10, 19, 20, 21, 22, 23,
332  10, 10, 10, 24, 25, 10, 10, 10, 10, 10,
333  4, 4, 4, 4, 4, 4, 26, 27, 10, 28,
334 
335  29, 30, 31, 10, 32, 10, 10, 33, 34, 35,
336  36, 37, 10, 38, 39, 40, 41, 10, 10, 10,
337  10, 10, 4, 4, 4, 4, 1, 1, 1, 1,
338  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 
346  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
351  1, 1, 1, 1, 1
352  } ;
353 
354 static yyconst int yy_meta[42] =
355  { 0,
356  1, 2, 3, 4, 4, 4, 4, 5, 1, 4,
357  6, 4, 4, 4, 4, 4, 4, 4, 4, 4,
358  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
359  4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
360  4
361  } ;
362 
363 static yyconst short int yy_base[194] =
364  { 0,
365  0, 1, 3, 14, 17, 28, 25, 30, 300, 299,
366  41, 45, 300, 303, 303, 50, 303, 0, 303, 303,
367  303, 0, 75, 303, 303, 0, 303, 303, 0, 303,
368  303, 0, 0, 303, 0, 78, 266, 269, 262, 262,
369  282, 258, 256, 266, 274, 0, 0, 285, 89, 0,
370  0, 0, 0, 0, 0, 276, 92, 252, 257, 258,
371  259, 265, 248, 253, 244, 267, 303, 257, 239, 251,
372  0, 245, 38, 250, 239, 244, 236, 251, 241, 228,
373  239, 234, 229, 248, 45, 226, 228, 248, 58, 228,
374  234, 223, 229, 244, 218, 238, 240, 214, 240, 213,
375 
376  233, 209, 221, 208, 211, 209, 208, 100, 211, 202,
377  217, 204, 105, 231, 205, 208, 211, 200, 193, 110,
378  199, 194, 219, 189, 115, 0, 0, 200, 203, 210,
379  187, 188, 195, 197, 219, 184, 0, 208, 202, 0,
380  178, 0, 182, 184, 191, 0, 147, 0, 141, 135,
381  67, 97, 68, 70, 56, 45, 80, 303, 43, 34,
382  26, 20, 0, 23, 20, 0, 5, 0, 1, 0,
383  303, 123, 129, 135, 141, 147, 153, 156, 159, 161,
384  166, 172, 177, 6, 3, 183, 189, 195, 198, 200,
385  202, 204, 209
386 
387  } ;
388 
389 static yyconst short int yy_def[194] =
390  { 0,
391  172, 172, 173, 173, 174, 174, 175, 175, 176, 176,
392  177, 177, 171, 171, 171, 178, 171, 179, 171, 171,
393  171, 180, 181, 171, 171, 182, 171, 171, 183, 171,
394  171, 184, 185, 171, 178, 186, 178, 178, 178, 178,
395  178, 178, 178, 178, 178, 179, 180, 187, 181, 180,
396  182, 183, 184, 185, 188, 188, 186, 178, 178, 178,
397  178, 178, 178, 178, 178, 178, 171, 188, 178, 178,
398  178, 178, 178, 178, 178, 178, 178, 188, 178, 178,
399  178, 178, 178, 178, 178, 178, 178, 188, 178, 178,
400  178, 178, 178, 178, 178, 178, 178, 178, 188, 178,
401 
402  178, 178, 178, 178, 178, 178, 178, 189, 178, 178,
403  188, 178, 190, 191, 178, 178, 178, 178, 178, 189,
404  178, 178, 188, 178, 190, 191, 192, 178, 178, 178,
405  178, 178, 178, 178, 188, 178, 192, 178, 178, 178,
406  178, 178, 178, 178, 188, 178, 178, 178, 178, 178,
407  178, 193, 178, 178, 178, 178, 193, 171, 178, 178,
408  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
409  0, 171, 171, 171, 171, 171, 171, 171, 171, 171,
410  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
411  171, 171, 171
412 
413  } ;
414 
415 static yyconst short int yy_nxt[345] =
416  { 0,
417  171, 15, 15, 14, 17, 14, 54, 16, 16, 53,
418  171, 19, 171, 20, 14, 17, 14, 14, 21, 14,
419  171, 23, 19, 171, 20, 24, 27, 25, 14, 21,
420  14, 27, 23, 171, 171, 28, 24, 171, 25, 170,
421  28, 14, 31, 14, 169, 14, 31, 14, 33, 14,
422  82, 34, 33, 14, 168, 34, 36, 167, 166, 83,
423  95, 165, 37, 38, 39, 164, 40, 41, 163, 96,
424  42, 43, 44, 100, 45, 48, 48, 48, 55, 50,
425  56, 158, 101, 48, 162, 48, 55, 161, 55, 48,
426  48, 48, 55, 50, 55, 160, 159, 48, 158, 48,
427 
428  55, 156, 55, 35, 35, 35, 35, 35, 35, 35,
429  35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
430  35, 35, 35, 14, 14, 14, 14, 14, 14, 18,
431  18, 18, 18, 18, 18, 22, 22, 22, 22, 22,
432  22, 26, 26, 26, 26, 26, 26, 29, 29, 29,
433  29, 29, 29, 32, 32, 32, 32, 32, 32, 35,
434  35, 46, 46, 46, 47, 47, 49, 49, 49, 49,
435  49, 49, 51, 155, 51, 51, 51, 52, 154, 52,
436  52, 52, 52, 57, 153, 57, 57, 57, 57, 48,
437  48, 48, 48, 48, 48, 55, 152, 55, 55, 55,
438 
439  55, 120, 120, 125, 125, 126, 126, 137, 137, 157,
440  157, 157, 157, 157, 157, 151, 150, 149, 148, 147,
441  146, 145, 144, 143, 142, 141, 140, 139, 138, 136,
442  135, 134, 133, 132, 131, 130, 129, 128, 127, 124,
443  123, 122, 121, 119, 118, 117, 116, 115, 114, 113,
444  112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
445  102, 99, 98, 97, 94, 93, 92, 91, 90, 89,
446  88, 87, 86, 85, 84, 81, 80, 79, 78, 77,
447  76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
448  66, 65, 64, 63, 62, 61, 60, 59, 58, 171,
449 
450  30, 30, 13, 171, 171, 171, 171, 171, 171, 171,
451  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
452  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
453  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
454  171, 171, 171, 171
455  } ;
456 
457 static yyconst short int yy_chk[345] =
458  { 0,
459  0, 1, 2, 3, 3, 3, 185, 1, 2, 184,
460  0, 3, 0, 3, 4, 4, 4, 5, 5, 5,
461  0, 5, 4, 0, 4, 5, 7, 5, 6, 6,
462  6, 8, 6, 0, 0, 7, 6, 0, 6, 169,
463  8, 11, 11, 11, 167, 12, 12, 12, 11, 11,
464  73, 11, 12, 12, 165, 12, 16, 164, 162, 73,
465  85, 161, 16, 16, 16, 160, 16, 16, 159, 85,
466  16, 16, 16, 89, 16, 23, 23, 23, 36, 23,
467  36, 157, 89, 23, 156, 23, 36, 155, 36, 49,
468  49, 49, 57, 49, 57, 154, 153, 49, 152, 49,
469 
470  57, 151, 57, 108, 108, 108, 108, 108, 113, 113,
471  113, 113, 113, 120, 120, 120, 120, 120, 125, 125,
472  125, 125, 125, 172, 172, 172, 172, 172, 172, 173,
473  173, 173, 173, 173, 173, 174, 174, 174, 174, 174,
474  174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
475  176, 176, 176, 177, 177, 177, 177, 177, 177, 178,
476  178, 179, 179, 179, 180, 180, 181, 181, 181, 181,
477  181, 181, 182, 150, 182, 182, 182, 183, 149, 183,
478  183, 183, 183, 186, 147, 186, 186, 186, 186, 187,
479  187, 187, 187, 187, 187, 188, 145, 188, 188, 188,
480 
481  188, 189, 189, 190, 190, 191, 191, 192, 192, 193,
482  193, 193, 193, 193, 193, 144, 143, 141, 139, 138,
483  136, 135, 134, 133, 132, 131, 130, 129, 128, 124,
484  123, 122, 121, 119, 118, 117, 116, 115, 114, 112,
485  111, 110, 109, 107, 106, 105, 104, 103, 102, 101,
486  100, 99, 98, 97, 96, 95, 94, 93, 92, 91,
487  90, 88, 87, 86, 84, 83, 82, 81, 80, 79,
488  78, 77, 76, 75, 74, 72, 70, 69, 68, 66,
489  65, 64, 63, 62, 61, 60, 59, 58, 56, 48,
490  45, 44, 43, 42, 41, 40, 39, 38, 37, 13,
491 
492  10, 9, 171, 171, 171, 171, 171, 171, 171, 171,
493  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
494  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
495  171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
496  171, 171, 171, 171
497  } ;
498 
499 static yy_state_type yy_last_accepting_state;
500 static char *yy_last_accepting_cpos;
501 
502 /* The intent behind this definition is that it'll catch
503  * any uses of REJECT which flex missed.
504  */
505 #define REJECT reject_used_but_not_detected
506 #define yymore() yymore_used_but_not_detected
507 #define YY_MORE_ADJ 0
508 #define YY_RESTORE_YY_MORE_OFFSET
509 char *yytext;
510 #line 1 "./ppdscanner.l"
511 #define INITIAL 0
512 #line 2 "./ppdscanner.l"
513 /*
514  * This file is part of the KDE libraries
515  * Copyright (c) 2001-2003 Michael Goffioul <tdeprint@swing.be>
516  *
517  * This library is free software; you can redistribute it and/or
518  * modify it under the terms of the GNU Library General Public
519  * License version 2 as published by the Free Software Foundation.
520  *
521  * This library is distributed in the hope that it will be useful,
522  * but WITHOUT ANY WARRANTY; without even the implied warranty of
523  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
524  * Library General Public License for more details.
525  *
526  * You should have received a copy of the GNU Library General Public License
527  * along with this library; see the file COPYING.LIB. If not, write to
528  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
529  * Boston, MA 02110-1301, USA.
530  **/
531 
532 #include <tqstringlist.h>
533 #include <tqiodevice.h>
534 #define YYSTYPE TQStringList
535 #include "ppdparser.cpp.h"
536 
537 #define yylval tdeprint_ppdlval
538 
539 TQIODevice *tdeprint_ppdscanner_device = NULL;
540 #define YY_INPUT(buf,result,max_size) \
541  { \
542  if (tdeprint_ppdscanner_device) \
543  { \
544  result = tdeprint_ppdscanner_device->readBlock(buf,max_size); \
545  if (result < 0) \
546  { \
547  result = 0; \
548  } \
549  } \
550  else \
551  { \
552  result = 0; \
553  } \
554  }
555 int tdeprint_ppdscanner_lno = 0;
556 
557 #if 0
558 #define QDEBUG0(s) tqDebug(s)
559 #define QDEBUG1(s,a) tqDebug(s,a)
560 #else
561 #define QDEBUG0(s)
562 #define QDEBUG1(s,a)
563 #endif
564 #define option 1
565 #define value 2
566 #define translation_1 3
567 #define translation_2 4
568 #define constr 5
569 
570 #line 576 "./ppdscanner.cpp"
571 
572 /* Macros after this point can all be overridden by user definitions in
573  * section 1.
574  */
575 
576 #ifndef YY_SKIP_YYWRAP
577 #ifdef __cplusplus
578 extern "C" int yywrap YY_PROTO(( void ));
579 #else
580 extern int yywrap YY_PROTO(( void ));
581 #endif
582 #endif
583 
584 #ifndef YY_NO_UNPUT
585 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
586 #endif
587 
588 #ifndef yytext_ptr
589 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
590 #endif
591 
592 #ifdef YY_NEED_STRLEN
593 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
594 #endif
595 
596 #ifndef YY_NO_INPUT
597 #ifdef __cplusplus
598 static int yyinput YY_PROTO(( void ));
599 #else
600 static int input YY_PROTO(( void ));
601 #endif
602 #endif
603 
604 #if YY_STACK_USED
605 static int yy_start_stack_ptr = 0;
606 static int yy_start_stack_depth = 0;
607 static int *yy_start_stack = 0;
608 #ifndef YY_NO_PUSH_STATE
609 static void yy_push_state YY_PROTO(( int new_state ));
610 #endif
611 #ifndef YY_NO_POP_STATE
612 static void yy_pop_state YY_PROTO(( void ));
613 #endif
614 #ifndef YY_NO_TOP_STATE
615 static int yy_top_state YY_PROTO(( void ));
616 #endif
617 
618 #else
619 #define YY_NO_PUSH_STATE 1
620 #define YY_NO_POP_STATE 1
621 #define YY_NO_TOP_STATE 1
622 #endif
623 
624 #ifdef YY_MALLOC_DECL
625 YY_MALLOC_DECL
626 #else
627 #if __STDC__
628 #ifndef __cplusplus
629 #include <stdlib.h>
630 #endif
631 #else
632 /* Just try to get by without declaring the routines. This will fail
633  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
634  * or sizeof(void*) != sizeof(int).
635  */
636 #endif
637 #endif
638 
639 /* Amount of stuff to slurp up with each read. */
640 #ifndef YY_READ_BUF_SIZE
641 #define YY_READ_BUF_SIZE 8192
642 #endif
643 
644 /* Copy whatever the last rule matched to the standard output. */
645 
646 #ifndef ECHO
647 /* This used to be an fputs(), but since the string might contain NUL's,
648  * we now use fwrite().
649  */
650 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
651 #endif
652 
653 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
654  * is returned in "result".
655  */
656 #ifndef YY_INPUT
657 #define YY_INPUT(buf,result,max_size) \
658  if ( yy_current_buffer->yy_is_interactive ) \
659  { \
660  int c = '*', n; \
661  for ( n = 0; n < max_size && \
662  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
663  buf[n] = (char) c; \
664  if ( c == '\n' ) \
665  buf[n++] = (char) c; \
666  if ( c == EOF && ferror( yyin ) ) \
667  YY_FATAL_ERROR( "input in flex scanner failed" ); \
668  result = n; \
669  } \
670  else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
671  && ferror( yyin ) ) \
672  YY_FATAL_ERROR( "input in flex scanner failed" );
673 #endif
674 
675 /* No semi-colon after return; correct usage is to write "yyterminate();" -
676  * we don't want an extra ';' after the "return" because that will cause
677  * some compilers to complain about unreachable statements.
678  */
679 #ifndef yyterminate
680 #define yyterminate() return YY_NULL
681 #endif
682 
683 /* Number of entries by which start-condition stack grows. */
684 #ifndef YY_START_STACK_INCR
685 #define YY_START_STACK_INCR 25
686 #endif
687 
688 /* Report a fatal error. */
689 #ifndef YY_FATAL_ERROR
690 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
691 #endif
692 
693 /* Default declaration of generated scanner - a define so the user can
694  * easily add parameters.
695  */
696 #ifndef YY_DECL
697 #define YY_DECL int yylex YY_PROTO(( void ))
698 #endif
699 
700 /* Code executed at the beginning of each rule, after yytext and yyleng
701  * have been set up.
702  */
703 #ifndef YY_USER_ACTION
704 #define YY_USER_ACTION
705 #endif
706 
707 /* Code executed at the end of each rule. */
708 #ifndef YY_BREAK
709 #define YY_BREAK break;
710 #endif
711 
712 #define YY_RULE_SETUP \
713  YY_USER_ACTION
714 
715 YY_DECL
716  {
717  yy_state_type yy_current_state;
718  char *yy_cp, *yy_bp;
719  int yy_act;
720 
721 #line 59 "./ppdscanner.l"
722 
723 
727 #line 733 "./ppdscanner.cpp"
728 
729  if ( yy_init )
730  {
731  yy_init = 0;
732 
733 #ifdef YY_USER_INIT
734  YY_USER_INIT;
735 #endif
736 
737  if ( ! yy_start )
738  yy_start = 1; /* first start state */
739 
740  if ( ! yyin )
741  yyin = stdin;
742 
743  if ( ! yyout )
744  yyout = stdout;
745 
746  if ( ! yy_current_buffer )
747  yy_current_buffer =
748  yy_create_buffer( yyin, YY_BUF_SIZE );
749 
750  yy_load_buffer_state();
751  }
752 
753  while ( 1 ) /* loops until end-of-file is reached */
754  {
755  yy_cp = yy_c_buf_p;
756 
757  /* Support of yytext. */
758  *yy_cp = yy_hold_char;
759 
760  /* yy_bp points to the position in yy_ch_buf of the start of
761  * the current run.
762  */
763  yy_bp = yy_cp;
764 
765  yy_current_state = yy_start;
766 yy_match:
767  do
768  {
769  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
770  if ( yy_accept[yy_current_state] )
771  {
772  yy_last_accepting_state = yy_current_state;
773  yy_last_accepting_cpos = yy_cp;
774  }
775  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
776  {
777  yy_current_state = (int) yy_def[yy_current_state];
778  if ( yy_current_state >= 172 )
779  yy_c = yy_meta[(unsigned int) yy_c];
780  }
781  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
782  ++yy_cp;
783  }
784  while ( yy_base[yy_current_state] != 303 );
785 
786 yy_find_action:
787  yy_act = yy_accept[yy_current_state];
788  if ( yy_act == 0 )
789  { /* have to back up */
790  yy_cp = yy_last_accepting_cpos;
791  yy_current_state = yy_last_accepting_state;
792  yy_act = yy_accept[yy_current_state];
793  }
794 
795  YY_DO_BEFORE_ACTION;
796 
797 
798 do_action: /* This label is used only to access EOF actions. */
799 
800 
801  switch ( yy_act )
802  { /* beginning of action switch */
803  case 0: /* must back up */
804  /* undo the effects of YY_DO_BEFORE_ACTION */
805  *yy_cp = yy_hold_char;
806  yy_cp = yy_last_accepting_cpos;
807  yy_current_state = yy_last_accepting_state;
808  goto yy_find_action;
809 
810 case 1:
811 #line 65 "./ppdscanner.l"
812 case 2:
813 YY_RULE_SETUP
814 #line 65 "./ppdscanner.l"
815 { QDEBUG0("Open UI"); BEGIN(option); return OPENUI; }
816  YY_BREAK
817 case 3:
818 #line 67 "./ppdscanner.l"
819 case 4:
820 YY_RULE_SETUP
821 #line 67 "./ppdscanner.l"
822 { QDEBUG0("Close UI"); BEGIN(value); return CLOSEUI; }
823  YY_BREAK
824 case 5:
825 YY_RULE_SETUP
826 #line 68 "./ppdscanner.l"
827 { QDEBUG0("Open group"); BEGIN(option); return OPENGROUP; }
828  YY_BREAK
829 case 6:
830 YY_RULE_SETUP
831 #line 69 "./ppdscanner.l"
832 { QDEBUG0("Close group"); BEGIN(option); return CLOSEGROUP; }
833  YY_BREAK
834 case 7:
835 YY_RULE_SETUP
836 #line 70 "./ppdscanner.l"
837 { yylval = yytext+9; BEGIN(option); return DEFAULT; }
838  YY_BREAK
839 case 8:
840 YY_RULE_SETUP
841 #line 71 "./ppdscanner.l"
842 { yylval = yytext+8; BEGIN(option); return DEFAULT; }
843  YY_BREAK
844 case 9:
845 #line 73 "./ppdscanner.l"
846 case 10:
847 YY_RULE_SETUP
848 #line 73 "./ppdscanner.l"
849 { BEGIN(constr); return CONSTRAINT; }
850  YY_BREAK
851 case 11:
852 YY_RULE_SETUP
853 #line 74 "./ppdscanner.l"
854 { BEGIN(option); return PAPERDIM; }
855  YY_BREAK
856 case 12:
857 YY_RULE_SETUP
858 #line 75 "./ppdscanner.l"
859 { BEGIN(option); return IMGAREA; }
860  YY_BREAK
861 case 13:
862 YY_RULE_SETUP
863 #line 76 "./ppdscanner.l"
864 { /* eat up */ }
865  YY_BREAK
866 case 14:
867 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
868 yy_c_buf_p = yy_cp -= 1;
869 YY_DO_BEFORE_ACTION; /* set up yytext again */
870 YY_RULE_SETUP
871 #line 78 "./ppdscanner.l"
872 { yylval = yytext+12; return FOODATA; }
873  YY_BREAK
874 case 15:
875 YY_RULE_SETUP
876 #line 79 "./ppdscanner.l"
877 { QDEBUG0("Comment"); return COMMENT; }
878  YY_BREAK
879 case 16:
880 YY_RULE_SETUP
881 #line 80 "./ppdscanner.l"
882 { yylval = yytext+1; QDEBUG1("Main keyword: %s",yytext+1); BEGIN(option); return KEYWORD; }
883  YY_BREAK
887 case 17:
888 YY_RULE_SETUP
889 #line 85 "./ppdscanner.l"
890 { yylval = yytext; QDEBUG1("Option: %s",yytext); return OPTION; }
891  YY_BREAK
892 case 18:
893 YY_RULE_SETUP
894 #line 86 "./ppdscanner.l"
895 { BEGIN(value); return ':'; }
896  YY_BREAK
897 case 19:
898 YY_RULE_SETUP
899 #line 87 "./ppdscanner.l"
900 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
901  YY_BREAK
902 case 20:
903 YY_RULE_SETUP
904 #line 88 "./ppdscanner.l"
905 { BEGIN(translation_1); return '/'; }
906  YY_BREAK
910 case 21:
911 YY_RULE_SETUP
912 #line 93 "./ppdscanner.l"
913 { yylval = yytext; QDEBUG1("Translation: %s",yytext); return TRANSLATION; }
914  YY_BREAK
915 case 22:
916 YY_RULE_SETUP
917 #line 94 "./ppdscanner.l"
918 { BEGIN(value); return ':'; }
919  YY_BREAK
920 case 23:
921 YY_RULE_SETUP
922 #line 95 "./ppdscanner.l"
923 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
924  YY_BREAK
928 case 24:
929 YY_RULE_SETUP
930 #line 100 "./ppdscanner.l"
931 { yylval = yytext; tdeprint_ppdscanner_lno += yylval[0].contains('\n'); QDEBUG1("Quoted value: %s",yytext); return QUOTED; }
932  YY_BREAK
933 case 25:
934 YY_RULE_SETUP
935 #line 101 "./ppdscanner.l"
936 { yylval = yytext; QDEBUG1("String part: %s",yytext); return STRINGPART; }
937  YY_BREAK
938 case 26:
939 YY_RULE_SETUP
940 #line 102 "./ppdscanner.l"
941 { BEGIN(translation_2); return '/'; }
942  YY_BREAK
943 case 27:
944 YY_RULE_SETUP
945 #line 103 "./ppdscanner.l"
946 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
947  YY_BREAK
948 case 28:
949 YY_RULE_SETUP
950 #line 104 "./ppdscanner.l"
951 { /* stay in the same state */ return ':'; }
952  YY_BREAK
956 case 29:
957 YY_RULE_SETUP
958 #line 109 "./ppdscanner.l"
959 { yylval = yytext; QDEBUG1("Translation: %s",yytext); return TRANSLATION; }
960  YY_BREAK
961 case 30:
962 YY_RULE_SETUP
963 #line 110 "./ppdscanner.l"
964 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
965  YY_BREAK
969 case 31:
970 YY_RULE_SETUP
971 #line 115 "./ppdscanner.l"
972 { return ':'; }
973  YY_BREAK
974 case 32:
975 YY_RULE_SETUP
976 #line 116 "./ppdscanner.l"
977 { yylval = yytext+1; QDEBUG1("Constraint keyword: %s",yytext); return KEYWORD; }
978  YY_BREAK
979 case 33:
980 YY_RULE_SETUP
981 #line 117 "./ppdscanner.l"
982 { yylval = yytext; QDEBUG1("Constraint option: %s",yytext); return OPTION; }
983  YY_BREAK
984 case 34:
985 YY_RULE_SETUP
986 #line 118 "./ppdscanner.l"
987 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
988  YY_BREAK
989 case 35:
990 YY_RULE_SETUP
991 #line 120 "./ppdscanner.l"
992 { tdeprint_ppdscanner_lno++; /* eat up */ }
993  YY_BREAK
994 case 36:
995 YY_RULE_SETUP
996 #line 121 "./ppdscanner.l"
997 { /* eat up */ }
998  YY_BREAK
999 case 37:
1000 YY_RULE_SETUP
1001 #line 123 "./ppdscanner.l"
1002 ECHO;
1003  YY_BREAK
1004 #line 1010 "./ppdscanner.cpp"
1005 case YY_STATE_EOF(INITIAL):
1006 case YY_STATE_EOF(option):
1007 case YY_STATE_EOF(value):
1008 case YY_STATE_EOF(translation_1):
1009 case YY_STATE_EOF(translation_2):
1010 case YY_STATE_EOF(constr):
1011  yyterminate();
1012 
1013  case YY_END_OF_BUFFER:
1014  {
1015  /* Amount of text matched not including the EOB char. */
1016  int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1017 
1018  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1019  *yy_cp = yy_hold_char;
1020  YY_RESTORE_YY_MORE_OFFSET
1021 
1022  if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1023  {
1024  /* We're scanning a new file or input source. It's
1025  * possible that this happened because the user
1026  * just pointed yyin at a new source and called
1027  * yylex(). If so, then we have to assure
1028  * consistency between yy_current_buffer and our
1029  * globals. Here is the right place to do so, because
1030  * this is the first action (other than possibly a
1031  * back-up) that will match for the new input source.
1032  */
1033  yy_n_chars = yy_current_buffer->yy_n_chars;
1034  yy_current_buffer->yy_input_file = yyin;
1035  yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1036  }
1037 
1038  /* Note that here we test for yy_c_buf_p "<=" to the position
1039  * of the first EOB in the buffer, since yy_c_buf_p will
1040  * already have been incremented past the NUL character
1041  * (since all states make transitions on EOB to the
1042  * end-of-buffer state). Contrast this with the test
1043  * in input().
1044  */
1045  if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1046  { /* This was really a NUL. */
1047  yy_state_type yy_next_state;
1048 
1049  yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1050 
1051  yy_current_state = yy_get_previous_state();
1052 
1053  /* Okay, we're now positioned to make the NUL
1054  * transition. We couldn't have
1055  * yy_get_previous_state() go ahead and do it
1056  * for us because it doesn't know how to deal
1057  * with the possibility of jamming (and we don't
1058  * want to build jamming into it because then it
1059  * will run more slowly).
1060  */
1061 
1062  yy_next_state = yy_try_NUL_trans( yy_current_state );
1063 
1064  yy_bp = yytext_ptr + YY_MORE_ADJ;
1065 
1066  if ( yy_next_state )
1067  {
1068  /* Consume the NUL. */
1069  yy_cp = ++yy_c_buf_p;
1070  yy_current_state = yy_next_state;
1071  goto yy_match;
1072  }
1073 
1074  else
1075  {
1076  yy_cp = yy_c_buf_p;
1077  goto yy_find_action;
1078  }
1079  }
1080 
1081  else switch ( yy_get_next_buffer() )
1082  {
1083  case EOB_ACT_END_OF_FILE:
1084  {
1085  yy_did_buffer_switch_on_eof = 0;
1086 
1087  if ( yywrap() )
1088  {
1089  /* Note: because we've taken care in
1090  * yy_get_next_buffer() to have set up
1091  * yytext, we can now set up
1092  * yy_c_buf_p so that if some total
1093  * hoser (like flex itself) wants to
1094  * call the scanner after we return the
1095  * YY_NULL, it'll still work - another
1096  * YY_NULL will get returned.
1097  */
1098  yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1099 
1100  yy_act = YY_STATE_EOF(YY_START);
1101  goto do_action;
1102  }
1103 
1104  else
1105  {
1106  if ( ! yy_did_buffer_switch_on_eof )
1107  YY_NEW_FILE;
1108  }
1109  break;
1110  }
1111 
1112  case EOB_ACT_CONTINUE_SCAN:
1113  yy_c_buf_p =
1114  yytext_ptr + yy_amount_of_matched_text;
1115 
1116  yy_current_state = yy_get_previous_state();
1117 
1118  yy_cp = yy_c_buf_p;
1119  yy_bp = yytext_ptr + YY_MORE_ADJ;
1120  goto yy_match;
1121 
1122  case EOB_ACT_LAST_MATCH:
1123  yy_c_buf_p =
1124  &yy_current_buffer->yy_ch_buf[yy_n_chars];
1125 
1126  yy_current_state = yy_get_previous_state();
1127 
1128  yy_cp = yy_c_buf_p;
1129  yy_bp = yytext_ptr + YY_MORE_ADJ;
1130  goto yy_find_action;
1131  }
1132  break;
1133  }
1134 
1135  default:
1136  YY_FATAL_ERROR(
1137  "fatal flex scanner internal error--no action found" );
1138  } /* end of action switch */
1139  } /* end of scanning one token */
1140  } /* end of yylex */
1141 
1142 
1143 /* yy_get_next_buffer - try to read in a new buffer
1144  *
1145  * Returns a code representing an action:
1146  * EOB_ACT_LAST_MATCH -
1147  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1148  * EOB_ACT_END_OF_FILE - end of file
1149  */
1150 
1151 static int yy_get_next_buffer()
1152  {
1153  char *dest = yy_current_buffer->yy_ch_buf;
1154  char *source = yytext_ptr;
1155  int number_to_move, i;
1156  int ret_val;
1157 
1158  if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1159  YY_FATAL_ERROR(
1160  "fatal flex scanner internal error--end of buffer missed" );
1161 
1162  if ( yy_current_buffer->yy_fill_buffer == 0 )
1163  { /* Don't try to fill the buffer, so this is an EOF. */
1164  if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1165  {
1166  /* We matched a single character, the EOB, so
1167  * treat this as a final EOF.
1168  */
1169  return EOB_ACT_END_OF_FILE;
1170  }
1171 
1172  else
1173  {
1174  /* We matched some text prior to the EOB, first
1175  * process it.
1176  */
1177  return EOB_ACT_LAST_MATCH;
1178  }
1179  }
1180 
1181  /* Try to read more data. */
1182 
1183  /* First move last chars to start of buffer. */
1184  number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1185 
1186  for ( i = 0; i < number_to_move; ++i )
1187  *(dest++) = *(source++);
1188 
1189  if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1190  /* don't do the read, it's not guaranteed to return an EOF,
1191  * just force an EOF
1192  */
1193  yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1194 
1195  else
1196  {
1197  int num_to_read =
1198  yy_current_buffer->yy_buf_size - number_to_move - 1;
1199 
1200  while ( num_to_read <= 0 )
1201  { /* Not enough room in the buffer - grow it. */
1202 #ifdef YY_USES_REJECT
1203  YY_FATAL_ERROR(
1204 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1205 #else
1206 
1207  /* just a shorter name for the current buffer */
1208  YY_BUFFER_STATE b = yy_current_buffer;
1209 
1210  int yy_c_buf_p_offset =
1211  (int) (yy_c_buf_p - b->yy_ch_buf);
1212 
1213  if ( b->yy_is_our_buffer )
1214  {
1215  int new_size = b->yy_buf_size * 2;
1216 
1217  if ( new_size <= 0 )
1218  b->yy_buf_size += b->yy_buf_size / 8;
1219  else
1220  b->yy_buf_size *= 2;
1221 
1222  b->yy_ch_buf = (char *)
1223  /* Include room in for 2 EOB chars. */
1224  yy_flex_realloc( (void *) b->yy_ch_buf,
1225  b->yy_buf_size + 2 );
1226  }
1227  else
1228  /* Can't grow it, we don't own it. */
1229  b->yy_ch_buf = 0;
1230 
1231  if ( ! b->yy_ch_buf )
1232  YY_FATAL_ERROR(
1233  "fatal error - scanner input buffer overflow" );
1234 
1235  yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1236 
1237  num_to_read = yy_current_buffer->yy_buf_size -
1238  number_to_move - 1;
1239 #endif
1240  }
1241 
1242  if ( num_to_read > YY_READ_BUF_SIZE )
1243  num_to_read = YY_READ_BUF_SIZE;
1244 
1245  /* Read in more data. */
1246  YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1247  yy_n_chars, num_to_read );
1248 
1249  yy_current_buffer->yy_n_chars = yy_n_chars;
1250  }
1251 
1252  if ( yy_n_chars == 0 )
1253  {
1254  if ( number_to_move == YY_MORE_ADJ )
1255  {
1256  ret_val = EOB_ACT_END_OF_FILE;
1257  yyrestart( yyin );
1258  }
1259 
1260  else
1261  {
1262  ret_val = EOB_ACT_LAST_MATCH;
1263  yy_current_buffer->yy_buffer_status =
1264  YY_BUFFER_EOF_PENDING;
1265  }
1266  }
1267 
1268  else
1269  ret_val = EOB_ACT_CONTINUE_SCAN;
1270 
1271  yy_n_chars += number_to_move;
1272  yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1273  yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1274 
1275  yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1276 
1277  return ret_val;
1278  }
1279 
1280 
1281 /* yy_get_previous_state - get the state just before the EOB char was reached */
1282 
1283 static yy_state_type yy_get_previous_state()
1284  {
1285  yy_state_type yy_current_state;
1286  char *yy_cp;
1287 
1288  yy_current_state = yy_start;
1289 
1290  for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1291  {
1292  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1293  if ( yy_accept[yy_current_state] )
1294  {
1295  yy_last_accepting_state = yy_current_state;
1296  yy_last_accepting_cpos = yy_cp;
1297  }
1298  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1299  {
1300  yy_current_state = (int) yy_def[yy_current_state];
1301  if ( yy_current_state >= 172 )
1302  yy_c = yy_meta[(unsigned int) yy_c];
1303  }
1304  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1305  }
1306 
1307  return yy_current_state;
1308  }
1309 
1310 
1311 /* yy_try_NUL_trans - try to make a transition on the NUL character
1312  *
1313  * synopsis
1314  * next_state = yy_try_NUL_trans( current_state );
1315  */
1316 
1317 #ifdef YY_USE_PROTOS
1318 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1319 #else
1320 static yy_state_type yy_try_NUL_trans( yy_current_state )
1321 yy_state_type yy_current_state;
1322 #endif
1323  {
1324  int yy_is_jam;
1325  char *yy_cp = yy_c_buf_p;
1326 
1327  YY_CHAR yy_c = 1;
1328  if ( yy_accept[yy_current_state] )
1329  {
1330  yy_last_accepting_state = yy_current_state;
1331  yy_last_accepting_cpos = yy_cp;
1332  }
1333  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1334  {
1335  yy_current_state = (int) yy_def[yy_current_state];
1336  if ( yy_current_state >= 172 )
1337  yy_c = yy_meta[(unsigned int) yy_c];
1338  }
1339  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1340  yy_is_jam = (yy_current_state == 171);
1341 
1342  return yy_is_jam ? 0 : yy_current_state;
1343  }
1344 
1345 
1346 #ifndef YY_NO_UNPUT
1347 #ifdef YY_USE_PROTOS
1348 static void yyunput( int c, char *yy_bp )
1349 #else
1350 static void yyunput( c, yy_bp )
1351 int c;
1352 char *yy_bp;
1353 #endif
1354  {
1355  char *yy_cp = yy_c_buf_p;
1356 
1357  /* undo effects of setting up yytext */
1358  *yy_cp = yy_hold_char;
1359 
1360  if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1361  { /* need to shift things up to make room */
1362  /* +2 for EOB chars. */
1363  int number_to_move = yy_n_chars + 2;
1364  char *dest = &yy_current_buffer->yy_ch_buf[
1365  yy_current_buffer->yy_buf_size + 2];
1366  char *source =
1367  &yy_current_buffer->yy_ch_buf[number_to_move];
1368 
1369  while ( source > yy_current_buffer->yy_ch_buf )
1370  *--dest = *--source;
1371 
1372  yy_cp += (int) (dest - source);
1373  yy_bp += (int) (dest - source);
1374  yy_current_buffer->yy_n_chars =
1375  yy_n_chars = yy_current_buffer->yy_buf_size;
1376 
1377  if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1378  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1379  }
1380 
1381  *--yy_cp = (char) c;
1382 
1383 
1384  yytext_ptr = yy_bp;
1385  yy_hold_char = *yy_cp;
1386  yy_c_buf_p = yy_cp;
1387  }
1388 #endif /* ifndef YY_NO_UNPUT */
1389 
1390 
1391 #ifdef __cplusplus
1392 static int yyinput()
1393 #else
1394 static int input()
1395 #endif
1396  {
1397  int c;
1398 
1399  *yy_c_buf_p = yy_hold_char;
1400 
1401  if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1402  {
1403  /* yy_c_buf_p now points to the character we want to return.
1404  * If this occurs *before* the EOB characters, then it's a
1405  * valid NUL; if not, then we've hit the end of the buffer.
1406  */
1407  if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1408  /* This was really a NUL. */
1409  *yy_c_buf_p = '\0';
1410 
1411  else
1412  { /* need more input */
1413  int offset = yy_c_buf_p - yytext_ptr;
1414  ++yy_c_buf_p;
1415 
1416  switch ( yy_get_next_buffer() )
1417  {
1418  case EOB_ACT_LAST_MATCH:
1419  /* This happens because yy_g_n_b()
1420  * sees that we've accumulated a
1421  * token and flags that we need to
1422  * try matching the token before
1423  * proceeding. But for input(),
1424  * there's no matching to consider.
1425  * So convert the EOB_ACT_LAST_MATCH
1426  * to EOB_ACT_END_OF_FILE.
1427  */
1428 
1429  /* Reset buffer status. */
1430  yyrestart( yyin );
1431 
1432  /* fall through */
1433 
1434  case EOB_ACT_END_OF_FILE:
1435  {
1436  if ( yywrap() )
1437  return EOF;
1438 
1439  if ( ! yy_did_buffer_switch_on_eof )
1440  YY_NEW_FILE;
1441 #ifdef __cplusplus
1442  return yyinput();
1443 #else
1444  return input();
1445 #endif
1446  }
1447 
1448  case EOB_ACT_CONTINUE_SCAN:
1449  yy_c_buf_p = yytext_ptr + offset;
1450  break;
1451  }
1452  }
1453  }
1454 
1455  c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1456  *yy_c_buf_p = '\0'; /* preserve yytext */
1457  yy_hold_char = *++yy_c_buf_p;
1458 
1459 
1460  return c;
1461  }
1462 
1463 
1464 #ifdef YY_USE_PROTOS
1465 void yyrestart( FILE *input_file )
1466 #else
1467 void yyrestart( input_file )
1468 FILE *input_file;
1469 #endif
1470  {
1471  if ( ! yy_current_buffer )
1472  yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1473 
1474  yy_init_buffer( yy_current_buffer, input_file );
1475  yy_load_buffer_state();
1476  }
1477 
1478 
1479 #ifdef YY_USE_PROTOS
1480 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1481 #else
1482 void yy_switch_to_buffer( new_buffer )
1483 YY_BUFFER_STATE new_buffer;
1484 #endif
1485  {
1486  if ( yy_current_buffer == new_buffer )
1487  return;
1488 
1489  if ( yy_current_buffer )
1490  {
1491  /* Flush out information for old buffer. */
1492  *yy_c_buf_p = yy_hold_char;
1493  yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1494  yy_current_buffer->yy_n_chars = yy_n_chars;
1495  }
1496 
1497  yy_current_buffer = new_buffer;
1498  yy_load_buffer_state();
1499 
1500  /* We don't actually know whether we did this switch during
1501  * EOF (yywrap()) processing, but the only time this flag
1502  * is looked at is after yywrap() is called, so it's safe
1503  * to go ahead and always set it.
1504  */
1505  yy_did_buffer_switch_on_eof = 1;
1506  }
1507 
1508 
1509 #ifdef YY_USE_PROTOS
1510 void yy_load_buffer_state( void )
1511 #else
1512 void yy_load_buffer_state()
1513 #endif
1514  {
1515  yy_n_chars = yy_current_buffer->yy_n_chars;
1516  yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1517  yyin = yy_current_buffer->yy_input_file;
1518  yy_hold_char = *yy_c_buf_p;
1519  }
1520 
1521 
1522 #ifdef YY_USE_PROTOS
1523 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1524 #else
1525 YY_BUFFER_STATE yy_create_buffer( file, size )
1526 FILE *file;
1527 int size;
1528 #endif
1529  {
1530  YY_BUFFER_STATE b;
1531 
1532  b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1533  if ( ! b )
1534  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1535 
1536  b->yy_buf_size = size;
1537 
1538  /* yy_ch_buf has to be 2 characters longer than the size given because
1539  * we need to put in 2 end-of-buffer characters.
1540  */
1541  b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1542  if ( ! b->yy_ch_buf )
1543  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1544 
1545  b->yy_is_our_buffer = 1;
1546 
1547  yy_init_buffer( b, file );
1548 
1549  return b;
1550  }
1551 
1552 
1553 #ifdef YY_USE_PROTOS
1554 void yy_delete_buffer( YY_BUFFER_STATE b )
1555 #else
1556 void yy_delete_buffer( b )
1557 YY_BUFFER_STATE b;
1558 #endif
1559  {
1560  if ( ! b )
1561  return;
1562 
1563  if ( b == yy_current_buffer )
1564  yy_current_buffer = (YY_BUFFER_STATE) 0;
1565 
1566  if ( b->yy_is_our_buffer )
1567  yy_flex_free( (void *) b->yy_ch_buf );
1568 
1569  yy_flex_free( (void *) b );
1570  }
1571 
1572 
1573 
1574 #ifdef YY_USE_PROTOS
1575 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1576 #else
1577 void yy_init_buffer( b, file )
1578 YY_BUFFER_STATE b;
1579 FILE *file;
1580 #endif
1581 
1582 
1583  {
1584  yy_flush_buffer( b );
1585 
1586  b->yy_input_file = file;
1587  b->yy_fill_buffer = 1;
1588 
1589 #if YY_ALWAYS_INTERACTIVE
1590  b->yy_is_interactive = 1;
1591 #else
1592 #if YY_NEVER_INTERACTIVE
1593  b->yy_is_interactive = 0;
1594 #else
1595  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1596 #endif
1597 #endif
1598  }
1599 
1600 
1601 #ifdef YY_USE_PROTOS
1602 void yy_flush_buffer( YY_BUFFER_STATE b )
1603 #else
1604 void yy_flush_buffer( b )
1605 YY_BUFFER_STATE b;
1606 #endif
1607 
1608  {
1609  if ( ! b )
1610  return;
1611 
1612  b->yy_n_chars = 0;
1613 
1614  /* We always need two end-of-buffer characters. The first causes
1615  * a transition to the end-of-buffer state. The second causes
1616  * a jam in that state.
1617  */
1618  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1619  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1620 
1621  b->yy_buf_pos = &b->yy_ch_buf[0];
1622 
1623  b->yy_at_bol = 1;
1624  b->yy_buffer_status = YY_BUFFER_NEW;
1625 
1626  if ( b == yy_current_buffer )
1627  yy_load_buffer_state();
1628  }
1629 
1630 
1631 #ifndef YY_NO_SCAN_BUFFER
1632 #ifdef YY_USE_PROTOS
1633 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1634 #else
1635 YY_BUFFER_STATE yy_scan_buffer( base, size )
1636 char *base;
1637 yy_size_t size;
1638 #endif
1639  {
1640  YY_BUFFER_STATE b;
1641 
1642  if ( size < 2 ||
1643  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1644  base[size-1] != YY_END_OF_BUFFER_CHAR )
1645  /* They forgot to leave room for the EOB's. */
1646  return 0;
1647 
1648  b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1649  if ( ! b )
1650  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1651 
1652  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1653  b->yy_buf_pos = b->yy_ch_buf = base;
1654  b->yy_is_our_buffer = 0;
1655  b->yy_input_file = 0;
1656  b->yy_n_chars = b->yy_buf_size;
1657  b->yy_is_interactive = 0;
1658  b->yy_at_bol = 1;
1659  b->yy_fill_buffer = 0;
1660  b->yy_buffer_status = YY_BUFFER_NEW;
1661 
1662  yy_switch_to_buffer( b );
1663 
1664  return b;
1665  }
1666 #endif
1667 
1668 
1669 #ifndef YY_NO_SCAN_STRING
1670 #ifdef YY_USE_PROTOS
1671 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1672 #else
1673 YY_BUFFER_STATE yy_scan_string( yy_str )
1674 yyconst char *yy_str;
1675 #endif
1676  {
1677  int len;
1678  for ( len = 0; yy_str[len]; ++len )
1679  ;
1680 
1681  return yy_scan_bytes( yy_str, len );
1682  }
1683 #endif
1684 
1685 
1686 #ifndef YY_NO_SCAN_BYTES
1687 #ifdef YY_USE_PROTOS
1688 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1689 #else
1690 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1691 yyconst char *bytes;
1692 int len;
1693 #endif
1694  {
1695  YY_BUFFER_STATE b;
1696  char *buf;
1697  yy_size_t n;
1698  int i;
1699 
1700  /* Get memory for full buffer, including space for trailing EOB's. */
1701  n = len + 2;
1702  buf = (char *) yy_flex_alloc( n );
1703  if ( ! buf )
1704  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1705 
1706  for ( i = 0; i < len; ++i )
1707  buf[i] = bytes[i];
1708 
1709  buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1710 
1711  b = yy_scan_buffer( buf, n );
1712  if ( ! b )
1713  YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1714 
1715  /* It's okay to grow etc. this buffer, and we should throw it
1716  * away when we're done.
1717  */
1718  b->yy_is_our_buffer = 1;
1719 
1720  return b;
1721  }
1722 #endif
1723 
1724 
1725 #ifndef YY_NO_PUSH_STATE
1726 #ifdef YY_USE_PROTOS
1727 static void yy_push_state( int new_state )
1728 #else
1729 static void yy_push_state( new_state )
1730 int new_state;
1731 #endif
1732  {
1733  if ( yy_start_stack_ptr >= yy_start_stack_depth )
1734  {
1735  yy_size_t new_size;
1736 
1737  yy_start_stack_depth += YY_START_STACK_INCR;
1738  new_size = yy_start_stack_depth * sizeof( int );
1739 
1740  if ( ! yy_start_stack )
1741  yy_start_stack = (int *) yy_flex_alloc( new_size );
1742 
1743  else
1744  yy_start_stack = (int *) yy_flex_realloc(
1745  (void *) yy_start_stack, new_size );
1746 
1747  if ( ! yy_start_stack )
1748  YY_FATAL_ERROR(
1749  "out of memory expanding start-condition stack" );
1750  }
1751 
1752  yy_start_stack[yy_start_stack_ptr++] = YY_START;
1753 
1754  BEGIN(new_state);
1755  }
1756 #endif
1757 
1758 
1759 #ifndef YY_NO_POP_STATE
1760 static void yy_pop_state()
1761  {
1762  if ( --yy_start_stack_ptr < 0 )
1763  YY_FATAL_ERROR( "start-condition stack underflow" );
1764 
1765  BEGIN(yy_start_stack[yy_start_stack_ptr]);
1766  }
1767 #endif
1768 
1769 
1770 #ifndef YY_NO_TOP_STATE
1771 static int yy_top_state()
1772  {
1773  return yy_start_stack[yy_start_stack_ptr - 1];
1774  }
1775 #endif
1776 
1777 #ifndef YY_EXIT_FAILURE
1778 #define YY_EXIT_FAILURE 2
1779 #endif
1780 
1781 #ifdef YY_USE_PROTOS
1782 static void yy_fatal_error( yyconst char msg[] )
1783 #else
1784 static void yy_fatal_error( msg )
1785 char msg[];
1786 #endif
1787  {
1788  (void) fprintf( stderr, "[ppdscanner] %s\n", msg );
1789  exit( YY_EXIT_FAILURE );
1790  }
1791 
1792 
1793 
1794 /* Redefine yyless() so it works in section 3 code. */
1795 
1796 #undef yyless
1797 #define yyless(n) \
1798  do \
1799  { \
1800  /* Undo effects of setting up yytext. */ \
1801  yytext[yyleng] = yy_hold_char; \
1802  yy_c_buf_p = yytext + n; \
1803  yy_hold_char = *yy_c_buf_p; \
1804  *yy_c_buf_p = '\0'; \
1805  yyleng = n; \
1806  } \
1807  while ( 0 )
1808 
1809 
1810 /* Internal utility routines. */
1811 
1812 #ifndef yytext_ptr
1813 #ifdef YY_USE_PROTOS
1814 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1815 #else
1816 static void yy_flex_strncpy( s1, s2, n )
1817 char *s1;
1818 yyconst char *s2;
1819 int n;
1820 #endif
1821  {
1822  int i;
1823  for ( i = 0; i < n; ++i )
1824  s1[i] = s2[i];
1825  }
1826 #endif
1827 
1828 #ifdef YY_NEED_STRLEN
1829 #ifdef YY_USE_PROTOS
1830 static int yy_flex_strlen( yyconst char *s )
1831 #else
1832 static int yy_flex_strlen( s )
1833 yyconst char *s;
1834 #endif
1835  {
1836  int n;
1837  for ( n = 0; s[n]; ++n )
1838  ;
1839 
1840  return n;
1841  }
1842 #endif
1843 
1844 
1845 #ifdef YY_USE_PROTOS
1846 static void *yy_flex_alloc( yy_size_t size )
1847 #else
1848 static void *yy_flex_alloc( size )
1849 yy_size_t size;
1850 #endif
1851  {
1852  return (void *) malloc( size );
1853  }
1854 
1855 #ifdef YY_USE_PROTOS
1856 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1857 #else
1858 static void *yy_flex_realloc( ptr, size )
1859 void *ptr;
1860 yy_size_t size;
1861 #endif
1862  {
1863  /* The cast to (char *) in the following accommodates both
1864  * implementations that use char* generic pointers, and those
1865  * that use void* generic pointers. It works with the latter
1866  * because both ANSI C and C++ allow castless assignment from
1867  * any pointer type to void*, and deal with argument conversions
1868  * as though doing an assignment.
1869  */
1870  return (void *) realloc( (char *) ptr, size );
1871  }
1872 
1873 #ifdef YY_USE_PROTOS
1874 static void yy_flex_free( void *ptr )
1875 #else
1876 static void yy_flex_free( ptr )
1877 void *ptr;
1878 #endif
1879  {
1880  free( ptr );
1881  }
1882 
1883 #if YY_MAIN
1884 int main()
1885  {
1886  yylex();
1887  return 0;
1888  }
1889 #endif
1890 #line 123 "./ppdscanner.l"
1891 
1892 
1893 void tdeprint_ppdscanner_init(TQIODevice *d)
1894 {
1895  tdeprint_ppdscanner_device = d;
1896  tdeprint_ppdscanner_lno = 1;
1897 }
1898 
1899 void tdeprint_ppdscanner_terminate( bool deleteIt )
1900 {
1901  if (deleteIt)
1902  delete tdeprint_ppdscanner_device;
1903  tdeprint_ppdscanner_device = NULL;
1904 }
1905 
1906 int tdeprint_ppdscanner_numberoflines()
1907 {
1908  return tdeprint_ppdscanner_lno;
1909 }

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.