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
18 #line 19 "./ppdscanner.cpp"
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
69 #define YY_PROTO(proto) proto
71 #define YY_PROTO(proto) ()
82 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
88 #define BEGIN yy_start = 1 + 2 *
94 #define YY_START ((yy_start - 1) / 2)
95 #define YYSTATE YY_START
98 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
101 #define YY_NEW_FILE yyrestart( yyin )
103 #define YY_END_OF_BUFFER_CHAR 0
106 #define YY_BUF_SIZE 16384
108 typedef struct yy_buffer_state *YY_BUFFER_STATE;
111 extern FILE *yyin, *yyout;
113 #define EOB_ACT_CONTINUE_SCAN 0
114 #define EOB_ACT_END_OF_FILE 1
115 #define EOB_ACT_LAST_MATCH 2
137 *yy_cp = yy_hold_char; \
138 YY_RESTORE_YY_MORE_OFFSET \
139 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
140 YY_DO_BEFORE_ACTION; \
144 #define unput(c) yyunput( c, yytext_ptr )
150 typedef unsigned int yy_size_t;
153 struct yy_buffer_state
163 yy_size_t yy_buf_size;
174 int yy_is_our_buffer;
181 int yy_is_interactive;
194 int yy_buffer_status;
195 #define YY_BUFFER_NEW 0
196 #define YY_BUFFER_NORMAL 1
207 #define YY_BUFFER_EOF_PENDING 2
210 static YY_BUFFER_STATE yy_current_buffer = 0;
216 #define YY_CURRENT_BUFFER yy_current_buffer
220 static char yy_hold_char;
222 static int yy_n_chars;
228 static char *yy_c_buf_p = (
char *) 0;
229 static int yy_init = 1;
230 static int yy_start = 0;
235 static int yy_did_buffer_switch_on_eof;
237 void yyrestart YY_PROTO(( FILE *input_file ));
239 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
240 void yy_load_buffer_state YY_PROTO((
void ));
241 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file,
int size ));
242 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
243 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
244 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
245 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
247 YY_BUFFER_STATE yy_scan_buffer YY_PROTO((
char *base, yy_size_t size ));
248 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst
char *yy_str ));
249 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst
char *bytes,
int len ));
251 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
252 static void *yy_flex_realloc YY_PROTO((
void *, yy_size_t ));
253 static void yy_flex_free YY_PROTO((
void * ));
255 #define yy_new_buffer yy_create_buffer
257 #define yy_set_interactive(is_interactive) \
259 if ( ! yy_current_buffer ) \
260 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
261 yy_current_buffer->yy_is_interactive = is_interactive; \
264 #define yy_set_bol(at_bol) \
266 if ( ! yy_current_buffer ) \
267 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
268 yy_current_buffer->yy_at_bol = at_bol; \
271 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
275 #define YY_SKIP_YYWRAP
276 typedef unsigned char YY_CHAR;
277 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
278 typedef int yy_state_type;
280 #define yytext_ptr yytext
282 static yy_state_type yy_get_previous_state YY_PROTO((
void ));
283 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
284 static int yy_get_next_buffer YY_PROTO((
void ));
285 static void yy_fatal_error YY_PROTO(( yyconst
char msg[] ));
290 #define YY_DO_BEFORE_ACTION \
291 yytext_ptr = yy_bp; \
292 yyleng = (int) (yy_cp - yy_bp); \
293 yy_hold_char = *yy_cp; \
297 #define YY_NUM_RULES 37
298 #define YY_END_OF_BUFFER 38
299 static yyconst
short int yy_accept[172] =
301 0, 0, 0, 0, 0, 0, 21, 21, 29, 29,
302 0, 0, 38, 36, 35, 36, 19, 17, 20, 18,
303 27, 25, 25, 26, 28, 21, 23, 22, 29, 30,
304 34, 33, 36, 31, 16, 15, 16, 16, 16, 16,
305 16, 16, 16, 16, 16, 17, 25, 0, 25, 24,
306 21, 29, 33, 32, 15, 15, 15, 16, 16, 16,
307 16, 16, 16, 16, 16, 16, 24, 15, 16, 16,
308 13, 16, 16, 16, 16, 16, 16, 15, 16, 16,
309 16, 16, 16, 16, 16, 16, 16, 15, 16, 16,
310 16, 16, 16, 16, 16, 16, 16, 16, 15, 16,
312 16, 16, 16, 16, 16, 16, 16, 2, 16, 16,
313 15, 16, 4, 16, 16, 16, 16, 16, 16, 2,
314 16, 16, 15, 16, 4, 8, 8, 16, 16, 16,
315 16, 16, 16, 16, 15, 16, 7, 16, 16, 1,
316 16, 5, 16, 16, 15, 6, 16, 3, 16, 16,
317 16, 15, 16, 16, 16, 16, 15, 14, 16, 16,
318 16, 16, 12, 16, 16, 9, 16, 11, 16, 10,
322 static yyconst
int yy_ec[256] =
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 3, 4, 5, 6, 4, 7, 4, 4, 4,
328 4, 8, 4, 4, 4, 4, 9, 10, 10, 10,
329 10, 10, 10, 10, 10, 10, 10, 11, 4, 4,
330 4, 4, 4, 4, 12, 10, 13, 14, 15, 10,
331 16, 10, 17, 18, 10, 19, 20, 21, 22, 23,
332 10, 10, 10, 24, 25, 10, 10, 10, 10, 10,
333 4, 4, 4, 4, 4, 4, 26, 27, 10, 28,
335 29, 30, 31, 10, 32, 10, 10, 33, 34, 35,
336 36, 37, 10, 38, 39, 40, 41, 10, 10, 10,
337 10, 10, 4, 4, 4, 4, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354 static yyconst
int yy_meta[42] =
356 1, 2, 3, 4, 4, 4, 4, 5, 1, 4,
357 6, 4, 4, 4, 4, 4, 4, 4, 4, 4,
358 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
359 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
363 static yyconst
short int yy_base[194] =
365 0, 1, 3, 14, 17, 28, 25, 30, 300, 299,
366 41, 45, 300, 303, 303, 50, 303, 0, 303, 303,
367 303, 0, 75, 303, 303, 0, 303, 303, 0, 303,
368 303, 0, 0, 303, 0, 78, 266, 269, 262, 262,
369 282, 258, 256, 266, 274, 0, 0, 285, 89, 0,
370 0, 0, 0, 0, 0, 276, 92, 252, 257, 258,
371 259, 265, 248, 253, 244, 267, 303, 257, 239, 251,
372 0, 245, 38, 250, 239, 244, 236, 251, 241, 228,
373 239, 234, 229, 248, 45, 226, 228, 248, 58, 228,
374 234, 223, 229, 244, 218, 238, 240, 214, 240, 213,
376 233, 209, 221, 208, 211, 209, 208, 100, 211, 202,
377 217, 204, 105, 231, 205, 208, 211, 200, 193, 110,
378 199, 194, 219, 189, 115, 0, 0, 200, 203, 210,
379 187, 188, 195, 197, 219, 184, 0, 208, 202, 0,
380 178, 0, 182, 184, 191, 0, 147, 0, 141, 135,
381 67, 97, 68, 70, 56, 45, 80, 303, 43, 34,
382 26, 20, 0, 23, 20, 0, 5, 0, 1, 0,
383 303, 123, 129, 135, 141, 147, 153, 156, 159, 161,
384 166, 172, 177, 6, 3, 183, 189, 195, 198, 200,
389 static yyconst
short int yy_def[194] =
391 172, 172, 173, 173, 174, 174, 175, 175, 176, 176,
392 177, 177, 171, 171, 171, 178, 171, 179, 171, 171,
393 171, 180, 181, 171, 171, 182, 171, 171, 183, 171,
394 171, 184, 185, 171, 178, 186, 178, 178, 178, 178,
395 178, 178, 178, 178, 178, 179, 180, 187, 181, 180,
396 182, 183, 184, 185, 188, 188, 186, 178, 178, 178,
397 178, 178, 178, 178, 178, 178, 171, 188, 178, 178,
398 178, 178, 178, 178, 178, 178, 178, 188, 178, 178,
399 178, 178, 178, 178, 178, 178, 178, 188, 178, 178,
400 178, 178, 178, 178, 178, 178, 178, 178, 188, 178,
402 178, 178, 178, 178, 178, 178, 178, 189, 178, 178,
403 188, 178, 190, 191, 178, 178, 178, 178, 178, 189,
404 178, 178, 188, 178, 190, 191, 192, 178, 178, 178,
405 178, 178, 178, 178, 188, 178, 192, 178, 178, 178,
406 178, 178, 178, 178, 188, 178, 178, 178, 178, 178,
407 178, 193, 178, 178, 178, 178, 193, 171, 178, 178,
408 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
409 0, 171, 171, 171, 171, 171, 171, 171, 171, 171,
410 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
415 static yyconst
short int yy_nxt[345] =
417 171, 15, 15, 14, 17, 14, 54, 16, 16, 53,
418 171, 19, 171, 20, 14, 17, 14, 14, 21, 14,
419 171, 23, 19, 171, 20, 24, 27, 25, 14, 21,
420 14, 27, 23, 171, 171, 28, 24, 171, 25, 170,
421 28, 14, 31, 14, 169, 14, 31, 14, 33, 14,
422 82, 34, 33, 14, 168, 34, 36, 167, 166, 83,
423 95, 165, 37, 38, 39, 164, 40, 41, 163, 96,
424 42, 43, 44, 100, 45, 48, 48, 48, 55, 50,
425 56, 158, 101, 48, 162, 48, 55, 161, 55, 48,
426 48, 48, 55, 50, 55, 160, 159, 48, 158, 48,
428 55, 156, 55, 35, 35, 35, 35, 35, 35, 35,
429 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
430 35, 35, 35, 14, 14, 14, 14, 14, 14, 18,
431 18, 18, 18, 18, 18, 22, 22, 22, 22, 22,
432 22, 26, 26, 26, 26, 26, 26, 29, 29, 29,
433 29, 29, 29, 32, 32, 32, 32, 32, 32, 35,
434 35, 46, 46, 46, 47, 47, 49, 49, 49, 49,
435 49, 49, 51, 155, 51, 51, 51, 52, 154, 52,
436 52, 52, 52, 57, 153, 57, 57, 57, 57, 48,
437 48, 48, 48, 48, 48, 55, 152, 55, 55, 55,
439 55, 120, 120, 125, 125, 126, 126, 137, 137, 157,
440 157, 157, 157, 157, 157, 151, 150, 149, 148, 147,
441 146, 145, 144, 143, 142, 141, 140, 139, 138, 136,
442 135, 134, 133, 132, 131, 130, 129, 128, 127, 124,
443 123, 122, 121, 119, 118, 117, 116, 115, 114, 113,
444 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
445 102, 99, 98, 97, 94, 93, 92, 91, 90, 89,
446 88, 87, 86, 85, 84, 81, 80, 79, 78, 77,
447 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
448 66, 65, 64, 63, 62, 61, 60, 59, 58, 171,
450 30, 30, 13, 171, 171, 171, 171, 171, 171, 171,
451 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
452 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
453 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
457 static yyconst
short int yy_chk[345] =
459 0, 1, 2, 3, 3, 3, 185, 1, 2, 184,
460 0, 3, 0, 3, 4, 4, 4, 5, 5, 5,
461 0, 5, 4, 0, 4, 5, 7, 5, 6, 6,
462 6, 8, 6, 0, 0, 7, 6, 0, 6, 169,
463 8, 11, 11, 11, 167, 12, 12, 12, 11, 11,
464 73, 11, 12, 12, 165, 12, 16, 164, 162, 73,
465 85, 161, 16, 16, 16, 160, 16, 16, 159, 85,
466 16, 16, 16, 89, 16, 23, 23, 23, 36, 23,
467 36, 157, 89, 23, 156, 23, 36, 155, 36, 49,
468 49, 49, 57, 49, 57, 154, 153, 49, 152, 49,
470 57, 151, 57, 108, 108, 108, 108, 108, 113, 113,
471 113, 113, 113, 120, 120, 120, 120, 120, 125, 125,
472 125, 125, 125, 172, 172, 172, 172, 172, 172, 173,
473 173, 173, 173, 173, 173, 174, 174, 174, 174, 174,
474 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
475 176, 176, 176, 177, 177, 177, 177, 177, 177, 178,
476 178, 179, 179, 179, 180, 180, 181, 181, 181, 181,
477 181, 181, 182, 150, 182, 182, 182, 183, 149, 183,
478 183, 183, 183, 186, 147, 186, 186, 186, 186, 187,
479 187, 187, 187, 187, 187, 188, 145, 188, 188, 188,
481 188, 189, 189, 190, 190, 191, 191, 192, 192, 193,
482 193, 193, 193, 193, 193, 144, 143, 141, 139, 138,
483 136, 135, 134, 133, 132, 131, 130, 129, 128, 124,
484 123, 122, 121, 119, 118, 117, 116, 115, 114, 112,
485 111, 110, 109, 107, 106, 105, 104, 103, 102, 101,
486 100, 99, 98, 97, 96, 95, 94, 93, 92, 91,
487 90, 88, 87, 86, 84, 83, 82, 81, 80, 79,
488 78, 77, 76, 75, 74, 72, 70, 69, 68, 66,
489 65, 64, 63, 62, 61, 60, 59, 58, 56, 48,
490 45, 44, 43, 42, 41, 40, 39, 38, 37, 13,
492 10, 9, 171, 171, 171, 171, 171, 171, 171, 171,
493 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
494 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
495 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
499 static yy_state_type yy_last_accepting_state;
500 static char *yy_last_accepting_cpos;
505 #define REJECT reject_used_but_not_detected
506 #define yymore() yymore_used_but_not_detected
507 #define YY_MORE_ADJ 0
508 #define YY_RESTORE_YY_MORE_OFFSET
510 #line 1 "./ppdscanner.l"
512 #line 2 "./ppdscanner.l"
532 #include <tqstringlist.h>
533 #include <tqiodevice.h>
534 #define YYSTYPE TQStringList
535 #include "ppdparser.cpp.h"
537 #define yylval tdeprint_ppdlval
539 TQIODevice *tdeprint_ppdscanner_device = NULL;
540 #define YY_INPUT(buf,result,max_size) \
542 if (tdeprint_ppdscanner_device) \
544 result = tdeprint_ppdscanner_device->readBlock(buf,max_size); \
555 int tdeprint_ppdscanner_lno = 0;
558 #define QDEBUG0(s) tqDebug(s)
559 #define QDEBUG1(s,a) tqDebug(s,a)
566 #define translation_1 3
567 #define translation_2 4
570 #line 576 "./ppdscanner.cpp"
576 #ifndef YY_SKIP_YYWRAP
578 extern "C" int yywrap YY_PROTO((
void ));
580 extern int yywrap YY_PROTO((
void ));
585 static void yyunput YY_PROTO((
int c,
char *buf_ptr ));
589 static void yy_flex_strncpy YY_PROTO((
char *, yyconst
char *,
int ));
592 #ifdef YY_NEED_STRLEN
593 static int yy_flex_strlen YY_PROTO(( yyconst
char * ));
598 static int yyinput YY_PROTO((
void ));
600 static int input YY_PROTO((
void ));
605 static int yy_start_stack_ptr = 0;
606 static int yy_start_stack_depth = 0;
607 static int *yy_start_stack = 0;
608 #ifndef YY_NO_PUSH_STATE
609 static void yy_push_state YY_PROTO((
int new_state ));
611 #ifndef YY_NO_POP_STATE
612 static void yy_pop_state YY_PROTO((
void ));
614 #ifndef YY_NO_TOP_STATE
615 static int yy_top_state YY_PROTO((
void ));
619 #define YY_NO_PUSH_STATE 1
620 #define YY_NO_POP_STATE 1
621 #define YY_NO_TOP_STATE 1
624 #ifdef YY_MALLOC_DECL
640 #ifndef YY_READ_BUF_SIZE
641 #define YY_READ_BUF_SIZE 8192
650 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
657 #define YY_INPUT(buf,result,max_size) \
658 if ( yy_current_buffer->yy_is_interactive ) \
661 for ( n = 0; n < max_size && \
662 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
665 buf[n++] = (char) c; \
666 if ( c == EOF && ferror( yyin ) ) \
667 YY_FATAL_ERROR( "input in flex scanner failed" ); \
670 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
671 && ferror( yyin ) ) \
672 YY_FATAL_ERROR( "input in flex scanner failed" );
680 #define yyterminate() return YY_NULL
684 #ifndef YY_START_STACK_INCR
685 #define YY_START_STACK_INCR 25
689 #ifndef YY_FATAL_ERROR
690 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
697 #define YY_DECL int yylex YY_PROTO(( void ))
703 #ifndef YY_USER_ACTION
704 #define YY_USER_ACTION
709 #define YY_BREAK break;
712 #define YY_RULE_SETUP \
717 yy_state_type yy_current_state;
721 #line 59 "./ppdscanner.l"
727 #line 733 "./ppdscanner.cpp"
746 if ( ! yy_current_buffer )
748 yy_create_buffer( yyin, YY_BUF_SIZE );
750 yy_load_buffer_state();
758 *yy_cp = yy_hold_char;
765 yy_current_state = yy_start;
769 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
770 if ( yy_accept[yy_current_state] )
772 yy_last_accepting_state = yy_current_state;
773 yy_last_accepting_cpos = yy_cp;
775 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
777 yy_current_state = (int) yy_def[yy_current_state];
778 if ( yy_current_state >= 172 )
779 yy_c = yy_meta[(
unsigned int) yy_c];
781 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
784 while ( yy_base[yy_current_state] != 303 );
787 yy_act = yy_accept[yy_current_state];
790 yy_cp = yy_last_accepting_cpos;
791 yy_current_state = yy_last_accepting_state;
792 yy_act = yy_accept[yy_current_state];
805 *yy_cp = yy_hold_char;
806 yy_cp = yy_last_accepting_cpos;
807 yy_current_state = yy_last_accepting_state;
811 #line 65 "./ppdscanner.l"
814 #line 65 "./ppdscanner.l"
815 { QDEBUG0(
"Open UI"); BEGIN(option);
return OPENUI; }
818 #line 67 "./ppdscanner.l"
821 #line 67 "./ppdscanner.l"
822 { QDEBUG0(
"Close UI"); BEGIN(value);
return CLOSEUI; }
826 #line 68 "./ppdscanner.l"
827 { QDEBUG0(
"Open group"); BEGIN(option);
return OPENGROUP; }
831 #line 69 "./ppdscanner.l"
832 { QDEBUG0(
"Close group"); BEGIN(option);
return CLOSEGROUP; }
836 #line 70 "./ppdscanner.l"
837 { yylval = yytext+9; BEGIN(option);
return DEFAULT; }
841 #line 71 "./ppdscanner.l"
842 { yylval = yytext+8; BEGIN(option);
return DEFAULT; }
845 #line 73 "./ppdscanner.l"
848 #line 73 "./ppdscanner.l"
849 { BEGIN(constr);
return CONSTRAINT; }
853 #line 74 "./ppdscanner.l"
854 { BEGIN(option);
return PAPERDIM; }
858 #line 75 "./ppdscanner.l"
859 { BEGIN(option);
return IMGAREA; }
863 #line 76 "./ppdscanner.l"
867 *yy_cp = yy_hold_char;
868 yy_c_buf_p = yy_cp -= 1;
871 #line 78 "./ppdscanner.l"
872 { yylval = yytext+12;
return FOODATA; }
876 #line 79 "./ppdscanner.l"
877 { QDEBUG0(
"Comment");
return COMMENT; }
881 #line 80 "./ppdscanner.l"
882 { yylval = yytext+1; QDEBUG1(
"Main keyword: %s",yytext+1); BEGIN(option);
return KEYWORD; }
889 #line 85 "./ppdscanner.l"
890 { yylval = yytext; QDEBUG1(
"Option: %s",yytext);
return OPTION; }
894 #line 86 "./ppdscanner.l"
895 { BEGIN(value);
return ':'; }
899 #line 87 "./ppdscanner.l"
900 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
904 #line 88 "./ppdscanner.l"
905 { BEGIN(translation_1);
return '/'; }
912 #line 93 "./ppdscanner.l"
913 { yylval = yytext; QDEBUG1(
"Translation: %s",yytext);
return TRANSLATION; }
917 #line 94 "./ppdscanner.l"
918 { BEGIN(value);
return ':'; }
922 #line 95 "./ppdscanner.l"
923 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
930 #line 100 "./ppdscanner.l"
931 { yylval = yytext; tdeprint_ppdscanner_lno += yylval[0].contains(
'\n'); QDEBUG1(
"Quoted value: %s",yytext);
return QUOTED; }
935 #line 101 "./ppdscanner.l"
936 { yylval = yytext; QDEBUG1(
"String part: %s",yytext);
return STRINGPART; }
940 #line 102 "./ppdscanner.l"
941 { BEGIN(translation_2);
return '/'; }
945 #line 103 "./ppdscanner.l"
946 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
950 #line 104 "./ppdscanner.l"
958 #line 109 "./ppdscanner.l"
959 { yylval = yytext; QDEBUG1(
"Translation: %s",yytext);
return TRANSLATION; }
963 #line 110 "./ppdscanner.l"
964 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
971 #line 115 "./ppdscanner.l"
976 #line 116 "./ppdscanner.l"
977 { yylval = yytext+1; QDEBUG1(
"Constraint keyword: %s",yytext);
return KEYWORD; }
981 #line 117 "./ppdscanner.l"
982 { yylval = yytext; QDEBUG1(
"Constraint option: %s",yytext);
return OPTION; }
986 #line 118 "./ppdscanner.l"
987 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
991 #line 120 "./ppdscanner.l"
992 { tdeprint_ppdscanner_lno++; }
996 #line 121 "./ppdscanner.l"
1001 #line 123 "./ppdscanner.l"
1004 #line 1010 "./ppdscanner.cpp"
1005 case YY_STATE_EOF(INITIAL):
1006 case YY_STATE_EOF(option):
1007 case YY_STATE_EOF(value):
1008 case YY_STATE_EOF(translation_1):
1009 case YY_STATE_EOF(translation_2):
1010 case YY_STATE_EOF(constr):
1013 case YY_END_OF_BUFFER:
1016 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1019 *yy_cp = yy_hold_char;
1020 YY_RESTORE_YY_MORE_OFFSET
1022 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1033 yy_n_chars = yy_current_buffer->yy_n_chars;
1034 yy_current_buffer->yy_input_file = yyin;
1035 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1045 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1047 yy_state_type yy_next_state;
1049 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1051 yy_current_state = yy_get_previous_state();
1062 yy_next_state = yy_try_NUL_trans( yy_current_state );
1064 yy_bp = yytext_ptr + YY_MORE_ADJ;
1066 if ( yy_next_state )
1069 yy_cp = ++yy_c_buf_p;
1070 yy_current_state = yy_next_state;
1077 goto yy_find_action;
1081 else switch ( yy_get_next_buffer() )
1083 case EOB_ACT_END_OF_FILE:
1085 yy_did_buffer_switch_on_eof = 0;
1098 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1100 yy_act = YY_STATE_EOF(YY_START);
1106 if ( ! yy_did_buffer_switch_on_eof )
1112 case EOB_ACT_CONTINUE_SCAN:
1114 yytext_ptr + yy_amount_of_matched_text;
1116 yy_current_state = yy_get_previous_state();
1119 yy_bp = yytext_ptr + YY_MORE_ADJ;
1122 case EOB_ACT_LAST_MATCH:
1124 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1126 yy_current_state = yy_get_previous_state();
1129 yy_bp = yytext_ptr + YY_MORE_ADJ;
1130 goto yy_find_action;
1137 "fatal flex scanner internal error--no action found" );
1151 static int yy_get_next_buffer()
1153 char *dest = yy_current_buffer->yy_ch_buf;
1154 char *source = yytext_ptr;
1155 int number_to_move, i;
1158 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1160 "fatal flex scanner internal error--end of buffer missed" );
1162 if ( yy_current_buffer->yy_fill_buffer == 0 )
1164 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1169 return EOB_ACT_END_OF_FILE;
1177 return EOB_ACT_LAST_MATCH;
1184 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1186 for ( i = 0; i < number_to_move; ++i )
1187 *(dest++) = *(source++);
1189 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1193 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1198 yy_current_buffer->yy_buf_size - number_to_move - 1;
1200 while ( num_to_read <= 0 )
1202 #ifdef YY_USES_REJECT
1204 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1208 YY_BUFFER_STATE b = yy_current_buffer;
1210 int yy_c_buf_p_offset =
1211 (int) (yy_c_buf_p - b->yy_ch_buf);
1213 if ( b->yy_is_our_buffer )
1215 int new_size = b->yy_buf_size * 2;
1217 if ( new_size <= 0 )
1218 b->yy_buf_size += b->yy_buf_size / 8;
1220 b->yy_buf_size *= 2;
1222 b->yy_ch_buf = (
char *)
1224 yy_flex_realloc( (
void *) b->yy_ch_buf,
1225 b->yy_buf_size + 2 );
1231 if ( ! b->yy_ch_buf )
1233 "fatal error - scanner input buffer overflow" );
1235 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1237 num_to_read = yy_current_buffer->yy_buf_size -
1242 if ( num_to_read > YY_READ_BUF_SIZE )
1243 num_to_read = YY_READ_BUF_SIZE;
1246 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1247 yy_n_chars, num_to_read );
1249 yy_current_buffer->yy_n_chars = yy_n_chars;
1252 if ( yy_n_chars == 0 )
1254 if ( number_to_move == YY_MORE_ADJ )
1256 ret_val = EOB_ACT_END_OF_FILE;
1262 ret_val = EOB_ACT_LAST_MATCH;
1263 yy_current_buffer->yy_buffer_status =
1264 YY_BUFFER_EOF_PENDING;
1269 ret_val = EOB_ACT_CONTINUE_SCAN;
1271 yy_n_chars += number_to_move;
1272 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1273 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1275 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1283 static yy_state_type yy_get_previous_state()
1285 yy_state_type yy_current_state;
1288 yy_current_state = yy_start;
1290 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1292 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1293 if ( yy_accept[yy_current_state] )
1295 yy_last_accepting_state = yy_current_state;
1296 yy_last_accepting_cpos = yy_cp;
1298 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1300 yy_current_state = (int) yy_def[yy_current_state];
1301 if ( yy_current_state >= 172 )
1302 yy_c = yy_meta[(
unsigned int) yy_c];
1304 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1307 return yy_current_state;
1317 #ifdef YY_USE_PROTOS
1318 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1320 static yy_state_type yy_try_NUL_trans( yy_current_state )
1321 yy_state_type yy_current_state;
1325 char *yy_cp = yy_c_buf_p;
1328 if ( yy_accept[yy_current_state] )
1330 yy_last_accepting_state = yy_current_state;
1331 yy_last_accepting_cpos = yy_cp;
1333 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1335 yy_current_state = (int) yy_def[yy_current_state];
1336 if ( yy_current_state >= 172 )
1337 yy_c = yy_meta[(
unsigned int) yy_c];
1339 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1340 yy_is_jam = (yy_current_state == 171);
1342 return yy_is_jam ? 0 : yy_current_state;
1347 #ifdef YY_USE_PROTOS
1348 static void yyunput(
int c,
char *yy_bp )
1350 static void yyunput( c, yy_bp )
1355 char *yy_cp = yy_c_buf_p;
1358 *yy_cp = yy_hold_char;
1360 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1363 int number_to_move = yy_n_chars + 2;
1364 char *dest = &yy_current_buffer->yy_ch_buf[
1365 yy_current_buffer->yy_buf_size + 2];
1367 &yy_current_buffer->yy_ch_buf[number_to_move];
1369 while ( source > yy_current_buffer->yy_ch_buf )
1370 *--dest = *--source;
1372 yy_cp += (int) (dest - source);
1373 yy_bp += (int) (dest - source);
1374 yy_current_buffer->yy_n_chars =
1375 yy_n_chars = yy_current_buffer->yy_buf_size;
1377 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1378 YY_FATAL_ERROR(
"flex scanner push-back overflow" );
1381 *--yy_cp = (char) c;
1385 yy_hold_char = *yy_cp;
1392 static int yyinput()
1399 *yy_c_buf_p = yy_hold_char;
1401 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1407 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1413 int offset = yy_c_buf_p - yytext_ptr;
1416 switch ( yy_get_next_buffer() )
1418 case EOB_ACT_LAST_MATCH:
1434 case EOB_ACT_END_OF_FILE:
1439 if ( ! yy_did_buffer_switch_on_eof )
1448 case EOB_ACT_CONTINUE_SCAN:
1449 yy_c_buf_p = yytext_ptr + offset;
1455 c = *(
unsigned char *) yy_c_buf_p;
1457 yy_hold_char = *++yy_c_buf_p;
1464 #ifdef YY_USE_PROTOS
1465 void yyrestart( FILE *input_file )
1467 void yyrestart( input_file )
1471 if ( ! yy_current_buffer )
1472 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1474 yy_init_buffer( yy_current_buffer, input_file );
1475 yy_load_buffer_state();
1479 #ifdef YY_USE_PROTOS
1480 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1482 void yy_switch_to_buffer( new_buffer )
1483 YY_BUFFER_STATE new_buffer;
1486 if ( yy_current_buffer == new_buffer )
1489 if ( yy_current_buffer )
1492 *yy_c_buf_p = yy_hold_char;
1493 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1494 yy_current_buffer->yy_n_chars = yy_n_chars;
1497 yy_current_buffer = new_buffer;
1498 yy_load_buffer_state();
1505 yy_did_buffer_switch_on_eof = 1;
1509 #ifdef YY_USE_PROTOS
1510 void yy_load_buffer_state(
void )
1512 void yy_load_buffer_state()
1515 yy_n_chars = yy_current_buffer->yy_n_chars;
1516 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1517 yyin = yy_current_buffer->yy_input_file;
1518 yy_hold_char = *yy_c_buf_p;
1522 #ifdef YY_USE_PROTOS
1523 YY_BUFFER_STATE yy_create_buffer( FILE *file,
int size )
1525 YY_BUFFER_STATE yy_create_buffer( file, size )
1532 b = (YY_BUFFER_STATE) yy_flex_alloc(
sizeof(
struct yy_buffer_state ) );
1534 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1536 b->yy_buf_size = size;
1541 b->yy_ch_buf = (
char *) yy_flex_alloc( b->yy_buf_size + 2 );
1542 if ( ! b->yy_ch_buf )
1543 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1545 b->yy_is_our_buffer = 1;
1547 yy_init_buffer( b, file );
1553 #ifdef YY_USE_PROTOS
1554 void yy_delete_buffer( YY_BUFFER_STATE b )
1556 void yy_delete_buffer( b )
1563 if ( b == yy_current_buffer )
1564 yy_current_buffer = (YY_BUFFER_STATE) 0;
1566 if ( b->yy_is_our_buffer )
1567 yy_flex_free( (
void *) b->yy_ch_buf );
1569 yy_flex_free( (
void *) b );
1574 #ifdef YY_USE_PROTOS
1575 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1577 void yy_init_buffer( b, file )
1584 yy_flush_buffer( b );
1586 b->yy_input_file = file;
1587 b->yy_fill_buffer = 1;
1589 #if YY_ALWAYS_INTERACTIVE
1590 b->yy_is_interactive = 1;
1592 #if YY_NEVER_INTERACTIVE
1593 b->yy_is_interactive = 0;
1595 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1601 #ifdef YY_USE_PROTOS
1602 void yy_flush_buffer( YY_BUFFER_STATE b )
1604 void yy_flush_buffer( b )
1618 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1619 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1621 b->yy_buf_pos = &b->yy_ch_buf[0];
1624 b->yy_buffer_status = YY_BUFFER_NEW;
1626 if ( b == yy_current_buffer )
1627 yy_load_buffer_state();
1631 #ifndef YY_NO_SCAN_BUFFER
1632 #ifdef YY_USE_PROTOS
1633 YY_BUFFER_STATE yy_scan_buffer(
char *base, yy_size_t size )
1635 YY_BUFFER_STATE yy_scan_buffer( base, size )
1643 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1644 base[size-1] != YY_END_OF_BUFFER_CHAR )
1648 b = (YY_BUFFER_STATE) yy_flex_alloc(
sizeof(
struct yy_buffer_state ) );
1650 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1652 b->yy_buf_size = size - 2;
1653 b->yy_buf_pos = b->yy_ch_buf = base;
1654 b->yy_is_our_buffer = 0;
1655 b->yy_input_file = 0;
1656 b->yy_n_chars = b->yy_buf_size;
1657 b->yy_is_interactive = 0;
1659 b->yy_fill_buffer = 0;
1660 b->yy_buffer_status = YY_BUFFER_NEW;
1662 yy_switch_to_buffer( b );
1669 #ifndef YY_NO_SCAN_STRING
1670 #ifdef YY_USE_PROTOS
1671 YY_BUFFER_STATE yy_scan_string( yyconst
char *yy_str )
1673 YY_BUFFER_STATE yy_scan_string( yy_str )
1674 yyconst
char *yy_str;
1678 for ( len = 0; yy_str[len]; ++len )
1681 return yy_scan_bytes( yy_str, len );
1686 #ifndef YY_NO_SCAN_BYTES
1687 #ifdef YY_USE_PROTOS
1688 YY_BUFFER_STATE yy_scan_bytes( yyconst
char *bytes,
int len )
1690 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1691 yyconst
char *bytes;
1702 buf = (
char *) yy_flex_alloc( n );
1704 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1706 for ( i = 0; i < len; ++i )
1709 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1711 b = yy_scan_buffer( buf, n );
1713 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1718 b->yy_is_our_buffer = 1;
1725 #ifndef YY_NO_PUSH_STATE
1726 #ifdef YY_USE_PROTOS
1727 static void yy_push_state(
int new_state )
1729 static void yy_push_state( new_state )
1733 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1737 yy_start_stack_depth += YY_START_STACK_INCR;
1738 new_size = yy_start_stack_depth *
sizeof( int );
1740 if ( ! yy_start_stack )
1741 yy_start_stack = (
int *) yy_flex_alloc( new_size );
1744 yy_start_stack = (
int *) yy_flex_realloc(
1745 (
void *) yy_start_stack, new_size );
1747 if ( ! yy_start_stack )
1749 "out of memory expanding start-condition stack" );
1752 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1759 #ifndef YY_NO_POP_STATE
1760 static void yy_pop_state()
1762 if ( --yy_start_stack_ptr < 0 )
1763 YY_FATAL_ERROR(
"start-condition stack underflow" );
1765 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1770 #ifndef YY_NO_TOP_STATE
1771 static int yy_top_state()
1773 return yy_start_stack[yy_start_stack_ptr - 1];
1777 #ifndef YY_EXIT_FAILURE
1778 #define YY_EXIT_FAILURE 2
1781 #ifdef YY_USE_PROTOS
1782 static void yy_fatal_error( yyconst
char msg[] )
1784 static void yy_fatal_error( msg )
1788 (void) fprintf( stderr,
"[ppdscanner] %s\n", msg );
1789 exit( YY_EXIT_FAILURE );
1801 yytext[yyleng] = yy_hold_char; \
1802 yy_c_buf_p = yytext + n; \
1803 yy_hold_char = *yy_c_buf_p; \
1804 *yy_c_buf_p = '\0'; \
1813 #ifdef YY_USE_PROTOS
1814 static void yy_flex_strncpy(
char *s1, yyconst
char *s2,
int n )
1816 static void yy_flex_strncpy( s1, s2, n )
1823 for ( i = 0; i < n; ++i )
1828 #ifdef YY_NEED_STRLEN
1829 #ifdef YY_USE_PROTOS
1830 static int yy_flex_strlen( yyconst
char *s )
1832 static int yy_flex_strlen( s )
1837 for ( n = 0; s[n]; ++n )
1845 #ifdef YY_USE_PROTOS
1846 static void *yy_flex_alloc( yy_size_t size )
1848 static void *yy_flex_alloc( size )
1852 return (
void *) malloc( size );
1855 #ifdef YY_USE_PROTOS
1856 static void *yy_flex_realloc(
void *ptr, yy_size_t size )
1858 static void *yy_flex_realloc( ptr, size )
1870 return (
void *) realloc( (
char *) ptr, size );
1873 #ifdef YY_USE_PROTOS
1874 static void yy_flex_free(
void *ptr )
1876 static void yy_flex_free( ptr )
1890 #line 123 "./ppdscanner.l"
1893 void tdeprint_ppdscanner_init(TQIODevice *d)
1895 tdeprint_ppdscanner_device = d;
1896 tdeprint_ppdscanner_lno = 1;
1899 void tdeprint_ppdscanner_terminate(
bool deleteIt )
1902 delete tdeprint_ppdscanner_device;
1903 tdeprint_ppdscanner_device = NULL;
1906 int tdeprint_ppdscanner_numberoflines()
1908 return tdeprint_ppdscanner_lno;