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

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.8.13
This website is maintained by Timothy Pearson.