
#line 3 "<stdout>"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer octave__create_buffer
#define yy_delete_buffer octave__delete_buffer
#define yy_flex_debug octave__flex_debug
#define yy_init_buffer octave__init_buffer
#define yy_flush_buffer octave__flush_buffer
#define yy_load_buffer_state octave__load_buffer_state
#define yy_switch_to_buffer octave__switch_to_buffer
#define yyin octave_in
#define yyleng octave_leng
#define yylex octave_lex
#define yylineno octave_lineno
#define yyout octave_out
#define yyrestart octave_restart
#define yytext octave_text
#define yywrap octave_wrap
#define yyalloc octave_alloc
#define yyrealloc octave_realloc
#define yyfree octave_free

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

/* First, we deal with  platform-specific or compiler-specific issues. */

/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 * if you want the limit (max/min) macros for int types. 
 */
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif

#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t; 
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN               (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN              (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN              (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX               (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX              (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX              (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX              (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX             (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX             (4294967295U)
#endif

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)

#define YY_USE_CONST

#endif	/* defined (__STDC__) */
#endif	/* ! __cplusplus */

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an unsigned
 * integer for use as an array index.  If the signed char is negative,
 * we want to instead treat it as an 8-bit unsigned char, hence the
 * double cast.
 */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)

/* Enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN.
 */
#define BEGIN (yy_start) = 1 + 2 *

/* Translate the current start state into a value that can be later handed
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
 * compatibility.
 */
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START

/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE octave_restart(octave_in  )

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif

/* The state buf must be large enough to hold one state per character in the main buffer.
 */
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

extern int octave_leng;

extern FILE *octave_in, *octave_out;

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

    #define YY_LESS_LINENO(n)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up octave_text. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = (yy_hold_char); \
		YY_RESTORE_YY_MORE_OFFSET \
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up octave_text again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, (yytext_ptr)  )

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
	{
	FILE *yy_input_file;

	char *yy_ch_buf;		/* input buffer */
	char *yy_buf_pos;		/* current position in input buffer */

	/* Size of input buffer in bytes, not including room for EOB
	 * characters.
	 */
	yy_size_t yy_buf_size;

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

	/* Whether we "own" the buffer - i.e., we know we created it,
	 * and can realloc() it to grow it, and should free() it to
	 * delete it.
	 */
	int yy_is_our_buffer;

	/* Whether this is an "interactive" input source; if so, and
	 * if we're using stdio for input, then we want to use getc()
	 * instead of fread(), to make sure we stop fetching input after
	 * each newline.
	 */
	int yy_is_interactive;

	/* Whether we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */
    
	/* 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 octave_restart()), so that the user can continue scanning by
	 * just pointing octave_in at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */

/* 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".
 *
 * Returns the top of the stack, or NULL.
 */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)

/* Same as previous macro, but useful when we know that the buffer stack is not
 * NULL or when we need an lvalue. For internal use only.
 */
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]

/* yy_hold_char holds the character lost when octave_text is formed. */
static char yy_hold_char;
static int yy_n_chars;		/* number of characters read into yy_ch_buf */
int octave_leng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow octave_wrap()'s to do buffer switches
 * instead of setting up a fresh octave_in.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void octave_restart (FILE *input_file  );
void octave__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE octave__create_buffer (FILE *file,int size  );
void octave__delete_buffer (YY_BUFFER_STATE b  );
void octave__flush_buffer (YY_BUFFER_STATE b  );
void octave_push_buffer_state (YY_BUFFER_STATE new_buffer  );
void octave_pop_buffer_state (void );

static void octave_ensure_buffer_stack (void );
static void octave__load_buffer_state (void );
static void octave__init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER octave__flush_buffer(YY_CURRENT_BUFFER )

YY_BUFFER_STATE octave__scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE octave__scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE octave__scan_bytes (yyconst char *bytes,int len  );

void *octave_alloc (yy_size_t  );
void *octave_realloc (void *,yy_size_t  );
void octave_free (void *  );

#define yy_new_buffer octave__create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        octave_ensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            octave__create_buffer(octave_in,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        octave_ensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            octave__create_buffer(octave_in,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

typedef unsigned char YY_CHAR;

FILE *octave_in = (FILE *) 0, *octave_out = (FILE *) 0;

typedef int yy_state_type;

extern int octave_lineno;

int octave_lineno = 1;

extern char *octave_text;
#define yytext_ptr octave_text

static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
static int yy_get_next_buffer (void );
static void yy_fatal_error (yyconst char msg[]  );

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up octave_text.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
	octave_leng = (size_t) (yy_cp - yy_bp); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
	(yy_c_buf_p) = yy_cp;

#define YY_NUM_RULES 85
#define YY_END_OF_BUFFER 86
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static yyconst flex_int16_t yy_accept[433] =
    {   0,
       19,   19,   19,   19,   19,   19,    0,    0,    0,    0,
       86,   84,   19,   24,   24,   62,   26,   27,   22,   44,
       25,   63,   64,   50,   48,   54,   49,   65,   51,   18,
       18,   28,   53,   46,   57,   47,   23,   14,   52,   15,
       55,   82,   45,   83,   62,    6,    3,    3,    6,    5,
        6,    6,    5,    6,    6,    6,    6,    4,    6,    6,
        6,    6,    6,    6,    4,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,   10,   13,   13,
       27,    9,   11,    7,    8,    1,   85,    2,   19,   24,
       42,   22,   22,   58,   78,   56,   68,   37,   66,   38,

       67,   36,   31,   29,   30,    0,   32,   18,   33,   34,
       69,   18,   18,    0,   16,    0,   60,   39,   40,   43,
       61,   14,    0,   20,   20,    0,   70,   76,   82,   79,
       59,   41,    6,    6,    3,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,   10,   13,   13,    0,    9,
       11,    7,    8,   13,   13,    0,   13,    0,   12,   12,
        9,   11,   11,    0,    7,    8,   35,   73,   71,   72,

        0,   74,    0,   75,   77,   17,   18,    0,   18,   18,
       80,   81,    0,   21,   21,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
        6,    6,    6,   13,   13,    0,   13,   13,   12,   12,
        0,   12,   12,   12,    0,   11,    7,    8,   11,    0,
       11,   11,    0,   18,   21,    6,    6,   13,   13,   13,
        0,   11,    7,    8,   12,    0,   12,   12,   12,   12,
        0,   12,   12,   11,   11,   11,    0,    7,    8,   11,
       11,   11,    0,   13,   13,   11,   11,   11,    0,    7,
        8,   12,   12,   12,    0,   11,    7,    8,   12,   12,

       12,    0,   11,    7,    8,   11,   11,    0,   11,   11,
       11,    0,    0,   11,   11,   11,   11,   11,   11,    0,
       11,   11,   11,    0,    0,   11,   11,   12,   12,   11,
       11,   11,    0,    7,    8,   12,   12,   11,   11,   11,
        0,    7,    8,   11,    0,   11,   11,   11,   11,    0,
       11,   11,   11,   11,   11,    0,   11,    7,    8,   11,
       11,   11,   11,   11,   11,    0,   11,    7,    8,   11,
       11,   11,    0,   11,   11,   11,    0,   11,   11,   11,
        0,   11,    7,    8,   11,   11,   11,    0,   11,    7,
        8,   11,   11,   11,   11,   11,    0,    7,    8,   11,

       11,   11,   11,   11,    0,    7,    8,   11,   11,   11,
       11,   11,   11,   11,   11,   11,    0,    7,    8,   11,
       11,   11,   11,   11,    0,    7,    8,   11,   11,   11,
       11,    0
    } ;

static yyconst flex_int32_t yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    5,    6,    7,    8,    7,    9,   10,   11,
       12,   13,   14,   15,   16,   17,   18,   19,   20,   20,
       20,   20,   20,   20,   20,   20,   20,   21,   22,   23,
       24,   25,    1,   26,   27,   27,   27,   28,   28,   27,
        8,    8,   29,   29,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,   30,    8,    8,
       31,   32,   33,   34,    8,    1,   27,   27,   27,   28,

       28,   27,    8,    8,   29,   29,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,   30,
        8,    8,   35,   36,   37,   38,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static yyconst flex_int32_t yy_meta[39] =
    {   0,
        1,    2,    3,    3,    1,    1,    1,    2,    1,    1,
        1,    1,    1,    1,    3,    1,    1,    1,    2,    2,
        1,    3,    1,    1,    1,    1,    2,    2,    2,    2,
        1,    1,    1,    1,    1,    1,    1,    1
    } ;

static yyconst flex_int16_t yy_base[448] =
    {   0,
        0,    0,   38,    0,   75,    0,  816,  815,  814,  813,
      815, 1982,  812, 1982,  810,  788, 1982, 1982,  809,   71,
     1982, 1982, 1982,   68,   69, 1982,   70,  103,  786,  121,
       81, 1982, 1982,   61,  784,   63, 1982,  805,  100, 1982,
      782,  803,   75, 1982,  780,  801, 1982,  799,   94, 1982,
      150,  123, 1982,  799,  798,  129,  112, 1982,  132,  179,
      103,  212,  769,  796, 1982,  131,  104,  137,  795,  794,
      161,  793,  142,  791,  158,  790,  143,  241,  277,  780,
      126,  776,  169,  775,  770, 1982, 1982, 1982,  769, 1982,
     1982,  761,  760, 1982, 1982,  733, 1982, 1982, 1982, 1982,

     1982, 1982,  133,  732,  723,  725,  717,  155,  712,  711,
     1982,  305,  187,  189, 1982,  198,  703, 1982, 1982, 1982,
      702,  719,  184, 1982,  717,  197, 1982, 1982,  709, 1982,
     1982, 1982,  704,  703, 1982,  698,  697,    0,  673,  637,
      188,  601,  565,  529,  497,  495,  470,  222,  225,  226,
      217,  228,  257,  231,  234,  451,  330,  401,  251,  423,
      270,  236,  417,  410,  407,  237,  402,  289,  298,  397,
      393,  379,  361,  359,  355,    0,    0,  341,  217,  340,
      301,  336,  327,    0,  316,  219,    0,  265,  363,  399,
      315,  324,  349,  279,  307,  273,  242, 1982, 1982, 1982,

      369, 1982,  316, 1982, 1982, 1982,  326,  268,  287,  355,
     1982, 1982,  291, 1982,  308,  249,  262,  260,  255,  384,
      252,  378,  245,  235,  208,  388,  339,  391,  435,  200,
      157,  411,  375,    0,    0,  318,    0,  463,    0,  140,
      365,  499,    0,  535,  386,  420,  426,  436,  439,  413,
      445,  454,  415,  431, 1982,  457,  469,  571,    0,  607,
      441,  471,  477,  480,    0,  465,    0,  643,    0,    0,
      483,    0,  679,  488,  715,  751,  490,  505,  508,  511,
      520,  526,  501,    0,    0,  541,  787,  823,  513,  547,
      550,  859,    0,  895,  516,  556,  562,  567,  931,    0,

      967,  522,  577,  583,  586,    0,  112,  531, 1003,    0,
     1039,  537,  543,    0, 1075,  592,  598,    0,   88,  552,
     1111,    0, 1147,  558,  573,    0, 1183,    0,    0,  613,
        0, 1219,  579,  619,  622,    0,    0,  628,    0, 1255,
      588,  634,  639,    0,  594,    0, 1291,    0,    0,  603,
        0, 1327, 1363,    0, 1399,  609,  649,  655,  658,    0,
        0,    0, 1435,    0, 1471,  615,  664,  670,  675, 1507,
        0, 1543,  624, 1579,    0, 1615,  630, 1651,    0, 1687,
      645,  685,  691,  694, 1723,    0, 1759,  651,  700,  706,
      711,    0,    0,  721,    0, 1795,  660,  727,  730,    0,

        0,  736,    0, 1831,  666,  742,  747,    0,    0,    0,
        0,    0,    0,  757,    0, 1867,  681,  763,  766,    0,
        0,  772,    0, 1903,  687,  778,  783,    0,    0,    0,
        0, 1982, 1940, 1943,   87, 1946, 1948, 1951, 1954, 1957,
     1960, 1963, 1966, 1969, 1972, 1975, 1978
    } ;

static yyconst flex_int16_t yy_def[448] =
    {   0,
      432,    1,  432,    3,    1,    5,  433,  433,  434,  434,
      432,  432,  432,  432,  432,  432,  432,  432,  435,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  436,  432,  432,  436,  432,
      436,  436,  432,  436,  436,  436,  436,  432,  436,  436,
      436,  436,   62,  436,  432,  436,  436,  436,  436,  436,
      436,  436,  436,  436,  436,  436,  436,  432,  432,   79,
      437,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  435,  432,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  438,  432,  432,  432,  432,
      432,  432,  436,  432,  432,  436,  432,   51,  436,  436,
      436,  436,  436,  436,  436,  436,  436,  436,  436,  436,
      436,  436,  436,  436,  436,  436,   62,   62,  436,  436,
      436,  436,  436,  436,  436,  436,  432,  432,  439,  436,
      436,  432,  436,  436,  436,   78,   79,   79,  437,  432,
      432,  432,  432,   79,   79,  440,   79,  437,  432,  437,
      432,  432,  432,  441,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  438,  432,  438,  436,  436,  436,  436,  436,
      436,  436,  436,  436,  436,   62,  436,  436,  436,  436,
      436,  439,  438,   79,   79,  440,   79,  440,  189,  189,
      442,  437,  189,  437,  443,  437,  437,  437,  432,  441,
      432,  441,  432,  432,  432,  436,  436,  440,   79,  440,
      440,  440,  440,  440,  189,  442,  189,  442,  189,  189,
      443,  189,  443,  437,  432,  437,  444,  437,  437,  441,
      432,  441,  441,   79,   79,  440,  432,  440,  445,  440,
      440,  442,  189,  442,  442,  442,  442,  442,  443,  189,

      443,  443,  443,  443,  443,  275,  275,  446,  437,  275,
      437,  447,  444,  275,  444,  432,  432,  287,  287,  445,
      440,  287,  440,  445,  445,  287,  445,  189,  189,  442,
      275,  442,  446,  442,  442,  189,  189,  443,  275,  443,
      447,  443,  443,  275,  446,  275,  446,  275,  275,  447,
      275,  447,  444,  275,  444,  447,  444,  444,  444,  287,
      287,  287,  445,  287,  445,  445,  445,  445,  445,  442,
      275,  442,  446,  443,  275,  443,  447,  446,  275,  446,
      446,  446,  446,  446,  447,  275,  447,  447,  447,  447,
      447,  275,  275,  444,  275,  444,  444,  444,  444,  287,

      287,  445,  287,  445,  445,  445,  445,  275,  275,  275,
      275,  275,  275,  446,  275,  446,  446,  446,  446,  275,
      275,  447,  275,  447,  447,  447,  447,  275,  287,  275,
      275,    0,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432
    } ;

static yyconst flex_int16_t yy_nxt[2021] =
    {   0,
       12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
       22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
       32,   33,   34,   35,   36,   37,   19,   19,   19,   19,
       38,   39,   40,   41,   42,   43,   44,   45,   46,   13,
       47,   48,   49,   50,   18,   51,   52,   53,   54,   55,
       56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
       66,   67,   68,   69,   51,   51,   51,   51,   70,   71,
       72,   73,   74,   75,   76,   77,   78,   79,   80,   94,
       96,   81,   98,  117,  118,  100,  120,  121,   93,   82,
      360,   97,   99,  101,   95,  134,   83,  112,  130,  113,

      113,  123,  124,  125,  134,  134,  126,   84,  114,  115,
      131,   85,  102,  134,  344,  103,  104,  136,  105,  106,
      107,  108,  108,  127,  134,  143,  156,  164,  189,  190,
      134,  139,  134,  134,  109,  144,  110,  112,  134,  113,
      113,  141,  265,  134,  134,  197,  140,  145,  114,  115,
      116,  137,  142,  162,  163,  146,  198,  138,  134,  134,
      165,  166,  168,  124,  125,  171,  175,  169,  138,  138,
      192,  192,  193,  108,  108,  194,  138,  138,  138,  138,
      134,  173,  203,  115,  170,  123,  124,  125,  147,  134,
      126,  148,  149,  174,  150,  151,  152,  153,  153,  214,

      215,  134,  208,  112,  208,  113,  113,  209,  209,  134,
      154,  171,  155,  134,  114,  115,  210,  210,  134,  189,
      190,  237,  238,  134,  210,  210,  134,  134,  157,  134,
      158,  158,  134,  220,  216,  134,  134,  134,  134,  159,
      160,  161,  176,  177,  178,  217,  134,  179,  218,  219,
      134,  221,  134,  134,  223,  180,  134,  224,  134,  230,
      231,  134,  181,  134,  227,  205,  227,  189,  190,  228,
      228,  134,  224,  182,  196,  153,  153,  183,  184,  184,
      185,  251,  252,  186,  222,  160,  209,  209,  229,  229,
      168,  124,  125,  214,  215,  126,  229,  229,  181,  233,

      214,  215,  192,  192,  193,  209,  209,  194,  195,  182,
      255,  215,  213,  183,  206,  115,  191,  206,  235,  213,
      237,  238,  206,  207,  207,  192,  192,  193,  196,  253,
      194,  253,  114,  115,  254,  254,  206,  195,  206,  225,
      134,  191,  225,  234,  207,  207,  133,  225,  226,  226,
      192,  249,  193,  114,  115,  194,  134,  228,  228,  133,
      134,  225,  134,  225,  239,  239,  240,  267,  268,  241,
      123,  124,  125,  210,  210,  126,  233,  214,  215,  134,
      172,  210,  210,  115,  181,  168,  124,  125,  272,  273,
      169,  256,  134,  256,  134,  182,  257,  257,  134,  183,

      242,  243,  244,  167,  133,  245,  226,  226,  134,  228,
      228,  134,  233,  214,  215,  251,  252,  133,  134,  160,
      246,  274,  275,  276,  134,  213,  277,  278,  189,  190,
      133,  247,  213,  254,  254,  248,  134,  279,  189,  190,
      192,  192,  193,  237,  238,  194,  192,  192,  193,  254,
      254,  194,  134,  229,  229,  280,  281,  282,  134,  115,
      283,  229,  229,  160,  258,  259,  260,  267,  268,  261,
      134,  134,  286,  287,  288,  257,  257,  289,  290,  237,
      238,  291,  237,  238,  262,  272,  273,  257,  257,  274,
      275,  276,  314,  315,  277,  263,  134,  160,  134,  264,

      242,  269,  244,  251,  252,  245,  278,  189,  190,  279,
      189,  190,  280,  316,  282,  326,  327,  283,  267,  268,
      246,  192,  192,  193,  272,  273,  194,  280,  317,  282,
      134,  247,  283,  346,  347,  248,  242,  270,  244,  351,
      352,  245,  286,  287,  288,  314,  315,  289,  290,  237,
      238,  291,  237,  238,  326,  327,  246,  330,  331,  332,
      326,  327,  333,  334,  267,  268,  134,  247,  335,  267,
      268,  248,  258,  284,  260,  326,  327,  261,  338,  339,
      340,  346,  347,  341,  342,  272,  273,  343,  272,  273,
      351,  352,  262,  192,  192,  193,  346,  347,  194,  192,

      192,  193,  134,  263,  194,  351,  352,  264,  258,  285,
      260,  351,  352,  261,  330,  331,  332,  326,  327,  333,
      334,  267,  268,  335,  267,  268,  346,  347,  262,  338,
      339,  340,  351,  352,  341,  342,  272,  273,  134,  263,
      343,  272,  273,  264,  292,  293,  294,  346,  347,  295,
      394,  395,  396,  351,  352,  397,  398,  314,  315,  399,
      314,  315,  314,  315,  296,  402,  403,  404,  326,  327,
      405,  406,  326,  327,  134,  297,  407,  326,  327,  298,
      299,  300,  301,  346,  347,  302,  414,  415,  416,  351,
      352,  417,  418,  346,  347,  419,  346,  347,  137,  134,

      303,  422,  423,  424,  134,  134,  425,  426,  351,  352,
      129,  304,  427,  351,  352,  305,  306,  306,  307,  124,
      122,  308,  394,  395,  396,  212,  211,  397,  398,  314,
      315,  399,  314,  315,  205,  204,  181,  402,  403,  404,
      202,  201,  405,  406,  326,  327,  200,  182,  407,  326,
      327,  183,  309,  310,  311,  199,  128,  312,  414,  415,
      416,   92,   92,  417,  418,  346,  347,  419,  346,  347,
       89,  196,  246,  422,  423,  424,  195,  191,  425,  426,
      351,  352,  187,  247,  427,  351,  352,  248,  318,  318,
      319,  134,  172,  320,  134,  167,  134,  134,  133,  134,

      134,  135,  134,  132,  129,  128,  122,  119,  181,  111,
       92,   91,   90,   89,  432,   87,   87,   87,   87,  182,
      432,  432,  432,  183,  321,  322,  323,  432,  432,  324,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  262,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  263,  432,  432,  432,  264,
      292,  328,  294,  432,  432,  295,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      296,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  297,  432,  432,  432,  298,  292,  329,  294,  432,

      432,  295,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  296,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  297,  432,  432,
      432,  298,  299,  336,  301,  432,  432,  302,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  303,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  304,  432,  432,  432,  305,  299,  337,
      301,  432,  432,  302,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  303,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  304,

      432,  432,  432,  305,  309,  348,  311,  432,  432,  312,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  246,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  247,  432,  432,  432,  248,
      309,  349,  311,  432,  432,  312,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      246,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  247,  432,  432,  432,  248,  353,  354,  355,  432,
      432,  356,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  357,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  358,  432,  432,
      432,  359,  321,  361,  323,  432,  432,  324,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  262,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  263,  432,  432,  432,  264,  321,  362,
      323,  432,  432,  324,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  262,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  263,
      432,  432,  432,  264,  363,  364,  365,  432,  432,  366,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  367,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  368,  432,  432,  432,  369,
      370,  371,  372,  432,  432,  373,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      296,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  297,  432,  432,  432,  298,  374,  375,  376,  432,
      432,  377,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  303,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  304,  432,  432,
      432,  305,  378,  379,  380,  432,  432,  381,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  382,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  383,  432,  432,  432,  384,  385,  386,
      387,  432,  432,  388,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  389,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  390,
      432,  432,  432,  391,  353,  392,  355,  432,  432,  356,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  357,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  358,  432,  432,  432,  359,

      353,  393,  355,  432,  432,  356,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      357,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  358,  432,  432,  432,  359,  363,  400,  365,  432,
      432,  366,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  367,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  368,  432,  432,
      432,  369,  363,  401,  365,  432,  432,  366,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  367,  432,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  368,  432,  432,  432,  369,  370,  408,
      372,  432,  432,  373,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  296,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  297,
      432,  432,  432,  298,  370,  409,  372,  432,  432,  373,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  296,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  297,  432,  432,  432,  298,
      374,  410,  376,  432,  432,  377,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,

      303,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  304,  432,  432,  432,  305,  374,  411,  376,  432,
      432,  377,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  303,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  304,  432,  432,
      432,  305,  378,  412,  380,  432,  432,  381,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  382,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  383,  432,  432,  432,  384,  378,  413,
      380,  432,  432,  381,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  382,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  383,
      432,  432,  432,  384,  385,  420,  387,  432,  432,  388,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  389,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  390,  432,  432,  432,  391,
      385,  421,  387,  432,  432,  388,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      389,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  390,  432,  432,  432,  391,  353,  428,  355,  432,

      432,  356,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  357,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  358,  432,  432,
      432,  359,  363,  429,  365,  432,  432,  366,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  367,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  368,  432,  432,  432,  369,  378,  430,
      380,  432,  432,  381,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  382,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  383,

      432,  432,  432,  384,  385,  431,  387,  432,  432,  388,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  389,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  390,  432,  432,  432,  391,
       86,   86,   86,   88,   88,   88,  133,  133,  188,  188,
      188,  213,  213,  213,  232,  232,  232,  236,  236,  236,
      250,  250,  250,  266,  266,  266,  271,  271,  271,  313,
      313,  313,  325,  325,  325,  345,  345,  345,  350,  350,
      350,   11,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432
    } ;

static yyconst flex_int16_t yy_chk[2021] =
    {   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,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    5,    5,    5,   20,
       24,    5,   25,   34,   34,   27,   36,   36,  435,    5,
      319,   24,   25,   27,   20,   49,    5,   31,   43,   31,

       31,   39,   39,   39,   61,   67,   39,    5,   31,   31,
       43,    5,   28,   57,  307,   28,   28,   49,   28,   28,
       28,   28,   28,   39,   52,   57,   61,   67,   81,   81,
       56,   52,   66,   59,   28,   57,   28,   30,   68,   30,
       30,   56,  240,   73,   77,  103,   52,   59,   30,   30,
       30,   51,   56,   66,   66,   59,  103,   51,  231,   75,
       68,   68,   71,   71,   71,   73,   77,   71,   51,   51,
       83,   83,   83,  108,  108,   83,   51,   51,   51,   51,
       60,   75,  108,  108,   71,  123,  123,  123,   60,  141,
      123,   60,   60,   75,   60,   60,   60,   60,   60,  126,

      126,  230,  114,  113,  114,  113,  113,  114,  114,  225,
       60,  141,   60,   62,  113,  113,  116,  116,  151,  179,
      179,  186,  186,  148,  116,  116,  149,  150,   62,  152,
       62,   62,  154,  151,  148,  155,  224,  162,  166,   62,
       62,   62,   78,   78,   78,  148,  223,   78,  149,  150,
      216,  152,  159,  221,  154,   78,  219,  155,  153,  162,
      166,  218,   78,  217,  159,  197,  159,  188,  188,  159,
      159,  161,  216,   78,  196,  153,  153,   78,   79,   79,
       79,  194,  194,   79,  153,  153,  208,  208,  161,  161,
      168,  168,  168,  213,  213,  168,  161,  161,   79,  169,

      169,  169,  181,  181,  181,  209,  209,  181,  195,   79,
      215,  215,  169,   79,  112,  209,  191,  112,  185,  169,
      236,  236,  112,  112,  112,  192,  192,  192,  183,  203,
      192,  203,  112,  112,  203,  203,  112,  182,  112,  157,
      227,  180,  157,  178,  207,  207,  157,  157,  157,  157,
      193,  193,  193,  207,  207,  193,  175,  227,  227,  157,
      174,  157,  173,  157,  189,  189,  189,  241,  241,  189,
      201,  201,  201,  210,  210,  201,  233,  233,  233,  222,
      172,  210,  210,  210,  189,  220,  220,  220,  245,  245,
      220,  222,  228,  222,  171,  189,  222,  222,  170,  189,

      190,  190,  190,  167,  226,  190,  226,  226,  165,  228,
      228,  164,  232,  232,  232,  250,  250,  226,  163,  228,
      190,  246,  246,  246,  160,  232,  246,  247,  247,  247,
      158,  190,  232,  253,  253,  190,  229,  248,  248,  248,
      249,  249,  249,  261,  261,  249,  251,  251,  251,  254,
      254,  251,  156,  229,  229,  252,  252,  252,  256,  254,
      252,  229,  229,  229,  238,  238,  238,  266,  266,  238,
      257,  147,  262,  262,  262,  256,  256,  262,  263,  263,
      263,  264,  264,  264,  238,  271,  271,  257,  257,  274,
      274,  274,  277,  277,  274,  238,  146,  257,  145,  238,

      242,  242,  242,  283,  283,  242,  278,  278,  278,  279,
      279,  279,  280,  280,  280,  289,  289,  280,  295,  295,
      242,  281,  281,  281,  302,  302,  281,  282,  282,  282,
      144,  242,  282,  308,  308,  242,  244,  244,  244,  312,
      312,  244,  286,  286,  286,  313,  313,  286,  290,  290,
      290,  291,  291,  291,  320,  320,  244,  296,  296,  296,
      324,  324,  296,  297,  297,  297,  143,  244,  298,  298,
      298,  244,  258,  258,  258,  325,  325,  258,  303,  303,
      303,  333,  333,  303,  304,  304,  304,  305,  305,  305,
      341,  341,  258,  316,  316,  316,  345,  345,  316,  317,

      317,  317,  142,  258,  317,  350,  350,  258,  260,  260,
      260,  356,  356,  260,  330,  330,  330,  366,  366,  330,
      334,  334,  334,  335,  335,  335,  373,  373,  260,  338,
      338,  338,  377,  377,  338,  342,  342,  342,  140,  260,
      343,  343,  343,  260,  268,  268,  268,  381,  381,  268,
      357,  357,  357,  388,  388,  357,  358,  358,  358,  359,
      359,  359,  397,  397,  268,  367,  367,  367,  405,  405,
      367,  368,  368,  368,  139,  268,  369,  369,  369,  268,
      273,  273,  273,  417,  417,  273,  382,  382,  382,  425,
      425,  382,  383,  383,  383,  384,  384,  384,  137,  136,

      273,  389,  389,  389,  134,  133,  389,  390,  390,  390,
      129,  273,  391,  391,  391,  273,  275,  275,  275,  125,
      122,  275,  394,  394,  394,  121,  117,  394,  398,  398,
      398,  399,  399,  399,  110,  109,  275,  402,  402,  402,
      107,  106,  402,  406,  406,  406,  105,  275,  407,  407,
      407,  275,  276,  276,  276,  104,   96,  276,  414,  414,
      414,   93,   92,  414,  418,  418,  418,  419,  419,  419,
       89,   85,  276,  422,  422,  422,   84,   82,  422,  426,
      426,  426,   80,  276,  427,  427,  427,  276,  287,  287,
      287,   76,   74,  287,   72,   70,   69,   64,   63,   55,

       54,   48,   46,   45,   42,   41,   38,   35,  287,   29,
       19,   16,   15,   13,   11,   10,    9,    8,    7,  287,
        0,    0,    0,  287,  288,  288,  288,    0,    0,  288,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  288,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  288,    0,    0,    0,  288,
      292,  292,  292,    0,    0,  292,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      292,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  292,    0,    0,    0,  292,  294,  294,  294,    0,

        0,  294,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  294,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  294,    0,    0,
        0,  294,  299,  299,  299,    0,    0,  299,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  299,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  299,    0,    0,    0,  299,  301,  301,
      301,    0,    0,  301,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  301,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  301,

        0,    0,    0,  301,  309,  309,  309,    0,    0,  309,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  309,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  309,    0,    0,    0,  309,
      311,  311,  311,    0,    0,  311,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      311,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  311,    0,    0,    0,  311,  315,  315,  315,    0,
        0,  315,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  315,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,  315,    0,    0,
        0,  315,  321,  321,  321,    0,    0,  321,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  321,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  321,    0,    0,    0,  321,  323,  323,
      323,    0,    0,  323,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  323,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  323,
        0,    0,    0,  323,  327,  327,  327,    0,    0,  327,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,  327,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  327,    0,    0,    0,  327,
      332,  332,  332,    0,    0,  332,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      332,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  332,    0,    0,    0,  332,  340,  340,  340,    0,
        0,  340,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  340,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  340,    0,    0,
        0,  340,  347,  347,  347,    0,    0,  347,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  347,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  347,    0,    0,    0,  347,  352,  352,
      352,    0,    0,  352,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  352,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  352,
        0,    0,    0,  352,  353,  353,  353,    0,    0,  353,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  353,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  353,    0,    0,    0,  353,

      355,  355,  355,    0,    0,  355,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      355,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  355,    0,    0,    0,  355,  363,  363,  363,    0,
        0,  363,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  363,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  363,    0,    0,
        0,  363,  365,  365,  365,    0,    0,  365,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  365,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,  365,    0,    0,    0,  365,  370,  370,
      370,    0,    0,  370,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  370,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  370,
        0,    0,    0,  370,  372,  372,  372,    0,    0,  372,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  372,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  372,    0,    0,    0,  372,
      374,  374,  374,    0,    0,  374,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

      374,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  374,    0,    0,    0,  374,  376,  376,  376,    0,
        0,  376,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  376,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  376,    0,    0,
        0,  376,  378,  378,  378,    0,    0,  378,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  378,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  378,    0,    0,    0,  378,  380,  380,
      380,    0,    0,  380,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,  380,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  380,
        0,    0,    0,  380,  385,  385,  385,    0,    0,  385,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  385,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  385,    0,    0,    0,  385,
      387,  387,  387,    0,    0,  387,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      387,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  387,    0,    0,    0,  387,  396,  396,  396,    0,

        0,  396,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  396,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  396,    0,    0,
        0,  396,  404,  404,  404,    0,    0,  404,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  404,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  404,    0,    0,    0,  404,  416,  416,
      416,    0,    0,  416,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  416,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  416,

        0,    0,    0,  416,  424,  424,  424,    0,    0,  424,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  424,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  424,    0,    0,    0,  424,
      433,  433,  433,  434,  434,  434,  436,  436,  437,  437,
      437,  438,  438,  438,  439,  439,  439,  440,  440,  440,
      441,  441,  441,  442,  442,  442,  443,  443,  443,  444,
      444,  444,  445,  445,  445,  446,  446,  446,  447,  447,
      447,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,

      432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
      432,  432,  432,  432,  432,  432,  432,  432,  432,  432
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int octave__flex_debug;
int octave__flex_debug = 0;

/* 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
#define YY_RESTORE_YY_MORE_OFFSET
char *octave_text;
#line 1 "lex.l"
/*

Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
              2002, 2003, 2004, 2005, 2006, 2007 John W. Eaton

This file is part of Octave.

Octave 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; either version 3 of the License, or (at your
option) any later version.

Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING.  If not, see
<http://www.gnu.org/licenses/>.

*/




#line 33 "lex.l"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <cctype>
#include <cstring>

#include <sstream>
#include <string>
#include <stack>

#ifdef HAVE_UNISTD_H
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <unistd.h>
#endif

#include "cmd-edit.h"
#include "quit.h"
#include "lo-mappers.h"

// These would be alphabetical, but y.tab.h must be included before
// oct-gperf.h and y.tab.h must be included after token.h and the tree
// class declarations.  We can't include y.tab.h in oct-gperf.h
// because it may not be protected to allow it to be included multiple
// times.

#include "Cell.h"
#include "comment-list.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "input.h"
#include "lex.h"
#include "ov.h"
#include "parse.h"
#include "pt-all.h"
#include "symtab.h"
#include "token.h"
#include "toplev.h"
#include "utils.h"
#include "variables.h"
#include <y.tab.h>
#include <oct-gperf.h>

#if ! (defined (FLEX_SCANNER) \
       && defined (YY_FLEX_MAJOR_VERSION) && YY_FLEX_MAJOR_VERSION >= 2 \
       && defined (YY_FLEX_MINOR_VERSION) && YY_FLEX_MINOR_VERSION >= 5)
#error lex.l requires flex version 2.5.4 or later
#endif

#define yylval octave_lval

// Arrange to get input via readline.

#ifdef YY_INPUT
#undef YY_INPUT
#endif
#define YY_INPUT(buf, result, max_size) \
  if ((result = octave_read (buf, max_size)) < 0) \
    YY_FATAL_ERROR ("octave_read () in flex scanner failed");

// Try to avoid crashing out completely on fatal scanner errors.
// The call to yy_fatal_error should never happen, but it avoids a
// `static function defined but not used' warning from gcc.

#ifdef YY_FATAL_ERROR
#undef YY_FATAL_ERROR
#endif
#define YY_FATAL_ERROR(msg) \
  do \
    { \
      error (msg); \
      OCTAVE_QUIT; \
      yy_fatal_error (msg); \
    } \
  while (0)

#define COUNT_TOK_AND_RETURN(tok) \
  do \
    { \
      Vtoken_count++; \
      return tok; \
    } \
  while (0)

#define TOK_RETURN(tok) \
  do \
    { \
      current_input_column += octave_leng; \
      lexer_flags.quote_is_transpose = false; \
      lexer_flags.convert_spaces_to_comma = true; \
      COUNT_TOK_AND_RETURN (tok); \
    } \
  while (0)

#define TOK_PUSH_AND_RETURN(name, tok) \
  do \
    { \
      yylval.tok_val = new token (name, input_line_number, \
				  current_input_column); \
      token_stack.push (yylval.tok_val); \
      TOK_RETURN (tok); \
    } \
  while (0)

#define BIN_OP_RETURN(tok, convert) \
  do \
    { \
      yylval.tok_val = new token (input_line_number, current_input_column); \
      token_stack.push (yylval.tok_val); \
      current_input_column += octave_leng; \
      lexer_flags.quote_is_transpose = false; \
      lexer_flags.convert_spaces_to_comma = convert; \
      COUNT_TOK_AND_RETURN (tok); \
    } \
  while (0)

#define XBIN_OP_RETURN(tok, convert) \
  do \
    { \
	gripe_matlab_incompatible_operator (octave_text); \
        BIN_OP_RETURN (tok, convert); \
    } \
  while (0)

// TRUE means that we have encountered EOF on the input stream.
bool parser_end_of_input = false;

// Flags that need to be shared between the lexer and parser.
lexical_feedback lexer_flags;

// Stack to hold tokens so that we can delete them when the parser is
// reset and avoid growing forever just because we are stashing some
// information.  This has to appear before lex.h is included, because
// one of the macros defined there uses token_stack.
//
// FIXME -- this should really be static, but that causes
// problems on some systems.
std::stack <token*> token_stack;

// Did eat_whitespace() eat a space or tab, or a newline, or both?

typedef int yum_yum;

const yum_yum ATE_NOTHING = 0;
const yum_yum ATE_SPACE_OR_TAB = 1;
const yum_yum ATE_NEWLINE = 2;

// Is the closest nesting level a square bracket, squiggly brace or a paren?

class bracket_brace_paren_nesting_level
{
public:

  bracket_brace_paren_nesting_level (void) : context () { }

  ~bracket_brace_paren_nesting_level (void) { }

  void bracket (void) { context.push (BRACKET); }
  bool is_bracket (void)
    { return ! context.empty () && context.top () == BRACKET; }

  void brace (void) {  context.push (BRACE); }
  bool is_brace (void)
    { return ! context.empty () && context.top () == BRACE; }

  void paren (void) {  context.push (PAREN); }
  bool is_paren (void)
    { return ! context.empty () && context.top () == PAREN; }

  bool is_bracket_or_brace (void)
    { return (! context.empty ()
	      && (context.top () == BRACKET || context.top () == BRACE)); }

  bool none (void) { return context.empty (); }

  void remove (void) { if (! context.empty ()) context.pop (); }

  void clear (void) { while (! context.empty ()) context.pop (); }

private:

  std::stack<int> context;

  static const int BRACKET;
  static const int BRACE;
  static const int PAREN;

  bracket_brace_paren_nesting_level (const bracket_brace_paren_nesting_level&);

  bracket_brace_paren_nesting_level&
  operator = (const bracket_brace_paren_nesting_level&);
};

const int bracket_brace_paren_nesting_level::BRACKET = 1;
const int bracket_brace_paren_nesting_level::BRACE = 2;
const int bracket_brace_paren_nesting_level::PAREN = 3;

static bracket_brace_paren_nesting_level nesting_level;

static unsigned int Vtoken_count = 0;

// Forward declarations for functions defined at the bottom of this
// file.

static void fixup_column_count (char *s);
static void do_comma_insert_check (void);
static int is_keyword_token (const std::string& s);
static void prep_for_function (void);
static void prep_for_nested_function (void);
static symbol_record *lookup_identifier (const std::string& s);
static std::string grab_help_text (void);
static bool match_any (char c, const char *s);
static bool next_token_is_sep_op (void);
static bool next_token_is_bin_op (bool spc_prev);
static bool next_token_is_postfix_unary_op (bool spc_prev);
static std::string strip_trailing_whitespace (char *s);
static void handle_number (void);
static int handle_string (char delim, int text_style = 0);
static int handle_close_bracket (bool spc_gobbled, int bracket_type);
static int handle_identifier (void);
static bool have_continuation (bool trailing_comments_ok = true);
static bool have_ellipsis_continuation (bool trailing_comments_ok = true);
static void scan_for_comments (const char *);
static yum_yum eat_whitespace (void);
static yum_yum eat_continuation (void);
static void maybe_warn_separator_insert (char sep);
static void gripe_single_quote_string (void);
static void gripe_matlab_incompatible (const std::string& msg);
static void maybe_gripe_matlab_incompatible_comment (char c);
static void gripe_matlab_incompatible_continuation (void);
static void gripe_matlab_incompatible_operator (const std::string& op);

#line 1318 "<stdout>"

#define INITIAL 0
#define COMMAND_START 1
#define MATRIX_START 2
#define NESTED_FUNCTION_END 3
#define NESTED_FUNCTION_BEGIN 4

#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 * down here because we want the user's section 1 to have been scanned first.
 * The user has a chance to override it with an option.
 */
#include <unistd.h>
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

/* Accessor methods to globals.
   These are made visible to non-reentrant scanners for convenience. */

int octave_lex_destroy (void );

int octave_get_debug (void );

void octave_set_debug (int debug_flag  );

YY_EXTRA_TYPE octave_get_extra (void );

void octave_set_extra (YY_EXTRA_TYPE user_defined  );

FILE *octave_get_in (void );

void octave_set_in  (FILE * in_str  );

FILE *octave_get_out (void );

void octave_set_out  (FILE * out_str  );

int octave_get_leng (void );

char *octave_get_text (void );

int octave_get_lineno (void );

void octave_set_lineno (int line_number  );

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

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int octave_wrap (void );
#else
extern int octave_wrap (void );
#endif
#endif

    static void yyunput (int c,char *buf_ptr  );
    
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif

#ifndef YY_NO_INPUT

#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#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 fwrite( octave_text, octave_leng, 1, octave_out )
#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_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		int n; \
		for ( n = 0; n < max_size && \
			     (c = getc( octave_in )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( octave_in ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, octave_in))==0 && ferror(octave_in)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(octave_in); \
			} \
		}\
\

#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

/* end tables serialization structures and prototypes */

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1

extern int octave_lex (void);

#define YY_DECL int octave_lex (void)
#endif /* !YY_DECL */

/* Code executed at the beginning of each rule, after octave_text and octave_leng
 * 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

#define YY_RULE_SETUP \
	YY_USER_ACTION

/** The main scanner function which does all the work.
 */
YY_DECL
{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;
    
#line 287 "lex.l"


#line 1507 "<stdout>"

	if ( !(yy_init) )
		{
		(yy_init) = 1;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! octave_in )
			octave_in = stdin;

		if ( ! octave_out )
			octave_out = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			octave_ensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				octave__create_buffer(octave_in,YY_BUF_SIZE );
		}

		octave__load_buffer_state( );
		}

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

		/* Support of octave_text. */
		*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);
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 >= 433 )
					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] != 1982 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
			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_RULE_SETUP
#line 289 "lex.l"
{
    BEGIN (NESTED_FUNCTION_BEGIN);
    yyunput (octave_text[0], octave_text);
    COUNT_TOK_AND_RETURN (';');
  }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 295 "lex.l"
{
    BEGIN (INITIAL);
    yyunput (octave_text[0], octave_text);
    prep_for_nested_function ();
    COUNT_TOK_AND_RETURN (FCN);
  }
	YY_BREAK

// Help and other command-style functions are a pain in the ass.  This
// stuff needs to be simplified.  May require some changes in the
// parser too.

case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 308 "lex.l"
{
    BEGIN (INITIAL);
    current_input_column = 1;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;
    lexer_flags.doing_rawcommand = false;
    COUNT_TOK_AND_RETURN ('\n');
  }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 317 "lex.l"
{
    if (lexer_flags.doing_rawcommand)
      TOK_PUSH_AND_RETURN (octave_text, SQ_STRING);

    BEGIN (INITIAL);

    if (strcmp (octave_text, ",") == 0)
      TOK_RETURN (',');
    else
      TOK_RETURN (';');
  }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 329 "lex.l"
{
    current_input_column++;
    COUNT_TOK_AND_RETURN (handle_string (octave_text[0], true));
  }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 334 "lex.l"
{
    std::string tok = strip_trailing_whitespace (octave_text);
    TOK_PUSH_AND_RETURN (tok, SQ_STRING);
  }
	YY_BREAK

// For this and the next two rules, we're looking at ']', and we
// need to know if the next token is `=' or `=='.
//
// It would have been so much easier if the delimiters were simply
// different for the expression on the left hand side of the equals
// operator.
//
// It's also a pain in the ass to decide whether to insert a comma
// after seeing a ']' character...

case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 351 "lex.l"
{
    scan_for_comments (octave_text);
    fixup_column_count (octave_text);
    int c = octave_text[octave_leng-1];
    int cont_is_spc = eat_continuation ();
    bool spc_gobbled = (cont_is_spc || c == ' ' || c == '\t');
    int tok_to_return = handle_close_bracket (spc_gobbled, ']');
    if (spc_gobbled)
      yyunput (' ', octave_text);
    COUNT_TOK_AND_RETURN (tok_to_return);
  }
	YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 363 "lex.l"
{
    scan_for_comments (octave_text);
    fixup_column_count (octave_text);
    int c = octave_text[octave_leng-1];
    int cont_is_spc = eat_continuation ();
    bool spc_gobbled = (cont_is_spc || c == ' ' || c == '\t');
    int tok_to_return = handle_close_bracket (spc_gobbled, '}');
    if (spc_gobbled)
      yyunput (' ', octave_text);
    COUNT_TOK_AND_RETURN (tok_to_return);
  }
	YY_BREAK

// Commas are element separators in matrix constants.  If we don't
// check for continuations here we can end up inserting too many
// commas.

case 9:
YY_RULE_SETUP
#line 381 "lex.l"
{
    current_input_column += octave_leng;

    int tmp = eat_continuation ();

    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;

    if ((tmp & ATE_NEWLINE) == ATE_NEWLINE)
      {
	maybe_warn_separator_insert (';');

	yyunput (';', octave_text);
      }

    COUNT_TOK_AND_RETURN (',');
  }
	YY_BREAK

// In some cases, spaces in matrix constants can turn into commas.
// If commas are required, spaces are not important in matrix
// constants so we just eat them.  If we don't check for continuations
// here we can end up inserting too many commas.

case 10:
YY_RULE_SETUP
#line 406 "lex.l"
{
    current_input_column += octave_leng;

    int tmp = eat_continuation ();
    int bin_op = next_token_is_bin_op (true);
    int postfix_un_op = next_token_is_postfix_unary_op (true);

    if (! (postfix_un_op || bin_op)
	&& nesting_level.is_bracket_or_brace ()
	&& lexer_flags.convert_spaces_to_comma)
      {
	if ((tmp & ATE_NEWLINE) == ATE_NEWLINE)
	  {
	    maybe_warn_separator_insert (';');

	    yyunput (';', octave_text);
	  }

	lexer_flags.quote_is_transpose = false;
	lexer_flags.convert_spaces_to_comma = true;

	maybe_warn_separator_insert (',');

	COUNT_TOK_AND_RETURN (',');
      }
  }
	YY_BREAK

// Semicolons are handled as row seprators in matrix constants.  If we
// don't eat whitespace here we can end up inserting too many
// semicolons.

case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 439 "lex.l"
{
    scan_for_comments (octave_text);
    fixup_column_count (octave_text);
    eat_whitespace ();
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;
    COUNT_TOK_AND_RETURN (';');
  }
	YY_BREAK

// In some cases, new lines can also become row separators.  If we
// don't eat whitespace here we can end up inserting too many
// semicolons.

case 12:
/* rule 12 can match eol */
#line 455 "lex.l"
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 455 "lex.l"
{
    scan_for_comments (octave_text);
    fixup_column_count (octave_text);
    eat_whitespace ();

    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;

    if (nesting_level.none ())
      return LEXICAL_ERROR;

    if (nesting_level.is_bracket_or_brace ())
      {
	maybe_warn_separator_insert (';');

	COUNT_TOK_AND_RETURN (';');
      }
  }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 474 "lex.l"
{
    nesting_level.bracket ();

    current_input_column += octave_leng;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;

    if (lexer_flags.defining_func && ! lexer_flags.parsed_function_name)
      lexer_flags.looking_at_return_list = true;
    else
      lexer_flags.looking_at_matrix_or_assign_lhs = true;

    promptflag--;
    eat_whitespace ();

    lexer_flags.bracketflag++;
    BEGIN (MATRIX_START);
    COUNT_TOK_AND_RETURN ('[');
  }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 494 "lex.l"
{
    nesting_level.remove ();

    TOK_RETURN (']');
  }
	YY_BREAK

// Imaginary numbers.

case 16:
YY_RULE_SETUP
#line 504 "lex.l"
{
    handle_number ();
    COUNT_TOK_AND_RETURN (IMAG_NUM);
  }
	YY_BREAK

// Real numbers.  Don't grab the `.' part of a dot operator as part of
// the constant.

case 17:
*yy_cp = (yy_hold_char); /* undo effects of setting up octave_text */
(yy_c_buf_p) = yy_cp -= 2;
YY_DO_BEFORE_ACTION; /* set up octave_text again */
#line 515 "lex.l"
case 18:
YY_RULE_SETUP
#line 515 "lex.l"
{
    handle_number ();
    COUNT_TOK_AND_RETURN (NUM);
  }
	YY_BREAK

// Eat whitespace.  Whitespace inside matrix constants is handled by
// the <MATRIX_START> start state code above.

case 19:
YY_RULE_SETUP
#line 525 "lex.l"
{
    current_input_column += octave_leng;
  }
	YY_BREAK

// Continuation lines.  Allow comments after continuations.

case 20:
/* rule 20 can match eol */
#line 534 "lex.l"
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
#line 534 "lex.l"
{
    if (octave_text[0] == '\\')
      gripe_matlab_incompatible_continuation ();
    scan_for_comments (octave_text);
    promptflag--;
    current_input_column = 1;
  }
	YY_BREAK

// End of file.

case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMAND_START):
case YY_STATE_EOF(MATRIX_START):
case YY_STATE_EOF(NESTED_FUNCTION_END):
case YY_STATE_EOF(NESTED_FUNCTION_BEGIN):
#line 546 "lex.l"
{
    TOK_RETURN (END_OF_INPUT);
  }
	YY_BREAK

// Identifiers.  Truncate the token at the first space or tab but
// don't write directly on octave_text.

case 22:
YY_RULE_SETUP
#line 555 "lex.l"
{
    int id_tok = handle_identifier ();

    if (id_tok >= 0)
      COUNT_TOK_AND_RETURN (id_tok);
  }
	YY_BREAK

// Function handles.

case 23:
YY_RULE_SETUP
#line 566 "lex.l"
{
    current_input_column++;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = false;
    lexer_flags.looking_at_function_handle++;
    COUNT_TOK_AND_RETURN ('@');
  }
	YY_BREAK

// A new line character.  New line characters inside matrix constants
// are handled by the <MATRIX_START> start state code above.  If closest
// nesting is inside parentheses, don't return a row separator.

case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
#line 580 "lex.l"
{
    current_input_column = 1;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;
    if (nesting_level.none ())
      COUNT_TOK_AND_RETURN ('\n');
    else if (nesting_level.is_paren ())
      gripe_matlab_incompatible ("bare newline inside parentheses");
    else if (nesting_level.is_bracket_or_brace ())
      return LEXICAL_ERROR;
  }
	YY_BREAK

// Single quote can either be the beginning of a string or a transpose
// operator. 

case 25:
YY_RULE_SETUP
#line 597 "lex.l"
{
    current_input_column++;
    lexer_flags.convert_spaces_to_comma = true;

    if (lexer_flags.quote_is_transpose)
      {
	do_comma_insert_check ();
	COUNT_TOK_AND_RETURN (QUOTE);
      }
    else
      COUNT_TOK_AND_RETURN (handle_string ('\''));
  }
	YY_BREAK

// Double quotes always begin strings.

case 26:
YY_RULE_SETUP
#line 614 "lex.l"
{
    current_input_column++;
    COUNT_TOK_AND_RETURN (handle_string ('"'));
}
	YY_BREAK

// Gobble comments.  If closest nesting is inside parentheses, don't
// return a new line.

case 27:
YY_RULE_SETUP
#line 624 "lex.l"
{
    std::string help_txt;

    if (! help_buf.empty ())
      help_txt = help_buf.top ();

    if (help_txt.empty ()
	&& lexer_flags.beginning_of_function
	&& nesting_level.none ())
      {
	lexer_flags.beginning_of_function = false;

	std::string txt = grab_help_text ();

	if (! help_buf.empty ())
	  help_buf.pop ();

	help_buf.push (txt);

	octave_comment_buffer::append (txt);
      }
    else
      {
	std::string buf;

	bool begin_comment = true;

	int c;
	while ((c = yyinput ()) != EOF && c != '\n')
	  {
	    if (begin_comment && (c == '#' || c == '%'))
	      ; /* Skip leading comment characters. */
	    else
	      buf += static_cast<char> (c);
	  }

	octave_comment_buffer::append (buf);
      }

    current_input_column = 1;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;

    maybe_gripe_matlab_incompatible_comment (octave_text[0]);

    if (YY_START == COMMAND_START)
      BEGIN (INITIAL);

    if (nesting_level.none ())
      {
	lexer_flags.doing_rawcommand = false;
	COUNT_TOK_AND_RETURN ('\n');
      }
    else if (nesting_level.is_bracket_or_brace ())
      COUNT_TOK_AND_RETURN (';');
  }
	YY_BREAK

// Other operators.

case 28:
YY_RULE_SETUP
#line 685 "lex.l"
{ BIN_OP_RETURN (':', false); }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 687 "lex.l"
{ XBIN_OP_RETURN (EPLUS, false); }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 688 "lex.l"
{ XBIN_OP_RETURN (EMINUS, false); }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 689 "lex.l"
{ BIN_OP_RETURN (EMUL, false); }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 690 "lex.l"
{ BIN_OP_RETURN (EDIV, false); }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 691 "lex.l"
{ BIN_OP_RETURN (ELEFTDIV, false); }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 692 "lex.l"
{ BIN_OP_RETURN (EPOW, false); }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 693 "lex.l"
{ XBIN_OP_RETURN (EPOW, false); }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 694 "lex.l"
{ do_comma_insert_check (); BIN_OP_RETURN (TRANSPOSE, true); }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 695 "lex.l"
{ do_comma_insert_check (); XBIN_OP_RETURN (PLUS_PLUS, true); }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 696 "lex.l"
{ do_comma_insert_check (); XBIN_OP_RETURN (MINUS_MINUS, true); }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 697 "lex.l"
{ BIN_OP_RETURN (EXPR_LE, false); }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 698 "lex.l"
{ BIN_OP_RETURN (EXPR_EQ, false); }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 699 "lex.l"
{ BIN_OP_RETURN (EXPR_NE, false); }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 700 "lex.l"
{ XBIN_OP_RETURN (EXPR_NE, false); }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 701 "lex.l"
{ BIN_OP_RETURN (EXPR_GE, false); }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 702 "lex.l"
{ BIN_OP_RETURN (EXPR_AND, false); }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 703 "lex.l"
{ BIN_OP_RETURN (EXPR_OR, false); }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 704 "lex.l"
{ BIN_OP_RETURN (EXPR_LT, false); }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 705 "lex.l"
{ BIN_OP_RETURN (EXPR_GT, false); }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 706 "lex.l"
{ BIN_OP_RETURN ('+', false); }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 707 "lex.l"
{ BIN_OP_RETURN ('-', false); }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 708 "lex.l"
{ BIN_OP_RETURN ('*', false); }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 709 "lex.l"
{ BIN_OP_RETURN ('/', false); }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 710 "lex.l"
{ BIN_OP_RETURN (LEFTDIV, false); }
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 711 "lex.l"
{ BIN_OP_RETURN (';', true); }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 712 "lex.l"
{ BIN_OP_RETURN (',', true); }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 713 "lex.l"
{ BIN_OP_RETURN (POW, false); }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 714 "lex.l"
{ XBIN_OP_RETURN (POW, false); }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 715 "lex.l"
{ BIN_OP_RETURN ('=', true); }
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 716 "lex.l"
{ BIN_OP_RETURN (EXPR_AND_AND, false); }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 717 "lex.l"
{ BIN_OP_RETURN (EXPR_OR_OR, false); }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 718 "lex.l"
{ XBIN_OP_RETURN (LSHIFT, false); }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 719 "lex.l"
{ XBIN_OP_RETURN (RSHIFT, false); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 721 "lex.l"
{
    if (octave_text[0] == '~')
      BIN_OP_RETURN (EXPR_NOT, false);
    else
      XBIN_OP_RETURN (EXPR_NOT, false);
  }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 728 "lex.l"
{
    lexer_flags.looking_at_indirect_ref = false;
    nesting_level.paren ();
    promptflag--;
    TOK_RETURN ('(');
  }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 735 "lex.l"
{
    nesting_level.remove ();
    current_input_column++;
    lexer_flags.quote_is_transpose = true;
    lexer_flags.convert_spaces_to_comma = nesting_level.is_bracket_or_brace ();
    do_comma_insert_check ();
    COUNT_TOK_AND_RETURN (')');
  }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 744 "lex.l"
{ TOK_RETURN ('.'); }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 746 "lex.l"
{ XBIN_OP_RETURN (ADD_EQ, false); }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 747 "lex.l"
{ XBIN_OP_RETURN (SUB_EQ, false); }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 748 "lex.l"
{ XBIN_OP_RETURN (MUL_EQ, false); }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 749 "lex.l"
{ XBIN_OP_RETURN (DIV_EQ, false); }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 750 "lex.l"
{ XBIN_OP_RETURN (LEFTDIV_EQ, false); }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 751 "lex.l"
{ XBIN_OP_RETURN (ADD_EQ, false); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 752 "lex.l"
{ XBIN_OP_RETURN (SUB_EQ, false); }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 753 "lex.l"
{ XBIN_OP_RETURN (EMUL_EQ, false); }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 754 "lex.l"
{ XBIN_OP_RETURN (EDIV_EQ, false); }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 755 "lex.l"
{ XBIN_OP_RETURN (ELEFTDIV_EQ, false); }
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 756 "lex.l"
{ XBIN_OP_RETURN (POW_EQ, false); }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 757 "lex.l"
{ XBIN_OP_RETURN (EPOW_EQ, false); }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 758 "lex.l"
{ XBIN_OP_RETURN (AND_EQ, false); }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 759 "lex.l"
{ XBIN_OP_RETURN (OR_EQ, false); }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 760 "lex.l"
{ XBIN_OP_RETURN (LSHIFT_EQ, false); }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 761 "lex.l"
{ XBIN_OP_RETURN (RSHIFT_EQ, false); }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 763 "lex.l"
{
    nesting_level.brace ();

    current_input_column += octave_leng;
    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = true;

    promptflag--;
    eat_whitespace ();

    lexer_flags.braceflag++;
    BEGIN (MATRIX_START);
    COUNT_TOK_AND_RETURN ('{');
  }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 778 "lex.l"
{
    nesting_level.remove ();

    TOK_RETURN ('}');
  }
	YY_BREAK

// Unrecognized input is a lexical error.

case 84:
YY_RULE_SETUP
#line 788 "lex.l"
{
    // EOF happens here if we are parsing nested functions.

    yyunput (octave_text[0], octave_text);

    int c = yyinput ();

    if (c != EOF)
      {
	current_input_column++;

	error ("invalid character `%s' (ASCII %d) near line %d, column %d",
	       undo_string_escape (static_cast<char> (c)), c,
	       input_line_number, current_input_column);

	return LEXICAL_ERROR;
      }
    else
      TOK_RETURN (END_OF_INPUT);
  }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 809 "lex.l"
ECHO;
	YY_BREAK
#line 2407 "<stdout>"

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

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

		if ( YY_CURRENT_BUFFER_LVALUE->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 octave_in at a new source and called
			 * octave_lex().  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_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = octave_in;
			YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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 ( octave_wrap( ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * octave_text, 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_LVALUE->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 octave_lex */

/* 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 (void)
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = (yytext_ptr);
	register int number_to_move, i;
	int ret_val;

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

	if ( YY_CURRENT_BUFFER_LVALUE->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 single character, 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 = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;

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

	if ( YY_CURRENT_BUFFER_LVALUE->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_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;

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

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */

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

			int yy_c_buf_p_offset =
				(int) ((yy_c_buf_p) - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					octave_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

			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_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	if ( (yy_n_chars) == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			octave_restart(octave_in  );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) octave_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
	}

	(yy_n_chars) += number_to_move;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;

	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];

	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 (void)
{
	register yy_state_type yy_current_state;
	register char *yy_cp;
    
	yy_current_state = (yy_start);

	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 >= 433 )
				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 );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	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 >= 433 )
			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 == 432);

	return yy_is_jam ? 0 : yy_current_state;
}

    static void yyunput (int c, register char * yy_bp )
{
	register char *yy_cp;
    
    yy_cp = (yy_c_buf_p);

	/* undo effects of setting up octave_text */
	*yy_cp = (yy_hold_char);

	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_ch_buf[
					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
		register char *source =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];

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

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;

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

	*--yy_cp = (char) c;

	(yytext_ptr) = yy_bp;
	(yy_hold_char) = *yy_cp;
	(yy_c_buf_p) = yy_cp;
}

#ifndef YY_NO_INPUT
#ifdef __cplusplus
    static int yyinput (void)
#else
    static int input  (void)
#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_LVALUE->yy_ch_buf[(yy_n_chars)] )
			/* This was really a NUL. */
			*(yy_c_buf_p) = '\0';

		else
			{ /* need more input */
			int offset = (yy_c_buf_p) - (yytext_ptr);
			++(yy_c_buf_p);

			switch ( yy_get_next_buffer(  ) )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because yy_g_n_b()
					 * sees that we've accumulated a
					 * token and flags that we need to
					 * try matching the token before
					 * proceeding.  But for input(),
					 * there's no matching to consider.
					 * So convert the EOB_ACT_LAST_MATCH
					 * to EOB_ACT_END_OF_FILE.
					 */

					/* Reset buffer status. */
					octave_restart(octave_in );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( octave_wrap( ) )
						return EOF;

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

				case EOB_ACT_CONTINUE_SCAN:
					(yy_c_buf_p) = (yytext_ptr) + offset;
					break;
				}
			}
		}

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

	return c;
}
#endif	/* ifndef YY_NO_INPUT */

/** Immediately switch to a different input stream.
 * @param input_file A readable stream.
 * 
 * @note This function does not reset the start condition to @c INITIAL .
 */
    void octave_restart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        octave_ensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            octave__create_buffer(octave_in,YY_BUF_SIZE );
	}

	octave__init_buffer(YY_CURRENT_BUFFER,input_file );
	octave__load_buffer_state( );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void octave__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		octave_pop_buffer_state();
	 *		octave_push_buffer_state(new_buffer);
     */
	octave_ensure_buffer_stack ();
	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_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	octave__load_buffer_state( );

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

static void octave__load_buffer_state  (void)
{
    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
	octave_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
	(yy_hold_char) = *(yy_c_buf_p);
}

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * 
 * @return the allocated buffer state.
 */
    YY_BUFFER_STATE octave__create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) octave_alloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in octave__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 *) octave_alloc(b->yy_buf_size + 2  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in octave__create_buffer()" );

	b->yy_is_our_buffer = 1;

	octave__init_buffer(b,file );

	return b;
}

/** Destroy the buffer.
 * @param b a buffer created with octave__create_buffer()
 * 
 */
    void octave__delete_buffer (YY_BUFFER_STATE  b )
{
    
	if ( ! b )
		return;

	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		octave_free((void *) b->yy_ch_buf  );

	octave_free((void *) b  );
}

#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
    
/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a octave_restart() or at EOF.
 */
    static void octave__init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	octave__flush_buffer(b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

    /* If b is the current buffer, then octave__init_buffer was _probably_
     * called from octave_restart() or through yy_get_next_buffer.
     * In that case, we don't want to reset the lineno or column.
     */
    if (b != YY_CURRENT_BUFFER){
        b->yy_bs_lineno = 1;
        b->yy_bs_column = 0;
    }

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

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * 
 */
    void octave__flush_buffer (YY_BUFFER_STATE  b )
{
    	if ( ! b )
		return;

	b->yy_n_chars = 0;

	/* 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[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

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

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == YY_CURRENT_BUFFER )
		octave__load_buffer_state( );
}

/** Pushes the new state onto the stack. The new state becomes
 *  the current state. This function will allocate the stack
 *  if necessary.
 *  @param new_buffer The new state.
 *  
 */
void octave_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
    	if (new_buffer == NULL)
		return;

	octave_ensure_buffer_stack();

	/* This block is copied from octave__switch_to_buffer. */
	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*(yy_c_buf_p) = (yy_hold_char);
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	/* Only push if top exists. Otherwise, replace top. */
	if (YY_CURRENT_BUFFER)
		(yy_buffer_stack_top)++;
	YY_CURRENT_BUFFER_LVALUE = new_buffer;

	/* copied from octave__switch_to_buffer. */
	octave__load_buffer_state( );
	(yy_did_buffer_switch_on_eof) = 1;
}

/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  
 */
void octave_pop_buffer_state (void)
{
    	if (!YY_CURRENT_BUFFER)
		return;

	octave__delete_buffer(YY_CURRENT_BUFFER );
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if ((yy_buffer_stack_top) > 0)
		--(yy_buffer_stack_top);

	if (YY_CURRENT_BUFFER) {
		octave__load_buffer_state( );
		(yy_did_buffer_switch_on_eof) = 1;
	}
}

/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
static void octave_ensure_buffer_stack (void)
{
	int num_to_alloc;
    
	if (!(yy_buffer_stack)) {

		/* First allocation is just for 2 elements, since we don't know if this
		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
		 * immediate realloc on the next call.
         */
		num_to_alloc = 1;
		(yy_buffer_stack) = (struct yy_buffer_state**)octave_alloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in octave_ensure_buffer_stack()" );
								  
		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
				
		(yy_buffer_stack_max) = num_to_alloc;
		(yy_buffer_stack_top) = 0;
		return;
	}

	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){

		/* Increase the buffer to prepare for a possible push. */
		int grow_size = 8 /* arbitrary grow size */;

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)octave_realloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in octave_ensure_buffer_stack()" );

		/* zero only the new slots.*/
		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
		(yy_buffer_stack_max) = num_to_alloc;
	}
}

/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * 
 * @return the newly allocated buffer state object. 
 */
YY_BUFFER_STATE octave__scan_buffer  (char * base, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

	b = (YY_BUFFER_STATE) octave_alloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in octave__scan_buffer()" );

	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = 0;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	octave__switch_to_buffer(b  );

	return b;
}

/** Setup the input buffer state to scan a string. The next call to octave_lex() will
 * scan from a @e copy of @a str.
 * @param yystr a NUL-terminated string to scan
 * 
 * @return the newly allocated buffer state object.
 * @note If you want to scan bytes that may contain NUL values, then use
 *       octave__scan_bytes() instead.
 */
YY_BUFFER_STATE octave__scan_string (yyconst char * yystr )
{
    
	return octave__scan_bytes(yystr,strlen(yystr) );
}

/** Setup the input buffer state to scan the given bytes. The next call to octave_lex() will
 * scan from a @e copy of @a bytes.
 * @param bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE octave__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) octave_alloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in octave__scan_bytes()" );

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;

	b = octave__scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in octave__scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

static void yy_fatal_error (yyconst char* msg )
{
    	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}

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

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up octave_text. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		octave_text[octave_leng] = (yy_hold_char); \
		(yy_c_buf_p) = octave_text + yyless_macro_arg; \
		(yy_hold_char) = *(yy_c_buf_p); \
		*(yy_c_buf_p) = '\0'; \
		octave_leng = yyless_macro_arg; \
		} \
	while ( 0 )

/* Accessor  methods (get/set functions) to struct members. */

/** Get the current line number.
 * 
 */
int octave_get_lineno  (void)
{
        
    return octave_lineno;
}

/** Get the input stream.
 * 
 */
FILE *octave_get_in  (void)
{
        return octave_in;
}

/** Get the output stream.
 * 
 */
FILE *octave_get_out  (void)
{
        return octave_out;
}

/** Get the length of the current token.
 * 
 */
int octave_get_leng  (void)
{
        return octave_leng;
}

/** Get the current token.
 * 
 */

char *octave_get_text  (void)
{
        return octave_text;
}

/** Set the current line number.
 * @param line_number
 * 
 */
void octave_set_lineno (int  line_number )
{
    
    octave_lineno = line_number;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param in_str A readable stream.
 * 
 * @see octave__switch_to_buffer
 */
void octave_set_in (FILE *  in_str )
{
        octave_in = in_str ;
}

void octave_set_out (FILE *  out_str )
{
        octave_out = out_str ;
}

int octave_get_debug  (void)
{
        return octave__flex_debug;
}

void octave_set_debug (int  bdebug )
{
        octave__flex_debug = bdebug ;
}

static int yy_init_globals (void)
{
        /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from octave_lex_destroy(), so don't allocate here.
     */

    (yy_buffer_stack) = 0;
    (yy_buffer_stack_top) = 0;
    (yy_buffer_stack_max) = 0;
    (yy_c_buf_p) = (char *) 0;
    (yy_init) = 0;
    (yy_start) = 0;

/* Defined in main.c */
#ifdef YY_STDINIT
    octave_in = stdin;
    octave_out = stdout;
#else
    octave_in = (FILE *) 0;
    octave_out = (FILE *) 0;
#endif

    /* For future reference: Set errno on error, since we are called by
     * octave_lex_init()
     */
    return 0;
}

/* octave_lex_destroy is for both reentrant and non-reentrant scanners. */
int octave_lex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		octave__delete_buffer(YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		octave_pop_buffer_state();
	}

	/* Destroy the stack itself. */
	octave_free((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * octave_lex() is called, initialization will occur. */
    yy_init_globals( );

    return 0;
}

/*
 * Internal utility routines.
 */

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

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif

void *octave_alloc (yy_size_t  size )
{
	return (void *) malloc( size );
}

void *octave_realloc  (void * ptr, yy_size_t  size )
{
	/* The cast to (char *) in the following accommodates both
	 * implementations that use char* generic pointers, and those
	 * that use void* generic pointers.  It works with the latter
	 * because both ANSI C and C++ allow castless assignment from
	 * any pointer type to void*, and deal with argument conversions
	 * as though doing an assignment.
	 */
	return (void *) realloc( (char *) ptr, size );
}

void octave_free (void * ptr )
{
	free( (char *) ptr );	/* see octave_realloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 809 "lex.l"



// GAG.
//
// If we're reading a matrix and the next character is '[', make sure
// that we insert a comma ahead of it.

void
do_comma_insert_check (void)
{
  int spc_gobbled = eat_continuation ();

  int c = yyinput ();

  yyunput (c, octave_text);

  if (spc_gobbled)
    yyunput (' ', octave_text);

  lexer_flags.do_comma_insert = (lexer_flags.bracketflag && c == '[');
}

// Fix things up for errors or interrupts.  The parser is never called
// recursively, so it is always safe to reinitialize its state before
// doing any parsing.

void
reset_parser (void)
{
  // Start off on the right foot.
  BEGIN (INITIAL);

  parser_end_of_input = false;
  end_tokens_expected = 0;

  while (! symtab_context.empty ())
    symtab_context.pop ();

  // We do want a prompt by default.
  promptflag = 1;

  // Error may have occurred inside some brackets, braces, or parentheses.
  nesting_level.clear ();

  // Clear out the stack of token info used to track line and column
  // numbers.
  while (! token_stack.empty ())
    {
      delete token_stack.top ();
      token_stack.pop ();
    }

  // Can be reset by defining a function.
  if (! (reading_script_file || reading_fcn_file))
    {
      current_input_column = 1;
      input_line_number = command_editor::current_command_number () - 1;
    }

  // Only ask for input from stdin if we are expecting interactive
  // input.
  if ((interactive || forced_interactive)
      && ! (reading_fcn_file
	    || reading_script_file
	    || get_input_from_eval_string
	    || input_from_startup_file))
    octave_restart (stdin);

  // Clear the buffer for help text.
  while (! help_buf.empty ())
    help_buf.pop ();

  // Reset other flags.
  lexer_flags.init ();
}

// If we read some newlines, we need figure out what column we're
// really looking at.

static void
fixup_column_count (char *s)
{
  char c;
  while ((c = *s++) != '\0')
    {
      if (c == '\n')
	  current_input_column = 1;
      else
	current_input_column++;
    }
}

// Include these so that we don't have to link to libfl.a.

int
octave_wrap (void)
{
  return 1;
}

// Tell us all what the current buffer is.

YY_BUFFER_STATE
current_buffer (void)
{
  return YY_CURRENT_BUFFER;
}

// Create a new buffer.

YY_BUFFER_STATE
create_buffer (FILE *f)
{
  return octave__create_buffer (f, YY_BUF_SIZE);
}

// Start reading a new buffer.

void
switch_to_buffer (YY_BUFFER_STATE buf)
{
  octave__switch_to_buffer (buf);
}

// Delete a buffer.

void
delete_buffer (YY_BUFFER_STATE buf)
{
  octave__delete_buffer (buf);
}

// Restore a buffer (for unwind-prot).

void
restore_input_buffer (void *buf)
{
  switch_to_buffer (static_cast<YY_BUFFER_STATE> (buf));
}

// Delete a buffer (for unwind-prot).

void
delete_input_buffer (void *buf)
{
  delete_buffer (static_cast<YY_BUFFER_STATE> (buf));
}

static void
prep_for_function (void)
{
  end_tokens_expected++;

  // Prepare for local symbols.

  tmp_local_sym_tab = new symbol_table ();

  promptflag--;

  lexer_flags.defining_func = true;
  lexer_flags.parsed_function_name = false;
  lexer_flags.beginning_of_function = true;

  if (! (reading_fcn_file || reading_script_file))
    input_line_number = 1;
}

static void
prep_for_nested_function (void)
{
  lexer_flags.parsing_nested_function = 1;
  help_buf.push (std::string ());
  prep_for_function ();
  // We're still only expecting one end token for this set of functions.
  end_tokens_expected--;
  yylval.tok_val = new token (input_line_number, current_input_column);
  token_stack.push (yylval.tok_val);
}

// Handle keywords.  Return -1 if the keyword should be ignored.

static int
is_keyword_token (const std::string& s)
{
  int l = input_line_number;
  int c = current_input_column;

  int len = s.length ();

  const octave_kw *kw = octave_kw_hash::in_word_set (s.c_str (), len);

  if (kw)
    {
      yylval.tok_val = 0;

      switch (kw->kw_id)
	{
	case break_kw:
	case case_kw:
	case catch_kw:
	case continue_kw:
	case else_kw:
	case elseif_kw:
	case global_kw:
	case otherwise_kw:
	case return_kw:
	case static_kw:
	case until_kw:
	case unwind_protect_cleanup_kw:
 	  break;

	case end_kw:
	  if (lexer_flags.looking_at_object_index)
	    return 0;
	  else
	    {
	      if (reading_fcn_file && end_tokens_expected == 1)
		return -1;
	      else
		{
		  yylval.tok_val = new token (token::simple_end, l, c);
		  end_tokens_expected--;
		}
	    }
	  break;

	case end_try_catch_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::try_catch_end, l, c);
	  break;

	case end_unwind_protect_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::unwind_protect_end, l, c);
	  break;

	case endfor_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::for_end, l, c);
	  break;

	case endfunction_kw:
	  {
	    if (reading_fcn_file && end_tokens_expected == 1)
	      return -1;
	    else
	      {
		yylval.tok_val = new token (token::function_end, l, c);
		end_tokens_expected--;
	      }
	  }
	  break;

	case endif_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::if_end, l, c);
	  break;

	case endswitch_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::switch_end, l, c);
	  break;

	case endwhile_kw:
	  end_tokens_expected--;
	  yylval.tok_val = new token (token::while_end, l, c);
	  break;

	case for_kw:
	case while_kw:
	  end_tokens_expected++;
	  // Fall through...

	case do_kw:
	  promptflag--;
	  lexer_flags.looping++;
	  break;

	case if_kw:
	case try_kw:
	case switch_kw:
	case unwind_protect_kw:
	  end_tokens_expected++;
	  promptflag--;
	  break;

	case function_kw:
	  {
	    if (lexer_flags.defining_func)
	      {
		if (reading_fcn_file)
		  {
		    if (lexer_flags.parsing_nested_function)
		      {
			BEGIN (NESTED_FUNCTION_END);

			yylval.tok_val = new token (token::function_end, l, c);
			token_stack.push (yylval.tok_val);

			return END;
		      }
		    else
		      {
			prep_for_nested_function ();

			return FCN;
		      }
		  }
		else
		  {
		    error ("nested functions not implemented in this context");

		    if ((reading_fcn_file || reading_script_file)
			&& ! curr_fcn_file_name.empty ())
		      error ("near line %d of file `%s.m'",
			     input_line_number, curr_fcn_file_name.c_str ());
		    else
		      error ("near line %d", input_line_number);

		    return LEXICAL_ERROR;
		  }
	      }
	    else
	      prep_for_function ();
	  }
	  break;

        case magic_file_kw:
	  {
	    if ((reading_fcn_file || reading_script_file)
		&& ! curr_fcn_file_full_name.empty ())
	      yylval.tok_val = new token (curr_fcn_file_full_name, l, c);
	    else
	      yylval.tok_val = new token ("stdin", l, c);
	  }
	  break;

        case magic_line_kw:
	  yylval.tok_val = new token (static_cast<double> (l), "", l, c);
	  break;

	case varargin_kw:
	  if (! lexer_flags.looking_at_parameter_list)
	    return 0;
	  break;

	case varargout_kw:
	  if (! (lexer_flags.looking_at_return_list
		 || (lexer_flags.defining_func
		     && ! lexer_flags.parsed_function_name)))
	    return 0;
	  break;

	default:
	  panic_impossible ();
	}

      if (! yylval.tok_val)
	yylval.tok_val = new token (l, c);

      token_stack.push (yylval.tok_val);

      return kw->tok;
    }

  return 0;
}

// Try to find an identifier.  All binding to global or builtin
// variables occurs when expressions are evaluated.

static symbol_record *
lookup_identifier (const std::string& name)
{
  std::string sym_name = name;

  if (curr_sym_tab == fbi_sym_tab
      && lexer_flags.parsing_nested_function)
    sym_name = parent_function_name + ":" + sym_name;

  return curr_sym_tab->lookup (sym_name, true);
}

static bool
is_variable (const std::string& name)
{
  symbol_record *sr = curr_sym_tab->lookup (name);

  return sr && sr->is_variable ();
}

static void
force_local_variable (const std::string& name)
{
  if (! is_variable (name))
    curr_sym_tab->clear (name);

  symbol_record *sr = curr_sym_tab->lookup (name, true);

  if (sr)
    sr->define (octave_value ());
}

// Grab the help text from an function file.

// FIXME -- gobble_leading_white_space() in parse.y
// duplicates some of this code!

static std::string
grab_help_text (void)
{
  std::string buf;

  bool begin_comment = true;
  bool in_comment = true;
  bool discard_space = true;

  int c = 0;

  while ((c = yyinput ()) != EOF)
    {
      if (begin_comment)
	{
	  if (c == '%' || c == '#')
	    continue;
	  else if (discard_space && c == ' ')
	    {
	      discard_space = false;
	      continue;
	    }
	  else
	    begin_comment = false;
	}	

      if (in_comment)
	{
	  buf += static_cast<char> (c);

	  if (c == '\n')
	    {
	      in_comment = false;
	      discard_space = true;
	    }
	}
      else
	{
	  switch (c)
	    {
	    case '#':
	    case '%':
	      maybe_gripe_matlab_incompatible_comment (octave_text[0]);
	      in_comment = true;
	      begin_comment = true;
	      break;

	    case ' ':
	    case '\t':
	      break;

	    default:
	      goto done;
	    }
	}
    }

 done:

  if (c)
    yyunput (c, octave_text);

  return buf;
}

// Return 1 if the given character matches any character in the given
// string.

static bool
match_any (char c, const char *s)
{
  char tmp;
  while ((tmp = *s++) != '\0')
    {
      if (c == tmp)
	return true;
    }
  return false;
}

// Given information about the spacing surrounding an operator,
// return 1 if it looks like it should be treated as a binary
// operator.  For example,
//
//   [ 1 + 2 ]  or  [ 1+ 2]  or  [ 1+2 ]  ==>  binary
//
//   [ 1 +2 ]  ==>  unary

static bool
looks_like_bin_op (bool spc_prev, int next_char)
{
  bool spc_next = (next_char == ' ' || next_char == '\t');

  return ((spc_prev && spc_next) || ! spc_prev);
}

// Recognize separators.  If the separator is a CRLF pair, it is
// replaced by a single LF.

static bool
next_token_is_sep_op (void)
{
  bool retval = false;

  int c1 = yyinput ();

  if (c1 == '\r')
    {
      int c2 = yyinput ();

      if (c2 == '\n')
	{
	  c1 = '\n';

	  retval = true;
	}
      else
	yyunput (c2, octave_text);
    }
  else
    retval = match_any (c1, ",;\n]");

  yyunput (c1, octave_text);

  return retval;
}

// Try to determine if the next token should be treated as a postfix
// unary operator.  This is ugly, but it seems to do the right thing.

static bool
next_token_is_postfix_unary_op (bool spc_prev)
{
  bool un_op = false;

  int c0 = yyinput ();

  if (c0 == '\'' && ! spc_prev)
    {
      un_op = true;
    }
  else if (c0 == '.')
    {
      int c1 = yyinput ();
      un_op = (c1 == '\'');
      yyunput (c1, octave_text);
    }
  else if (c0 == '+')
    {
      int c1 = yyinput ();
      un_op = (c1 == '+');
      yyunput (c1, octave_text);
    }
  else if (c0 == '-')
    {
      int c1 = yyinput ();
      un_op = (c1 == '-');
      yyunput (c1, octave_text);
    }

  yyunput (c0, octave_text);

  return un_op;
}

// Try to determine if the next token should be treated as a binary
// operator.
//
// This kluge exists because whitespace is not always ignored inside
// the square brackets that are used to create matrix objects (though
// spacing only really matters in the cases that can be interpreted
// either as binary ops or prefix unary ops: currently just +, -).
//
// Note that a line continuation directly following a + or - operator
// (e.g., the characters '[' 'a' ' ' '+' '\' LFD 'b' ']') will be
// parsed as a binary operator.

static bool
next_token_is_bin_op (bool spc_prev)
{
  bool bin_op = false;

  int c0 = yyinput ();

  switch (c0)
    {
    case '+':
    case '-':
      {
	int c1 = yyinput ();

	switch (c1)
	  {
	  case '+':
	  case '-':
	    // Unary ops, spacing doesn't matter.
	    break;

	  case '=':
	    // Binary ops, spacing doesn't matter.
	    bin_op = true;
	    break;

	  default:
	    // Could be either, spacing matters.
	    bin_op = looks_like_bin_op (spc_prev, c1);
	    break;
	  }

	yyunput (c1, octave_text);
      }
      break;

    case ':':
    case '/':
    case '\\':
    case '^':
      // Always a binary op (may also include /=, \=, and ^=).
      bin_op = true;
      break;

    // .+ .- ./ .\ .^ .* .**
    case '.':
      {
	int c1 = yyinput ();

	if (match_any (c1, "+-/\\^*"))
	  // Always a binary op (may also include .+=, .-=, ./=, ...).
	  bin_op = true;
	else if (! isdigit (c1) && c1 != ' ' && c1 != '\t' && c1 != '.')
	  // A structure element reference is a binary op.
	  bin_op = true;

	yyunput (c1, octave_text);
      }
      break;

    // = == & && | || * **
    case '=':
    case '&':
    case '|':
    case '*':
      // Always a binary op (may also include ==, &&, ||, **).
      bin_op = true;
      break;

    // < <= <> > >=
    case '<':
    case '>':
      // Always a binary op (may also include <=, <>, >=).
      bin_op = true;
      break;

    // ~= !=
    case '~':
    case '!':
      {
	int c1 = yyinput ();

	// ~ and ! can be unary ops, so require following =.
	if (c1 == '=')
	  bin_op = true;

	yyunput (c1, octave_text);
      }
      break;

    default:
      break;
    }

  yyunput (c0, octave_text);

  return bin_op;
}

// Used to delete trailing white space from tokens.

static std::string
strip_trailing_whitespace (char *s)
{
  std::string retval = s;

  size_t pos = retval.find_first_of (" \t");

  if (pos != NPOS)
    retval.resize (pos);

  return retval;
}

static void
scan_for_comments (const char *text)
{
  std::string comment_buf;

  bool in_comment = false;
  bool beginning_of_comment = false;

  int len = strlen (text);
  int i = 0;

  while (i < len)
    {
      char c = text[i++];

      switch (c)
	{
	case '%':
	case '#':
	  if (in_comment)
	    {
	      if (! beginning_of_comment)
		comment_buf += static_cast<char> (c);
	    }
	  else
	    {
	      maybe_gripe_matlab_incompatible_comment (c);
	      in_comment = true;
	      beginning_of_comment = true;
	    }
	  break;

	case '\n':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      octave_comment_buffer::append (comment_buf);
	      comment_buf.resize (0);
	      in_comment = false;
	      beginning_of_comment = false;
	    }
	  break;

	case '\r':
	  if (in_comment)
	    comment_buf += static_cast<char> (c);
	  if (i < len)
	    {
	      c = text[i++];

	      if (c == '\n')
		{
		  if (in_comment)
		    {
		      comment_buf += static_cast<char> (c);
		      octave_comment_buffer::append (comment_buf);
		      in_comment = false;
		      beginning_of_comment = false;
		    }
		}
	    }

	default:
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	    }
	  break;
	}
    }

  if (! comment_buf.empty ())
    octave_comment_buffer::append (comment_buf);
}

// Discard whitespace, including comments and continuations.
//
// Return value is logical OR of the following values:
//
//  ATE_NOTHING      : no spaces to eat
//  ATE_SPACE_OR_TAB : space or tab in input
//  ATE_NEWLINE      : bare new line in input

static yum_yum
eat_whitespace (void)
{
  yum_yum retval = ATE_NOTHING;

  std::string comment_buf;

  bool in_comment = false;
  bool beginning_of_comment = false;

  int c = 0;

  while ((c = yyinput ()) != EOF)
    {
      current_input_column++;

      switch (c)
	{
	case ' ':
	case '\t':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	    }
	  retval |= ATE_SPACE_OR_TAB;
	  break;

	case '\n':
	  retval |= ATE_NEWLINE;
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      octave_comment_buffer::append (comment_buf);
	      comment_buf.resize (0);
	      in_comment = false;
	      beginning_of_comment = false;
	    }
	  current_input_column = 0;
	  break;

	case '#':
	case '%':
	  if (in_comment)
	    {
	      if (! beginning_of_comment)
		comment_buf += static_cast<char> (c);
	    }
	  else
	    {
	      maybe_gripe_matlab_incompatible_comment (c);
	      in_comment = true;
	      beginning_of_comment = true;
	    }
	  break;

	case '.':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	      break;
	    }
	  else
	    {
	      if (have_ellipsis_continuation ())
		break;
	      else
		goto done;
	    }

	case '\\':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	      break;
	    }
	  else
	    {
	      if (have_continuation ())
		break;
	      else
		goto done;
	    }

	case '\r':
	  if (in_comment)
	    comment_buf += static_cast<char> (c);
	  c = yyinput ();
	  if (c == EOF)
	    break;
	  else if (c == '\n')
	    {
	      retval |= ATE_NEWLINE;
	      if (in_comment)
		{
		  comment_buf += static_cast<char> (c);
		  octave_comment_buffer::append (comment_buf);
		  in_comment = false;
		  beginning_of_comment = false;
		}
	      current_input_column = 0;
	      break;
	    }

	  // Fall through...

	default:
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	      break;
	    }
	  else
	    goto done;
	}
    }

  if (! comment_buf.empty ())
    octave_comment_buffer::append (comment_buf);

 done:
  yyunput (c, octave_text);
  current_input_column--;
  return retval;
}

static inline bool
looks_like_hex (const char *s, int len)
{
  return (len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X'));
}

static void
handle_number (void)
{
  double value = 0.0;
  int nread = 0;

  if (looks_like_hex (octave_text, strlen (octave_text)))
    {
      unsigned long ival;

      nread = sscanf (octave_text, "%lx", &ival);

      value = static_cast<double> (ival);
    }
  else
    {
      char *tmp = strsave (octave_text);

      char *idx = strpbrk (tmp, "Dd");

      if (idx)
	*idx = 'e';

      nread = sscanf (tmp, "%lf", &value);

      delete [] tmp;
    }

  // If octave_text doesn't contain a valid number, we are in deep doo doo.

  assert (nread == 1);

  lexer_flags.quote_is_transpose = true;
  lexer_flags.convert_spaces_to_comma = true;

  yylval.tok_val = new token (value, octave_text, input_line_number,
			      current_input_column);

  token_stack.push (yylval.tok_val);

  current_input_column += octave_leng;

  do_comma_insert_check ();
}

// We have seen a backslash and need to find out if it should be
// treated as a continuation character.  If so, this eats it, up to
// and including the new line character.
//
// Match whitespace only, followed by a comment character or newline.
// Once a comment character is found, discard all input until newline.
// If non-whitespace characters are found before comment
// characters, return 0.  Otherwise, return 1.

static bool
have_continuation (bool trailing_comments_ok)
{
  std::ostringstream buf;

  std::string comment_buf;

  bool in_comment = false;
  bool beginning_of_comment = false;

  int c = 0;

  while ((c = yyinput ()) != EOF)
    {
      buf << static_cast<char> (c);

      switch (c)
	{
	case ' ':
	case '\t':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	    }
	  break;

	case '%':
	case '#':
	  if (trailing_comments_ok)
	    {
	      if (in_comment)
		{
		  if (! beginning_of_comment)
		    comment_buf += static_cast<char> (c);
		}
	      else
		{
		  maybe_gripe_matlab_incompatible_comment (c);
		  in_comment = true;
		  beginning_of_comment = true;
		}
	    }
	  else
	    goto cleanup;
	  break;

	case '\n':
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      octave_comment_buffer::append (comment_buf);
	    }
	  current_input_column = 0;
	  promptflag--;
	  gripe_matlab_incompatible_continuation ();
	  return true;

	case '\r':
	  if (in_comment)
	    comment_buf += static_cast<char> (c);
	  c = yyinput ();
	  if (c == EOF)
	    break;
	  else if (c == '\n')
	    {
	      if (in_comment)
		{
		  comment_buf += static_cast<char> (c);
		  octave_comment_buffer::append (comment_buf);
		}
	      current_input_column = 0;
	      promptflag--;
	      gripe_matlab_incompatible_continuation ();
	      return true;
	    }

	  // Fall through...

	default:
	  if (in_comment)
	    {
	      comment_buf += static_cast<char> (c);
	      beginning_of_comment = false;
	    }
	  else
	    goto cleanup;
	  break;
	}
    }

  yyunput (c, octave_text);
  return false;

cleanup:

  std::string s = buf.str ();

  int len = s.length ();
  while (len--)
    yyunput (s[len], octave_text);

  return false;
}

// We have seen a `.' and need to see if it is the start of a
// continuation.  If so, this eats it, up to and including the new
// line character.

static bool
have_ellipsis_continuation (bool trailing_comments_ok)
{
  char c1 = yyinput ();
  if (c1 == '.')
    {
      char c2 = yyinput ();
      if (c2 == '.' && have_continuation (trailing_comments_ok))
	return true;
      else
	{
	  yyunput (c2, octave_text);
	  yyunput (c1, octave_text);
	}
    }
  else
    yyunput (c1, octave_text);

  return false;
}

// See if we have a continuation line.  If so, eat it and the leading
// whitespace on the next line.
//
// Return value is the same as described for eat_whitespace().

static yum_yum
eat_continuation (void)
{
  int retval = ATE_NOTHING;

  int c = yyinput ();

  if ((c == '.' && have_ellipsis_continuation ())
      || (c == '\\' && have_continuation ()))
    retval = eat_whitespace ();
  else
    yyunput (c, octave_text);

  return retval;
}

static int
handle_string (char delim, int text_style)
{
  std::ostringstream buf;

  int bos_line = input_line_number;
  int bos_col = current_input_column;

  int c;
  int escape_pending = 0;

  while ((c = yyinput ()) != EOF)
    {
      current_input_column++;

      if (c == '\\')
	{
	  if (delim == '\'' || escape_pending)
	    {
	      buf << static_cast<char> (c);
	      escape_pending = 0;
	    }
	  else
	    {
	      if (have_continuation (false))
		escape_pending = 0;
	      else
		{
		  buf << static_cast<char> (c);
		  escape_pending = 1;
		}
	    }
	  continue;
	}
      else if (c == '.')
	{
	  if (delim == '\'' || ! have_ellipsis_continuation (false))
	    buf << static_cast<char> (c);
	}
      else if (c == '\n')
	{
	  error ("unterminated string constant");
	  break;
	}
      else if (c == delim)
	{
	  if (escape_pending)
	    buf << static_cast<char> (c);
	  else
	    {
	      c = yyinput ();
	      if (c == delim)
		{
		  buf << static_cast<char> (c);		    
		  if (lexer_flags.doing_rawcommand)
		    buf << static_cast<char> (c);
		}
	      else
		{
		  std::string s;  
		  yyunput (c, octave_text);

		  if (lexer_flags.doing_rawcommand || delim == '\'')
		    s = buf.str ();
		  else
		    s = do_string_escapes (buf.str ());

		  if (text_style && lexer_flags.doing_rawcommand)
		    s = std::string (1, delim) + s + std::string (1, delim);
		  else
		    {
		      lexer_flags.quote_is_transpose = true;
		      lexer_flags.convert_spaces_to_comma = true;
		    }

		  yylval.tok_val = new token (s, bos_line, bos_col);
		  token_stack.push (yylval.tok_val);

		  if (delim == '"')
		    gripe_matlab_incompatible ("\" used as string delimiter");
		  else if (delim == '\'')
		    gripe_single_quote_string ();

		  return delim == '"' ? DQ_STRING : SQ_STRING;
		}
	    }
	}
      else
	{
	  buf << static_cast<char> (c);
	}

      escape_pending = 0;
    }

  return LEXICAL_ERROR;
}

static bool
next_token_is_assign_op (void)
{
  bool retval = false;

  int c0 = yyinput ();

  switch (c0)
    {
    case '=':
      {
	int c1 = yyinput ();
	yyunput (c1, octave_text);
	if (c1 != '=')
	  retval = true;
      }
      break;

    case '+':
    case '-':
    case '*':
    case '/':
    case '\\':
    case '&':
    case '|':
      {
	int c1 = yyinput ();
	yyunput (c1, octave_text);
	if (c1 == '=')
	  retval = true;
      }
      break;

    case '.':
      {
	int c1 = yyinput ();
	if (match_any (c1, "+-*/\\"))
	  {
	    int c2 = yyinput ();
	    yyunput (c2, octave_text);
	    if (c2 == '=')
	      retval = true;
	  }
	yyunput (c1, octave_text);
      }
      break;

    case '>':
      {
	int c1 = yyinput ();
	if (c1 == '>')
	  {
	    int c2 = yyinput ();
	    yyunput (c2, octave_text);
	    if (c2 == '=')
	      retval = true;
	  }
	yyunput (c1, octave_text);
      }
      break;

    case '<':
      {
	int c1 = yyinput ();
	if (c1 == '<')
	  {
	    int c2 = yyinput ();
	    yyunput (c2, octave_text);
	    if (c2 == '=')
	      retval = true;
	  }
	yyunput (c1, octave_text);
      }
      break;

    default:
      break;
    }

  yyunput (c0, octave_text);

  return retval;
}

static bool
next_token_is_index_op (void)
{
  int c = yyinput ();
  yyunput (c, octave_text);
  return c == '(' || c == '{';
}

static int
handle_close_bracket (bool spc_gobbled, int bracket_type)
{
  int retval = bracket_type;

  if (! nesting_level.none ())
    {
      nesting_level.remove ();

      if (bracket_type == ']')
	lexer_flags.bracketflag--;
      else if (bracket_type == '}')
	lexer_flags.braceflag--;
      else
	panic_impossible ();
    }

  if (lexer_flags.bracketflag == 0 && lexer_flags.braceflag == 0)
    BEGIN (INITIAL);

  if (bracket_type == ']'
      && next_token_is_assign_op ()
      && ! lexer_flags.looking_at_return_list)
    {
      retval = CLOSE_BRACE;
    }
  else if ((lexer_flags.bracketflag || lexer_flags.braceflag)
	   && lexer_flags.convert_spaces_to_comma
	   && (nesting_level.is_bracket ()
	       || (nesting_level.is_brace ()
		   && ! lexer_flags.looking_at_object_index)))
    {
      bool index_op = next_token_is_index_op ();

      // Don't insert comma if we are looking at something like
      //
      //   [x{i}{j}] or [x{i}(j)]
      //
      // but do if we are looking at
      //
      //   [x{i} {j}] or [x{i} (j)]

      if (spc_gobbled || ! (bracket_type == '}' && index_op))
	{
	  bool bin_op = next_token_is_bin_op (spc_gobbled);

	  bool postfix_un_op = next_token_is_postfix_unary_op (spc_gobbled);

	  bool sep_op = next_token_is_sep_op ();

	  if (! (postfix_un_op || bin_op || sep_op))
	    {
	      maybe_warn_separator_insert (',');

	      yyunput (',', octave_text);
	      return retval;
	    }
	}
    }

  lexer_flags.quote_is_transpose = true;
  lexer_flags.convert_spaces_to_comma = true;

  return retval;
}

static void
maybe_unput_comma (int spc_gobbled)
{
  if (nesting_level.is_bracket ()
      || (nesting_level.is_brace ()
	  && ! lexer_flags.looking_at_object_index))
    {
      int bin_op = next_token_is_bin_op (spc_gobbled);

      int postfix_un_op = next_token_is_postfix_unary_op (spc_gobbled);

      int c1 = yyinput ();
      int c2 = yyinput ();

      yyunput (c2, octave_text);
      yyunput (c1, octave_text);

      int sep_op = next_token_is_sep_op ();

      int dot_op = (c1 == '.'
		    && (isalpha (c2) || isspace (c2) || c2 == '_'));

      if (postfix_un_op || bin_op || sep_op || dot_op)
	return;

      int index_op = (c1 == '(' || c1 == '{');

      // If there is no space before the indexing op, we don't insert
      // a comma.

      if (index_op && ! spc_gobbled)
	return;

      maybe_warn_separator_insert (',');

      yyunput (',', octave_text);
    }
}

// Figure out exactly what kind of token to return when we have seen
// an identifier.  Handles keywords.  Return -1 if the identifier
// should be ignored.

static int
handle_identifier (void)
{
  std::string tok = strip_trailing_whitespace (octave_text);

  int c = octave_text[octave_leng-1];

  int cont_is_spc = eat_continuation ();

  int spc_gobbled = (cont_is_spc || c == ' ' || c == '\t');

  // If we are expecting a structure element, avoid recognizing
  // keywords and other special names and return STRUCT_ELT, which is
  // a string that is also a valid identifier.  But first, we have to
  // decide whether to insert a comma.

  if (lexer_flags.looking_at_indirect_ref)
    {
      do_comma_insert_check ();

      maybe_unput_comma (spc_gobbled);

      yylval.tok_val = new token (tok, input_line_number,
				  current_input_column);

      token_stack.push (yylval.tok_val);

      lexer_flags.quote_is_transpose = true;
      lexer_flags.convert_spaces_to_comma = true;

      current_input_column += octave_leng;

      return STRUCT_ELT;
    }

  int kw_token = is_keyword_token (tok);

  if (lexer_flags.looking_at_function_handle)
    {
      if (kw_token)
	{
	  error ("function handles may not refer to keywords");

	  return LEXICAL_ERROR;
	}
      else
	TOK_PUSH_AND_RETURN (tok, FCN_HANDLE);
    }

  // If we have a regular keyword, return it.
  // Keywords can be followed by identifiers (TOK_RETURN handles
  // that).

  if (kw_token)
    {
      if (kw_token < 0)
	return kw_token;
      else
	TOK_RETURN (kw_token);
    }

  // See if we have a plot keyword (title, using, with, or clear).

  int c1 = yyinput ();

  bool next_tok_is_paren = (c1 == '(');

  bool next_tok_is_eq = false;
  if (c1 == '=')
    {
      int c2 = yyinput ();
      yyunput (c2, octave_text);

      if (c2 != '=')
	next_tok_is_eq = true;
    }

  yyunput (c1, octave_text);

  // Make sure we put the return values of a function in the symbol
  // table that is local to the function.

  // If we are defining a function and we have not seen the function
  // name yet and the next token is `=', then this identifier must be
  // the only return value for the function and it belongs in the
  // local symbol table.

  if (next_tok_is_eq
      && lexer_flags.defining_func
      && ! lexer_flags.parsed_function_name)
    curr_sym_tab = tmp_local_sym_tab;

  // Kluge alert.
  //
  // If we are looking at a text style function, set up to gobble its
  // arguments.
  //
  // If the following token is `=', or if we are parsing a function
  // return list or function parameter list, or if we are looking at
  // something like [ab,cd] = foo (), force the symbol to be inserted
  // as a variable in the current symbol table.

  if (is_command_name (tok) && ! is_variable (tok))
    {
      if (next_tok_is_eq
	  || lexer_flags.looking_at_return_list
	  || lexer_flags.looking_at_parameter_list
	  || lexer_flags.looking_at_matrix_or_assign_lhs)
	{
	  force_local_variable (tok);
	}
      else if (! (next_tok_is_paren || lexer_flags.looking_at_object_index))
	{
	  BEGIN (COMMAND_START);
	}

      if (is_rawcommand_name (tok) && ! lexer_flags.looking_at_object_index)
	{
	  lexer_flags.doing_rawcommand = true;
	  BEGIN (COMMAND_START);
	}
    }

  // Find the token in the symbol table.  Beware the magic
  // transformation of the end keyword...

  if (tok == "end")
    tok = "__end__";    

  yylval.tok_val = new token (lookup_identifier (tok),
			      input_line_number,
			      current_input_column);

  token_stack.push (yylval.tok_val);

  // After seeing an identifer, it is ok to convert spaces to a comma
  // (if needed).

  lexer_flags.convert_spaces_to_comma = true;

  if (! next_tok_is_eq)
    {
      lexer_flags.quote_is_transpose = true;

      do_comma_insert_check ();

      maybe_unput_comma (spc_gobbled);
    }

  current_input_column += octave_leng;

  return NAME;
}

void
lexical_feedback::init (void)
{
  // Not initially defining a matrix list.
  bracketflag = 0;

  // Not initially defining a cell array list.
  braceflag = 0;

  // Not initially inside a loop or if statement.
  looping = 0;

  // Not initially defining a function.
  beginning_of_function = false;
  defining_func = false;
  parsed_function_name = false;
  parsing_nested_function = 0;

  // Not initiallly looking at a function handle.
  looking_at_function_handle = 0;

  // Not parsing a function return or parameter list.
  looking_at_return_list = false;
  looking_at_parameter_list = false;

  // Not parsing a matrix or the left hand side of multi-value
  // assignment statement.
  looking_at_matrix_or_assign_lhs = false;

  // Not parsing an object index.
  looking_at_object_index = 0;

  // No need to do comma insert or convert spaces to comma at
  // beginning of input. 
  convert_spaces_to_comma = true;
  do_comma_insert = false;

  // Not initially doing any plotting or setting of plot attributes.
  doing_rawcommand = false;

  // Not initially looking at indirect references.
  looking_at_indirect_ref = false;

  // Quote marks strings intially.
  quote_is_transpose = false;
}

bool
is_keyword (const std::string& s)
{
  return octave_kw_hash::in_word_set (s.c_str (), s.length ()) != 0;
}

DEFCMD (iskeyword, args, ,
  "-*- texinfo -*-\n\
@deftypefn {Built-in Function} {} iskeyword (@var{name})\n\
Return true if @var{name} is an Octave keyword.  If @var{name}\n\
is omitted, return a list of keywords.\n\
@end deftypefn")
{
  octave_value retval;

  int argc = args.length () + 1;

  string_vector argv = args.make_argv ("iskeyword");

  if (error_state)
    return retval;

  if (argc == 1)
    {
      string_vector lst (TOTAL_KEYWORDS);

      for (int i = 0; i < TOTAL_KEYWORDS; i++)
	lst[i] = wordlist[i].name;

      retval = Cell (lst.qsort ());
    }
  else if (argc == 2)
    {
      retval = is_keyword (argv[1]);
    }
  else
    print_usage ();

  return retval;
}


static void
maybe_warn_separator_insert (char sep)
{
  std::string nm = curr_fcn_file_full_name;

  if (nm.empty ())
    warning_with_id ("Octave:separator-insert",
		     "potential auto-insertion of `%c' near line %d",
		     sep, input_line_number);
  else
    warning_with_id ("Octave:separator-insert",
		     "potential auto-insertion of `%c' near line %d of file %s",
		     sep, input_line_number, nm.c_str ());
}

static void
gripe_single_quote_string (void)
{
  std::string nm = curr_fcn_file_full_name;

  if (nm.empty ())
    warning_with_id ("Octave:single-quote-string",
		     "single quote delimited string near line %d",
		     input_line_number);
  else
    warning_with_id ("Octave:single-quote-string",
		     "single quote delimited string near line %d of file %s",
		     input_line_number, nm.c_str ());
}

static void
gripe_matlab_incompatible (const std::string& msg)
{
  warning_with_id ("Octave:matlab-incompatible",
		   "potential Matlab compatibility problem: %s",
		   msg.c_str ());
}

static void
maybe_gripe_matlab_incompatible_comment (char c)
{
  if (c == '#')
    gripe_matlab_incompatible ("# used as comment character");
}

static void
gripe_matlab_incompatible_continuation (void)
{
  gripe_matlab_incompatible ("\\ used as line continuation marker");
}

static void
gripe_matlab_incompatible_operator (const std::string& op)
{
  std::string t = op;
  int n = t.length ();
  if (t[n-1] == '\n')
    t.resize (n-1);
  gripe_matlab_incompatible (t + " used as operator");
}

DEFUN (__token_count__, , ,
  "-*- texinfo -*-\n\
@deftypefn {Built-in Function} {} __token_count__\n\
Number of language tokens processed since Octave startup.\n\
@end deftypefn")
{
  return octave_value (Vtoken_count);
}

/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/

