home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource Library: Graphics
/
graphics-16000.iso
/
msdos
/
raytrace
/
rayshade
/
etc
/
rsconver
/
lexyy.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-30
|
28KB
|
912 lines
#define YY_DEFAULT_ACTION ECHO;
#define FLEX_USE_ECS
#define FLEX_USE_MECS
/* A lexical scanner generated by flex */
#include "skeleton.h"
#define INITIAL 0
/* lex.l */
/* Copyright (C) 1989, 1991, Craig E. Kolb */
/* All rights reserved. */
/* */
/* This software may be freely copied, modified, and redistributed, */
/* provided that this copyright notice is preserved on all copies. */
/* */
/* You may not distribute this software, in whole or in part, as part of */
/* any commercial product without the express consent of the authors. */
/* */
/* There is no warranty or other guarantee of fitness of this software */
/* for any purpose. It is provided solely "as is". */
/* $Id: lex.l,v 4.0.1.1 91/11/26 21:12:29 cek Exp Locker: cek $ */
#include "config.h"
#include <stdio.h>
#ifdef I_STRING
#include <string.h>
#else
#include <strings.h>
#endif
#include "common.h"
#include "yacc_tab.h"
#define YY_JAM 299
#define YY_JAM_BASE 601
#define YY_TEMPLATE 300
static char l[300] =
{ 0,
-2, -2, 62, 1, 2, 3, 62, 62, 57, 58,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 4,
0, 58, 60, 5, 57, 59, 0, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 55, 57, 0, 59, 0, 0,
61, 57, 57, 57, 57, 10, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 23, 57, 26, 27,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 57, 0, 60, 0,
0, 59, 57, 57, 57, 57, 11, 57, 13, 57,
57, 57, 57, 57, 57, 57, 57, 22, 57, 57,
57, 29, 57, 57, 57, 33, 57, 57, 57, 37,
57, 57, 57, 57, 42, 57, 57, 57, 57, 57,
57, 57, 57, 57, 57, 57, 56, 0, 59, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 57,
57, 57, 57, 57, 28, 57, 57, 32, 34, 57,
57, 57, 57, 40, 41, 57, 57, 57, 46, 57,
57, 57, 57, 57, 57, 57, 57, 57, 57, 9,
57, 57, 15, 57, 17, 18, 57, 57, 57, 57,
57, 57, 57, 35, 57, 38, 57, 57, 44, 57,
47, 48, 49, 57, 57, 57, 57, 57, 57, 57,
57, 12, 57, 57, 57, 20, 57, 24, 57, 57,
57, 57, 39, 57, 45, 50, 51, 57, 57, 57,
6, 7, 57, 14, 16, 57, 21, 57, 57, 31,
36, 57, 57, 57, 54, 57, 57, 25, 57, 57,
52, 53, 8, 57, 57, 43, 19, 30, 0
} ;
static char e[128] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 1, 5, 1, 1, 1, 1, 1,
1, 6, 7, 1, 8, 9, 10, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 1, 1, 1,
1, 1, 1, 1, 12, 12, 12, 12, 13, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
1, 1, 1, 1, 14, 1, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 12, 1, 1, 1, 1, 1
} ;
static char m[40] =
{ 0,
1, 1, 1, 1, 1, 2, 1, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2
} ;
static short int b[301] =
{ 0,
0, 596, 601, 601, 601, 601, 31, 589, 593, 32,
592, 38, 40, 41, 42, 43, 44, 46, 48, 51,
56, 71, 77, 58, 82, 83, 84, 85, 90, 601,
586, 86, 91, 601, 590, 95, 113, 111, 103, 117,
101, 119, 121, 122, 123, 125, 126, 127, 129, 131,
130, 134, 133, 137, 136, 132, 139, 138, 150, 140,
144, 157, 160, 161, 162, 168, 164, 169, 172, 173,
174, 179, 175, 183, 589, 181, 193, 201, 208, 583,
582, 187, 186, 196, 201, 586, 202, 216, 217, 218,
219, 220, 221, 224, 222, 223, 232, 231, 585, 584,
225, 239, 228, 244, 246, 248, 249, 250, 253, 254,
256, 257, 255, 258, 53, 261, 264, 259, 266, 274,
275, 278, 267, 270, 263, 290, 289, 578, 577, 291,
576, 575, 279, 294, 295, 297, 579, 300, 578, 302,
303, 304, 305, 309, 312, 313, 311, 577, 306, 314,
315, 576, 316, 324, 318, 575, 320, 321, 325, 574,
329, 336, 339, 343, 573, 345, 347, 348, 349, 350,
351, 354, 355, 356, 357, 359, 572, 566, 565, 361,
358, 360, 366, 370, 367, 374, 379, 389, 390, 369,
372, 393, 373, 395, 569, 396, 399, 568, 567, 398,
402, 400, 409, 566, 565, 404, 406, 408, 564, 410,
414, 412, 420, 413, 416, 423, 415, 417, 418, 563,
422, 434, 562, 440, 561, 560, 435, 442, 444, 446,
447, 449, 454, 559, 450, 558, 456, 451, 557, 458,
556, 555, 554, 459, 460, 465, 462, 466, 468, 474,
475, 553, 477, 476, 480, 552, 482, 551, 483, 484,
495, 490, 550, 491, 549, 548, 546, 489, 492, 496,
545, 543, 497, 542, 541, 499, 540, 498, 500, 539,
537, 493, 511, 512, 535, 517, 514, 534, 518, 522,
533, 531, 530, 527, 524, 528, 180, 52, 601, 51
} ;
static short int d[301] =
{ 0,
299, 1, 299, 299, 299, 299, 299, 299, 300, 299,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 299,
299, 299, 299, 299, 300, 299, 299, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 299, 299, 299, 299,
299, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 299, 299, 299,
299, 299, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 299, 299, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300, 300, 300,
300, 300, 300, 300, 300, 300, 300, 300,-32767, 299
} ;
static short int n[641] =
{ 0,
3, 4, 5, 6, 3, 3, 7, 7, 8, 9,
10, 11, 11, 3, 12, 13, 14, 15, 16, 17,
18, 19, 11, 20, 11, 21, 22, 11, 23, 24,
11, 25, 26, 27, 28, 11, 29, 11, 11, 31,
36, 32, 32, 299, 37, 299, 299, 299, 299, 299,
37, 299, 35, 299, 40, 38, 299, 299, 299, 53,
48, 299, 44, 299, 49, 41, 57, 39, 42, 45,
50, 55, 54, 58, 43, 46, 299, 56, 59, 47,
51, 52, 299, 65, 60, 61, 66, 299, 299, 299,
299, 165, 63, 62, 36, 299, 32, 69, 37, 70,
67, 33, 73, 77, 37, 78, 299, 79, 299, 77,
68, 64, 71, 79, 75, 74, 299, 72, 76, 80,
80, 83, 299, 81, 299, 82, 299, 299, 299, 85,
299, 299, 299, 84, 299, 299, 299, 299, 299, 299,
88, 299, 299, 299, 299, 299, 92, 87, 94, 299,
89, 91, 96, 98, 102, 299, 86, 99, 90, 97,
93, 103, 299, 95, 101, 299, 299, 299, 107, 299,
105, 104, 100, 299, 299, 108, 113, 299, 299, 299,
299, 109, 106, 111, 299, 299, 299, 119, 299, 110,
114, 299, 299, 115, 112, 121, 116, 125, 118, 128,
128, 299, 117, 129, 120, 126, 299, 299, 122, 127,
123, 78, 124, 130, 131, 131, 133, 134, 132, 130,
135, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 137, 138, 299, 136, 139, 299, 299, 143, 145,
147, 142, 144, 146, 299, 150, 141, 149, 153, 299,
140, 299, 148, 299, 299, 299, 152, 151, 299, 299,
299, 299, 299, 299, 299, 158, 299, 155, 299, 299,
159, 299, 299, 157, 161, 299, 162, 154, 167, 299,
299, 156, 163, 299, 299, 164, 173, 160, 168, 166,
175, 169, 170, 171, 299, 299, 172, 178, 178, 299,
299, 179, 299, 174, 176, 299, 177, 299, 299, 299,
299, 299, 180, 183, 299, 182, 299, 299, 299, 299,
299, 299, 186, 299, 184, 299, 299, 181, 190, 299,
299, 187, 188, 185, 299, 191, 189, 196, 192, 194,
193, 299, 197, 201, 299, 202, 200, 195, 299, 199,
299, 198, 299, 299, 299, 299, 299, 204, 203, 299,
299, 299, 299, 299, 299, 299, 299, 209, 210, 213,
206, 299, 299, 208, 299, 299, 205, 299, 299, 299,
207, 222, 211, 217, 299, 212, 216, 220, 221, 215,
214, 219, 218, 223, 299, 299, 224, 228, 299, 230,
299, 299, 227, 299, 299, 299, 225, 299, 226, 299,
229, 299, 231, 299, 299, 299, 234, 299, 299, 299,
299, 299, 299, 299, 239, 299, 240, 299, 299, 232,
233, 235, 242, 236, 237, 246, 244, 241, 238, 299,
299, 247, 243, 248, 245, 299, 251, 299, 250, 299,
249, 299, 299, 252, 299, 299, 299, 255, 254, 299,
256, 299, 257, 299, 299, 299, 253, 299, 260, 259,
299, 299, 261, 299, 263, 258, 269, 266, 267, 299,
299, 299, 299, 262, 264, 299, 271, 299, 299, 299,
265, 270, 272, 268, 299, 299, 299, 299, 299, 277,
299, 299, 299, 299, 299, 299, 279, 275, 276, 273,
274, 281, 280, 282, 285, 278, 299, 299, 289, 299,
283, 290, 299, 299, 286, 284, 287, 299, 294, 299,
292, 288, 299, 299, 293, 299, 299, 291, 299, 299,
299, 298, 299, 295, 299, 299, 299, 299, 299, 296,
299, 299, 297, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 179, 179, 299, 299, 299,
299, 299, 299, 299, 299, 132, 132, 129, 129, 299,
299, 299, 81, 81, 299, 299, 33, 299, 34, 33,
30, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299
} ;
static short int c[641] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 7,
10, 7, 10, 12, 10, 13, 14, 15, 16, 17,
10, 18, 300, 19, 13, 12, 20, 298, 115, 17,
15, 21, 14, 24, 15, 13, 19, 12, 13, 14,
16, 18, 17, 20, 13, 14, 22, 18, 21, 14,
16, 16, 23, 24, 21, 22, 24, 25, 26, 27,
28, 115, 23, 22, 32, 29, 32, 26, 32, 26,
25, 33, 27, 33, 32, 36, 41, 36, 39, 33,
25, 23, 26, 36, 28, 27, 38, 26, 29, 37,
37, 39, 40, 37, 42, 38, 43, 44, 45, 41,
46, 47, 48, 40, 49, 51, 50, 56, 53, 52,
44, 55, 54, 58, 57, 60, 48, 43, 50, 61,
45, 47, 52, 54, 56, 59, 42, 54, 46, 53,
49, 57, 62, 51, 55, 63, 64, 65, 60, 67,
59, 58, 54, 66, 68, 61, 65, 69, 70, 71,
73, 61, 59, 63, 72, 297, 76, 70, 74, 62,
66, 83, 82, 66, 64, 71, 67, 74, 69, 77,
77, 84, 68, 77, 70, 74, 85, 87, 72, 76,
72, 78, 73, 78, 79, 79, 82, 83, 79, 78,
84, 88, 89, 90, 91, 92, 93, 95, 96, 94,
101, 87, 88, 103, 85, 89, 98, 97, 92, 93,
95, 91, 92, 94, 102, 98, 90, 97, 103, 104,
89, 105, 96, 106, 107, 108, 102, 101, 109, 110,
113, 111, 112, 114, 118, 108, 116, 105, 125, 117,
109, 119, 123, 107, 111, 124, 112, 104, 117, 120,
121, 106, 113, 122, 133, 114, 123, 110, 118, 116,
125, 119, 120, 121, 127, 126, 122, 130, 130, 134,
135, 130, 136, 124, 126, 138, 127, 140, 141, 142,
143, 149, 133, 136, 144, 135, 147, 145, 146, 150,
151, 153, 141, 155, 138, 157, 158, 134, 145, 154,
159, 142, 143, 140, 161, 146, 144, 153, 147, 150,
149, 162, 154, 159, 163, 161, 158, 151, 164, 157,
166, 155, 167, 168, 169, 170, 171, 163, 162, 172,
173, 174, 175, 181, 176, 182, 180, 169, 170, 173,
166, 183, 185, 168, 190, 184, 164, 191, 193, 186,
167, 185, 171, 180, 187, 172, 176, 183, 184, 175,
174, 182, 181, 186, 188, 189, 187, 191, 192, 193,
194, 196, 190, 200, 197, 202, 188, 201, 189, 206,
192, 207, 194, 208, 203, 210, 200, 212, 214, 211,
217, 215, 218, 219, 207, 213, 208, 221, 216, 196,
197, 201, 211, 202, 203, 215, 213, 210, 206, 222,
227, 215, 212, 216, 214, 224, 219, 228, 218, 229,
217, 230, 231, 221, 232, 235, 238, 227, 224, 233,
228, 237, 229, 240, 244, 245, 222, 247, 232, 231,
246, 248, 233, 249, 237, 230, 247, 244, 245, 250,
251, 254, 253, 235, 238, 255, 249, 257, 259, 260,
240, 248, 250, 246, 268, 262, 264, 269, 282, 257,
261, 270, 273, 278, 276, 279, 260, 254, 255, 251,
253, 262, 261, 264, 270, 259, 283, 284, 279, 287,
268, 282, 286, 289, 273, 269, 276, 290, 287, 295,
284, 278, 294, 296, 286, 293, 292, 283, 291, 288,
285, 295, 281, 289, 280, 277, 275, 274, 272, 290,
271, 267, 294, 266, 265, 263, 258, 256, 252, 243,
242, 241, 239, 236, 234, 226, 225, 223, 220, 209,
205, 204, 199, 198, 195, 179, 178, 177, 165, 160,
156, 152, 148, 139, 137, 132, 131, 129, 128, 100,
99, 86, 81, 80, 75, 35, 31, 11, 9, 8,
2, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299,
299, 299, 299, 299, 299, 299, 299, 299, 299, 299
} ;
/* these declarations have to come after the section 1 code or lint gets
* confused about whether the variables are used
*/
FILE *yyin = stdin, *yyout = stdout;
/* these variables are all declared out here so that section 3 code can
* manipulate them
*/
static int yy_start, yy_b_buf_p, yy_c_buf_p, yy_e_buf_p;
static int yy_saw_eof, yy_init = 1;
/* yy_ch_buf has to be 1 character longer than YY_BUF_SIZE, since when
* setting up yytext we can try to put a '\0' just past the end of the
* matched text
*/
static char yy_ch_buf[YY_BUF_SIZE + 1];
static int yy_st_buf[YY_BUF_SIZE];
static char yy_hold_char;
static char input( void) ;
static void unput( char) ;
char *yytext;
static int yyleng;
/*--------------------------------------------------------------------------*/
/*------------------------- BEGIN LEXICAL ANALYZER -------------------------*/
/*--------------------------------------------------------------------------*/
YY_DECL
{
int yy_n_chars, yy_lp, yy_iii, yy_buf_pos, yy_act;
#ifdef FLEX_REJECT_ENABLED
int yy_full_match;
#endif
if ( yy_init )
{
YY_INIT;
yy_start = 1;
yy_init = 0;
}
goto get_next_token;
do_action:
#ifdef FLEX_REJECT_ENABLED
/* remember matched text in case we back up due to trailing context */
yy_full_match = yy_c_buf_p;
#endif
for ( ; ; )
{
YY_DO_BEFORE_ACTION
#ifdef FLEX_DEBUG
fprintf( stderr, "--accepting rule #%d\n", yy_act );
#endif
switch ( yy_act )
{
case 1:
{WriteVerbatim(yytext);};
YY_BREAK
case 2:
{};
YY_BREAK
case 3:
{};
YY_BREAK
case 4:
{return handlehash();}
YY_BREAK
case 5:
{skipcomments();}
YY_BREAK
case 6:
{return(tADAPTIVE);}
YY_BREAK
case 7:
{return(tAPERTURE);}
YY_BREAK
case 8:
{return(tBACKGROUND);}
YY_BREAK
case 9:
{return(tBLOTCH);}
YY_BREAK
case 10:
{return(tBOX);}
YY_BREAK
case 11:
{return(tBUMP);}
YY_BREAK
case 12:
{return(tCHECKER);}
YY_BREAK
case 13:
{return(tCONE);}
YY_BREAK
case 14:
{return(tCONTRAST);}
YY_BREAK
case 15:
{return(tCUTOFF);}
YY_BREAK
case 16:
{return(tCYL);}
YY_BREAK
case 17:
{return(tENDDEF);}
YY_BREAK
case 18:
{return(tSTARTDEF);}
YY_BREAK
case 19:
{return(tDIRECTIONAL);}
YY_BREAK
case 20:
{return(tENDFILE);}
YY_BREAK
case 21:
{return(tEXTENDED);}
YY_BREAK
case 22:
{return(tEYEP);}
YY_BREAK
case 23:
{return(tFBM);}
YY_BREAK
case 24:
{return(tFBMBUMP);}
YY_BREAK
case 25:
{return(tFOCALDIST);}
YY_BREAK
case 26:
{return(tFOG);}
YY_BREAK
case 27:
{return(tFOV);}
YY_BREAK
case 28:
{return(tGLOSS);}
YY_BREAK
case 29:
{return(tGRID);}
YY_BREAK
case 30:
{return(tHEIGHTFIELD);}
YY_BREAK
case 31:
{return(tJITTERED);}
YY_BREAK
case 32:
{return(tLIGHT);}
YY_BREAK
case 33:
{return(tLIST);}
YY_BREAK
case 34:
{return(tLOOKP);}
YY_BREAK
case 35:
{return(tMARBLE);}
YY_BREAK
case 36:
{return(tMAXDEPTH);}
YY_BREAK
case 37:
{return(tMIST);}
YY_BREAK
case 38:
{return(tOBJECT);}
YY_BREAK
case 39:
{return(tOUTFILE);}
YY_BREAK
case 40:
{return(tPLANE);}
YY_BREAK
case 41:
{return(tPOINT);}
YY_BREAK
case 42:
{return(tPOLY);}
YY_BREAK
case 43:
{return(tRESOLUTION);}
YY_BREAK
case 44:
{return(tROTATE);}
YY_BREAK
case 45:
{return(tSAMPLES);}
YY_BREAK
case 46:
{return(tSCALE);}
YY_BREAK
case 47:
{return(tSCREEN);}
YY_BREAK
case 48:
{return(tSPHERE);}
YY_BREAK
case 49:
{return(tSUPERQ);}
YY_BREAK
case 50:
{return(tSURFACE);}
YY_BREAK
case 51:
{return(tTEXTURE);}
YY_BREAK
case 52:
{return(tTRANSFORM);}
YY_BREAK
case 53:
{return(tTRANSLATE);}
YY_BREAK
case 54:
{return(tTRIANGLE);}
YY_BREAK
case 55:
{return(tUP);}
YY_BREAK
case 56:
{return(tWOOD);}
YY_BREAK
case 57:
{yylval.c = strsave(yytext);
return(tSTRING);}
YY_BREAK
case 58:
{yylval.i = atoi(yytext);
return(tINT);}
YY_BREAK
case 59:
case 60:
case 61:
{yylval.d = atof(yytext); return(tFLOAT);}
YY_BREAK
case 62:
{return yytext[0];}
YY_BREAK
case 63:
YY_DEFAULT_ACTION;
YY_BREAK
case YY_NEW_FILE:
break; /* begin reading from new file */
case YY_END_TOK:
return ( YY_END_TOK );
default:
YY_FATAL_ERROR( "fatal flex scanner internal error" );
}
get_next_token:
{
register int yy_curst;
register char yy_sym;
YY_DO_BEFORE_SCAN
/* set up to begin running DFA */
yy_curst = yy_start;
if ( yy_ch_buf[yy_c_buf_p] == '\n' )
++yy_curst;
/* yy_b_buf_p points to the position in yy_ch_buf
* of the start of the current run.
*/
yy_b_buf_p = yy_c_buf_p + 1;
do /* until the machine jams */
{
if ( yy_c_buf_p == yy_e_buf_p )
{ /* need more input */
if ( yy_e_buf_p >= YY_BUF_LIM )
{ /* not enough room to do another read */
/* see if we can make some room for more chars */
yy_n_chars = yy_e_buf_p - yy_b_buf_p;
if ( yy_n_chars >= 0 )
/* shift down buffer to make room */
for ( yy_iii = 0; yy_iii <= yy_n_chars; ++yy_iii )
{
yy_buf_pos = yy_b_buf_p + yy_iii;
yy_ch_buf[yy_iii] = yy_ch_buf[yy_buf_pos];
yy_st_buf[yy_iii] = yy_st_buf[yy_buf_pos];
}
yy_b_buf_p = 0;
yy_e_buf_p = yy_n_chars;
if ( yy_e_buf_p >= YY_BUF_LIM )
YY_FATAL_ERROR( "flex input buffer overflowed" );
yy_c_buf_p = yy_e_buf_p;
}
else if ( yy_saw_eof )
{
saweof: if ( yy_b_buf_p > yy_e_buf_p )
{
if ( yywrap() )
{
yy_act = YY_END_TOK;
goto do_action;
}
else
{
YY_INIT;
yy_act = YY_NEW_FILE;
goto do_action;
}
}
else /* do a jam to eat up more input */
{
#ifndef FLEX_INTERACTIVE_SCANNER
/* we're going to decrement yy_c_buf_p upon doing
* the jam. In this case, that's wrong, since
* it points to the last non-jam character. So
* we increment it now to counter the decrement.
*/
++yy_c_buf_p;
#endif
break;
}
}
YY_INPUT( (yy_ch_buf + yy_c_buf_p + 1), yy_n_chars,
YY_MAX_LINE );
if ( yy_n_chars == YY_NULL )
{
if ( yy_saw_eof )
YY_FATAL_ERROR( "flex scanner saw EOF twice - shouldn't happen" );
yy_saw_eof = 1;
goto saweof;
}
yy_e_buf_p += yy_n_chars;
}
++yy_c_buf_p;
#ifdef FLEX_USE_ECS
yy_sym = e[yy_ch_buf[yy_c_buf_p]];
#else
yy_sym = yy_ch_buf[yy_c_buf_p];
#endif
#ifdef FLEX_FULL_TABLE
yy_curst = n[yy_curst][yy_sym];
#else /* get next state from compressed table */
while ( c[b[yy_curst] + yy_sym] != yy_curst )
{
yy_curst = d[yy_curst];
#ifdef FLEX_USE_MECS
/* we've arrange it so that templates are never chained
* to one another. This means we can afford make a
* very simple test to see if we need to convert to
* yy_sym's meta-equivalence class without worrying
* about erroneously looking up the meta-equivalence
* class twice
*/
if ( yy_curst >= YY_TEMPLATE )
yy_sym = m[yy_sym];
#endif
}
yy_curst = n[b[yy_curst] + yy_sym];
#endif
yy_st_buf[yy_c_buf_p] = yy_curst;
}
#ifdef FLEX_INTERACTIVE_SCANNER
while ( b[yy_curst] != YY_JAM_BASE );
#else
while ( yy_curst != YY_JAM );
--yy_c_buf_p; /* put back character we jammed on */
#endif
if ( yy_c_buf_p >= yy_b_buf_p )
{ /* we matched some text */
yy_curst = yy_st_buf[yy_c_buf_p];
yy_lp = l[yy_curst];
#ifdef FLEX_REJECT_ENABLED
find_rule: /* we branch to this label when doing a REJECT */
#endif
for ( ; ; ) /* until we find what rule we matched */
{
#ifdef FLEX_REJECT_ENABLED
if ( yy_lp && yy_lp < l[yy_curst + 1] )
{
yy_act = a[yy_lp];
goto do_action; /* "continue 2" */
}
#else
if ( yy_lp )
{
yy_act = yy_lp;
goto do_action; /* "continue 2" */
}
#endif
if ( --yy_c_buf_p < yy_b_buf_p )
break;
yy_curst = yy_st_buf[yy_c_buf_p];
yy_lp = l[yy_curst];
}
}
YY_FATAL_ERROR( "no match in flex scanner - possible NULL in input" );
}
}
/*NOTREACHED*/
}
static void unput( c )
char c;
{
register int i;
register int yy_buf_pos ;
YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */
if ( yy_c_buf_p == 0 )
{
yy_buf_pos = YY_BUF_MAX ;
for ( i = yy_e_buf_p; i >= yy_c_buf_p; --i )
{
yy_ch_buf[yy_buf_pos] = yy_ch_buf[i];
yy_st_buf[yy_buf_pos] = yy_st_buf[i];
--yy_buf_pos;
}
yy_c_buf_p = YY_BUF_MAX - yy_e_buf_p;
yy_e_buf_p = YY_BUF_MAX;
}
if ( yy_c_buf_p <= 0 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
if ( yy_c_buf_p >= yy_b_buf_p && yy_ch_buf[yy_c_buf_p] == '\n' )
yy_ch_buf[yy_c_buf_p - 1] = '\n';
yy_ch_buf[yy_c_buf_p--] = c;
YY_DO_BEFORE_ACTION; /* set up yytext again */
}
static char input( void)
{
char c;
YY_DO_BEFORE_SCAN
if ( yy_c_buf_p == yy_e_buf_p )
{ /* need more input */
int yy_n_chars;
/* we can throw away the entire current buffer */
if ( yy_saw_eof )
{
if ( yywrap() )
return ( EOF );
YY_INIT;
}
yy_b_buf_p = 0;
YY_INPUT( yy_ch_buf, yy_n_chars, YY_MAX_LINE );
if ( yy_n_chars == YY_NULL )
{
yy_saw_eof = 1;
if ( yywrap() )
return ( EOF );
YY_INIT;
return ( input() );
}
yy_c_buf_p = -1;
yy_e_buf_p = yy_n_chars - 1;
}
c = (unsigned char) yy_ch_buf[++yy_c_buf_p];
YY_DO_BEFORE_ACTION;
return ( c );
}
/*--------------------------------------------------------------------------*/
/*------------------------- END OF LEXICAL ANALYZER ------------------------*/
/*--------------------------------------------------------------------------*/
yywrap() {return(1);}
/*
* Skip over comments.
*/
skipcomments()
{
char c;
WriteVerbatim("/*");
while (1) {
while ((c = input()) != '*')
WriteChar(c);
WriteChar(c);
if ((c = input()) == '/') {
WriteChar(c);
WriteNewline();
return;
}
unput(c);
}
}
/*
* Deal with ccp-produced lines of the form:
* # n "filename"
* and
* # n
* Where filename is the name of the file being processed, and n is
* the current line number in that file.
*/
handlehash()
{
char buf[BUFSIZ];
int i, linenumber;
extern int yylineno;
extern char yyfilename[];
/*
* Read the entire line into buf.
*/
for (i = 0; (buf[i] = input()) != '\n'; i++)
;
unput(buf[i]); /* To make sure consecutive # lines work. */
buf[i] = (char)NULL; /* Replace newline with NULL. */
yylval.c = strsave(buf);
/*
* Set file/line if the line was of the form #n "filename"
*/
if ((i = sscanf(buf, "%d \"%[^\"]s\"", &linenumber, buf)) != 0) {
yylineno = linenumber;
#ifdef SYSV
if (strchr(buf, '"') != (char *)0) {
#else
if (index(buf, '"') != (char *)0) {
#endif
/*
* Filename was "", which means stdin.
*/
strcpy(yyfilename, "stdin");
} else
strcpy(yyfilename, buf);
}
return tHASHTHING;
}