/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /RW310/rwsdk/buildtools/cmetrics/csize/scan.c 8     10/09/01 2:46p Mspendlove $
 */

#define FLEX_SCANNER

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else	/* ! __cplusplus */

#ifdef __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */


#ifdef __TURBOC__
#define YY_USE_CONST
#endif


#ifndef YY_USE_CONST
#ifndef const
#define const
#endif
#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.
 */
#define YY_START ((yy_start - 1) / 2)

/* 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".  Now included
 * only for backward compatibility with previous versions of flex.
 */
#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;

#ifdef __cplusplus
extern "C" {
#endif
	extern int yywrap YY_PROTO(( void ));
#ifdef __cplusplus
	}
#endif

#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 )


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.
	 */
	int yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	int yy_n_chars;

	/* 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 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;

static void yyunput YY_PROTO(( int c, char *buf_ptr ));
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 ));

static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
static void yy_push_state YY_PROTO(( int new_state ));
static void yy_pop_state YY_PROTO(( void ));
static int yy_top_state YY_PROTO(( void ));

static void *yy_flex_alloc YY_PROTO(( unsigned int ));
static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define INITIAL 0
typedef unsigned char YY_CHAR;
typedef int yy_state_type;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
extern char *yytext;
#define yytext_ptr yytext

#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
#endif

#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif

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(( const 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 = yy_cp - yy_bp; \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define YY_END_OF_BUFFER 113
static const short int yy_accept[324] =
    {   0,
        0,    0,  113,  111,  108,  110,   74,   86,  111,   80,
       73,  111,   68,   69,   78,   77,   65,   76,   72,   79,
       36,   36,   66,   62,   81,   67,   82,   85,   33,   70,
      106,   71,   83,   33,   33,   33,   33,   33,   33,   33,
       33,   33,   33,   33,   33,   33,   33,   33,   63,   84,
       64,   75,  108,  108,   61,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,   47,   56,   48,    0,    0,
       45,   53,   43,   54,   44,   55,   39,  107,   46,   40,
       35,    0,   36,    0,   36,   52,   58,   60,   59,   51,
       33,   49,   33,   33,   33,   33,   33,   33,    8,   33,

       33,   33,   33,   33,   33,   16,   33,   33,   33,   33,
       33,   33,   33,   33,   33,   33,   33,   50,   57,  108,
      109,    0,    0,    0,    0,    0,    0,   94,    0,    0,
        0,    0,    0,    0,    0,   37,    0,   39,   39,    0,
       40,   35,    0,   38,   34,   42,   41,   33,   33,   33,
       33,   33,   33,   33,   33,   33,   33,   33,   14,   33,
       17,   33,   33,   33,   33,   33,   33,   33,   33,   33,
       33,   33,   33,   33,   33,   33,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,   39,    0,   39,    0,   40,   38,

       34,    1,   33,    3,    4,   33,   33,   33,   33,   10,
       11,   33,   33,   15,   18,   33,   33,   33,   33,   33,
       33,   33,   33,   33,   33,   33,   30,   33,   33,    0,
        0,   97,   98,    0,    0,    0,    0,    0,    0,    0,
       90,    0,  102,    0,    0,    0,    0,   39,    2,    5,
       33,   33,   33,   33,   13,   33,   33,   21,   33,   33,
       33,   33,   33,   33,   28,   33,   33,   32,    0,    0,
       93,   91,  103,   95,    0,    0,    0,    0,    0,   88,
        0,   33,   33,    9,   12,   33,   20,   22,   23,   24,
       25,   26,   33,   33,   33,  104,   87,   96,  100,    0,

       92,    0,    0,   33,    7,   33,   27,   33,   33,   89,
        0,  101,    6,   19,   29,   31,    0,  105,    0,    0,
        0,   99,    0
    } ;

static const int yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        2,    2,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    4,    5,    6,    1,    7,    8,    9,   10,
       11,   12,   13,   14,   15,   16,   17,   18,   19,   19,
       19,   19,   19,   19,   19,   19,   19,   20,   21,   22,
       23,   24,   25,    1,   26,   26,   26,   26,   27,   28,
       29,   29,   29,   29,   29,   30,   29,   29,   29,   29,
       29,   29,   29,   29,   31,   29,   29,   32,   29,   29,
       33,   34,   35,   36,   37,    1,   38,   39,   40,   41,

       42,   43,   44,   45,   46,   29,   47,   48,   49,   50,
       51,   52,   29,   53,   54,   55,   56,   57,   58,   59,
       60,   61,   62,   63,   64,   65,    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 const int yy_meta[66] =
    {   0,
        1,    1,    2,    1,    1,    1,    1,    1,    2,    1,
        1,    1,    1,    1,    1,    1,    1,    3,    3,    1,
        1,    1,    1,    1,    1,    3,    3,    3,    4,    4,
        4,    4,    1,    1,    1,    1,    4,    3,    3,    3,
        3,    3,    3,    4,    4,    4,    4,    4,    4,    4,
        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
        4,    1,    1,    1,    1
    } ;

static const short int yy_base[327] =
    {   0,
        0,  445,  446,  448,  443,  448,  421,  448,   64,  420,
       59,  408,  448,  448,  418,   55,  448,   56,   51,   60,
      107,   73,  448,  448,   51,  417,   52,  448,    0,  448,
      448,  448,  416,  382,  384,   39,   43,   38,   45,  385,
       58,  384,  392,   85,  373,  382,  380,  385,  448,   64,
      448,  448,   96,  427,  448,    0,  374,  385,   61,   92,
      380,  372,  384,  373,  384,  448,  448,  448,   98,  412,
      448,  448,  448,  448,  448,  448,  126,  448,  448,  143,
      162,  133,  127,    0,  178,  397,  448,  448,  448,  396,
        0,  448,  363,  375,  362,  377,  364,  370,  356,  357,

      354,  354,  357,  354,  351,    0,  350,  354,   69,  352,
       75,  112,  356,  349,  113,  131,  354,  448,  448,  185,
      448,  345,  355,  118,  356,  343,  353,  149,  342,  353,
      342,  353,  350,  157,  336,  448,  188,  448,  194,  210,
      448,  184,  198,  220,  213,  448,  448,  337,  349,  344,
      332,  176,  346,  344,  340,  332,  338,  341,    0,  327,
        0,  333,  330,  319,  321,  323,  330,  316,  314,  314,
      326,  316,  320,  324,  326,  315,  320,  315,  317,  317,
      312,  306,  306,  313,  313,  302,  304,  309,  306,  295,
      294,  305,  296,  227,  234,  236,  448,  238,  248,  448,

      241,    0,  298,    0,    0,  289,  297,  286,  293,    0,
        0,  287,  284,    0,    0,  284,  284,  281,  293,  283,
      287,  292,  291,  289,  279,  284,    0,  272,  284,  272,
      274,  448,  448,  280,  269,  266,  277,  277,  265,  261,
      448,  267,  448,  261,  271,  267,  240,  255,    0,    0,
      262,  263,  268,  255,    0,  247,  251,    0,  259,  256,
      255,  239,  248,  250,    0,  240,  242,    0,  232,  244,
      448,  448,  448,  448,  241,  226,  239,  241,  233,  448,
      220,  209,  205,    0,    0,  205,    0,    0,    0,    0,
        0,    0,  198,  193,  185,  448,  448,  448,  448,  185,

      448,  166,  167,  160,    0,  147,    0,  143,  140,  139,
      105,  448,    0,    0,    0,    0,   97,  448,   86,   58,
       40,  448,  448,  303,  305,   78
    } ;

static const short int yy_def[327] =
    {   0,
      323,    1,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  324,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  325,  323,
      323,  323,  323,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  323,  323,
      323,  323,  323,  323,  323,    9,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  324,  324,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  326,  323,  323,  323,  323,  323,  323,
      325,  323,  325,  325,  325,  325,  325,  325,  325,  325,

      325,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  326,  323,  323,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,

      323,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  325,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  325,  325,  325,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  325,  325,  325,  325,  325,  325,  325,  325,  325,
      325,  325,  325,  325,  325,  323,  323,  323,  323,  323,

      323,  323,  323,  325,  325,  325,  325,  325,  325,  323,
      323,  323,  325,  325,  325,  325,  323,  323,  323,  323,
      323,  323,    0,  323,  323,  323
    } ;

static const short int yy_nxt[514] =
    {   0,
        4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
       24,   25,   26,   27,   28,   29,   29,   29,   29,   29,
       29,   29,   30,   31,   32,   33,   29,   34,   35,   36,
       37,   38,   39,   40,   29,   41,   29,   42,   29,   29,
       29,   29,   43,   44,   45,   46,   47,   48,   29,   29,
       29,   49,   50,   51,   52,   56,   67,   72,   77,   77,
       74,   78,   86,   87,   89,   90,   95,   73,   75,   76,
      145,   68,   79,   96,   98,  100,  118,  101,   80,   97,
       85,   85,  103,   99,  322,  104,  102,  120,  121,   82,

      106,   57,   83,   83,   58,   59,  136,  107,  124,   60,
      125,   61,  163,  126,   82,   62,  321,   63,  166,   64,
       83,   65,   80,  164,   81,   81,  119,  320,   83,  110,
      111,   70,  127,   82,  128,  167,   83,   83,   84,  112,
      129,  130,  113,   77,   77,  143,  319,  143,   82,  168,
      144,  144,  137,  138,   83,  138,   83,   83,  172,  318,
      139,  139,   83,  179,  169,   84,  173,  137,  138,  140,
      141,  180,  141,  138,   83,  317,  174,   80,  175,   81,
       81,  316,   83,  315,  140,  141,  120,  121,   82,  184,
      141,  142,  142,   80,  191,   85,   85,  192,  185,  314,

      194,  313,  194,   82,   82,  195,  195,   83,   83,  142,
      312,  139,  139,  142,  142,  144,  144,  142,  311,   82,
      196,  197,  198,  197,  198,   83,  310,  199,  199,  206,
      207,  142,  309,   83,  308,  196,  197,  144,  144,  142,
      307,  197,  201,  201,  195,  195,  306,  200,  247,  200,
      247,  195,  195,  248,  248,  199,  199,  248,  248,  305,
      201,  138,  200,  138,  304,  199,  199,  200,  201,  303,
      201,  201,  248,  248,  302,  141,  138,  141,  301,  300,
      299,  138,  197,  298,  197,  297,  296,  295,  201,  294,
      141,  293,  292,  291,  290,  141,  201,  197,  289,  288,

      287,  286,  197,   69,  285,   69,   69,   91,   91,  284,
      283,  282,  281,  280,  279,  278,  277,  276,  275,  274,
      273,  272,  271,  270,  269,  268,  267,  266,  265,  264,
      263,  262,  261,  260,  259,  258,  257,  256,  255,  254,
      253,  252,  251,  250,  249,  246,  245,  244,  243,  242,
      241,  240,  239,  238,  237,  236,  235,  234,  233,  232,
      231,  230,  229,  228,  227,  226,  225,  224,  223,  222,
      221,  220,  219,  218,  217,  216,  215,  214,  213,  212,
      211,  210,  209,  208,  205,  204,  203,  202,  193,  190,
      189,  188,  187,  186,  183,  182,  181,  178,  177,  176,

      171,  170,  165,  162,  161,  160,  159,  158,  157,  156,
      155,  154,  153,  152,  151,  150,  149,  148,  147,  146,
       69,  135,  134,  133,  132,  131,  123,  122,   54,  117,
      116,  115,  114,  109,  108,  105,   94,   93,   92,   88,
       71,   70,   66,   55,   54,  323,   53,    3,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,

      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323
    } ;

static const short int yy_chk[514] =
    {   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,    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,    9,   11,   16,   19,   19,
       18,   20,   25,   25,   27,   27,   36,   16,   18,   18,
      326,   11,   20,   36,   37,   38,   50,   38,   22,   36,
       22,   22,   39,   37,  321,   39,   38,   53,   53,   22,

       41,    9,   22,   22,    9,    9,   69,   41,   59,    9,
       59,    9,  109,   59,   22,    9,  320,    9,  111,    9,
       22,    9,   21,  109,   21,   21,   50,  319,   22,   44,
       44,   69,   60,   21,   60,  111,   21,   21,   21,   44,
       60,   60,   44,   77,   77,   82,  317,   82,   21,  112,
       82,   82,   77,   77,   21,   77,   83,   83,  115,  311,
       80,   80,   21,  124,  112,   21,  115,   77,   77,   80,
       80,  124,   80,   77,   83,  310,  116,   81,  116,   81,
       81,  309,   83,  308,   80,   80,  120,  120,   81,  128,
       80,   81,   81,   85,  134,   85,   85,  134,  128,  306,

      137,  304,  137,   81,   85,  137,  137,   85,   85,   81,
      303,  139,  139,  142,  142,  143,  143,   81,  302,   85,
      139,  139,  140,  139,  140,   85,  300,  140,  140,  152,
      152,  142,  295,   85,  294,  139,  139,  144,  144,  142,
      293,  139,  145,  145,  194,  194,  286,  144,  196,  144,
      196,  195,  195,  196,  196,  198,  198,  247,  247,  283,
      145,  195,  144,  195,  282,  199,  199,  144,  145,  281,
      201,  201,  248,  248,  279,  199,  195,  199,  278,  277,
      276,  195,  248,  275,  248,  270,  269,  267,  201,  266,
      199,  264,  263,  262,  261,  199,  201,  248,  260,  259,

      257,  256,  248,  324,  254,  324,  324,  325,  325,  253,
      252,  251,  246,  245,  244,  242,  240,  239,  238,  237,
      236,  235,  234,  231,  230,  229,  228,  226,  225,  224,
      223,  222,  221,  220,  219,  218,  217,  216,  213,  212,
      209,  208,  207,  206,  203,  193,  192,  191,  190,  189,
      188,  187,  186,  185,  184,  183,  182,  181,  180,  179,
      178,  177,  176,  175,  174,  173,  172,  171,  170,  169,
      168,  167,  166,  165,  164,  163,  162,  160,  158,  157,
      156,  155,  154,  153,  151,  150,  149,  148,  135,  133,
      132,  131,  130,  129,  127,  126,  125,  123,  122,  117,

      114,  113,  110,  108,  107,  105,  104,  103,  102,  101,
      100,   99,   98,   97,   96,   95,   94,   93,   90,   86,
       70,   65,   64,   63,   62,   61,   58,   57,   54,   48,
       47,   46,   45,   43,   42,   40,   35,   34,   33,   26,
       15,   12,   10,    7,    5,    3,    2,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,

      323,  323,  323,  323,  323,  323,  323,  323,  323,  323,
      323,  323,  323
    } ;

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 "scan.l"
# line 12 "scan.l"

/* $Id: scan.c,v 1.1 2001/03/16 15:41:59 johns Exp $
 *
 * csize, a program to measure the size of C source files.
 * Copyright (C) 1994 Christopher Lott <lott@informatik.uni-kl.de>
 * FB Informatik - Bau 57 / Universitaet KL / D--67653 Kaiserslautern / Germany
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation.  See the file COPYING for more details.
 *
 * This file holds the source used by flex to generate the scanner for C.
 * SEE THE FILE "INSTALL" FOR THE REQUIRED FLEX VERSION.  Sorry to
 * shout, but different versions of flex exhibit different behavior.  
 *
 * Why flex?  Because lex complains about this file as follows:
 *     "scan.l", line xxx: (Error) Too many right contexts
 * If you simply remove the first token ("auto"), then lex dumps core
 * on my machine.  Neither behavior is acceptable and I refuse to code
 * around bugs in lex when flex is available, reliable, and free.
 *
 */

#include <stdio.h>
#include <scan.h>
#include <csize.h>

/* variables supplied by flex
 *
 */

extern int yyleng;
extern char *yytext;
extern FILE *yyin;

/* global variables
 * variables beginning with C_ are referenced in main and
 * Echo is set in main; all appear in csize.h
 *
 */

int  Echo, 
     Lex_errors;

long C_newlines,           /* incremented at the *end* of a line */
     C_blank_lines,
     C_lines_w_comments,   
     C_nb_nc_lines,        /* incremented when first nbnc is seen */
     C_semicolons,
     C_pp_directives;

/*
 * variables used only in this file
 */

static char *Filename;
static int Column;
static long prev_line_with_text;
static long prev_line_with_comment;

/*
 * functions defined and used only in this file
 */

static int check_type _((void));
static void count_nb_nc_lines _((void));
static void count _((void));
static void semicolon _((void));
static void string_lit _((void));
static void count_line_w_comment _((void));
static void comment _((int));
static void pp_dir _((void));
static void count_ws _((void));
static void whitespace_line _((void));
static void newline _((void));
static void scan_error _((char *));
static void bad_char _((void));


/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( yy_current_buffer->yy_is_interactive ) \
		{ \
		int c = getc( yyin ); \
		result = c == EOF ? 0 : 1; \
		buf[0] = (char) c; \
		} \
	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
		  && ferror( yyin ) ) \
		YY_FATAL_ERROR( "input in flex scanner failed" );
#endif

/* No semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif

/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif

/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif

/* Code executed at the beginning of each rule, after yytext and yyleng
 * have been set up.
 */
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif

YY_DECL
	{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;

# line 92 "scan.l"



	if ( yy_init )
		{
#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! yy_start )
			yy_start = 1;	/* first start state */

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( yy_current_buffer )
			yy_init_buffer( yy_current_buffer, yyin );
		else
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();

		yy_init = 0;
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		yy_cp = yy_c_buf_p;

		/* Support of yytext. */
		*yy_cp = yy_hold_char;

		/* yy_bp points to the position in yy_ch_buf of the start of
		 * the current run.
		 */
		yy_bp = yy_cp;

		yy_current_state = yy_start;
		if ( yy_bp[-1] == '\n' )
			++yy_current_state;
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yy_last_accepting_state = yy_current_state;
				yy_last_accepting_cpos = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 324 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_base[yy_current_state] != 448 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;


do_action:	/* This label is used only to access EOF actions. */


		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = yy_hold_char;
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			goto yy_find_action;

case 1:
YY_USER_ACTION
# line 94 "scan.l"
{ count(); return(AUTO);     }
	YY_BREAK
case 2:
YY_USER_ACTION
# line 95 "scan.l"
{ count(); return(BREAK);    }
	YY_BREAK
case 3:
YY_USER_ACTION
# line 96 "scan.l"
{ count(); return(CASE);     }
	YY_BREAK
case 4:
YY_USER_ACTION
# line 97 "scan.l"
{ count(); return(CHAR);     }
	YY_BREAK
case 5:
YY_USER_ACTION
# line 98 "scan.l"
{ count(); return(CONST);    }
	YY_BREAK
case 6:
YY_USER_ACTION
# line 99 "scan.l"
{ count(); return(CONTINUE); }
	YY_BREAK
case 7:
YY_USER_ACTION
# line 100 "scan.l"
{ count(); return(DEFAULT);  }
	YY_BREAK
case 8:
YY_USER_ACTION
# line 101 "scan.l"
{ count(); return(DO);       }
	YY_BREAK
case 9:
YY_USER_ACTION
# line 102 "scan.l"
{ count(); return(DOUBLE);   }
	YY_BREAK
case 10:
YY_USER_ACTION
# line 103 "scan.l"
{ count(); return(ELSE);     }
	YY_BREAK
case 11:
YY_USER_ACTION
# line 104 "scan.l"
{ count(); return(ENUM);     }
	YY_BREAK
case 12:
YY_USER_ACTION
# line 105 "scan.l"
{ count(); return(EXTERN);   }
	YY_BREAK
case 13:
YY_USER_ACTION
# line 106 "scan.l"
{ count(); return(FLOAT);    }
	YY_BREAK
case 14:
YY_USER_ACTION
# line 107 "scan.l"
{ count(); return(FOR);      }
	YY_BREAK
case 15:
YY_USER_ACTION
# line 108 "scan.l"
{ count(); return(GOTO);     }
	YY_BREAK
case 16:
YY_USER_ACTION
# line 109 "scan.l"
{ count(); return(IF);       }
	YY_BREAK
case 17:
YY_USER_ACTION
# line 110 "scan.l"
{ count(); return(INT);      }
	YY_BREAK
case 18:
YY_USER_ACTION
# line 111 "scan.l"
{ count(); return(LONG);     }
	YY_BREAK
case 19:
YY_USER_ACTION
# line 112 "scan.l"
{ count(); return(REGISTER); }
	YY_BREAK
case 20:
YY_USER_ACTION
# line 113 "scan.l"
{ count(); return(RETURN);   }
	YY_BREAK
case 21:
YY_USER_ACTION
# line 114 "scan.l"
{ count(); return(SHORT);    }
	YY_BREAK
case 22:
YY_USER_ACTION
# line 115 "scan.l"
{ count(); return(SIGNED);   }
	YY_BREAK
case 23:
YY_USER_ACTION
# line 116 "scan.l"
{ count(); return(SIZEOF);   }
	YY_BREAK
case 24:
YY_USER_ACTION
# line 117 "scan.l"
{ count(); return(STATIC);   }
	YY_BREAK
case 25:
YY_USER_ACTION
# line 118 "scan.l"
{ count(); return(STRUCT);   }
	YY_BREAK
case 26:
YY_USER_ACTION
# line 119 "scan.l"
{ count(); return(SWITCH);   }
	YY_BREAK
case 27:
YY_USER_ACTION
# line 120 "scan.l"
{ count(); return(TYPEDEF);  }
	YY_BREAK
case 28:
YY_USER_ACTION
# line 121 "scan.l"
{ count(); return(UNION);    }
	YY_BREAK
case 29:
YY_USER_ACTION
# line 122 "scan.l"
{ count(); return(UNSIGNED); }
	YY_BREAK
case 30:
YY_USER_ACTION
# line 123 "scan.l"
{ count(); return(VOID);     }
	YY_BREAK
case 31:
YY_USER_ACTION
# line 124 "scan.l"
{ count(); return(VOLATILE); }
	YY_BREAK
case 32:
YY_USER_ACTION
# line 125 "scan.l"
{ count(); return(WHILE);    }
	YY_BREAK
case 33:
YY_USER_ACTION
# line 127 "scan.l"
{ count(); return(check_type()); }
	YY_BREAK
case 34:
YY_USER_ACTION
# line 129 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 35:
YY_USER_ACTION
# line 130 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 36:
YY_USER_ACTION
# line 131 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 37:
YY_USER_ACTION
# line 132 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 38:
YY_USER_ACTION
# line 134 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 39:
YY_USER_ACTION
# line 135 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 40:
YY_USER_ACTION
# line 136 "scan.l"
{ count(); return(CONSTANT); }
	YY_BREAK
case 41:
YY_USER_ACTION
# line 138 "scan.l"
{ count(); return(RIGHT_ASSIGN); }
	YY_BREAK
case 42:
YY_USER_ACTION
# line 139 "scan.l"
{ count(); return(LEFT_ASSIGN); }
	YY_BREAK
case 43:
YY_USER_ACTION
# line 140 "scan.l"
{ count(); return(ADD_ASSIGN); }
	YY_BREAK
case 44:
YY_USER_ACTION
# line 141 "scan.l"
{ count(); return(SUB_ASSIGN); }
	YY_BREAK
case 45:
YY_USER_ACTION
# line 142 "scan.l"
{ count(); return(MUL_ASSIGN); }
	YY_BREAK
case 46:
YY_USER_ACTION
# line 143 "scan.l"
{ count(); return(DIV_ASSIGN); }
	YY_BREAK
case 47:
YY_USER_ACTION
# line 144 "scan.l"
{ count(); return(MOD_ASSIGN); }
	YY_BREAK
case 48:
YY_USER_ACTION
# line 145 "scan.l"
{ count(); return(AND_ASSIGN); }
	YY_BREAK
case 49:
YY_USER_ACTION
# line 146 "scan.l"
{ count(); return(XOR_ASSIGN); }
	YY_BREAK
case 50:
YY_USER_ACTION
# line 147 "scan.l"
{ count(); return(OR_ASSIGN); }
	YY_BREAK
case 51:
YY_USER_ACTION
# line 148 "scan.l"
{ count(); return(RIGHT_OP); }
	YY_BREAK
case 52:
YY_USER_ACTION
# line 149 "scan.l"
{ count(); return(LEFT_OP); }
	YY_BREAK
case 53:
YY_USER_ACTION
# line 150 "scan.l"
{ count(); return(INC_OP); }
	YY_BREAK
case 54:
YY_USER_ACTION
# line 151 "scan.l"
{ count(); return(DEC_OP); }
	YY_BREAK
case 55:
YY_USER_ACTION
# line 152 "scan.l"
{ count(); return(PTR_OP); }
	YY_BREAK
case 56:
YY_USER_ACTION
# line 153 "scan.l"
{ count(); return(AND_OP); }
	YY_BREAK
case 57:
YY_USER_ACTION
# line 154 "scan.l"
{ count(); return(OR_OP); }
	YY_BREAK
case 58:
YY_USER_ACTION
# line 155 "scan.l"
{ count(); return(LE_OP); }
	YY_BREAK
case 59:
YY_USER_ACTION
# line 156 "scan.l"
{ count(); return(GE_OP); }
	YY_BREAK
case 60:
YY_USER_ACTION
# line 157 "scan.l"
{ count(); return(EQ_OP); }
	YY_BREAK
case 61:
YY_USER_ACTION
# line 158 "scan.l"
{ count(); return(NE_OP); }
	YY_BREAK
case 62:
YY_USER_ACTION
# line 159 "scan.l"
{ count(); semicolon(); return(';'); }
	YY_BREAK
case 63:
YY_USER_ACTION
# line 160 "scan.l"
{ count(); return('{'); }
	YY_BREAK
case 64:
YY_USER_ACTION
# line 161 "scan.l"
{ count(); return('}'); }
	YY_BREAK
case 65:
YY_USER_ACTION
# line 162 "scan.l"
{ count(); return(','); }
	YY_BREAK
case 66:
YY_USER_ACTION
# line 163 "scan.l"
{ count(); return(':'); }
	YY_BREAK
case 67:
YY_USER_ACTION
# line 164 "scan.l"
{ count(); return('='); }
	YY_BREAK
case 68:
YY_USER_ACTION
# line 165 "scan.l"
{ count(); return('('); }
	YY_BREAK
case 69:
YY_USER_ACTION
# line 166 "scan.l"
{ count(); return(')'); }
	YY_BREAK
case 70:
YY_USER_ACTION
# line 167 "scan.l"
{ count(); return('['); }
	YY_BREAK
case 71:
YY_USER_ACTION
# line 168 "scan.l"
{ count(); return(']'); }
	YY_BREAK
case 72:
YY_USER_ACTION
# line 169 "scan.l"
{ count(); return('.'); }
	YY_BREAK
case 73:
YY_USER_ACTION
# line 170 "scan.l"
{ count(); return('&'); }
	YY_BREAK
case 74:
YY_USER_ACTION
# line 171 "scan.l"
{ count(); return('!'); }
	YY_BREAK
case 75:
YY_USER_ACTION
# line 172 "scan.l"
{ count(); return('~'); }
	YY_BREAK
case 76:
YY_USER_ACTION
# line 173 "scan.l"
{ count(); return('-'); }
	YY_BREAK
case 77:
YY_USER_ACTION
# line 174 "scan.l"
{ count(); return('+'); }
	YY_BREAK
case 78:
YY_USER_ACTION
# line 175 "scan.l"
{ count(); return('*'); }
	YY_BREAK
case 79:
YY_USER_ACTION
# line 176 "scan.l"
{ count(); return('/'); }
	YY_BREAK
case 80:
YY_USER_ACTION
# line 177 "scan.l"
{ count(); return('%'); }
	YY_BREAK
case 81:
YY_USER_ACTION
# line 178 "scan.l"
{ count(); return('<'); }
	YY_BREAK
case 82:
YY_USER_ACTION
# line 179 "scan.l"
{ count(); return('>'); }
	YY_BREAK
case 83:
YY_USER_ACTION
# line 180 "scan.l"
{ count(); return('^'); }
	YY_BREAK
case 84:
YY_USER_ACTION
# line 181 "scan.l"
{ count(); return('|'); }
	YY_BREAK
case 85:
YY_USER_ACTION
# line 182 "scan.l"
{ count(); return('?'); }
	YY_BREAK
case 86:
YY_USER_ACTION
# line 184 "scan.l"
{ count(); string_lit(); return(STRING_LITERAL); }
	YY_BREAK
case 87:
YY_USER_ACTION
# line 186 "scan.l"
{ count(); pp_dir(); /* from K&R 2/e p. 239 */ }
	YY_BREAK
case 88:
YY_USER_ACTION
# line 187 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 89:
YY_USER_ACTION
# line 188 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 90:
YY_USER_ACTION
# line 189 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 91:
YY_USER_ACTION
# line 190 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 92:
YY_USER_ACTION
# line 191 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 93:
YY_USER_ACTION
# line 193 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 94:
YY_USER_ACTION
# line 194 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 95:
YY_USER_ACTION
# line 195 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 96:
YY_USER_ACTION
# line 196 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 97:
YY_USER_ACTION
# line 197 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 98:
YY_USER_ACTION
# line 198 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 99:
YY_USER_ACTION
# line 200 "scan.l"
{ count(); pp_dir(); /* from GCC's cccp.c */ }
	YY_BREAK
case 100:
YY_USER_ACTION
# line 201 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 101:
YY_USER_ACTION
# line 202 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 102:
YY_USER_ACTION
# line 203 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 103:
YY_USER_ACTION
# line 204 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 104:
YY_USER_ACTION
# line 205 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 105:
YY_USER_ACTION
# line 206 "scan.l"
{ count(); pp_dir(); }
	YY_BREAK
case 106:
YY_USER_ACTION
# line 208 "scan.l"
{ count(); /* backslash processing is weak */ }
	YY_BREAK
case 107:
YY_USER_ACTION
# line 210 "scan.l"
{ comment(1); }
	YY_BREAK
case 108:
YY_USER_ACTION
# line 211 "scan.l"
{ count_ws(); }
	YY_BREAK
case 109:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_USER_ACTION
# line 212 "scan.l"
{ whitespace_line(); }
	YY_BREAK
case 110:
YY_USER_ACTION
# line 213 "scan.l"
{ newline(); }
	YY_BREAK
case 111:
YY_USER_ACTION
# line 214 "scan.l"
{ bad_char(); }
	YY_BREAK
case 112:
YY_USER_ACTION
# line 216 "scan.l"
ECHO;
	YY_BREAK
case YY_STATE_EOF(INITIAL):
	yyterminate();

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*yy_cp = yy_hold_char;

		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between yy_current_buffer and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			yy_n_chars = yy_current_buffer->yy_n_chars;
			yy_current_buffer->yy_input_file = yyin;
			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the
		 * end-of-buffer state).  Contrast this with the test
		 * in input().
		 */
		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = yytext_ptr + YY_MORE_ADJ;

			if ( yy_next_state )
				{
				/* Consume the NUL. */
				yy_cp = ++yy_c_buf_p;
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
							yy_cp = yy_c_buf_p;
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
				yy_did_buffer_switch_on_eof = 0;

				if ( yywrap() )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				yy_c_buf_p =
					yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
				yy_c_buf_p =
				&yy_current_buffer->yy_ch_buf[yy_n_chars];

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_find_action;
			}
		break;
		}

	default:
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of yylex */


/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */

static int yy_get_next_buffer()
	{
	register char *dest = yy_current_buffer->yy_ch_buf;
	register char *source = yytext_ptr - 1; /* copy prev. char, too */
	register int number_to_move, i;
	int ret_val;

	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( yy_current_buffer->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
			{
			/* We matched a singled characater, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = yy_c_buf_p - yytext_ptr;

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		yy_n_chars = 0;

	else
		{
		int num_to_read =
			yy_current_buffer->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = yy_current_buffer;

			int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;

			b->yy_buf_size *= 2;
			b->yy_ch_buf = (char *)
				yy_flex_realloc( (void *) b->yy_ch_buf,
						 b->yy_buf_size );

			if ( ! b->yy_ch_buf )
				YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = yy_current_buffer->yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
			yy_n_chars, num_to_read );
		}

	if ( yy_n_chars == 0 )
		{
		if ( number_to_move - YY_MORE_ADJ == 1 )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart( yyin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			yy_current_buffer->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	yy_n_chars += number_to_move;
	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

	/* yytext begins at the second character in yy_ch_buf; the first
	 * character is the one which preceded it before reading in the latest
	 * buffer; it needs to be kept around in case it's a newline, so
	 * yy_get_previous_state() will have with '^' rules active.
	 */

	yytext_ptr = &yy_current_buffer->yy_ch_buf[1];

	return ret_val;
	}


/* yy_get_previous_state - get the state just before the EOB char was reached */

static yy_state_type yy_get_previous_state()
	{
	register yy_state_type yy_current_state;
	register char *yy_cp;

	register char *yy_bp = yytext_ptr;

	yy_current_state = yy_start;
	if ( yy_bp[-1] == '\n' )
		++yy_current_state;

	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			yy_last_accepting_state = yy_current_state;
			yy_last_accepting_cpos = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 324 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	return yy_current_state;
	}


/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	register int yy_is_jam;
	register char *yy_cp = yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 324 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	yy_is_jam = (yy_current_state == 323);

	return yy_is_jam ? 0 : yy_current_state;
	}


#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
	{
	register char *yy_cp = yy_c_buf_p;

	/* undo effects of setting up yytext */
	*yy_cp = yy_hold_char;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = yy_n_chars + 2;
		register char *dest = &yy_current_buffer->yy_ch_buf[
					yy_current_buffer->yy_buf_size + 2];
		register char *source =
				&yy_current_buffer->yy_ch_buf[number_to_move];

		while ( source > yy_current_buffer->yy_ch_buf )
			*--dest = *--source;

		yy_cp += dest - source;
		yy_bp += dest - source;
		yy_n_chars = yy_current_buffer->yy_buf_size;

		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
		yy_cp[-2] = '\n';

	*--yy_cp = (char) c;


	/* Note: the formal parameter *must* be called "yy_bp" for this
	 * macro to now work correctly.
	 */
	YY_DO_BEFORE_ACTION; /* set up yytext again */
	}


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
	{
	int c;

	*yy_c_buf_p = yy_hold_char;

	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			/* This was really a NUL. */
			*yy_c_buf_p = '\0';

		else
			{ /* need more input */
			yytext_ptr = yy_c_buf_p;
			++yy_c_buf_p;

			switch ( yy_get_next_buffer() )
				{
				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						{
						yy_c_buf_p =
						yytext_ptr + YY_MORE_ADJ;
						return EOF;
						}

					YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
					break;

				case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
					YY_FATAL_ERROR(
					"unexpected last match in yyinput()" );
#else
					YY_FATAL_ERROR(
					"unexpected last match in input()" );
#endif
				}
			}
		}

	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
	*yy_c_buf_p = '\0';	/* preserve yytext */
	yy_hold_char = *++yy_c_buf_p;

	return c;
	}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! yy_current_buffer )
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_init_buffer( yy_current_buffer, input_file );
	yy_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	if ( yy_current_buffer == new_buffer )
		return;

	if ( yy_current_buffer )
		{
		/* Flush out information for old buffer. */
		*yy_c_buf_p = yy_hold_char;
		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	yy_did_buffer_switch_on_eof = 1;
	}


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
	{
	yy_n_chars = yy_current_buffer->yy_n_chars;
	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
	yyin = yy_current_buffer->yy_input_file;
	yy_hold_char = *yy_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );

	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );

	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

	yy_flex_free( (void *) b->yy_ch_buf );
	yy_flex_free( (void *) b );
	}


#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
	{
	b->yy_input_file = file;

	/* We put in the '\n' and start reading from [1] so that an
	 * initial match-at-newline will be true.
	 */

	b->yy_ch_buf[0] = '\n';
	b->yy_n_chars = 1;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[1];

	b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;

	b->yy_fill_buffer = 1;

	b->yy_buffer_status = YY_BUFFER_NEW;
	}


#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
	{
	if ( yy_start_stack_ptr >= yy_start_stack_depth )
		{
		int new_size;

		yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yy_start_stack_depth * sizeof( int );

		if ( ! yy_start_stack )
			yy_start_stack = (int *) yy_flex_alloc( new_size );

		else
			yy_start_stack = (int *) yy_flex_realloc(
					(void *) yy_start_stack, new_size );

		if ( ! yy_start_stack )
			YY_FATAL_ERROR(
			"out of memory expanding start-condition stack" );
		}

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}


static void yy_pop_state()
	{
	if ( --yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}


static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}


#ifdef YY_USE_PROTOS
static void yy_fatal_error( const char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
	{
	(void) fprintf( stderr, "%s\n", msg );
	exit( 1 );
	}



/* Redefine yyless() so it works in section 3 code. */

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		yytext[yyleng] = yy_hold_char; \
		yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
		yy_hold_char = *yy_c_buf_p; \
		*yy_c_buf_p = '\0'; \
		yyleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, const char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
const char *s2;
int n;
#endif
	{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
	}
#endif


#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( unsigned int size )
#else
static void *yy_flex_alloc( size )
unsigned int size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, unsigned int size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
unsigned int size;
#endif
	{
	return (void *) realloc( ptr, size );
	}

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}
# line 216 "scan.l"


/* If being compiled with a C++ compiler, 
 * then the flex input function is named 
 * "yyinput"; else it's named "input".
 *
 * Only tested with g++.
 *
 */

#ifdef __cplusplus
#define input yyinput
#endif

/* init_scanner
 * initialize necessary variables and set up the input file pointer
 * before processing a file.
 *
 * Called from csize.c
 *
 */

void
init_scanner(FILE *fp, char *filename) 
{
  C_newlines    = 0;
  C_blank_lines = 0;
  C_lines_w_comments = 0;
  C_nb_nc_lines = 0;
  C_semicolons = 0;
  C_pp_directives = 0;

  Lex_errors = 0;
  prev_line_with_comment = -1;
  prev_line_with_text    = -1;

  Filename = filename;

  /* although the flex documentation states that assigning
   * to yyin like this:
   *         yyin = fp;
   * should be equivalent to 
   *         yyrestart(fp);
   * the run-time behavior of scanners generated with flex 2.4.7
   * is different; with only the assignment, the scanner complains
   * of an illegal characater at line 1, character 1 of subsequent
   * files.  Anyhow, this works.
   */
  yyrestart(fp); 
}


/* count_nb_nc_lines
 * count nonblank noncomment lines in the input, but
 * ensure that we don't count the same line twice by
 * checking and/or updating the appropriate variable
 *
 * called by functions; no dependence on yytext
 *
 */

static void
count_nb_nc_lines(void)
{
  if (C_newlines != prev_line_with_text) {
    ++C_nb_nc_lines;
    prev_line_with_text = C_newlines;
  }
}


/* count
 * count columns for lines with *nonblank noncomment* text.
 * Optionally echo the buffer yytext, and call count_nb_nc_lines  
 * to count the line.
 *
 * called by lexer with the *nonblank noncomment* token in yytext
 *
 */

static void
count(void)
{
  Column += yyleng;
  if (Echo) 
    ECHO;
  count_nb_nc_lines();
}


/* semicolon
 * saw a semicolon in the input, just bump the appropriate counter
 * 
 * count() is called before this function
 *
 * called by lexer but has no dependence on yytext
 *
 */

static void
semicolon(void)
{
  ++C_semicolons;
}


/* pp_dir
 * Read characters until the terminating newline ('\n') is found.  Count the
 * number of directives.  Even though no text may appear after a directive 
 * on a line, count columns so that the function newline() can be used.
 *
 * Complications:
 *     Escaped backslash characters ('\\').  These do nothing.
 *     Escaped newline characters (continuation lines).  These force the
 *         function to update newline and nonblank noncomment line counts.  
 *         Note that a continuation line can consist of a single newline,
 *         or only whitespace and a newline; in both cases the continuation
 *         line terminates the preprocessor directive.  The algorithm makes 
 *         provisions to treat both cases identically.  Those blank-ish 
 *         continuation lines, although they look blank, are counted as 
 *         nonblank noncomment lines.
 *     Comments that begin on the pp_dir's line.  These must be processed
 *         until the closing * and / is found, after which processing of 
 *         the pp resumes.  See the part in K&Rrev2, p. 229, about 
 *         logically successive preprocessor phases.
 *     The terminating newline must be given back via unput so that
 *         the lexer can correctly identify the beginning of lines
 *         for rules that use the caret ('^')
 *
 * Input errors:
 *     EOF condition before the terminating newline
 * 
 * count() is called before this function, which marks the first line of
 *     the preprocessor directive as having nonblank noncomment text.  
 *
 * Called by the lexer, but no dependence on yytext
 *
 */

static void
pp_dir(void)
{
  register int c;
  register int in_pp_dir = 1;
  register int saw_forwslash = 0;
  register int apply_backslash = 0;
  
  ++C_pp_directives;

  while (in_pp_dir && (c = input()) != EOF) {

    if (c == '\n') {             /* first take care of newline chars */
      if (apply_backslash) {
	apply_backslash = 0;
	newline();               /* register the newline globally */
	count_nb_nc_lines();     /* count the new nb nc line */
      }
      else {
	if (Column == 0)         /* if Column has value 0, newline() will */
	  ++Column;              /* count the line as blank; don't let it */
	unput(c);                /* give back the nl */
	in_pp_dir = 0;           /* done with this pp dir */
      }
    }
    else {

      if (Echo)                  /* only do echo processing for non-newlines */
	putchar(c);
      ++Column;

      switch (c) {
      case '\\':
	if (apply_backslash) {
	  apply_backslash = 0;
	}
	else {
	  apply_backslash = 1;
	}
	saw_forwslash = 0;
	break;
      case '/':
	saw_forwslash = 1;
	apply_backslash = 0;
	break;
      case '*':
	if (saw_forwslash) {
	  comment(0);             /* 0 means don't echo the start token again */
	}
	saw_forwslash = 0;
	apply_backslash = 0;
	break;
      default:   
	apply_backslash = 0;      /* any char after f/b-slash turns off the flags */
	saw_forwslash = 0;
	break;
      }
    }

  } /* while */

  if (c == EOF)
    scan_error("EOF in preprocessor directive");
}


/* string_lit
 * Read characters until the closing quote ('"') is found.  Do not count
 * string literals. Count columns because a string literal may be followed 
 * by other text on a line. 
 *
 * Complications:
 *     Escaped backslash characters ('\\').  These do nothing.
 *     Escaped quote characters ('\"').  These do not terminate
 *         the string literal.
 *     Escaped newline characters (continuation lines).  These force the
 *         function to update newline and nonblank noncomment line counts.  
 *         Note that a continuation line can never be entirely blank - 
 *         either it has another escaped newline, or it has the terminating 
 *         quote.  This prevents the anomaly of counting a blank line as
 *         something else, as is the case for preprocessor directives.
 *
 * Input errors:
 *     unescaped newline before the terminating quote
 *     EOF condition     before the terminating quote
 * 
 * count() is called before this function, which marks the first line of
 *     the string literal line as having nonblank noncomment text.  
 *
 * Called by the lexer, but no dependence on yytext
 *
 */

static void
string_lit(void)
{
  register int c;
  register int in_string_lit = 1;
  register int apply_backslash = 0;  /* apply backslash to the next char seen */

  while (in_string_lit && (c = input()) != EOF) {

    if (c == '\n') {             /* first take care of newline chars */
      if (apply_backslash) {
	apply_backslash = 0;
	newline();               /* register the newline globally */
	count_nb_nc_lines();     /* count the new nb nc line */
      }
      else {
	scan_error("newline in string literal");
	unput(c);                /* give back the newline */
	in_string_lit = 0;       /* give up on this string literal */
      }
    }
    else {                       /* prev char was not a newline */
      switch (c) {
      case '\\':
	if (apply_backslash) 
	  apply_backslash = 0;
	else
	  apply_backslash = 1;
	break;
      case '"':
	if (apply_backslash) 
	  apply_backslash = 0;
	else
	  in_string_lit = 0;     /* finished with this string literal */
	break;
      default:   
	if (apply_backslash)     /* any char after bslash turns off the flag */
	  apply_backslash = 0;
	break;
      }

      if (Echo)                  /* only do echo processing for non-newlines */
	putchar(c);
      ++Column;
    }

  } /* while */

  if (c == EOF)
    scan_error("EOF in string literal");
}


/* count_ws
 * count the columns in the buffer yytext (only white space, never nl)
 * adjusting for tabs 
 *
 * called by the lexer with the whitespace in yytext
 *
 */

static void
count_ws(void)
{
  register int i;
  
  if (Echo) 
    ECHO;

  for (i = 0; yytext[i] != '\0'; i++)
    if (yytext[i] == '\t')
      Column += 8 - (Column % 8);
    else
      Column++;
}  


/* whitespace_line
 * Process a line that is not empty but only has whitespace.
 * The newline is *not* part of yytext at this point.
 * Do not do *anything* except echo the line, if desired.
 * Because the Column variable is not changed, it will be
 * 0 when newline is called, which will count the blank line.
 *
 * called by the lexer with the whitespace in yytext
 *
 */

static void
whitespace_line(void)
{
  if (Echo) 
    ECHO;
}


/* newline
 * Count all newline characters.  Also check the value of the Column 
 * variable to catch lines with nothing but whitespace (blank lines).
 * 
 * Note that blank lines are somewhat difficult to catch with a lex 
 * pattern, because the pattern ``^"\n"'', meaning match a newline that 
 * occurs first on a line, doesn't seem to work.
 *
 * Note also that if the lex pattern to match a line with only whitespace
 * fires, then the Column variable will not be incremented, and this 
 * function will be called with Column = 0.  I call this a virtual 
 * column 0, because newline really didn't occur as the first character
 * on the line, we just pretend that it did.
 *
 * Called by the lexer *and* other functions; no dependence on yytext
 *
 */

static void
newline(void)
{
  if (Echo) 
    putchar('\n');
  ++C_newlines;
  if (Column == 0) {
    ++C_blank_lines;
  }
  Column = 0;
}


/* count_line_w_comment
 * Cuarantee that we don't count a line as having a comment twice
 *
 * Called by functions; no dependence on yytext
 *
 */

static void
count_line_w_comment(void)
{
  if (C_newlines != prev_line_with_comment) {
    ++C_lines_w_comments;
    prev_line_with_comment = C_newlines;
  }
}


/* comment
 * Read characters until the closing two-character sequence '*' and '/'
 * is found.  Count the lines with comments.  Count columns because a 
 * comment may be followed by other text on a line.
 *
 * Complications:
 *     Newline characters.  These force the function to update the counts
 *         of newlines and the number of lines with comments.  A line
 *         within a comment that has zero or more whitespace characters 
 *         and a newline, although blank, will be counted as a comment line.
 * Input errors:
 *     EOF condition before the terminating token
 * 
 * This fn implements a simple FSA to recognize the end of a comment.
 * The original code was reused from Jeff Lee's distribution and
 * amended to count lines.  While I don't much like gotos, his 
 * implementation is highly concise and keeps code redundancy to a 
 * minimum.  This code is far more concise than, for example, the 
 * code from the flexdoc(1) man page, when you consider all the
 * intermediate cases in which characters must be counted.
 *
 * Called by the lexer with the comment start token in yytext,
 * and also called by pp_dir with garbage in yytext, so don't
 * depend on yytext (and don't use ECHO).  Argument tells whether
 * it should echo the comment start token.
 *
 */

static void
comment(int echo_start)
{
  register int c;
  int lookahead;

  if (Echo && echo_start) { 
    putchar('/');
    putchar('*');
  }
  Column += yyleng;

  /* starting a comment, count the line if necessary */
  count_line_w_comment();
  
  /* deal with all characters in this while loop */
 loop:
  while ((c = input()) != EOF) {    /* find a star */

    if (c == '\n') {
      if (Column == 0)      /* if Column has value 0, newline() will count */
	++Column;           /* the line as blank, which we don't want */
      newline();
      count_line_w_comment();
    }
    else {
      if (Echo) 
	putchar(c);
      ++Column;
    }

    if (c == '*')                   /* found one, leave the while loop */
      break;
  }

  if (c != EOF && (lookahead = input()) != '/') {    /* check for a slash */
    unput(lookahead);
    goto loop;
  }

  if (c == EOF) {
    scan_error("EOF in comment");
  }
  else {
    if (Echo) 
      putchar('/');
  }
}


/* check_type
 * pseudo code --- this is what it should check
 *
 *	if (yytext == type_name)
 *		return(TYPE_NAME);
 *	else
 *		return(IDENTIFIER);
 *
 * If it did, it would be easy to build a C language
 * recognizer, and then trivial to count declarations
 * and executable statements.
 *
 * However, the function only returns IDENTIFIER
 *
 */

static int
check_type(void)
{
  return(IDENTIFIER);
}


/* scan_error
 * print an informative error message with file, line info.
 * if echoing is on, indicate the column where the error
 * was found by using the Column variable
 *
 */

static void
scan_error(char *s)
{
  fflush(stdout);
  ++Lex_errors;
  if (Echo)
    printf("\n%*s\n%*s\n", Column, "^", Column, s);
  else
    printf("\"%s\", line %d: %s\n", Filename, C_newlines + 1, s);
}


/* bad_char
 * bump up the column count and call the error function
 *
 * Called by the lexer with the unrecognized character in yytext
 *
 */

static void
bad_char(void)
{
  register int i;

  if (Echo)
    ECHO;
  ++Column;
  scan_error("bad character");
  if (Echo) /* restore output to column where we left off */
    for (i = 0; i < Column; ++i)
      putchar(' ');
}


/* yywrap
 * supply a trivial version of yywrap
 * to eliminate the need to link against libfl
 * the value 1 means stop at the end of the file
 * (the file pointer has not been aimed at a new file)
 *
 * Called by the lexer at the end of the input
 *
 */

int
yywrap(void)
{
  return 1;
}
