/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include
#include
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include
#include
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the yyless() call.
*/
/* Return all but the first 'n' matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, yytext_ptr )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
typedef unsigned int yy_size_t;
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE yy_current_buffer = 0;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*/
#define YY_CURRENT_BUFFER yy_current_buffer
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 17
#define YY_END_OF_BUFFER 18
static yyconst short int yy_accept[190] =
{ 0,
0, 0, 0, 0, 2, 2, 18, 17, 7, 16,
17, 17, 17, 16, 16, 9, 9, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 2, 2, 3, 0, 14, 0, 0,
6, 0, 0, 12, 0, 0, 1, 0, 0, 10,
9, 9, 0, 9, 9, 9, 15, 15, 15, 15,
15, 15, 15, 8, 15, 15, 15, 15, 15, 15,
8, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 2, 4, 0, 14, 6, 12, 0, 0,
0, 0, 5, 13, 10, 10, 9, 9, 11, 9,
9, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 0, 0,
0, 13, 13, 10, 10, 11, 11, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 0, 0, 13,
13, 11, 11, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 13, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 0
} ;
static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 5, 6, 1, 4, 4, 7, 4,
4, 8, 9, 4, 9, 10, 11, 12, 13, 13,
13, 13, 13, 13, 13, 14, 14, 4, 4, 4,
4, 4, 4, 1, 15, 15, 15, 15, 16, 17,
18, 18, 18, 18, 18, 19, 18, 18, 18, 18,
18, 18, 18, 18, 20, 18, 18, 21, 18, 18,
4, 22, 4, 4, 23, 1, 24, 25, 26, 27,
28, 29, 30, 31, 32, 18, 33, 34, 35, 36,
37, 38, 18, 39, 40, 41, 42, 43, 44, 45,
46, 47, 4, 4, 4, 4, 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, 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, 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, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst int yy_meta[48] =
{ 0,
1, 1, 2, 1, 1, 1, 3, 4, 1, 1,
1, 5, 5, 5, 5, 5, 5, 6, 6, 6,
6, 1, 7, 5, 5, 5, 5, 5, 5, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6
} ;
static yyconst short int yy_base[200] =
{ 0,
0, 2, 5, 0, 51, 53, 370, 371, 371, 371,
52, 55, 53, 50, 57, 68, 104, 0, 327, 329,
42, 39, 49, 35, 330, 55, 329, 337, 64, 318,
327, 325, 330, 0, 0, 349, 81, 371, 87, 90,
371, 97, 352, 351, 142, 115, 371, 354, 85, 178,
84, 87, 0, 0, 91, 88, 0, 315, 327, 314,
329, 316, 322, 308, 309, 306, 306, 309, 306, 303,
0, 302, 306, 90, 304, 85, 106, 308, 301, 102,
103, 306, 0, 371, 131, 134, 137, 371, 145, 330,
329, 332, 371, 209, 121, 131, 371, 371, 142, 371,
371, 297, 309, 304, 292, 30, 306, 304, 300, 292,
298, 301, 287, 293, 290, 279, 281, 283, 290, 276,
274, 274, 286, 276, 280, 284, 286, 275, 161, 301,
298, 141, 153, 371, 371, 152, 161, 273, 264, 272,
261, 268, 262, 259, 257, 246, 232, 214, 204, 208,
213, 210, 208, 198, 203, 191, 203, 223, 187, 371,
371, 371, 371, 193, 193, 190, 181, 175, 179, 187,
184, 185, 169, 177, 178, 169, 164, 190, 151, 148,
158, 150, 149, 135, 123, 109, 117, 115, 371, 243,
250, 257, 264, 271, 274, 281, 288, 96, 293
} ;
static yyconst short int yy_def[200] =
{ 0,
190, 190, 189, 3, 191, 191, 189, 189, 189, 189,
192, 193, 194, 189, 189, 189, 189, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 196, 196, 189, 192, 189, 192, 193,
189, 193, 189, 189, 189, 189, 189, 197, 189, 189,
189, 189, 198, 17, 189, 189, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 196, 189, 192, 192, 193, 189, 189, 189,
199, 197, 189, 189, 189, 189, 189, 189, 198, 189,
189, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 189, 199,
189, 189, 189, 189, 189, 189, 189, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 189, 189, 189,
189, 189, 189, 195, 195, 195, 195, 195, 195, 195,
195, 195, 195, 195, 195, 195, 195, 189, 195, 195,
195, 195, 195, 195, 195, 195, 195, 195, 0, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189
} ;
static yyconst short int yy_nxt[419] =
{ 0,
189, 9, 9, 9, 9, 8, 9, 9, 10, 11,
12, 13, 10, 14, 10, 15, 16, 17, 17, 18,
18, 18, 18, 18, 18, 18, 8, 18, 19, 20,
21, 22, 23, 24, 25, 18, 26, 18, 27, 18,
18, 18, 18, 28, 29, 30, 31, 32, 33, 18,
18, 18, 35, 35, 35, 35, 38, 41, 36, 44,
36, 46, 46, 46, 47, 60, 63, 48, 68, 139,
140, 69, 61, 39, 45, 64, 42, 49, 62, 50,
50, 46, 65, 71, 66, 38, 51, 52, 53, 85,
72, 86, 41, 67, 75, 76, 94, 94, 94, 87,
99, 51, 39, 97, 77, 98, 101, 78, 39, 52,
100, 42, 53, 49, 118, 54, 54, 54, 42, 115,
98, 101, 55, 56, 49, 97, 46, 46, 46, 120,
116, 119, 100, 124, 126, 38, 127, 55, 38, 41,
134, 125, 71, 71, 121, 56, 43, 71, 44, 135,
71, 88, 39, 89, 89, 39, 129, 129, 42, 160,
136, 137, 134, 43, 135, 43, 43, 88, 188, 161,
90, 162, 158, 158, 160, 136, 187, 43, 71, 163,
43, 161, 43, 137, 43, 186, 91, 49, 71, 50,
50, 46, 185, 162, 163, 184, 95, 96, 178, 178,
178, 178, 178, 178, 183, 182, 132, 71, 133, 71,
71, 95, 71, 71, 71, 181, 71, 71, 132, 96,
94, 94, 94, 133, 131, 132, 180, 133, 179, 88,
71, 177, 176, 71, 175, 174, 131, 132, 173, 172,
171, 170, 133, 8, 8, 8, 8, 8, 8, 8,
34, 34, 34, 34, 34, 34, 34, 37, 37, 37,
37, 37, 37, 37, 40, 40, 40, 40, 40, 40,
40, 43, 71, 43, 43, 43, 43, 43, 57, 57,
57, 83, 83, 83, 169, 83, 83, 83, 92, 92,
92, 92, 92, 92, 92, 130, 168, 130, 130, 71,
167, 166, 165, 164, 71, 71, 159, 88, 157, 156,
71, 155, 154, 153, 152, 151, 150, 149, 148, 147,
146, 145, 71, 71, 144, 143, 71, 71, 142, 141,
71, 71, 138, 71, 93, 88, 88, 128, 123, 122,
117, 114, 71, 113, 71, 112, 111, 110, 109, 108,
107, 106, 105, 104, 103, 102, 93, 88, 88, 84,
82, 81, 80, 79, 74, 73, 70, 59, 58, 189,
7, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189
} ;
static yyconst short int yy_chk[419] =
{ 0,
0, 1, 1, 2, 2, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 5, 5, 6, 6, 11, 12, 5, 13,
6, 14, 14, 14, 15, 21, 22, 15, 24, 106,
106, 24, 21, 11, 13, 22, 12, 16, 21, 16,
16, 16, 23, 26, 23, 37, 16, 16, 16, 39,
26, 39, 40, 23, 29, 29, 49, 49, 49, 42,
198, 16, 37, 51, 29, 52, 56, 29, 39, 16,
55, 40, 16, 17, 76, 17, 17, 17, 42, 74,
52, 56, 17, 17, 46, 51, 46, 46, 46, 77,
74, 76, 55, 80, 81, 85, 81, 17, 86, 87,
95, 80, 188, 187, 77, 17, 45, 186, 45, 96,
185, 89, 85, 45, 45, 86, 89, 89, 87, 132,
99, 99, 95, 45, 96, 45, 45, 129, 184, 133,
45, 136, 129, 129, 132, 99, 183, 45, 182, 137,
45, 133, 45, 99, 45, 181, 45, 50, 180, 50,
50, 50, 179, 136, 137, 177, 50, 50, 159, 159,
159, 178, 178, 178, 176, 175, 178, 174, 178, 173,
172, 50, 171, 170, 169, 168, 167, 166, 178, 50,
94, 94, 94, 178, 94, 94, 165, 94, 164, 158,
157, 156, 155, 154, 153, 152, 94, 94, 151, 150,
149, 148, 94, 190, 190, 190, 190, 190, 190, 190,
191, 191, 191, 191, 191, 191, 191, 192, 192, 192,
192, 192, 192, 192, 193, 193, 193, 193, 193, 193,
193, 194, 147, 194, 194, 194, 194, 194, 195, 195,
195, 196, 196, 196, 146, 196, 196, 196, 197, 197,
197, 197, 197, 197, 197, 199, 145, 199, 199, 144,
143, 142, 141, 140, 139, 138, 131, 130, 128, 127,
126, 125, 124, 123, 122, 121, 120, 119, 118, 117,
116, 115, 114, 113, 112, 111, 110, 109, 108, 107,
105, 104, 103, 102, 92, 91, 90, 82, 79, 78,
75, 73, 72, 70, 69, 68, 67, 66, 65, 64,
63, 62, 61, 60, 59, 58, 48, 44, 43, 36,
33, 32, 31, 30, 28, 27, 25, 20, 19, 7,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189, 189, 189,
189, 189, 189, 189, 189, 189, 189, 189
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
char *yytext;
#line 1 "tclex.l"
#define INITIAL 0
/*A Lexical analyser to convert a C source file into a html file that contains*/
/*the code color coded as in our very own Turbo C editor (the one with a blue screen*/
#line 4 "tclex.l"
# define CECHO(color) fprintf(yyout, "%s",color, yytext)
char* cbkground = "blue";
char* ccomment = "goldenrod";
char* ckeyword = "white";
char* cdeclit = "azure";
char* coctlit = "chocolate";
char* chexlit = "black";
char* ccharlit = "magenta";
char* cfloatlit = "gold";
char* cstringlit = "red";
char* cidentifier = "lime";
char* coperator = "yellow";
char* cpreproc = "cyan";
char* header="%s"
;
char* footer="