/* A lexical scanner generated by flex */

/* scanner skeleton version:
 * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
 */

#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 <osfcn.h>

/* use prototypes in function declarations */
#define inf_USE_PROTOS

/* the "const" storage-class-modifier is valid */
#define inf_USE_CONST

#else	/* ! __cplusplus */

#ifdef __STDC__

#ifdef __GNUC__
#include <stddef.h>
void *malloc( size_t );
void free( void* );
#else
#include <stdlib.h>
#endif	/* __GNUC__ */

#define inf_USE_PROTOS
#define inf_USE_CONST

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


#ifdef __TURBOC__
#define inf_USE_CONST
#endif


#ifndef inf_USE_CONST
#define const
#endif


#ifdef inf_USE_PROTOS
#define inf_PROTO(proto) proto
#else
#define inf_PROTO(proto) ()
/* we can't get here if it's an ANSI C compiler, or a C++ compiler,
 * so it's got to be a K&R compiler, and therefore there's no standard
 * place from which to include these definitions
 */
char *malloc();
int free();
int read();
#endif


/* amount of stuff to slurp up with each read */
#ifndef inf_READ_BUF_SIZE
#define inf_READ_BUF_SIZE 8192
#endif

/* returned upon end-of-file */
#define inf_END_TOK 0

/* copy whatever the last rule matched to the standard output */

/* cast to (char *) is because for 8-bit chars, inftext is (unsigned char *) */
/* this used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite()
 */
#define ECHO (void) fwrite( (char *) inftext, infleng, 1, infout )

/* gets input and stuffs it into "buf".  number of characters read, or inf_NULL,
 * is returned in "result".
 */
#define inf_INPUT(buf,result,max_size) \
	if ( (result = read( fileno(infin), (char *) buf, max_size )) < 0 ) \
	    inf_FATAL_ERROR( "read() in flex scanner failed" );
#define inf_NULL 0

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

/* report a fatal error */

/* The funky do-while is used to turn this macro definition into
 * a single C statement (which needs a semi-colon terminator).
 * This avoids problems with code like:
 *
 * 	if ( something_happens )
 *		inf_FATAL_ERROR( "oops, the something happened" );
 *	else
 *		everything_okay();
 *
 * 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 inf_FATAL_ERROR() call.
 */

#define inf_FATAL_ERROR(msg) \
	do \
		{ \
		(void) fputs( msg, stderr ); \
		(void) putc( '\n', stderr ); \
		exit( 1 ); \
		} \
	while ( 0 )

/* default infwrap function - always treat EOF as an EOF */
#define infwrap() 1

/* 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 inf_start = 1 + 2 *

/* action number for EOF rule of a given start state */
#define inf_STATE_EOF(state) (inf_END_OF_BUFFER + state + 1)

/* special action meaning "start processing a new file" */
#define inf_NEW_FILE \
	do \
		{ \
		inf_init_buffer( inf_current_buffer, infin ); \
		inf_load_buffer_state(); \
		} \
	while ( 0 )

/* default declaration of generated scanner - a define so the user can
 * easily add parameters
 */
#define inf_DECL int inflex inf_PROTO(( void )) 

/* code executed at the end of each rule */
#define inf_BREAK break;

#define inf_END_OF_BUFFER_CHAR 0

#ifndef inf_BUF_SIZE
#define inf_BUF_SIZE (inf_READ_BUF_SIZE * 2) /* size of default input buffer */
#endif

typedef struct inf_buffer_state *inf_BUFFER_STATE;

#define inf_CHAR char
# line 1 "inf.lex"
#define INITIAL 0
# line 2 "inf.lex"
#include<string.h>
#include"inf.tab.h"
#undef ECHO
#define ECHO {}

extern infSTYPE inflval ;
extern int infParseLine  ;
# line 11 "inf.lex"

/* done after the current pattern has been matched and before the
 * corresponding action - sets up inftext
 */
#define inf_DO_BEFORE_ACTION \
	inftext = inf_bp; \
	infleng = inf_cp - inf_bp; \
	inf_hold_char = *inf_cp; \
	*inf_cp = '\0'; \
	inf_c_buf_p = inf_cp;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* return all but the first 'n' matched characters back to the input stream */
#define infless(n) \
	do \
		{ \
		/* undo effects of setting up inftext */ \
		*inf_cp = inf_hold_char; \
		inf_c_buf_p = inf_cp = inf_bp + n; \
		inf_DO_BEFORE_ACTION; /* set up inftext again */ \
		} \
	while ( 0 )

#define unput(c) infunput( c, inftext )


struct inf_buffer_state
    {
    FILE *inf_input_file;

    inf_CHAR *inf_ch_buf;		/* input buffer */
    inf_CHAR *inf_buf_pos;	/* current position in input buffer */

    /* size of input buffer in bytes, not including room for EOB characters*/
    int inf_buf_size;	

    /* number of characters read into inf_ch_buf, not including EOB characters */
    int inf_n_chars;

    int inf_eof_status;		/* whether we've seen an EOF on this buffer */
#define EOF_NOT_SEEN 0
    /* "pending" happens when the EOF has been seen but there's still
     * some text process
     */
#define EOF_PENDING 1
#define EOF_DONE 2
    };

static inf_BUFFER_STATE inf_current_buffer;

/* 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 inf_CURRENT_BUFFER inf_current_buffer


/* inf_hold_char holds the character lost when inftext is formed */
static inf_CHAR inf_hold_char;

static int inf_n_chars;		/* number of characters read into inf_ch_buf */



#ifndef inf_USER_ACTION
#define inf_USER_ACTION
#endif

#ifndef inf_USER_INIT
#define inf_USER_INIT
#endif

extern inf_CHAR *inftext;
extern int infleng;
extern FILE *infin, *infout;

inf_CHAR *inftext;
int infleng;

FILE *infin = (FILE *) 0, *infout = (FILE *) 0;

#define inf_END_OF_BUFFER 23
typedef int inf_state_type;
static const short int inf_accept[62] =
    {   0,
       16,   16,   23,   16,    1,    2,   21,   18,   17,   16,
       16,   16,   16,   16,   16,   16,   19,   20,    3,   16,
        1,    2,   16,   16,   16,    9,   16,   16,   16,    3,
        3,    3,   16,    4,   16,   16,   16,   16,   16,   10,
       16,   16,   16,   16,    5,   16,   16,   16,   16,   16,
       15,   14,   16,    8,   11,   13,   12,   16,    6,    7,
        0
    } ;

static const inf_CHAR inf_ec[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,    2,    1,    1,    4,    1,    1,    1,    1,    1,
        1,    1,    1,    5,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    6,    7,    1,
        1,    1,    1,    1,    8,    1,    9,   10,   11,   12,
        1,   13,   14,    1,    1,   15,   16,   17,   18,   19,
        1,   20,   21,   22,   23,    1,    1,   24,    1,    1,
        1,    1,    1,    1,   25,    1,    8,    1,    9,   10,

       11,   12,    1,   13,   14,    1,    1,   15,   16,   17,
       18,   19,    1,   20,   21,   22,   23,    1,    1,   24,
        1,    1,   26,    1,   27,    1,    1
    } ;

static const inf_CHAR inf_meta[28] =
    {   0,
        1,    2,    3,    1,    2,    2,    2,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    2,    2
    } ;

static const short int inf_base[65] =
    {   0,
        0,   83,   86,    0,   83,   81,   88,   88,   88,   61,
       59,   64,   57,   50,   49,   60,   88,   88,   26,    0,
       68,   66,   49,   57,   51,   17,   12,   43,   47,   52,
        0,   59,   27,    0,   43,   43,   37,   45,   28,    0,
       47,   32,   29,   22,    0,   24,   21,   27,   24,   26,
        0,    0,   20,    0,    0,    0,    0,   29,    0,    0,
       88,   38,   79,   81
    } ;

static const short int inf_def[65] =
    {   0,
       61,    1,   61,   62,   61,   61,   61,   61,   61,   62,
       62,   62,   62,   62,   62,   62,   61,   61,   63,   62,
       61,   61,   62,   62,   62,   62,   62,   62,   62,   63,
       64,   30,   62,   62,   62,   62,   62,   62,   62,   62,
       62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
       62,   62,   62,   62,   62,   62,   62,   62,   62,   62,
        0,   61,   61,   61
    } ;

static const short int inf_nxt[116] =
    {   0,
        4,    5,    6,    4,    7,    8,    9,    4,   10,    4,
       11,    4,   12,   13,    4,   14,    4,   15,    4,   16,
        4,    4,    4,    4,    4,   17,   18,   31,   36,   32,
       31,   31,   31,   38,   37,   39,   42,   48,   20,   60,
       59,   58,   57,   56,   55,   54,   53,   52,   51,   43,
       49,   31,   31,   31,   50,   47,   31,   31,   31,   46,
       45,   44,   32,   41,   40,   35,   34,   33,   22,   21,
       29,   28,   27,   26,   25,   24,   23,   31,   31,   30,
       30,   31,   31,   22,   21,   61,   19,    3,   61,   61,
       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,

       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
       61,   61,   61,   61,   61
    } ;

static const short int inf_chk[116] =
    {   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,   19,   26,   19,
       19,   19,   19,   27,   26,   27,   33,   39,   62,   58,
       53,   50,   49,   48,   47,   46,   44,   43,   42,   33,
       39,   19,   19,   30,   41,   38,   30,   30,   30,   37,
       36,   35,   32,   29,   28,   25,   24,   23,   22,   21,
       16,   15,   14,   13,   12,   11,   10,   30,   30,   63,
       63,   64,   64,    6,    5,    3,    2,   61,   61,   61,
       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,

       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
       61,   61,   61,   61,   61
    } ;

static inf_state_type inf_last_accepting_state;
static inf_CHAR *inf_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 infmore() infmore_used_but_not_detected
#define inf_MORE_ADJ 0

/* these variables are all declared out here so that section 3 code can
 * manipulate them
 */
/* points to current character in buffer */
static inf_CHAR *inf_c_buf_p = (inf_CHAR *) 0;
static int inf_init = 1;		/* whether we need to initialize */
static int inf_start = 0;	/* start state number */

/* flag which is used to allow infwrap()'s to do buffer switches
 * instead of setting up a fresh infin.  A bit of a hack ...
 */
static int inf_did_buffer_switch_on_eof;

static inf_state_type inf_get_previous_state inf_PROTO(( void ));
static inf_state_type inf_try_NUL_trans inf_PROTO(( inf_state_type current_state ));
static int inf_get_next_buffer inf_PROTO(( void ));
static void infunput inf_PROTO(( inf_CHAR c, inf_CHAR *buf_ptr ));
void infrestart inf_PROTO(( FILE *input_file ));
void inf_switch_to_buffer inf_PROTO(( inf_BUFFER_STATE new_buffer ));
void inf_load_buffer_state inf_PROTO(( void ));
inf_BUFFER_STATE inf_create_buffer inf_PROTO(( FILE *file, int size ));
void inf_delete_buffer inf_PROTO(( inf_BUFFER_STATE b ));
void inf_init_buffer inf_PROTO(( inf_BUFFER_STATE b, FILE *file ));

#define inf_new_buffer inf_create_buffer

#ifdef __cplusplus
static int infinput inf_PROTO(( void ));
#else
static int input inf_PROTO(( void ));
#endif

inf_DECL
    {
    register inf_state_type inf_current_state;
    register inf_CHAR *inf_cp, *inf_bp;
    register int inf_act;



    if ( inf_init )
	{
	inf_USER_INIT;

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

	if ( ! infin )
	    infin = stdin;

	if ( ! infout )
	    infout = stdout;

	if ( inf_current_buffer )
	    inf_init_buffer( inf_current_buffer, infin );
	else
	    inf_current_buffer = inf_create_buffer( infin, inf_BUF_SIZE );

	inf_load_buffer_state();

	inf_init = 0;
	}

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

	/* support of inftext */
	*inf_cp = inf_hold_char;

	/* inf_bp points to the position in inf_ch_buf of the start of the
	 * current run.
	 */
	inf_bp = inf_cp;

	inf_current_state = inf_start;
	if ( inf_bp[-1] == '\n' )
	    ++inf_current_state;
inf_match:
	do
	    {
	    register inf_CHAR inf_c = inf_ec[*inf_cp];
	    if ( inf_accept[inf_current_state] )
		{
		inf_last_accepting_state = inf_current_state;
		inf_last_accepting_cpos = inf_cp;
		}
	    while ( inf_chk[inf_base[inf_current_state] + inf_c] != inf_current_state )
		{
		inf_current_state = inf_def[inf_current_state];
		if ( inf_current_state >= 62 )
		    inf_c = inf_meta[inf_c];
		}
	    inf_current_state = inf_nxt[inf_base[inf_current_state] + inf_c];
	    ++inf_cp;
	    }
	while ( inf_current_state != 61 );
	inf_cp = inf_last_accepting_cpos;
	inf_current_state = inf_last_accepting_state;

inf_find_action:
	inf_act = inf_accept[inf_current_state];

	inf_DO_BEFORE_ACTION;
	inf_USER_ACTION;

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


	switch ( inf_act )
	    {
	    case 0: /* must backtrack */
	    /* undo the effects of inf_DO_BEFORE_ACTION */
	    *inf_cp = inf_hold_char;
	    inf_cp = inf_last_accepting_cpos;
	    inf_current_state = inf_last_accepting_state;
	    goto inf_find_action;

case 1:
# line 12 "inf.lex"
{;}
	inf_BREAK
case 2:
# line 13 "inf.lex"
{infParseLine++;}
	inf_BREAK
case 3:
# line 14 "inf.lex"
{ECHO;}
	inf_BREAK
case 4:
# line 15 "inf.lex"
{ECHO;return(T_END);} ;
	inf_BREAK
case 5:
# line 16 "inf.lex"
{ECHO;return(T_HELP_S);} ;
	inf_BREAK
case 6:
# line 17 "inf.lex"
{ECHO;return(T_HELP_S);};
	inf_BREAK
case 7:
# line 18 "inf.lex"
{ECHO;return(T_RENOM);} ;
	inf_BREAK
case 8:
# line 19 "inf.lex"
{ECHO;return(T_INOUT);} ;
	inf_BREAK
case 9:
# line 20 "inf.lex"
{ECHO;return(T_IN);} ;
	inf_BREAK
case 10:
# line 21 "inf.lex"
{ECHO;return(T_OUT);} ;
	inf_BREAK
case 11:
# line 22 "inf.lex"
{ECHO;return(T_MUTEX);};
	inf_BREAK
case 12:
# line 23 "inf.lex"
{ECHO;return(T_MUXU);};
	inf_BREAK
case 13:
# line 24 "inf.lex"
{ECHO;return(T_MUXD);};
	inf_BREAK
case 14:
# line 25 "inf.lex"
{ECHO;return(T_CMPU);};
	inf_BREAK
case 15:
# line 26 "inf.lex"
{ECHO;return(T_CMPD);};
	inf_BREAK
case 16:
# line 27 "inf.lex"
{ECHO;strcpy(inflval.istr,inftext);return(T_NAME);} ;
	inf_BREAK
case 17:
# line 28 "inf.lex"
{ECHO; return(*inftext) ; } ; 
	inf_BREAK
case 18:
# line 29 "inf.lex"
{ECHO; return(*inftext) ; } ; 
	inf_BREAK
case 19:
# line 30 "inf.lex"
{ECHO; return(*inftext) ; } ; 
	inf_BREAK
case 20:
# line 31 "inf.lex"
{ECHO; return(*inftext) ; } ; 
	inf_BREAK
case 21:
# line 32 "inf.lex"
{ECHO; return(*inftext) ; } ; 
	inf_BREAK
case 22:
# line 33 "inf.lex"
ECHO;
	inf_BREAK
case inf_STATE_EOF(INITIAL):
    infterminate();

	    case inf_END_OF_BUFFER:
		{
		/* amount of text matched not including the EOB char */
		int inf_amount_of_matched_text = inf_cp - inftext - 1;

		/* undo the effects of inf_DO_BEFORE_ACTION */
		*inf_cp = inf_hold_char;

		/* note that here we test for inf_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since inf_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 infinput().
		 */
		if ( inf_c_buf_p <= &inf_current_buffer->inf_ch_buf[inf_n_chars] )
		    /* this was really a NUL */
		    {
		    inf_state_type inf_next_state;

		    inf_c_buf_p = inftext + inf_amount_of_matched_text;

		    inf_current_state = inf_get_previous_state();

		    /* okay, we're now positioned to make the
		     * NUL transition.  We couldn't have
		     * inf_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)
		     */

		    inf_next_state = inf_try_NUL_trans( inf_current_state );

		    inf_bp = inftext + inf_MORE_ADJ;

		    if ( inf_next_state )
			{
			/* consume the NUL */
			inf_cp = ++inf_c_buf_p;
			inf_current_state = inf_next_state;
			goto inf_match;
			}

		    else
			{
			    inf_cp = inf_last_accepting_cpos;
			    inf_current_state = inf_last_accepting_state;
			goto inf_find_action;
			}
		    }

		else switch ( inf_get_next_buffer() )
		    {
		    case EOB_ACT_END_OF_FILE:
			{
			inf_did_buffer_switch_on_eof = 0;

			if ( infwrap() )
			    {
			    /* note: because we've taken care in
			     * inf_get_next_buffer() to have set up inftext,
			     * we can now set up inf_c_buf_p so that if some
			     * total hoser (like flex itself) wants
			     * to call the scanner after we return the
			     * inf_NULL, it'll still work - another inf_NULL
			     * will get returned.
			     */
			    inf_c_buf_p = inftext + inf_MORE_ADJ;

			    inf_act = inf_STATE_EOF((inf_start - 1) / 2);
			    goto do_action;
			    }

			else
			    {
			    if ( ! inf_did_buffer_switch_on_eof )
				inf_NEW_FILE;
			    }
			}
			break;

		    case EOB_ACT_CONTINUE_SCAN:
			inf_c_buf_p = inftext + inf_amount_of_matched_text;

			inf_current_state = inf_get_previous_state();

			inf_cp = inf_c_buf_p;
			inf_bp = inftext + inf_MORE_ADJ;
			goto inf_match;

		    case EOB_ACT_LAST_MATCH:
			inf_c_buf_p =
			    &inf_current_buffer->inf_ch_buf[inf_n_chars];

			inf_current_state = inf_get_previous_state();

			inf_cp = inf_c_buf_p;
			inf_bp = inftext + inf_MORE_ADJ;
			goto inf_find_action;
		    }
		break;
		}

	    default:
#ifdef FLEX_DEBUG
		printf( "action # %d\n", inf_act );
#endif
		inf_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	    }
	}
    }


/* inf_get_next_buffer - try to read in a new buffer
 *
 * synopsis
 *     int inf_get_next_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 inf_get_next_buffer()

    {
    register inf_CHAR *dest = inf_current_buffer->inf_ch_buf;
    register inf_CHAR *source = inftext - 1; /* copy prev. char, too */
    register int number_to_move, i;
    int ret_val;

    if ( inf_c_buf_p > &inf_current_buffer->inf_ch_buf[inf_n_chars + 1] )
	inf_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

    /* try to read more data */

    /* first move last chars to start of buffer */
    number_to_move = inf_c_buf_p - inftext;

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

    if ( inf_current_buffer->inf_eof_status != EOF_NOT_SEEN )
	/* don't do the read, it's not guaranteed to return an EOF,
	 * just force an EOF
	 */
	inf_n_chars = 0;

    else
	{
	int num_to_read = inf_current_buffer->inf_buf_size - number_to_move - 1;

	if ( num_to_read > inf_READ_BUF_SIZE )
	    num_to_read = inf_READ_BUF_SIZE;

	else if ( num_to_read <= 0 )
	    inf_FATAL_ERROR( "fatal error - scanner input buffer overflow" );

	/* read in more data */
	inf_INPUT( (&inf_current_buffer->inf_ch_buf[number_to_move]),
		  inf_n_chars, num_to_read );
	}

    if ( inf_n_chars == 0 )
	{
	if ( number_to_move == 1 )
	    {
	    ret_val = EOB_ACT_END_OF_FILE;
	    inf_current_buffer->inf_eof_status = EOF_DONE;
	    }

	else
	    {
	    ret_val = EOB_ACT_LAST_MATCH;
	    inf_current_buffer->inf_eof_status = EOF_PENDING;
	    }
	}

    else
	ret_val = EOB_ACT_CONTINUE_SCAN;

    inf_n_chars += number_to_move;
    inf_current_buffer->inf_ch_buf[inf_n_chars] = inf_END_OF_BUFFER_CHAR;
    inf_current_buffer->inf_ch_buf[inf_n_chars + 1] = inf_END_OF_BUFFER_CHAR;

    /* inftext begins at the second character in inf_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
     * inf_get_previous_state() will have with '^' rules active
     */

    inftext = &inf_current_buffer->inf_ch_buf[1];

    return ( ret_val );
    }


/* inf_get_previous_state - get the state just before the EOB char was reached
 *
 * synopsis
 *     inf_state_type inf_get_previous_state();
 */

static inf_state_type inf_get_previous_state()

    {
    register inf_state_type inf_current_state;
    register inf_CHAR *inf_cp;

    register inf_CHAR *inf_bp = inftext;

    inf_current_state = inf_start;
    if ( inf_bp[-1] == '\n' )
	++inf_current_state;

    for ( inf_cp = inftext + inf_MORE_ADJ; inf_cp < inf_c_buf_p; ++inf_cp )
	{
	register inf_CHAR inf_c = (*inf_cp ? inf_ec[*inf_cp] : 1);
	if ( inf_accept[inf_current_state] )
	    {
	    inf_last_accepting_state = inf_current_state;
	    inf_last_accepting_cpos = inf_cp;
	    }
	while ( inf_chk[inf_base[inf_current_state] + inf_c] != inf_current_state )
	    {
	    inf_current_state = inf_def[inf_current_state];
	    if ( inf_current_state >= 62 )
		inf_c = inf_meta[inf_c];
	    }
	inf_current_state = inf_nxt[inf_base[inf_current_state] + inf_c];
	}

    return ( inf_current_state );
    }


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

#ifdef inf_USE_PROTOS
static inf_state_type inf_try_NUL_trans( register inf_state_type inf_current_state )
#else
static inf_state_type inf_try_NUL_trans( inf_current_state )
register inf_state_type inf_current_state;
#endif

    {
    register int inf_is_jam;
    register inf_CHAR *inf_cp = inf_c_buf_p;

    register inf_CHAR inf_c = 1;
    if ( inf_accept[inf_current_state] )
	{
	inf_last_accepting_state = inf_current_state;
	inf_last_accepting_cpos = inf_cp;
	}
    while ( inf_chk[inf_base[inf_current_state] + inf_c] != inf_current_state )
	{
	inf_current_state = inf_def[inf_current_state];
	if ( inf_current_state >= 62 )
	    inf_c = inf_meta[inf_c];
	}
    inf_current_state = inf_nxt[inf_base[inf_current_state] + inf_c];
    inf_is_jam = (inf_current_state == 61);

    return ( inf_is_jam ? 0 : inf_current_state );
    }


#ifdef inf_USE_PROTOS
static void infunput( inf_CHAR c, register inf_CHAR *inf_bp )
#else
static void infunput( c, inf_bp )
inf_CHAR c;
register inf_CHAR *inf_bp;
#endif

    {
    register inf_CHAR *inf_cp = inf_c_buf_p;

    /* undo effects of setting up inftext */
    *inf_cp = inf_hold_char;

    if ( inf_cp < inf_current_buffer->inf_ch_buf + 2 )
	{ /* need to shift things up to make room */
	register int number_to_move = inf_n_chars + 2; /* +2 for EOB chars */
	register inf_CHAR *dest =
	    &inf_current_buffer->inf_ch_buf[inf_current_buffer->inf_buf_size + 2];
	register inf_CHAR *source =
	    &inf_current_buffer->inf_ch_buf[number_to_move];

	while ( source > inf_current_buffer->inf_ch_buf )
	    *--dest = *--source;

	inf_cp += dest - source;
	inf_bp += dest - source;
	inf_n_chars = inf_current_buffer->inf_buf_size;

	if ( inf_cp < inf_current_buffer->inf_ch_buf + 2 )
	    inf_FATAL_ERROR( "flex scanner push-back overflow" );
	}

    if ( inf_cp > inf_bp && inf_cp[-1] == '\n' )
	inf_cp[-2] = '\n';

    *--inf_cp = c;

    /* note: the formal parameter *must* be called "inf_bp" for this
     *       macro to now work correctly
     */
    inf_DO_BEFORE_ACTION; /* set up inftext again */
    }


#ifdef __cplusplus
static int infinput()
#else
static int input()
#endif

    {
    int c;
    inf_CHAR *inf_cp = inf_c_buf_p;

    *inf_cp = inf_hold_char;

    if ( *inf_c_buf_p == inf_END_OF_BUFFER_CHAR )
	{
	/* inf_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 ( inf_c_buf_p < &inf_current_buffer->inf_ch_buf[inf_n_chars] )
	    /* this was really a NUL */
	    *inf_c_buf_p = '\0';

	else
	    { /* need more input */
	    inftext = inf_c_buf_p;
	    ++inf_c_buf_p;

	    switch ( inf_get_next_buffer() )
		{
		case EOB_ACT_END_OF_FILE:
		    {
		    if ( infwrap() )
			{
			inf_c_buf_p = inftext + inf_MORE_ADJ;
			return ( EOF );
			}

		    inf_NEW_FILE;

#ifdef __cplusplus
		    return ( infinput() );
#else
		    return ( input() );
#endif
		    }
		    break;

		case EOB_ACT_CONTINUE_SCAN:
		    inf_c_buf_p = inftext + inf_MORE_ADJ;
		    break;

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

    c = *inf_c_buf_p;
    inf_hold_char = *++inf_c_buf_p;

    return ( c );
    }


#ifdef inf_USE_PROTOS
void infrestart( FILE *input_file )
#else
void infrestart( input_file )
FILE *input_file;
#endif

    {
    inf_init_buffer( inf_current_buffer, input_file );
    inf_load_buffer_state();
    }


#ifdef inf_USE_PROTOS
void inf_switch_to_buffer( inf_BUFFER_STATE new_buffer )
#else
void inf_switch_to_buffer( new_buffer )
inf_BUFFER_STATE new_buffer;
#endif

    {
    if ( inf_current_buffer == new_buffer )
	return;

    if ( inf_current_buffer )
	{
	/* flush out information for old buffer */
	*inf_c_buf_p = inf_hold_char;
	inf_current_buffer->inf_buf_pos = inf_c_buf_p;
	inf_current_buffer->inf_n_chars = inf_n_chars;
	}

    inf_current_buffer = new_buffer;
    inf_load_buffer_state();

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


#ifdef inf_USE_PROTOS
void inf_load_buffer_state( void )
#else
void inf_load_buffer_state()
#endif

    {
    inf_n_chars = inf_current_buffer->inf_n_chars;
    inftext = inf_c_buf_p = inf_current_buffer->inf_buf_pos;
    infin = inf_current_buffer->inf_input_file;
    inf_hold_char = *inf_c_buf_p;
    }


#ifdef inf_USE_PROTOS
inf_BUFFER_STATE inf_create_buffer( FILE *file, int size )
#else
inf_BUFFER_STATE inf_create_buffer( file, size )
FILE *file;
int size;
#endif

    {
    inf_BUFFER_STATE b;

    b = (inf_BUFFER_STATE) malloc( sizeof( struct inf_buffer_state ) );

    if ( ! b )
	inf_FATAL_ERROR( "out of dynamic memory in inf_create_buffer()" );

    b->inf_buf_size = size;

    /* inf_ch_buf has to be 2 characters longer than the size given because
     * we need to put in 2 end-of-buffer characters.
     */
    b->inf_ch_buf = (inf_CHAR *) malloc( (unsigned) (b->inf_buf_size + 2) );

    if ( ! b->inf_ch_buf )
	inf_FATAL_ERROR( "out of dynamic memory in inf_create_buffer()" );

    inf_init_buffer( b, file );

    return ( b );
    }


#ifdef inf_USE_PROTOS
void inf_delete_buffer( inf_BUFFER_STATE b )
#else
void inf_delete_buffer( b )
inf_BUFFER_STATE b;
#endif

    {
    if ( b == inf_current_buffer )
	inf_current_buffer = (inf_BUFFER_STATE) 0;

    free( (char *) b->inf_ch_buf );
    free( (char *) b );
    }


#ifdef inf_USE_PROTOS
void inf_init_buffer( inf_BUFFER_STATE b, FILE *file )
#else
void inf_init_buffer( b, file )
inf_BUFFER_STATE b;
FILE *file;
#endif

    {
    b->inf_input_file = file;

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

    b->inf_ch_buf[0] = '\n';
    b->inf_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->inf_ch_buf[1] = inf_END_OF_BUFFER_CHAR;
    b->inf_ch_buf[2] = inf_END_OF_BUFFER_CHAR;

    b->inf_buf_pos = &b->inf_ch_buf[1];

    b->inf_eof_status = EOF_NOT_SEEN;
    }
# line 33 "inf.lex"



