• 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
117typedef struct yy_buffer_state *YY_BUFFER_STATE;
118
119extern int yyleng;
120extern 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 */
159typedef unsigned int yy_size_t;
160
161
162struct 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
219static 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. */
229static char yy_hold_char;
230
231static int yy_n_chars; /* number of characters read into yy_ch_buf */
232
233
234int yyleng;
235
236/* Points to current character in buffer. */
237static char *yy_c_buf_p = (char *) 0;
238static int yy_init = 1; /* whether we need to initialize */
239static 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 */
244static int yy_did_buffer_switch_on_eof;
245
246void yyrestart YY_PROTO(( FILE *input_file ));
247
248void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
249void yy_load_buffer_state YY_PROTO(( void ));
250YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
251void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
252void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
253void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
255
256YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
257YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
258YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
259
260static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
261static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
262static 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
285typedef unsigned char YY_CHAR;
286FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
287typedef int yy_state_type;
288extern char *yytext;
289#define yytext_ptr yytext
290
291static yy_state_type yy_get_previous_state YY_PROTO(( void ));
292static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
293static int yy_get_next_buffer YY_PROTO(( void ));
294static 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
308static 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
331static 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
363static 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
372static 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
398static 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
424static 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
466static 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
508static yy_state_type yy_last_accepting_state;
509static 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
518char *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
548TQIODevice *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 { \
556 result = 0; \
557 } \
558 } \
559 else \
560 { \
561 result = 0; \
562 } \
563 }
564int tdeprint_ppdscanner_lno = 0;
565
566#if 0
567#define QDEBUG0(s) tqDebug(s)
568#define QDEBUG1(s,a) tqDebug(s,a)
569#else
570#define QDEBUG0(s)
571#define QDEBUG1(s,a)
572#endif
573#define option 1
574#define value 2
575#define translation_1 3
576#define translation_2 4
577#define constr 5
578
579#line 576 "./ppdscanner.cpp"
580
581/* Macros after this point can all be overridden by user definitions in
582 * section 1.
583 */
584
585#ifndef YY_SKIP_YYWRAP
586#ifdef __cplusplus
587extern "C" int yywrap YY_PROTO(( void ));
588#else
589extern int yywrap YY_PROTO(( void ));
590#endif
591#endif
592
593#ifndef YY_NO_UNPUT
594static void yyunput YY_PROTO(( int c, char *buf_ptr ));
595#endif
596
597#ifndef yytext_ptr
598static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
599#endif
600
601#ifdef YY_NEED_STRLEN
602static int yy_flex_strlen YY_PROTO(( yyconst char * ));
603#endif
604
605#ifndef YY_NO_INPUT
606#ifdef __cplusplus
607static int yyinput YY_PROTO(( void ));
608#else
609static int input YY_PROTO(( void ));
610#endif
611#endif
612
613#if YY_STACK_USED
614static int yy_start_stack_ptr = 0;
615static int yy_start_stack_depth = 0;
616static int *yy_start_stack = 0;
617#ifndef YY_NO_PUSH_STATE
618static void yy_push_state YY_PROTO(( int new_state ));
619#endif
620#ifndef YY_NO_POP_STATE
621static void yy_pop_state YY_PROTO(( void ));
622#endif
623#ifndef YY_NO_TOP_STATE
624static int yy_top_state YY_PROTO(( void ));
625#endif
626
627#else
628#define YY_NO_PUSH_STATE 1
629#define YY_NO_POP_STATE 1
630#define YY_NO_TOP_STATE 1
631#endif
632
633#ifdef YY_MALLOC_DECL
634YY_MALLOC_DECL
635#else
636#if __STDC__
637#ifndef __cplusplus
638#include <stdlib.h>
639#endif
640#else
641/* Just try to get by without declaring the routines. This will fail
642 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
643 * or sizeof(void*) != sizeof(int).
644 */
645#endif
646#endif
647
648/* Amount of stuff to slurp up with each read. */
649#ifndef YY_READ_BUF_SIZE
650#define YY_READ_BUF_SIZE 8192
651#endif
652
653/* Copy whatever the last rule matched to the standard output. */
654
655#ifndef ECHO
656/* This used to be an fputs(), but since the string might contain NUL's,
657 * we now use fwrite().
658 */
659#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
660#endif
661
662/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
663 * is returned in "result".
664 */
665#ifndef YY_INPUT
666#define YY_INPUT(buf,result,max_size) \
667 if ( yy_current_buffer->yy_is_interactive ) \
668 { \
669 int c = '*', n; \
670 for ( n = 0; n < max_size && \
671 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
672 buf[n] = (char) c; \
673 if ( c == '\n' ) \
674 buf[n++] = (char) c; \
675 if ( c == EOF && ferror( yyin ) ) \
676 YY_FATAL_ERROR( "input in flex scanner failed" ); \
677 result = n; \
678 } \
679 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
680 && ferror( yyin ) ) \
681 YY_FATAL_ERROR( "input in flex scanner failed" );
682#endif
683
684/* No semi-colon after return; correct usage is to write "yyterminate();" -
685 * we don't want an extra ';' after the "return" because that will cause
686 * some compilers to complain about unreachable statements.
687 */
688#ifndef yyterminate
689#define yyterminate() return YY_NULL
690#endif
691
692/* Number of entries by which start-condition stack grows. */
693#ifndef YY_START_STACK_INCR
694#define YY_START_STACK_INCR 25
695#endif
696
697/* Report a fatal error. */
698#ifndef YY_FATAL_ERROR
699#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
700#endif
701
702/* Default declaration of generated scanner - a define so the user can
703 * easily add parameters.
704 */
705#ifndef YY_DECL
706#define YY_DECL int yylex YY_PROTO(( void ))
707#endif
708
709/* Code executed at the beginning of each rule, after yytext and yyleng
710 * have been set up.
711 */
712#ifndef YY_USER_ACTION
713#define YY_USER_ACTION
714#endif
715
716/* Code executed at the end of each rule. */
717#ifndef YY_BREAK
718#define YY_BREAK break;
719#endif
720
721#define YY_RULE_SETUP \
722 YY_USER_ACTION
723
724YY_DECL
725 {
726 yy_state_type yy_current_state;
727 char *yy_cp, *yy_bp;
728 int yy_act;
729
730#line 59 "./ppdscanner.l"
731
732
736#line 733 "./ppdscanner.cpp"
737
738 if ( yy_init )
739 {
740 yy_init = 0;
741
742#ifdef YY_USER_INIT
743 YY_USER_INIT;
744#endif
745
746 if ( ! yy_start )
747 yy_start = 1; /* first start state */
748
749 if ( ! yyin )
750 yyin = stdin;
751
752 if ( ! yyout )
753 yyout = stdout;
754
755 if ( ! yy_current_buffer )
756 yy_current_buffer =
757 yy_create_buffer( yyin, YY_BUF_SIZE );
758
759 yy_load_buffer_state();
760 }
761
762 while ( 1 ) /* loops until end-of-file is reached */
763 {
764 yy_cp = yy_c_buf_p;
765
766 /* Support of yytext. */
767 *yy_cp = yy_hold_char;
768
769 /* yy_bp points to the position in yy_ch_buf of the start of
770 * the current run.
771 */
772 yy_bp = yy_cp;
773
774 yy_current_state = yy_start;
775yy_match:
776 do
777 {
778 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
779 if ( yy_accept[yy_current_state] )
780 {
781 yy_last_accepting_state = yy_current_state;
782 yy_last_accepting_cpos = yy_cp;
783 }
784 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
785 {
786 yy_current_state = (int) yy_def[yy_current_state];
787 if ( yy_current_state >= 172 )
788 yy_c = yy_meta[(unsigned int) yy_c];
789 }
790 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
791 ++yy_cp;
792 }
793 while ( yy_base[yy_current_state] != 303 );
794
795yy_find_action:
796 yy_act = yy_accept[yy_current_state];
797 if ( yy_act == 0 )
798 { /* have to back up */
799 yy_cp = yy_last_accepting_cpos;
800 yy_current_state = yy_last_accepting_state;
801 yy_act = yy_accept[yy_current_state];
802 }
803
804 YY_DO_BEFORE_ACTION;
805
806
807do_action: /* This label is used only to access EOF actions. */
808
809
810 switch ( yy_act )
811 { /* beginning of action switch */
812 case 0: /* must back up */
813 /* undo the effects of YY_DO_BEFORE_ACTION */
814 *yy_cp = yy_hold_char;
815 yy_cp = yy_last_accepting_cpos;
816 yy_current_state = yy_last_accepting_state;
817 goto yy_find_action;
818
819case 1:
820#line 65 "./ppdscanner.l"
821case 2:
822YY_RULE_SETUP
823#line 65 "./ppdscanner.l"
824{ QDEBUG0("Open UI"); BEGIN(option); return OPENUI; }
825 YY_BREAK
826case 3:
827#line 67 "./ppdscanner.l"
828case 4:
829YY_RULE_SETUP
830#line 67 "./ppdscanner.l"
831{ QDEBUG0("Close UI"); BEGIN(value); return CLOSEUI; }
832 YY_BREAK
833case 5:
834YY_RULE_SETUP
835#line 68 "./ppdscanner.l"
836{ QDEBUG0("Open group"); BEGIN(option); return OPENGROUP; }
837 YY_BREAK
838case 6:
839YY_RULE_SETUP
840#line 69 "./ppdscanner.l"
841{ QDEBUG0("Close group"); BEGIN(option); return CLOSEGROUP; }
842 YY_BREAK
843case 7:
844YY_RULE_SETUP
845#line 70 "./ppdscanner.l"
846{ yylval = yytext+9; BEGIN(option); return DEFAULT; }
847 YY_BREAK
848case 8:
849YY_RULE_SETUP
850#line 71 "./ppdscanner.l"
851{ yylval = yytext+8; BEGIN(option); return DEFAULT; }
852 YY_BREAK
853case 9:
854#line 73 "./ppdscanner.l"
855case 10:
856YY_RULE_SETUP
857#line 73 "./ppdscanner.l"
858{ BEGIN(constr); return CONSTRAINT; }
859 YY_BREAK
860case 11:
861YY_RULE_SETUP
862#line 74 "./ppdscanner.l"
863{ BEGIN(option); return PAPERDIM; }
864 YY_BREAK
865case 12:
866YY_RULE_SETUP
867#line 75 "./ppdscanner.l"
868{ BEGIN(option); return IMGAREA; }
869 YY_BREAK
870case 13:
871YY_RULE_SETUP
872#line 76 "./ppdscanner.l"
873{ /* eat up */ }
874 YY_BREAK
875case 14:
876*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
877yy_c_buf_p = yy_cp -= 1;
878YY_DO_BEFORE_ACTION; /* set up yytext again */
879YY_RULE_SETUP
880#line 78 "./ppdscanner.l"
881{ yylval = yytext+12; return FOODATA; }
882 YY_BREAK
883case 15:
884YY_RULE_SETUP
885#line 79 "./ppdscanner.l"
886{ QDEBUG0("Comment"); return COMMENT; }
887 YY_BREAK
888case 16:
889YY_RULE_SETUP
890#line 80 "./ppdscanner.l"
891{ yylval = yytext+1; QDEBUG1("Main keyword: %s",yytext+1); BEGIN(option); return KEYWORD; }
892 YY_BREAK
896case 17:
897YY_RULE_SETUP
898#line 85 "./ppdscanner.l"
899{ yylval = yytext; QDEBUG1("Option: %s",yytext); return OPTION; }
900 YY_BREAK
901case 18:
902YY_RULE_SETUP
903#line 86 "./ppdscanner.l"
904{ BEGIN(value); return ':'; }
905 YY_BREAK
906case 19:
907YY_RULE_SETUP
908#line 87 "./ppdscanner.l"
909{ tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
910 YY_BREAK
911case 20:
912YY_RULE_SETUP
913#line 88 "./ppdscanner.l"
914{ BEGIN(translation_1); return '/'; }
915 YY_BREAK
919case 21:
920YY_RULE_SETUP
921#line 93 "./ppdscanner.l"
922{ yylval = yytext; QDEBUG1("Translation: %s",yytext); return TRANSLATION; }
923 YY_BREAK
924case 22:
925YY_RULE_SETUP
926#line 94 "./ppdscanner.l"
927{ BEGIN(value); return ':'; }
928 YY_BREAK
929case 23:
930YY_RULE_SETUP
931#line 95 "./ppdscanner.l"
932{ tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
933 YY_BREAK
937case 24:
938YY_RULE_SETUP
939#line 100 "./ppdscanner.l"
940{ yylval = yytext; tdeprint_ppdscanner_lno += yylval[0].contains('\n'); QDEBUG1("Quoted value: %s",yytext); return QUOTED; }
941 YY_BREAK
942case 25:
943YY_RULE_SETUP
944#line 101 "./ppdscanner.l"
945{ yylval = yytext; QDEBUG1("String part: %s",yytext); return STRINGPART; }
946 YY_BREAK
947case 26:
948YY_RULE_SETUP
949#line 102 "./ppdscanner.l"
950{ BEGIN(translation_2); return '/'; }
951 YY_BREAK
952case 27:
953YY_RULE_SETUP
954#line 103 "./ppdscanner.l"
955{ tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
956 YY_BREAK
957case 28:
958YY_RULE_SETUP
959#line 104 "./ppdscanner.l"
960{ /* stay in the same state */ return ':'; }
961 YY_BREAK
965case 29:
966YY_RULE_SETUP
967#line 109 "./ppdscanner.l"
968{ yylval = yytext; QDEBUG1("Translation: %s",yytext); return TRANSLATION; }
969 YY_BREAK
970case 30:
971YY_RULE_SETUP
972#line 110 "./ppdscanner.l"
973{ tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
974 YY_BREAK
978case 31:
979YY_RULE_SETUP
980#line 115 "./ppdscanner.l"
981{ return ':'; }
982 YY_BREAK
983case 32:
984YY_RULE_SETUP
985#line 116 "./ppdscanner.l"
986{ yylval = yytext+1; QDEBUG1("Constraint keyword: %s",yytext); return KEYWORD; }
987 YY_BREAK
988case 33:
989YY_RULE_SETUP
990#line 117 "./ppdscanner.l"
991{ yylval = yytext; QDEBUG1("Constraint option: %s",yytext); return OPTION; }
992 YY_BREAK
993case 34:
994YY_RULE_SETUP
995#line 118 "./ppdscanner.l"
996{ tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
997 YY_BREAK
998case 35:
999YY_RULE_SETUP
1000#line 120 "./ppdscanner.l"
1001{ tdeprint_ppdscanner_lno++; /* eat up */ }
1002 YY_BREAK
1003case 36:
1004YY_RULE_SETUP
1005#line 121 "./ppdscanner.l"
1006{ /* eat up */ }
1007 YY_BREAK
1008case 37:
1009YY_RULE_SETUP
1010#line 123 "./ppdscanner.l"
1011ECHO;
1012 YY_BREAK
1013#line 1010 "./ppdscanner.cpp"
1014case YY_STATE_EOF(INITIAL):
1015case YY_STATE_EOF(option):
1016case YY_STATE_EOF(value):
1017case YY_STATE_EOF(translation_1):
1018case YY_STATE_EOF(translation_2):
1019case YY_STATE_EOF(constr):
1020 yyterminate();
1021
1022 case YY_END_OF_BUFFER:
1023 {
1024 /* Amount of text matched not including the EOB char. */
1025 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1026
1027 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1028 *yy_cp = yy_hold_char;
1029 YY_RESTORE_YY_MORE_OFFSET
1030
1031 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1032 {
1033 /* We're scanning a new file or input source. It's
1034 * possible that this happened because the user
1035 * just pointed yyin at a new source and called
1036 * yylex(). If so, then we have to assure
1037 * consistency between yy_current_buffer and our
1038 * globals. Here is the right place to do so, because
1039 * this is the first action (other than possibly a
1040 * back-up) that will match for the new input source.
1041 */
1042 yy_n_chars = yy_current_buffer->yy_n_chars;
1043 yy_current_buffer->yy_input_file = yyin;
1044 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1045 }
1046
1047 /* Note that here we test for yy_c_buf_p "<=" to the position
1048 * of the first EOB in the buffer, since yy_c_buf_p will
1049 * already have been incremented past the NUL character
1050 * (since all states make transitions on EOB to the
1051 * end-of-buffer state). Contrast this with the test
1052 * in input().
1053 */
1054 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1055 { /* This was really a NUL. */
1056 yy_state_type yy_next_state;
1057
1058 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1059
1060 yy_current_state = yy_get_previous_state();
1061
1062 /* Okay, we're now positioned to make the NUL
1063 * transition. We couldn't have
1064 * yy_get_previous_state() go ahead and do it
1065 * for us because it doesn't know how to deal
1066 * with the possibility of jamming (and we don't
1067 * want to build jamming into it because then it
1068 * will run more slowly).
1069 */
1070
1071 yy_next_state = yy_try_NUL_trans( yy_current_state );
1072
1073 yy_bp = yytext_ptr + YY_MORE_ADJ;
1074
1075 if ( yy_next_state )
1076 {
1077 /* Consume the NUL. */
1078 yy_cp = ++yy_c_buf_p;
1079 yy_current_state = yy_next_state;
1080 goto yy_match;
1081 }
1082
1083 else
1084 {
1085 yy_cp = yy_c_buf_p;
1086 goto yy_find_action;
1087 }
1088 }
1089
1090 else switch ( yy_get_next_buffer() )
1091 {
1092 case EOB_ACT_END_OF_FILE:
1093 {
1094 yy_did_buffer_switch_on_eof = 0;
1095
1096 if ( yywrap() )
1097 {
1098 /* Note: because we've taken care in
1099 * yy_get_next_buffer() to have set up
1100 * yytext, we can now set up
1101 * yy_c_buf_p so that if some total
1102 * hoser (like flex itself) wants to
1103 * call the scanner after we return the
1104 * YY_NULL, it'll still work - another
1105 * YY_NULL will get returned.
1106 */
1107 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1108
1109 yy_act = YY_STATE_EOF(YY_START);
1110 goto do_action;
1111 }
1112
1113 else
1114 {
1115 if ( ! yy_did_buffer_switch_on_eof )
1116 YY_NEW_FILE;
1117 }
1118 break;
1119 }
1120
1121 case EOB_ACT_CONTINUE_SCAN:
1122 yy_c_buf_p =
1123 yytext_ptr + yy_amount_of_matched_text;
1124
1125 yy_current_state = yy_get_previous_state();
1126
1127 yy_cp = yy_c_buf_p;
1128 yy_bp = yytext_ptr + YY_MORE_ADJ;
1129 goto yy_match;
1130
1131 case EOB_ACT_LAST_MATCH:
1132 yy_c_buf_p =
1133 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1134
1135 yy_current_state = yy_get_previous_state();
1136
1137 yy_cp = yy_c_buf_p;
1138 yy_bp = yytext_ptr + YY_MORE_ADJ;
1139 goto yy_find_action;
1140 }
1141 break;
1142 }
1143
1144 default:
1145 YY_FATAL_ERROR(
1146 "fatal flex scanner internal error--no action found" );
1147 } /* end of action switch */
1148 } /* end of scanning one token */
1149 } /* end of yylex */
1150
1151
1152/* yy_get_next_buffer - try to read in a new buffer
1153 *
1154 * Returns a code representing an action:
1155 * EOB_ACT_LAST_MATCH -
1156 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1157 * EOB_ACT_END_OF_FILE - end of file
1158 */
1159
1160static int yy_get_next_buffer()
1161 {
1162 char *dest = yy_current_buffer->yy_ch_buf;
1163 char *source = yytext_ptr;
1164 int number_to_move, i;
1165 int ret_val;
1166
1167 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1168 YY_FATAL_ERROR(
1169 "fatal flex scanner internal error--end of buffer missed" );
1170
1171 if ( yy_current_buffer->yy_fill_buffer == 0 )
1172 { /* Don't try to fill the buffer, so this is an EOF. */
1173 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1174 {
1175 /* We matched a single character, the EOB, so
1176 * treat this as a final EOF.
1177 */
1178 return EOB_ACT_END_OF_FILE;
1179 }
1180
1181 else
1182 {
1183 /* We matched some text prior to the EOB, first
1184 * process it.
1185 */
1186 return EOB_ACT_LAST_MATCH;
1187 }
1188 }
1189
1190 /* Try to read more data. */
1191
1192 /* First move last chars to start of buffer. */
1193 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1194
1195 for ( i = 0; i < number_to_move; ++i )
1196 *(dest++) = *(source++);
1197
1198 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1199 /* don't do the read, it's not guaranteed to return an EOF,
1200 * just force an EOF
1201 */
1202 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1203
1204 else
1205 {
1206 int num_to_read =
1207 yy_current_buffer->yy_buf_size - number_to_move - 1;
1208
1209 while ( num_to_read <= 0 )
1210 { /* Not enough room in the buffer - grow it. */
1211#ifdef YY_USES_REJECT
1212 YY_FATAL_ERROR(
1213"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1214#else
1215
1216 /* just a shorter name for the current buffer */
1217 YY_BUFFER_STATE b = yy_current_buffer;
1218
1219 int yy_c_buf_p_offset =
1220 (int) (yy_c_buf_p - b->yy_ch_buf);
1221
1222 if ( b->yy_is_our_buffer )
1223 {
1224 int new_size = b->yy_buf_size * 2;
1225
1226 if ( new_size <= 0 )
1227 b->yy_buf_size += b->yy_buf_size / 8;
1228 else
1229 b->yy_buf_size *= 2;
1230
1231 b->yy_ch_buf = (char *)
1232 /* Include room in for 2 EOB chars. */
1233 yy_flex_realloc( (void *) b->yy_ch_buf,
1234 b->yy_buf_size + 2 );
1235 }
1236 else
1237 /* Can't grow it, we don't own it. */
1238 b->yy_ch_buf = 0;
1239
1240 if ( ! b->yy_ch_buf )
1241 YY_FATAL_ERROR(
1242 "fatal error - scanner input buffer overflow" );
1243
1244 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1245
1246 num_to_read = yy_current_buffer->yy_buf_size -
1247 number_to_move - 1;
1248#endif
1249 }
1250
1251 if ( num_to_read > YY_READ_BUF_SIZE )
1252 num_to_read = YY_READ_BUF_SIZE;
1253
1254 /* Read in more data. */
1255 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1256 yy_n_chars, num_to_read );
1257
1258 yy_current_buffer->yy_n_chars = yy_n_chars;
1259 }
1260
1261 if ( yy_n_chars == 0 )
1262 {
1263 if ( number_to_move == YY_MORE_ADJ )
1264 {
1265 ret_val = EOB_ACT_END_OF_FILE;
1266 yyrestart( yyin );
1267 }
1268
1269 else
1270 {
1271 ret_val = EOB_ACT_LAST_MATCH;
1272 yy_current_buffer->yy_buffer_status =
1273 YY_BUFFER_EOF_PENDING;
1274 }
1275 }
1276
1277 else
1278 ret_val = EOB_ACT_CONTINUE_SCAN;
1279
1280 yy_n_chars += number_to_move;
1281 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1282 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1283
1284 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1285
1286 return ret_val;
1287 }
1288
1289
1290/* yy_get_previous_state - get the state just before the EOB char was reached */
1291
1292static yy_state_type yy_get_previous_state()
1293 {
1294 yy_state_type yy_current_state;
1295 char *yy_cp;
1296
1297 yy_current_state = yy_start;
1298
1299 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1300 {
1301 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1302 if ( yy_accept[yy_current_state] )
1303 {
1304 yy_last_accepting_state = yy_current_state;
1305 yy_last_accepting_cpos = yy_cp;
1306 }
1307 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1308 {
1309 yy_current_state = (int) yy_def[yy_current_state];
1310 if ( yy_current_state >= 172 )
1311 yy_c = yy_meta[(unsigned int) yy_c];
1312 }
1313 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1314 }
1315
1316 return yy_current_state;
1317 }
1318
1319
1320/* yy_try_NUL_trans - try to make a transition on the NUL character
1321 *
1322 * synopsis
1323 * next_state = yy_try_NUL_trans( current_state );
1324 */
1325
1326#ifdef YY_USE_PROTOS
1327static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1328#else
1329static yy_state_type yy_try_NUL_trans( yy_current_state )
1330yy_state_type yy_current_state;
1331#endif
1332 {
1333 int yy_is_jam;
1334 char *yy_cp = yy_c_buf_p;
1335
1336 YY_CHAR yy_c = 1;
1337 if ( yy_accept[yy_current_state] )
1338 {
1339 yy_last_accepting_state = yy_current_state;
1340 yy_last_accepting_cpos = yy_cp;
1341 }
1342 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1343 {
1344 yy_current_state = (int) yy_def[yy_current_state];
1345 if ( yy_current_state >= 172 )
1346 yy_c = yy_meta[(unsigned int) yy_c];
1347 }
1348 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1349 yy_is_jam = (yy_current_state == 171);
1350
1351 return yy_is_jam ? 0 : yy_current_state;
1352 }
1353
1354
1355#ifndef YY_NO_UNPUT
1356#ifdef YY_USE_PROTOS
1357static void yyunput( int c, char *yy_bp )
1358#else
1359static void yyunput( c, yy_bp )
1360int c;
1361char *yy_bp;
1362#endif
1363 {
1364 char *yy_cp = yy_c_buf_p;
1365
1366 /* undo effects of setting up yytext */
1367 *yy_cp = yy_hold_char;
1368
1369 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1370 { /* need to shift things up to make room */
1371 /* +2 for EOB chars. */
1372 int number_to_move = yy_n_chars + 2;
1373 char *dest = &yy_current_buffer->yy_ch_buf[
1374 yy_current_buffer->yy_buf_size + 2];
1375 char *source =
1376 &yy_current_buffer->yy_ch_buf[number_to_move];
1377
1378 while ( source > yy_current_buffer->yy_ch_buf )
1379 *--dest = *--source;
1380
1381 yy_cp += (int) (dest - source);
1382 yy_bp += (int) (dest - source);
1383 yy_current_buffer->yy_n_chars =
1384 yy_n_chars = yy_current_buffer->yy_buf_size;
1385
1386 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1387 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1388 }
1389
1390 *--yy_cp = (char) c;
1391
1392
1393 yytext_ptr = yy_bp;
1394 yy_hold_char = *yy_cp;
1395 yy_c_buf_p = yy_cp;
1396 }
1397#endif /* ifndef YY_NO_UNPUT */
1398
1399
1400#ifdef __cplusplus
1401static int yyinput()
1402#else
1403static int input()
1404#endif
1405 {
1406 int c;
1407
1408 *yy_c_buf_p = yy_hold_char;
1409
1410 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1411 {
1412 /* yy_c_buf_p now points to the character we want to return.
1413 * If this occurs *before* the EOB characters, then it's a
1414 * valid NUL; if not, then we've hit the end of the buffer.
1415 */
1416 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1417 /* This was really a NUL. */
1418 *yy_c_buf_p = '\0';
1419
1420 else
1421 { /* need more input */
1422 int offset = yy_c_buf_p - yytext_ptr;
1423 ++yy_c_buf_p;
1424
1425 switch ( yy_get_next_buffer() )
1426 {
1427 case EOB_ACT_LAST_MATCH:
1428 /* This happens because yy_g_n_b()
1429 * sees that we've accumulated a
1430 * token and flags that we need to
1431 * try matching the token before
1432 * proceeding. But for input(),
1433 * there's no matching to consider.
1434 * So convert the EOB_ACT_LAST_MATCH
1435 * to EOB_ACT_END_OF_FILE.
1436 */
1437
1438 /* Reset buffer status. */
1439 yyrestart( yyin );
1440
1441 /* fall through */
1442
1443 case EOB_ACT_END_OF_FILE:
1444 {
1445 if ( yywrap() )
1446 return EOF;
1447
1448 if ( ! yy_did_buffer_switch_on_eof )
1449 YY_NEW_FILE;
1450#ifdef __cplusplus
1451 return yyinput();
1452#else
1453 return input();
1454#endif
1455 }
1456
1457 case EOB_ACT_CONTINUE_SCAN:
1458 yy_c_buf_p = yytext_ptr + offset;
1459 break;
1460 }
1461 }
1462 }
1463
1464 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1465 *yy_c_buf_p = '\0'; /* preserve yytext */
1466 yy_hold_char = *++yy_c_buf_p;
1467
1468
1469 return c;
1470 }
1471
1472
1473#ifdef YY_USE_PROTOS
1474void yyrestart( FILE *input_file )
1475#else
1476void yyrestart( input_file )
1477FILE *input_file;
1478#endif
1479 {
1480 if ( ! yy_current_buffer )
1481 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1482
1483 yy_init_buffer( yy_current_buffer, input_file );
1484 yy_load_buffer_state();
1485 }
1486
1487
1488#ifdef YY_USE_PROTOS
1489void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1490#else
1491void yy_switch_to_buffer( new_buffer )
1492YY_BUFFER_STATE new_buffer;
1493#endif
1494 {
1495 if ( yy_current_buffer == new_buffer )
1496 return;
1497
1498 if ( yy_current_buffer )
1499 {
1500 /* Flush out information for old buffer. */
1501 *yy_c_buf_p = yy_hold_char;
1502 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1503 yy_current_buffer->yy_n_chars = yy_n_chars;
1504 }
1505
1506 yy_current_buffer = new_buffer;
1507 yy_load_buffer_state();
1508
1509 /* We don't actually know whether we did this switch during
1510 * EOF (yywrap()) processing, but the only time this flag
1511 * is looked at is after yywrap() is called, so it's safe
1512 * to go ahead and always set it.
1513 */
1514 yy_did_buffer_switch_on_eof = 1;
1515 }
1516
1517
1518#ifdef YY_USE_PROTOS
1519void yy_load_buffer_state( void )
1520#else
1521void yy_load_buffer_state()
1522#endif
1523 {
1524 yy_n_chars = yy_current_buffer->yy_n_chars;
1525 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1526 yyin = yy_current_buffer->yy_input_file;
1527 yy_hold_char = *yy_c_buf_p;
1528 }
1529
1530
1531#ifdef YY_USE_PROTOS
1532YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1533#else
1534YY_BUFFER_STATE yy_create_buffer( file, size )
1535FILE *file;
1536int size;
1537#endif
1538 {
1539 YY_BUFFER_STATE b;
1540
1541 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1542 if ( ! b )
1543 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1544
1545 b->yy_buf_size = size;
1546
1547 /* yy_ch_buf has to be 2 characters longer than the size given because
1548 * we need to put in 2 end-of-buffer characters.
1549 */
1550 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1551 if ( ! b->yy_ch_buf )
1552 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1553
1554 b->yy_is_our_buffer = 1;
1555
1556 yy_init_buffer( b, file );
1557
1558 return b;
1559 }
1560
1561
1562#ifdef YY_USE_PROTOS
1563void yy_delete_buffer( YY_BUFFER_STATE b )
1564#else
1565void yy_delete_buffer( b )
1566YY_BUFFER_STATE b;
1567#endif
1568 {
1569 if ( ! b )
1570 return;
1571
1572 if ( b == yy_current_buffer )
1573 yy_current_buffer = (YY_BUFFER_STATE) 0;
1574
1575 if ( b->yy_is_our_buffer )
1576 yy_flex_free( (void *) b->yy_ch_buf );
1577
1578 yy_flex_free( (void *) b );
1579 }
1580
1581
1582
1583#ifdef YY_USE_PROTOS
1584void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1585#else
1586void yy_init_buffer( b, file )
1587YY_BUFFER_STATE b;
1588FILE *file;
1589#endif
1590
1591
1592 {
1593 yy_flush_buffer( b );
1594
1595 b->yy_input_file = file;
1596 b->yy_fill_buffer = 1;
1597
1598#if YY_ALWAYS_INTERACTIVE
1599 b->yy_is_interactive = 1;
1600#else
1601#if YY_NEVER_INTERACTIVE
1602 b->yy_is_interactive = 0;
1603#else
1604 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1605#endif
1606#endif
1607 }
1608
1609
1610#ifdef YY_USE_PROTOS
1611void yy_flush_buffer( YY_BUFFER_STATE b )
1612#else
1613void yy_flush_buffer( b )
1614YY_BUFFER_STATE b;
1615#endif
1616
1617 {
1618 if ( ! b )
1619 return;
1620
1621 b->yy_n_chars = 0;
1622
1623 /* We always need two end-of-buffer characters. The first causes
1624 * a transition to the end-of-buffer state. The second causes
1625 * a jam in that state.
1626 */
1627 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1628 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1629
1630 b->yy_buf_pos = &b->yy_ch_buf[0];
1631
1632 b->yy_at_bol = 1;
1633 b->yy_buffer_status = YY_BUFFER_NEW;
1634
1635 if ( b == yy_current_buffer )
1636 yy_load_buffer_state();
1637 }
1638
1639
1640#ifndef YY_NO_SCAN_BUFFER
1641#ifdef YY_USE_PROTOS
1642YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1643#else
1644YY_BUFFER_STATE yy_scan_buffer( base, size )
1645char *base;
1646yy_size_t size;
1647#endif
1648 {
1649 YY_BUFFER_STATE b;
1650
1651 if ( size < 2 ||
1652 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1653 base[size-1] != YY_END_OF_BUFFER_CHAR )
1654 /* They forgot to leave room for the EOB's. */
1655 return 0;
1656
1657 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1658 if ( ! b )
1659 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1660
1661 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1662 b->yy_buf_pos = b->yy_ch_buf = base;
1663 b->yy_is_our_buffer = 0;
1664 b->yy_input_file = 0;
1665 b->yy_n_chars = b->yy_buf_size;
1666 b->yy_is_interactive = 0;
1667 b->yy_at_bol = 1;
1668 b->yy_fill_buffer = 0;
1669 b->yy_buffer_status = YY_BUFFER_NEW;
1670
1671 yy_switch_to_buffer( b );
1672
1673 return b;
1674 }
1675#endif
1676
1677
1678#ifndef YY_NO_SCAN_STRING
1679#ifdef YY_USE_PROTOS
1680YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1681#else
1682YY_BUFFER_STATE yy_scan_string( yy_str )
1683yyconst char *yy_str;
1684#endif
1685 {
1686 int len;
1687 for ( len = 0; yy_str[len]; ++len )
1688 ;
1689
1690 return yy_scan_bytes( yy_str, len );
1691 }
1692#endif
1693
1694
1695#ifndef YY_NO_SCAN_BYTES
1696#ifdef YY_USE_PROTOS
1697YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1698#else
1699YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1700yyconst char *bytes;
1701int len;
1702#endif
1703 {
1704 YY_BUFFER_STATE b;
1705 char *buf;
1706 yy_size_t n;
1707 int i;
1708
1709 /* Get memory for full buffer, including space for trailing EOB's. */
1710 n = len + 2;
1711 buf = (char *) yy_flex_alloc( n );
1712 if ( ! buf )
1713 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1714
1715 for ( i = 0; i < len; ++i )
1716 buf[i] = bytes[i];
1717
1718 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1719
1720 b = yy_scan_buffer( buf, n );
1721 if ( ! b )
1722 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1723
1724 /* It's okay to grow etc. this buffer, and we should throw it
1725 * away when we're done.
1726 */
1727 b->yy_is_our_buffer = 1;
1728
1729 return b;
1730 }
1731#endif
1732
1733
1734#ifndef YY_NO_PUSH_STATE
1735#ifdef YY_USE_PROTOS
1736static void yy_push_state( int new_state )
1737#else
1738static void yy_push_state( new_state )
1739int new_state;
1740#endif
1741 {
1742 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1743 {
1744 yy_size_t new_size;
1745
1746 yy_start_stack_depth += YY_START_STACK_INCR;
1747 new_size = yy_start_stack_depth * sizeof( int );
1748
1749 if ( ! yy_start_stack )
1750 yy_start_stack = (int *) yy_flex_alloc( new_size );
1751
1752 else
1753 yy_start_stack = (int *) yy_flex_realloc(
1754 (void *) yy_start_stack, new_size );
1755
1756 if ( ! yy_start_stack )
1757 YY_FATAL_ERROR(
1758 "out of memory expanding start-condition stack" );
1759 }
1760
1761 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1762
1763 BEGIN(new_state);
1764 }
1765#endif
1766
1767
1768#ifndef YY_NO_POP_STATE
1769static void yy_pop_state()
1770 {
1771 if ( --yy_start_stack_ptr < 0 )
1772 YY_FATAL_ERROR( "start-condition stack underflow" );
1773
1774 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1775 }
1776#endif
1777
1778
1779#ifndef YY_NO_TOP_STATE
1780static int yy_top_state()
1781 {
1782 return yy_start_stack[yy_start_stack_ptr - 1];
1783 }
1784#endif
1785
1786#ifndef YY_EXIT_FAILURE
1787#define YY_EXIT_FAILURE 2
1788#endif
1789
1790#ifdef YY_USE_PROTOS
1791static void yy_fatal_error( yyconst char msg[] )
1792#else
1793static void yy_fatal_error( msg )
1794char msg[];
1795#endif
1796 {
1797 (void) fprintf( stderr, "[ppdscanner] %s\n", msg );
1798 exit( YY_EXIT_FAILURE );
1799 }
1800
1801
1802
1803/* Redefine yyless() so it works in section 3 code. */
1804
1805#undef yyless
1806#define yyless(n) \
1807 do \
1808 { \
1809 /* Undo effects of setting up yytext. */ \
1810 yytext[yyleng] = yy_hold_char; \
1811 yy_c_buf_p = yytext + n; \
1812 yy_hold_char = *yy_c_buf_p; \
1813 *yy_c_buf_p = '\0'; \
1814 yyleng = n; \
1815 } \
1816 while ( 0 )
1817
1818
1819/* Internal utility routines. */
1820
1821#ifndef yytext_ptr
1822#ifdef YY_USE_PROTOS
1823static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1824#else
1825static void yy_flex_strncpy( s1, s2, n )
1826char *s1;
1827yyconst char *s2;
1828int n;
1829#endif
1830 {
1831 int i;
1832 for ( i = 0; i < n; ++i )
1833 s1[i] = s2[i];
1834 }
1835#endif
1836
1837#ifdef YY_NEED_STRLEN
1838#ifdef YY_USE_PROTOS
1839static int yy_flex_strlen( yyconst char *s )
1840#else
1841static int yy_flex_strlen( s )
1842yyconst char *s;
1843#endif
1844 {
1845 int n;
1846 for ( n = 0; s[n]; ++n )
1847 ;
1848
1849 return n;
1850 }
1851#endif
1852
1853
1854#ifdef YY_USE_PROTOS
1855static void *yy_flex_alloc( yy_size_t size )
1856#else
1857static void *yy_flex_alloc( size )
1858yy_size_t size;
1859#endif
1860 {
1861 return (void *) malloc( size );
1862 }
1863
1864#ifdef YY_USE_PROTOS
1865static void *yy_flex_realloc( void *ptr, yy_size_t size )
1866#else
1867static void *yy_flex_realloc( ptr, size )
1868void *ptr;
1869yy_size_t size;
1870#endif
1871 {
1872 /* The cast to (char *) in the following accommodates both
1873 * implementations that use char* generic pointers, and those
1874 * that use void* generic pointers. It works with the latter
1875 * because both ANSI C and C++ allow castless assignment from
1876 * any pointer type to void*, and deal with argument conversions
1877 * as though doing an assignment.
1878 */
1879 return (void *) realloc( (char *) ptr, size );
1880 }
1881
1882#ifdef YY_USE_PROTOS
1883static void yy_flex_free( void *ptr )
1884#else
1885static void yy_flex_free( ptr )
1886void *ptr;
1887#endif
1888 {
1889 free( ptr );
1890 }
1891
1892#if YY_MAIN
1893int main()
1894 {
1895 yylex();
1896 return 0;
1897 }
1898#endif
1899#line 123 "./ppdscanner.l"
1900
1901
1902void tdeprint_ppdscanner_init(TQIODevice *d)
1903{
1904 tdeprint_ppdscanner_device = d;
1905 tdeprint_ppdscanner_lno = 1;
1906}
1907
1908void tdeprint_ppdscanner_terminate( bool deleteIt )
1909{
1910 if (deleteIt)
1911 delete tdeprint_ppdscanner_device;
1912 tdeprint_ppdscanner_device = NULL;
1913}
1914
1915int tdeprint_ppdscanner_numberoflines()
1916{
1917 return tdeprint_ppdscanner_lno;
1918}

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