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
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
97 #define BEGIN yy_start = 1 + 2 *
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state *YY_BUFFER_STATE;
120 extern FILE *yyin, *yyout;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
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; \
153 #define unput(c) yyunput( c, yytext_ptr )
159 typedef unsigned int yy_size_t;
162 struct yy_buffer_state
172 yy_size_t yy_buf_size;
183 int yy_is_our_buffer;
190 int yy_is_interactive;
203 int yy_buffer_status;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer = 0;
225 #define YY_CURRENT_BUFFER yy_current_buffer
229 static char yy_hold_char;
231 static int yy_n_chars;
237 static char *yy_c_buf_p = (
char *) 0;
238 static int yy_init = 1;
239 static int yy_start = 0;
244 static int yy_did_buffer_switch_on_eof;
246 void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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 ));
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 * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
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; \
273 #define yy_set_bol(at_bol) \
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; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
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;
289 #define yytext_ptr yytext
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[] ));
299 #define YY_DO_BEFORE_ACTION \
300 yytext_ptr = yy_bp; \
301 yyleng = (int) (yy_cp - yy_bp); \
302 yy_hold_char = *yy_cp; \
306 #define YY_NUM_RULES 37
307 #define YY_END_OF_BUFFER 38
308 static yyconst
short int yy_accept[172] =
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,
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,
331 static yyconst
int yy_ec[256] =
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,
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,
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,
363 static yyconst
int yy_meta[42] =
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,
372 static yyconst
short int yy_base[194] =
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,
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,
398 static yyconst
short int yy_def[194] =
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,
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,
424 static yyconst
short int yy_nxt[345] =
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,
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,
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,
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,
466 static yyconst
short int yy_chk[345] =
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,
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,
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,
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,
508 static yy_state_type yy_last_accepting_state;
509 static char *yy_last_accepting_cpos;
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
519 #line 1 "./ppdscanner.l"
521 #line 2 "./ppdscanner.l"
541 #include <tqstringlist.h>
542 #include <tqiodevice.h>
543 #define YYSTYPE TQStringList
544 #include "ppdparser.cpp.h"
546 #define yylval tdeprint_ppdlval
548 TQIODevice *tdeprint_ppdscanner_device = NULL;
549 #define YY_INPUT(buf,result,max_size) \
551 if (tdeprint_ppdscanner_device) \
553 result = tdeprint_ppdscanner_device->readBlock(buf,max_size); \
564 int tdeprint_ppdscanner_lno = 0;
567 #define QDEBUG0(s) tqDebug(s)
568 #define QDEBUG1(s,a) tqDebug(s,a)
575 #define translation_1 3
576 #define translation_2 4
579 #line 576 "./ppdscanner.cpp"
585 #ifndef YY_SKIP_YYWRAP
587 extern "C" int yywrap YY_PROTO((
void ));
589 extern int yywrap YY_PROTO((
void ));
594 static void yyunput YY_PROTO((
int c,
char *buf_ptr ));
598 static void yy_flex_strncpy YY_PROTO((
char *, yyconst
char *,
int ));
601 #ifdef YY_NEED_STRLEN
602 static int yy_flex_strlen YY_PROTO(( yyconst
char * ));
607 static int yyinput YY_PROTO((
void ));
609 static int input YY_PROTO((
void ));
614 static int yy_start_stack_ptr = 0;
615 static int yy_start_stack_depth = 0;
616 static int *yy_start_stack = 0;
617 #ifndef YY_NO_PUSH_STATE
618 static void yy_push_state YY_PROTO((
int new_state ));
620 #ifndef YY_NO_POP_STATE
621 static void yy_pop_state YY_PROTO((
void ));
623 #ifndef YY_NO_TOP_STATE
624 static int yy_top_state YY_PROTO((
void ));
628 #define YY_NO_PUSH_STATE 1
629 #define YY_NO_POP_STATE 1
630 #define YY_NO_TOP_STATE 1
633 #ifdef YY_MALLOC_DECL
649 #ifndef YY_READ_BUF_SIZE
650 #define YY_READ_BUF_SIZE 8192
659 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
666 #define YY_INPUT(buf,result,max_size) \
667 if ( yy_current_buffer->yy_is_interactive ) \
670 for ( n = 0; n < max_size && \
671 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
674 buf[n++] = (char) c; \
675 if ( c == EOF && ferror( yyin ) ) \
676 YY_FATAL_ERROR( "input in flex scanner failed" ); \
679 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
680 && ferror( yyin ) ) \
681 YY_FATAL_ERROR( "input in flex scanner failed" );
689 #define yyterminate() return YY_NULL
693 #ifndef YY_START_STACK_INCR
694 #define YY_START_STACK_INCR 25
698 #ifndef YY_FATAL_ERROR
699 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
706 #define YY_DECL int yylex YY_PROTO(( void ))
712 #ifndef YY_USER_ACTION
713 #define YY_USER_ACTION
718 #define YY_BREAK break;
721 #define YY_RULE_SETUP \
726 yy_state_type yy_current_state;
730 #line 59 "./ppdscanner.l"
736 #line 733 "./ppdscanner.cpp"
755 if ( ! yy_current_buffer )
757 yy_create_buffer( yyin, YY_BUF_SIZE );
759 yy_load_buffer_state();
767 *yy_cp = yy_hold_char;
774 yy_current_state = yy_start;
778 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
779 if ( yy_accept[yy_current_state] )
781 yy_last_accepting_state = yy_current_state;
782 yy_last_accepting_cpos = yy_cp;
784 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
790 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
793 while ( yy_base[yy_current_state] != 303 );
796 yy_act = yy_accept[yy_current_state];
799 yy_cp = yy_last_accepting_cpos;
800 yy_current_state = yy_last_accepting_state;
801 yy_act = yy_accept[yy_current_state];
814 *yy_cp = yy_hold_char;
815 yy_cp = yy_last_accepting_cpos;
816 yy_current_state = yy_last_accepting_state;
820 #line 65 "./ppdscanner.l"
823 #line 65 "./ppdscanner.l"
824 { QDEBUG0(
"Open UI"); BEGIN(option);
return OPENUI; }
827 #line 67 "./ppdscanner.l"
830 #line 67 "./ppdscanner.l"
831 { QDEBUG0(
"Close UI"); BEGIN(value);
return CLOSEUI; }
835 #line 68 "./ppdscanner.l"
836 { QDEBUG0(
"Open group"); BEGIN(option);
return OPENGROUP; }
840 #line 69 "./ppdscanner.l"
841 { QDEBUG0(
"Close group"); BEGIN(option);
return CLOSEGROUP; }
845 #line 70 "./ppdscanner.l"
846 { yylval = yytext+9; BEGIN(option);
return DEFAULT; }
850 #line 71 "./ppdscanner.l"
851 { yylval = yytext+8; BEGIN(option);
return DEFAULT; }
854 #line 73 "./ppdscanner.l"
857 #line 73 "./ppdscanner.l"
858 { BEGIN(constr);
return CONSTRAINT; }
862 #line 74 "./ppdscanner.l"
863 { BEGIN(option);
return PAPERDIM; }
867 #line 75 "./ppdscanner.l"
868 { BEGIN(option);
return IMGAREA; }
872 #line 76 "./ppdscanner.l"
876 *yy_cp = yy_hold_char;
877 yy_c_buf_p = yy_cp -= 1;
880 #line 78 "./ppdscanner.l"
881 { yylval = yytext+12;
return FOODATA; }
885 #line 79 "./ppdscanner.l"
886 { QDEBUG0(
"Comment");
return COMMENT; }
890 #line 80 "./ppdscanner.l"
891 { yylval = yytext+1; QDEBUG1(
"Main keyword: %s",yytext+1); BEGIN(option);
return KEYWORD; }
898 #line 85 "./ppdscanner.l"
899 { yylval = yytext; QDEBUG1(
"Option: %s",yytext);
return OPTION; }
903 #line 86 "./ppdscanner.l"
904 { BEGIN(value);
return ':'; }
908 #line 87 "./ppdscanner.l"
909 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
913 #line 88 "./ppdscanner.l"
914 { BEGIN(translation_1);
return '/'; }
921 #line 93 "./ppdscanner.l"
922 { yylval = yytext; QDEBUG1(
"Translation: %s",yytext);
return TRANSLATION; }
926 #line 94 "./ppdscanner.l"
927 { BEGIN(value);
return ':'; }
931 #line 95 "./ppdscanner.l"
932 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
939 #line 100 "./ppdscanner.l"
940 { yylval = yytext; tdeprint_ppdscanner_lno += yylval[0].contains(
'\n'); QDEBUG1(
"Quoted value: %s",yytext);
return QUOTED; }
944 #line 101 "./ppdscanner.l"
945 { yylval = yytext; QDEBUG1(
"String part: %s",yytext);
return STRINGPART; }
949 #line 102 "./ppdscanner.l"
950 { BEGIN(translation_2);
return '/'; }
954 #line 103 "./ppdscanner.l"
955 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
959 #line 104 "./ppdscanner.l"
967 #line 109 "./ppdscanner.l"
968 { yylval = yytext; QDEBUG1(
"Translation: %s",yytext);
return TRANSLATION; }
972 #line 110 "./ppdscanner.l"
973 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
980 #line 115 "./ppdscanner.l"
985 #line 116 "./ppdscanner.l"
986 { yylval = yytext+1; QDEBUG1(
"Constraint keyword: %s",yytext);
return KEYWORD; }
990 #line 117 "./ppdscanner.l"
991 { yylval = yytext; QDEBUG1(
"Constraint option: %s",yytext);
return OPTION; }
995 #line 118 "./ppdscanner.l"
996 { tdeprint_ppdscanner_lno++; BEGIN(INITIAL); }
1000 #line 120 "./ppdscanner.l"
1001 { tdeprint_ppdscanner_lno++; }
1005 #line 121 "./ppdscanner.l"
1010 #line 123 "./ppdscanner.l"
1013 #line 1010 "./ppdscanner.cpp"
1014 case YY_STATE_EOF(INITIAL):
1015 case YY_STATE_EOF(option):
1016 case YY_STATE_EOF(value):
1017 case YY_STATE_EOF(translation_1):
1018 case YY_STATE_EOF(translation_2):
1019 case YY_STATE_EOF(constr):
1022 case YY_END_OF_BUFFER:
1025 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1028 *yy_cp = yy_hold_char;
1029 YY_RESTORE_YY_MORE_OFFSET
1031 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
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;
1054 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1056 yy_state_type yy_next_state;
1058 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1060 yy_current_state = yy_get_previous_state();
1071 yy_next_state = yy_try_NUL_trans( yy_current_state );
1073 yy_bp = yytext_ptr + YY_MORE_ADJ;
1075 if ( yy_next_state )
1078 yy_cp = ++yy_c_buf_p;
1079 yy_current_state = yy_next_state;
1086 goto yy_find_action;
1090 else switch ( yy_get_next_buffer() )
1092 case EOB_ACT_END_OF_FILE:
1094 yy_did_buffer_switch_on_eof = 0;
1107 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1109 yy_act = YY_STATE_EOF(YY_START);
1115 if ( ! yy_did_buffer_switch_on_eof )
1121 case EOB_ACT_CONTINUE_SCAN:
1123 yytext_ptr + yy_amount_of_matched_text;
1125 yy_current_state = yy_get_previous_state();
1128 yy_bp = yytext_ptr + YY_MORE_ADJ;
1131 case EOB_ACT_LAST_MATCH:
1133 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1135 yy_current_state = yy_get_previous_state();
1138 yy_bp = yytext_ptr + YY_MORE_ADJ;
1139 goto yy_find_action;
1146 "fatal flex scanner internal error--no action found" );
1160 static int yy_get_next_buffer()
1162 char *dest = yy_current_buffer->yy_ch_buf;
1163 char *source = yytext_ptr;
1164 int number_to_move, i;
1167 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1169 "fatal flex scanner internal error--end of buffer missed" );
1171 if ( yy_current_buffer->yy_fill_buffer == 0 )
1173 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1178 return EOB_ACT_END_OF_FILE;
1186 return EOB_ACT_LAST_MATCH;
1193 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1195 for ( i = 0; i < number_to_move; ++i )
1196 *(dest++) = *(source++);
1198 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1202 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1207 yy_current_buffer->yy_buf_size - number_to_move - 1;
1209 while ( num_to_read <= 0 )
1211 #ifdef YY_USES_REJECT
1213 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1217 YY_BUFFER_STATE b = yy_current_buffer;
1219 int yy_c_buf_p_offset =
1220 (int) (yy_c_buf_p - b->yy_ch_buf);
1222 if ( b->yy_is_our_buffer )
1224 int new_size = b->yy_buf_size * 2;
1226 if ( new_size <= 0 )
1227 b->yy_buf_size += b->yy_buf_size / 8;
1229 b->yy_buf_size *= 2;
1231 b->yy_ch_buf = (
char *)
1233 yy_flex_realloc( (
void *) b->yy_ch_buf,
1234 b->yy_buf_size + 2 );
1240 if ( ! b->yy_ch_buf )
1242 "fatal error - scanner input buffer overflow" );
1244 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1246 num_to_read = yy_current_buffer->yy_buf_size -
1251 if ( num_to_read > YY_READ_BUF_SIZE )
1252 num_to_read = YY_READ_BUF_SIZE;
1255 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1256 yy_n_chars, num_to_read );
1258 yy_current_buffer->yy_n_chars = yy_n_chars;
1261 if ( yy_n_chars == 0 )
1263 if ( number_to_move == YY_MORE_ADJ )
1265 ret_val = EOB_ACT_END_OF_FILE;
1271 ret_val = EOB_ACT_LAST_MATCH;
1272 yy_current_buffer->yy_buffer_status =
1273 YY_BUFFER_EOF_PENDING;
1278 ret_val = EOB_ACT_CONTINUE_SCAN;
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;
1284 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1292 static yy_state_type yy_get_previous_state()
1294 yy_state_type yy_current_state;
1297 yy_current_state = yy_start;
1299 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1301 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1302 if ( yy_accept[yy_current_state] )
1304 yy_last_accepting_state = yy_current_state;
1305 yy_last_accepting_cpos = yy_cp;
1307 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1313 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1316 return yy_current_state;
1326 #ifdef YY_USE_PROTOS
1327 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1329 static yy_state_type yy_try_NUL_trans( yy_current_state )
1330 yy_state_type yy_current_state;
1334 char *yy_cp = yy_c_buf_p;
1337 if ( yy_accept[yy_current_state] )
1339 yy_last_accepting_state = yy_current_state;
1340 yy_last_accepting_cpos = yy_cp;
1342 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
1348 yy_current_state = yy_nxt[yy_base[yy_current_state] + (
unsigned int) yy_c];
1349 yy_is_jam = (yy_current_state == 171);
1351 return yy_is_jam ? 0 : yy_current_state;
1356 #ifdef YY_USE_PROTOS
1357 static void yyunput(
int c,
char *yy_bp )
1359 static void yyunput( c, yy_bp )
1364 char *yy_cp = yy_c_buf_p;
1367 *yy_cp = yy_hold_char;
1369 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
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];
1376 &yy_current_buffer->yy_ch_buf[number_to_move];
1378 while ( source > yy_current_buffer->yy_ch_buf )
1379 *--dest = *--source;
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;
1386 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1387 YY_FATAL_ERROR(
"flex scanner push-back overflow" );
1390 *--yy_cp = (char) c;
1394 yy_hold_char = *yy_cp;
1401 static int yyinput()
1408 *yy_c_buf_p = yy_hold_char;
1410 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1416 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1422 int offset = yy_c_buf_p - yytext_ptr;
1425 switch ( yy_get_next_buffer() )
1427 case EOB_ACT_LAST_MATCH:
1443 case EOB_ACT_END_OF_FILE:
1448 if ( ! yy_did_buffer_switch_on_eof )
1457 case EOB_ACT_CONTINUE_SCAN:
1458 yy_c_buf_p = yytext_ptr + offset;
1464 c = *(
unsigned char *) yy_c_buf_p;
1466 yy_hold_char = *++yy_c_buf_p;
1473 #ifdef YY_USE_PROTOS
1474 void yyrestart( FILE *input_file )
1476 void yyrestart( input_file )
1480 if ( ! yy_current_buffer )
1481 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1483 yy_init_buffer( yy_current_buffer, input_file );
1484 yy_load_buffer_state();
1488 #ifdef YY_USE_PROTOS
1489 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1491 void yy_switch_to_buffer( new_buffer )
1492 YY_BUFFER_STATE new_buffer;
1495 if ( yy_current_buffer == new_buffer )
1498 if ( yy_current_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;
1506 yy_current_buffer = new_buffer;
1507 yy_load_buffer_state();
1514 yy_did_buffer_switch_on_eof = 1;
1518 #ifdef YY_USE_PROTOS
1519 void yy_load_buffer_state(
void )
1521 void yy_load_buffer_state()
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;
1531 #ifdef YY_USE_PROTOS
1532 YY_BUFFER_STATE yy_create_buffer( FILE *file,
int size )
1534 YY_BUFFER_STATE yy_create_buffer( file, size )
1541 b = (YY_BUFFER_STATE) yy_flex_alloc(
sizeof(
struct yy_buffer_state ) );
1543 YY_FATAL_ERROR(
"out of dynamic memory in yy_create_buffer()" );
1545 b->yy_buf_size = size;
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()" );
1554 b->yy_is_our_buffer = 1;
1556 yy_init_buffer( b, file );
1562 #ifdef YY_USE_PROTOS
1563 void yy_delete_buffer( YY_BUFFER_STATE b )
1565 void yy_delete_buffer( b )
1572 if ( b == yy_current_buffer )
1573 yy_current_buffer = (YY_BUFFER_STATE) 0;
1575 if ( b->yy_is_our_buffer )
1576 yy_flex_free( (
void *) b->yy_ch_buf );
1578 yy_flex_free( (
void *) b );
1583 #ifdef YY_USE_PROTOS
1584 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1586 void yy_init_buffer( b, file )
1593 yy_flush_buffer( b );
1595 b->yy_input_file = file;
1596 b->yy_fill_buffer = 1;
1598 #if YY_ALWAYS_INTERACTIVE
1599 b->yy_is_interactive = 1;
1601 #if YY_NEVER_INTERACTIVE
1602 b->yy_is_interactive = 0;
1604 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1610 #ifdef YY_USE_PROTOS
1611 void yy_flush_buffer( YY_BUFFER_STATE b )
1613 void yy_flush_buffer( b )
1627 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1628 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1630 b->yy_buf_pos = &b->yy_ch_buf[0];
1633 b->yy_buffer_status = YY_BUFFER_NEW;
1635 if ( b == yy_current_buffer )
1636 yy_load_buffer_state();
1640 #ifndef YY_NO_SCAN_BUFFER
1641 #ifdef YY_USE_PROTOS
1642 YY_BUFFER_STATE yy_scan_buffer(
char *base, yy_size_t size )
1644 YY_BUFFER_STATE yy_scan_buffer( base, size )
1652 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1653 base[size-1] != YY_END_OF_BUFFER_CHAR )
1657 b = (YY_BUFFER_STATE) yy_flex_alloc(
sizeof(
struct yy_buffer_state ) );
1659 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_buffer()" );
1661 b->yy_buf_size = size - 2;
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;
1668 b->yy_fill_buffer = 0;
1669 b->yy_buffer_status = YY_BUFFER_NEW;
1671 yy_switch_to_buffer( b );
1678 #ifndef YY_NO_SCAN_STRING
1679 #ifdef YY_USE_PROTOS
1680 YY_BUFFER_STATE yy_scan_string( yyconst
char *yy_str )
1682 YY_BUFFER_STATE yy_scan_string( yy_str )
1683 yyconst
char *yy_str;
1687 for ( len = 0; yy_str[len]; ++len )
1690 return yy_scan_bytes( yy_str, len );
1695 #ifndef YY_NO_SCAN_BYTES
1696 #ifdef YY_USE_PROTOS
1697 YY_BUFFER_STATE yy_scan_bytes( yyconst
char *bytes,
int len )
1699 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1700 yyconst
char *bytes;
1711 buf = (
char *) yy_flex_alloc( n );
1713 YY_FATAL_ERROR(
"out of dynamic memory in yy_scan_bytes()" );
1715 for ( i = 0; i < len; ++i )
1718 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1720 b = yy_scan_buffer( buf, n );
1722 YY_FATAL_ERROR(
"bad buffer in yy_scan_bytes()" );
1727 b->yy_is_our_buffer = 1;
1734 #ifndef YY_NO_PUSH_STATE
1735 #ifdef YY_USE_PROTOS
1736 static void yy_push_state(
int new_state )
1738 static void yy_push_state( new_state )
1742 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1746 yy_start_stack_depth += YY_START_STACK_INCR;
1747 new_size = yy_start_stack_depth *
sizeof( int );
1749 if ( ! yy_start_stack )
1750 yy_start_stack = (
int *) yy_flex_alloc( new_size );
1753 yy_start_stack = (
int *) yy_flex_realloc(
1754 (
void *) yy_start_stack, new_size );
1756 if ( ! yy_start_stack )
1758 "out of memory expanding start-condition stack" );
1761 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1768 #ifndef YY_NO_POP_STATE
1769 static void yy_pop_state()
1771 if ( --yy_start_stack_ptr < 0 )
1772 YY_FATAL_ERROR(
"start-condition stack underflow" );
1774 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1779 #ifndef YY_NO_TOP_STATE
1780 static int yy_top_state()
1782 return yy_start_stack[yy_start_stack_ptr - 1];
1786 #ifndef YY_EXIT_FAILURE
1787 #define YY_EXIT_FAILURE 2
1790 #ifdef YY_USE_PROTOS
1791 static void yy_fatal_error( yyconst
char msg[] )
1793 static void yy_fatal_error( msg )
1797 (void) fprintf( stderr,
"[ppdscanner] %s\n", msg );
1798 exit( YY_EXIT_FAILURE );
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'; \
1822 #ifdef YY_USE_PROTOS
1823 static void yy_flex_strncpy(
char *s1, yyconst
char *s2,
int n )
1825 static void yy_flex_strncpy( s1, s2, n )
1832 for ( i = 0; i < n; ++i )
1837 #ifdef YY_NEED_STRLEN
1838 #ifdef YY_USE_PROTOS
1839 static int yy_flex_strlen( yyconst
char *s )
1841 static int yy_flex_strlen( s )
1846 for ( n = 0; s[n]; ++n )
1854 #ifdef YY_USE_PROTOS
1855 static void *yy_flex_alloc( yy_size_t size )
1857 static void *yy_flex_alloc( size )
1861 return (
void *) malloc( size );
1864 #ifdef YY_USE_PROTOS
1865 static void *yy_flex_realloc(
void *ptr, yy_size_t size )
1867 static void *yy_flex_realloc( ptr, size )
1879 return (
void *) realloc( (
char *) ptr, size );
1882 #ifdef YY_USE_PROTOS
1883 static void yy_flex_free(
void *ptr )
1885 static void yy_flex_free( ptr )
1899 #line 123 "./ppdscanner.l"
1902 void tdeprint_ppdscanner_init(TQIODevice *d)
1904 tdeprint_ppdscanner_device = d;
1905 tdeprint_ppdscanner_lno = 1;
1908 void tdeprint_ppdscanner_terminate(
bool deleteIt )
1911 delete tdeprint_ppdscanner_device;
1912 tdeprint_ppdscanner_device = NULL;
1915 int tdeprint_ppdscanner_numberoflines()
1917 return tdeprint_ppdscanner_lno;