#line 26 "lex.ll"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif




#line 10 "lex.cc"

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

/* 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 /* ! C99 */

#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
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 * Ditto for the __ia64__ case accordingly.
 */
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#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 90
#define YY_END_OF_BUFFER 91
/* 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[506] =
    {   0,
       19,   19,   19,   19,   19,   19,    0,    0,    0,    0,
       91,   89,   19,   28,   28,   67,   30,   31,   22,   49,
       29,   68,   69,   55,   53,   59,   54,   70,   56,   18,
       18,   33,   58,   51,   62,   52,   89,   27,   14,   57,
       15,   60,   87,   50,   88,   67,   19,   31,    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,
        6,   10,   13,   13,   31,    9,   11,    7,    8,   10,
       31,    1,   90,    2,   19,   28,   47,   22,   22,    0,

       63,   83,   61,   73,   42,   71,   43,   72,   41,   36,
       34,   35,    0,   37,   18,   38,   39,   74,   18,   18,
        0,   16,    0,   65,   44,   45,   48,   66,   25,   14,
        0,   20,   20,    0,   75,   81,   87,   84,   64,   46,
       19,    0,    0,    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,    6,    6,   10,   13,
       13,    0,    9,   11,    7,    8,   13,   13,    0,   13,

        0,   12,   12,    9,   11,   11,    0,    7,    8,   10,
        0,    0,   23,   40,   78,   76,   77,    0,   79,    0,
       80,   82,   17,   18,    0,   18,   18,   85,   86,    0,
       25,   25,    0,   21,   21,    0,   32,   32,    6,    6,
        6,    6,    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,
       12,   12,    0,   23,   23,    0,   18,   26,   25,   25,
       21,    6,    6,    6,    6,    6,    6,    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,   12,   24,   23,   23,   26,
       26,   25,   25,   25,    6,    6,    6,    6,    6,    6,
        6,    6,   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,   24,   24,   23,   23,
       23,   25,    6,    6,    6,    6,    6,    6,   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,
       23,    6,   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,   26,   27,   28,   28,   28,   29,   29,   28,
        8,    8,   30,   30,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,   31,    8,    8,
       32,   33,   34,   35,    8,    1,   28,   28,   28,   29,

       29,   28,    8,    8,   30,   30,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,   31,
        8,    8,   36,   37,   38,   39,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    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[40] =
    {   0,
        1,    2,    3,    4,    1,    1,    1,    2,    1,    1,
        1,    1,    1,    1,    4,    1,    1,    1,    5,    5,
        1,    4,    1,    1,    1,    1,    6,    2,    2,    2,
        2,    1,    1,    1,    1,    1,    1,    1,    1
    } ;

static yyconst flex_int16_t yy_base[529] =
    {   0,
        0,   38,   45,   83,   89,   87,  944,  942,  941,  940,
      942, 2707,  939, 2707,  932,  910, 2707, 2707,   85,   77,
     2707, 2707, 2707,   75,   81, 2707,   82,  118,  909,  137,
       90, 2707, 2707,   18,  908,   19,  113, 2707,  929,  122,
     2707,  906,  927,   76, 2707,  902,   95,  889,  922, 2707,
      920,  106, 2707,  167,  131, 2707,  920,  919,  137,  146,
     2707,  147,  197,  150,  231,  889,  917, 2707,  156,  157,
      160,  261,  916,  915,  198,  913,  180,  912,  188,  911,
      204,  291,  328,  909,  111,  909,  216,  906,  905,  115,
      173, 2707, 2707, 2707,  904, 2707, 2707,  902,  145,  213,

     2707, 2707,  879, 2707, 2707, 2707, 2707, 2707, 2707,  165,
      878,  877,  883,  875,  207,  874,  873, 2707,  357,  235,
      215, 2707,  238,  868, 2707, 2707, 2707,  867,  391,  884,
      268, 2707,  882,  161, 2707, 2707,  875, 2707, 2707, 2707,
      181,  840,  189,  865,  864, 2707,  862,  861,    0,  421,
      853,  852,  222,  847,  846,  838,  837,  828,  827,  272,
      254,  257,  101,  275,  281,  278,  280,  825,  443,  795,
      301,  731,  314,  284,  707,  660,  657,  285,  477,  653,
      320,  334,  648,  642,  636,  616,  612,  586,    0,    0,
      581,  235,  579,  337,  577,  575,    0,  537,  315,    0,

      342,  507,  544,  533,  350,  356,  344,  526,  522,    0,
      361,  369,  581,  474, 2707, 2707, 2707,  376, 2707,  375,
     2707, 2707, 2707,  383,  349,  385,  388, 2707, 2707,  406,
      489,  611,  378, 2707,  381,  422, 2707,  480,  641,  372,
      478,  473,  471,  436,  468,  428,  457,  439,  425,  438,
      426,  452,  671,  407,  404,  700,  396,  730,  462,  429,
        0,    0,  397,    0,  760,    0,  385,  464,  797,    0,
      834,  483,  486,  498,  513,  516,  491,  523,  529,  535,
        0,  871,  526,  359,  908,  484,  523,  353,  349,  938,
     2707,  968,  326,  998,  542,  550, 1028,  324, 1058, 1088,

        0, 1125,  509,  556,  569,  572,    0,  518,    0, 1162,
        0,    0,  546,    0, 1199,  583, 1236, 1273,  561,  589,
      592,  595,  601,  613,  564,    0,  312,  310, 1310,  305,
      303,  295,    0,    0, 1340,  286, 1370,  282,    0,  277,
        0,    0,    0,    0,  619, 1400, 1437,  603,  625,  630,
     1474,    0, 1511,  621,  644,  633,  650, 1548,    0, 1585,
      654,  672,  662,  678,    0,  273,  664, 1622,    0, 1659,
      674,  680,    0, 1696,  685,  691,  271,  266,  251,    0,
        0,  247,  245,    0,  243,    0,    0,  238,    0,  205,
      682, 1733,    0, 1770,  693,  700,    0, 1807,    0,    0,

      703,    0, 1844,  708,  711,  714,    0,    0,  717,    0,
     1881,  719,  723,  733,    0,  736,    0, 1918,    0,    0,
      738,    0, 1955, 1992,    0, 2029,  740,  744,  751,  766,
      201,  171,    0,    0,    0, 2066,    0, 2103,  753,  769,
      775,  781, 2140,    0, 2177,  762, 2214,    0, 2251,  771,
     2288,    0, 2325,  777,  784,  793,  803, 2362,    0, 2399,
      786,  806,  812,  818,    0,    0,  821,    0, 2436,  789,
      830,  840,    0,    0,  843,    0, 2473,  799,  849,  855,
        0,    0,    0,    0,    0,    0,  858,    0, 2510,  808,
      867,  877,    0,    0,  880,    0, 2547,  814,  886,  892,

        0,    0,    0,    0, 2707, 2585, 2591, 2596, 2602, 2608,
     2614, 2620, 2626, 2632, 2638, 2644, 2650,  143, 2656, 2662,
     2668,  114, 2673, 2678, 2683, 2688, 2694, 2700
    } ;

static yyconst flex_int16_t yy_def[529] =
    {   0,
      505,    1,  505,    3,    1,    5,  506,  506,  507,  507,
      505,  505,  505,  505,  505,  505,  505,  505,  508,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  509,  505,
      505,  509,  505,  509,  509,  505,  509,  509,  509,  509,
      505,  509,  509,  509,  509,   65,  509,  505,  509,  509,
      509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
      509,  505,  505,   83,  510,  505,  505,  505,  505,   82,
      510,  505,  505,  505,  505,  505,  505,  505,  508,  505,

      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  511,  505,
      505,  505,  505,  512,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  509,  505,  505,  509,  505,   54,  509,
      509,  509,  509,  509,  509,  509,  509,  509,  509,  509,
      509,  509,  509,  509,  509,  509,  509,  509,   65,   65,
      509,  509,  509,  509,  509,  509,  509,  509,  513,  505,
      505,  514,  509,  509,  505,  509,  509,  509,   82,   83,
       83,  510,  505,  505,  505,  505,   83,   83,  515,   83,

      510,  505,  510,  505,  505,  505,  516,  505,  505,   90,
      510,  510,  517,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      518,  511,  512,  505,  512,  505,  505,  505,  519,  509,
      509,  509,  509,  509,  509,  509,  509,  509,  509,   65,
      509,  509,  509,  509,  509,  509,  518,  513,  514,  512,
       83,   83,  515,   83,  515,  202,  202,  520,  510,  202,
      510,  521,  510,  510,  510,  505,  516,  505,  516,  510,
      202,  510,  505,  522,  517,  505,  505,  523,  505,  511,
      505,  509,  522,  519,  509,  509,  509,  505,  258,  515,

       83,  515,  515,  515,  515,  515,  202,  520,  202,  520,
      202,  202,  521,  202,  521,  510,  505,  510,  524,  510,
      510,  516,  505,  516,  516,  202,  525,  505,  517,  505,
      523,  518,  290,  290,  509,  505,  294,  505,  297,  518,
      299,  299,   83,   83,  515,  505,  515,  526,  515,  515,
      520,  202,  520,  520,  520,  520,  520,  521,  202,  521,
      521,  521,  521,  521,  317,  317,  527,  510,  317,  510,
      528,  524,  317,  524,  505,  505,  505,  525,  522,  329,
      329,  505,  505,  335,  522,  337,  337,  505,  346,  346,
      526,  515,  346,  515,  526,  526,  346,  526,  202,  202,

      520,  317,  520,  527,  520,  520,  202,  202,  521,  317,
      521,  528,  521,  521,  317,  527,  317,  527,  317,  317,
      528,  317,  528,  524,  317,  524,  528,  524,  524,  524,
      505,  505,  346,  346,  346,  526,  346,  526,  526,  526,
      526,  526,  520,  317,  520,  527,  521,  317,  521,  528,
      527,  317,  527,  527,  527,  527,  527,  528,  317,  528,
      528,  528,  528,  528,  317,  317,  524,  317,  524,  524,
      524,  524,  346,  346,  526,  346,  526,  526,  526,  526,
      317,  317,  317,  317,  317,  317,  527,  317,  527,  527,
      527,  527,  317,  317,  528,  317,  528,  528,  528,  528,

      317,  346,  317,  317,    0,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505
    } ;

static yyconst flex_int16_t yy_nxt[2747] =
    {   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,   38,   19,   19,   19,
       19,   39,   40,   41,   42,   43,   44,   45,   46,   47,
      124,  125,  127,  128,   48,   49,   13,   50,   51,   52,
       53,   18,   54,   55,   56,   57,   58,   59,   60,   61,
       62,   63,   64,   65,   66,   67,   68,   69,   70,   71,
       72,   73,   54,   54,   54,   54,   74,   75,   76,   77,
       78,   79,   80,   81,   47,  101,   98,  103,   90,   48,
       82,   83,   84,   91,  105,   85,  141,  107,  104,  138,

      102,  142,  145,   86,  106,  108,  119,  145,  120,  120,
       87,  100,  139,  202,  203,  327,  210,  244,  121,  122,
      129,  211,   88,  131,  132,  133,   89,  109,  134,  147,
      110,  111,  145,  112,  113,  114,  115,  115,  145,  151,
      129,  129,  129,  129,  288,  135,   98,  145,  145,  153,
      116,  145,  117,  119,  152,  120,  120,  145,  145,  155,
      154,  145,  157,  234,  235,  121,  122,  123,  148,  156,
      158,  100,  432,  168,  149,  202,  203,  214,  174,  175,
      176,  145,  141,  177,  178,  149,  149,  142,  215,  145,
      236,  237,  238,  150,  149,  149,  149,  149,  145,  181,

      132,  133,  431,  184,  182,  145,  159,  433,  212,  160,
      161,  186,  162,  163,  164,  165,  165,  205,  205,  206,
      213,  183,  207,  145,  187,  115,  115,  188,  225,  166,
      225,  167,  145,  226,  226,  220,  122,  202,  203,  388,
      213,  213,  213,  213,  432,  184,  383,  169,  382,  170,
      170,  119,  431,  120,  120,  145,  227,  227,  145,  171,
      172,  173,  145,  121,  122,  227,  227,  377,  179,  131,
      132,  133,  377,  145,  134,  415,  145,  242,  388,  145,
      243,  145,  145,  338,  240,  145,  145,  336,  179,  179,
      179,  179,  189,  190,  191,  241,  382,  192,  245,  165,

      165,  247,  145,  248,  330,  193,  330,  254,  255,  246,
      172,  328,  194,  377,  251,  145,  251,  264,  265,  252,
      252,  181,  132,  133,  195,  298,  134,  336,  196,  197,
      197,  198,  253,  253,  199,  260,  234,  235,  205,  205,
      206,  253,  253,  207,  202,  203,  278,  279,  233,  194,
      289,  205,  205,  206,  330,  233,  207,  205,  276,  206,
      328,  195,  207,  202,  203,  196,  223,  226,  226,  223,
      280,  281,  282,  145,  223,  224,  224,  131,  132,  133,
      234,  235,  134,  291,  235,  121,  122,  307,  286,  223,
      286,  223,  231,  287,  287,  248,  212,  298,  232,  264,

      265,  224,  224,  226,  226,  145,  227,  227,  145,  232,
      232,  121,  122,  288,  122,  227,  227,  122,  232,  232,
      232,  232,  145,  236,  237,  238,  145,  145,  239,  145,
      260,  234,  235,  288,  288,  288,  288,  181,  132,  133,
      145,  295,  182,  295,  252,  252,  296,  296,  239,  239,
      239,  239,  249,  145,  144,  249,  250,  250,  145,  144,
      249,  250,  250,  260,  234,  235,  309,  310,  144,  145,
      252,  252,  145,  144,  145,  249,  233,  249,  257,  145,
      230,  172,  237,  233,  258,  314,  315,  316,  317,  318,
      289,  230,  319,  278,  279,  258,  258,  222,  230,  320,

      202,  203,  287,  287,  258,  258,  258,  258,  266,  266,
      267,  264,  265,  268,  321,  202,  203,  205,  205,  206,
      309,  310,  207,  209,  205,  205,  206,  208,  194,  207,
      322,  323,  324,  327,  204,  325,  280,  281,  282,  262,
      195,  287,  287,  145,  196,  269,  270,  271,  314,  315,
      272,  145,  122,  327,  327,  327,  327,  345,  346,  347,
      296,  296,  348,  373,  374,  273,  278,  279,  296,  296,
      349,  264,  265,  350,  264,  265,  209,  274,  208,  172,
      204,  275,  284,  261,  316,  317,  318,  145,  285,  319,
      320,  202,  203,  321,  202,  203,  322,  375,  324,  285,

      285,  325,  205,  205,  206,  397,  398,  207,  285,  285,
      285,  285,  231,  145,  322,  376,  324,  145,  290,  325,
      345,  346,  347,  309,  310,  348,  349,  264,  265,  232,
      232,  350,  264,  265,  405,  309,  310,  185,  290,  290,
      290,  290,  293,  145,  283,  401,  402,  403,  294,  145,
      404,  406,  309,  310,  180,  283,  314,  315,  145,  294,
      294,  145,  283,  413,  314,  315,  417,  418,  294,  294,
      294,  294,  145,  409,  410,  411,  422,  423,  412,  414,
      314,  315,  373,  374,  397,  398,  205,  205,  206,  253,
      253,  207,  205,  205,  206,  397,  398,  207,  253,  253,

      172,  145,  397,  398,  401,  402,  403,  297,  145,  404,
      417,  418,  405,  309,  310,  406,  309,  310,  409,  410,
      411,  422,  423,  412,  413,  314,  315,  297,  297,  297,
      297,  257,  145,  230,  414,  314,  315,  299,  417,  418,
      422,  423,  422,  423,  230,  467,  468,  469,  258,  258,
      470,  230,  471,  373,  374,  397,  398,  299,  299,  299,
      299,  300,  301,  302,  417,  418,  303,  472,  373,  374,
      475,  476,  477,  422,  423,  478,  479,  397,  398,  417,
      418,  304,  480,  397,  398,  487,  488,  489,  422,  423,
      490,  373,  374,  305,  491,  417,  418,  306,  269,  311,

      271,  397,  398,  272,  492,  417,  418,  495,  496,  497,
      417,  418,  498,  499,  422,  423,  422,  423,  273,  500,
      422,  423,  467,  468,  469,  144,  145,  470,  145,  145,
      274,  471,  373,  374,  275,  269,  312,  271,  145,  145,
      272,  472,  373,  374,  475,  476,  477,  145,  145,  478,
      479,  397,  398,  145,  145,  273,  480,  397,  398,  487,
      488,  489,  148,  145,  490,  145,  145,  274,  491,  417,
      418,  275,  269,  326,  271,  143,  137,  272,  492,  417,
      418,  495,  496,  497,  132,  130,  498,  499,  422,  423,
      229,  228,  273,  500,  422,  423,  222,  221,  219,  218,

      217,  216,  136,   98,  274,   95,  209,  208,  275,  284,
      204,  200,  145,  185,  145,  329,  180,  145,  145,  144,
      145,  145,  146,  145,  143,  140,  285,  285,  137,  136,
      130,  126,  118,   97,   96,  329,  329,  329,  329,  332,
       95,  505,   93,   93,   93,  333,   93,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  334,  334,  505,  505,
      505,  505,  505,  505,  505,  333,  333,  333,  333,  145,
      505,  505,  505,  505,  505,  335,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  335,  335,  335,  335,  293,

      505,  283,  505,  505,  505,  337,  505,  505,  505,  505,
      505,  505,  283,  505,  505,  505,  294,  294,  505,  283,
      505,  505,  505,  505,  505,  337,  337,  337,  337,  338,
      505,  505,  505,  505,  505,  339,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  339,  339,  505,  505,
      505,  505,  505,  505,  505,  339,  339,  339,  339,  340,
      505,  505,  505,  505,  505,  341,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  342,  342,  505,  505,
      505,  505,  505,  505,  505,  341,  341,  341,  341,  300,
      343,  302,  505,  505,  303,  505,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  505,  505,  505,  304,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  305,  505,  505,  505,  306,  300,  344,  302,  505,
      505,  303,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  304,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  305,  505,
      505,  505,  306,  351,  352,  353,  505,  505,  354,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  355,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  356,  505,  505,  505,  357,

      358,  359,  360,  505,  505,  361,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      362,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  363,  505,  505,  505,  364,  365,  365,  366,
      505,  505,  367,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  194,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  195,
      505,  505,  505,  196,  368,  369,  370,  505,  505,  371,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  273,  505,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  274,  505,  505,  505,
      275,  379,  505,  505,  505,  505,  505,  380,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  381,  381,
      505,  505,  505,  505,  505,  505,  505,  380,  380,  380,
      380,  383,  505,  505,  505,  505,  505,  384,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  384,  384,
      505,  505,  505,  505,  505,  505,  505,  384,  384,  384,
      384,  385,  505,  505,  505,  505,  505,  386,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  387,  387,
      505,  505,  505,  505,  505,  505,  505,  386,  386,  386,

      386,  389,  389,  390,  505,  505,  391,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  194,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  195,  505,  505,  505,  196,  392,  393,
      394,  505,  505,  395,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  304,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      305,  505,  505,  505,  306,  351,  399,  353,  505,  505,
      354,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  355,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  505,  356,  505,  505,
      505,  357,  351,  400,  353,  505,  505,  354,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  355,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  356,  505,  505,  505,  357,  358,
      407,  360,  505,  505,  361,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  362,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  363,  505,  505,  505,  364,  358,  408,  360,  505,
      505,  361,  505,  505,  505,  505,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  362,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  363,  505,
      505,  505,  364,  368,  419,  370,  505,  505,  371,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  273,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  274,  505,  505,  505,  275,
      368,  420,  370,  505,  505,  371,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      273,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  274,  505,  505,  505,  275,  424,  425,  426,

      505,  505,  427,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  428,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  429,
      505,  505,  505,  430,  392,  434,  394,  505,  505,  395,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  304,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  305,  505,  505,  505,
      306,  392,  435,  394,  505,  505,  395,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  304,  505,  505,  505,  505,  505,  505,  505,  505,

      505,  505,  505,  305,  505,  505,  505,  306,  436,  437,
      438,  505,  505,  439,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  440,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      441,  505,  505,  505,  442,  443,  444,  445,  505,  505,
      446,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  355,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  356,  505,  505,
      505,  357,  447,  448,  449,  505,  505,  450,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,

      505,  505,  362,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  363,  505,  505,  505,  364,  451,
      452,  453,  505,  505,  454,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  455,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  456,  505,  505,  505,  457,  458,  459,  460,  505,
      505,  461,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  462,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  463,  505,
      505,  505,  464,  424,  465,  426,  505,  505,  427,  505,

      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  428,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  429,  505,  505,  505,  430,
      424,  466,  426,  505,  505,  427,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      428,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  429,  505,  505,  505,  430,  436,  473,  438,
      505,  505,  439,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  440,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  441,

      505,  505,  505,  442,  436,  474,  438,  505,  505,  439,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  440,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  441,  505,  505,  505,
      442,  443,  481,  445,  505,  505,  446,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  355,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  356,  505,  505,  505,  357,  443,  482,
      445,  505,  505,  446,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  355,  505,

      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      356,  505,  505,  505,  357,  447,  483,  449,  505,  505,
      450,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  362,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  363,  505,  505,
      505,  364,  447,  484,  449,  505,  505,  450,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  362,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  363,  505,  505,  505,  364,  451,
      485,  453,  505,  505,  454,  505,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  505,  505,  505,  455,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  456,  505,  505,  505,  457,  451,  486,  453,  505,
      505,  454,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  455,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  456,  505,
      505,  505,  457,  458,  493,  460,  505,  505,  461,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  462,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  463,  505,  505,  505,  464,

      458,  494,  460,  505,  505,  461,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      462,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  463,  505,  505,  505,  464,  424,  501,  426,
      505,  505,  427,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  428,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  429,
      505,  505,  505,  430,  436,  502,  438,  505,  505,  439,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  440,  505,  505,  505,  505,  505,

      505,  505,  505,  505,  505,  505,  441,  505,  505,  505,
      442,  451,  503,  453,  505,  505,  454,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  455,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  456,  505,  505,  505,  457,  458,  504,
      460,  505,  505,  461,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  462,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      463,  505,  505,  505,  464,   92,   92,   92,   92,   92,
       92,   94,   94,   94,   94,   94,   94,   99,  505,  505,

       99,   99,  144,  144,  505,  505,  144,  144,  201,  201,
      201,  201,  201,  201,  230,  230,  505,  230,  230,  230,
      233,  233,  233,  233,  233,  233,  256,  256,  505,  256,
      256,  256,  259,  259,  259,  259,  259,  259,  263,  263,
      263,  263,  263,  263,  277,  277,  277,  277,  277,  277,
      283,  283,  505,  283,  283,  283,  292,  292,  505,  292,
      292,  292,  308,  308,  308,  308,  308,  308,  313,  313,
      313,  313,  313,  313,  331,  505,  505,  331,  372,  372,
      372,  372,  372,  372,  378,  505,  505,  378,  396,  396,
      396,  396,  396,  396,  416,  416,  416,  416,  416,  416,

      421,  421,  421,  421,  421,  421,   11,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505
    } ;

static yyconst flex_int16_t yy_chk[2747] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
       34,   34,   36,   36,    2,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    4,   20,   19,   24,    6,    4,
        5,    5,    5,    6,   25,    5,   47,   27,   24,   44,

       20,   47,  163,    5,   25,   27,   31,   52,   31,   31,
        5,   19,   44,   85,   85,  522,   90,  163,   31,   31,
       37,   90,    5,   40,   40,   40,    5,   28,   40,   52,
       28,   28,   55,   28,   28,   28,   28,   28,   59,   55,
       37,   37,   37,   37,  518,   40,   99,   60,   62,   59,
       28,   64,   28,   30,   55,   30,   30,   69,   70,   60,
       59,   71,   62,  134,  134,   30,   30,   30,   54,   60,
       62,   99,  432,   64,   54,   91,   91,  110,   69,   69,
       70,   77,  141,   71,   71,   54,   54,  141,  110,   79,
      143,  143,  143,   54,   54,   54,   54,   54,   63,   75,

       75,   75,  431,   77,   75,   81,   63,  390,   91,   63,
       63,   79,   63,   63,   63,   63,   63,   87,   87,   87,
      100,   75,   87,  153,   79,  115,  115,   81,  121,   63,
      121,   63,   65,  121,  121,  115,  115,  192,  192,  388,
      100,  100,  100,  100,  385,  153,  383,   65,  382,   65,
       65,  120,  379,  120,  120,  161,  123,  123,  162,   65,
       65,   65,   72,  120,  120,  123,  123,  378,   72,  131,
      131,  131,  377,  160,  131,  366,  164,  161,  340,  166,
      162,  167,  165,  338,  160,  174,  178,  336,   72,   72,
       72,   72,   82,   82,   82,  160,  332,   82,  164,  165,

      165,  166,  171,  167,  331,   82,  330,  174,  178,  165,
      165,  328,   82,  327,  171,  173,  171,  199,  199,  171,
      171,  181,  181,  181,   82,  298,  181,  293,   82,   83,
       83,   83,  173,  173,   83,  182,  182,  182,  194,  194,
      194,  173,  173,  194,  201,  201,  207,  207,  182,   83,
      289,  205,  205,  205,  288,  182,  205,  206,  206,  206,
      284,   83,  206,  211,  211,   83,  119,  225,  225,  119,
      212,  212,  212,  240,  119,  119,  119,  218,  218,  218,
      233,  233,  218,  235,  235,  119,  119,  267,  220,  119,
      220,  119,  129,  220,  220,  240,  211,  257,  129,  263,

      263,  224,  224,  226,  226,  255,  227,  227,  254,  129,
      129,  224,  224,  230,  226,  227,  227,  227,  129,  129,
      129,  129,  150,  236,  236,  236,  249,  251,  150,  246,
      260,  260,  260,  230,  230,  230,  230,  244,  244,  244,
      248,  246,  244,  246,  251,  251,  246,  246,  150,  150,
      150,  150,  169,  252,  250,  169,  250,  250,  247,  169,
      169,  169,  169,  259,  259,  259,  268,  268,  250,  245,
      252,  252,  243,  169,  242,  169,  259,  169,  179,  241,
      179,  252,  238,  259,  179,  272,  272,  273,  273,  273,
      231,  179,  273,  277,  277,  179,  179,  214,  179,  274,

      274,  274,  286,  286,  179,  179,  179,  179,  202,  202,
      202,  303,  303,  202,  275,  275,  275,  276,  276,  276,
      308,  308,  276,  209,  278,  278,  278,  208,  202,  278,
      279,  279,  279,  283,  204,  279,  280,  280,  280,  198,
      202,  287,  287,  295,  202,  203,  203,  203,  313,  313,
      203,  296,  287,  283,  283,  283,  283,  304,  304,  304,
      295,  295,  304,  319,  319,  203,  325,  325,  296,  296,
      305,  305,  305,  306,  306,  306,  196,  203,  195,  296,
      193,  203,  213,  191,  316,  316,  316,  188,  213,  316,
      320,  320,  320,  321,  321,  321,  322,  322,  322,  213,

      213,  322,  323,  323,  323,  348,  348,  323,  213,  213,
      213,  213,  232,  187,  324,  324,  324,  186,  232,  324,
      345,  345,  345,  354,  354,  345,  349,  349,  349,  232,
      232,  350,  350,  350,  356,  356,  356,  185,  232,  232,
      232,  232,  239,  184,  239,  355,  355,  355,  239,  183,
      355,  357,  357,  357,  180,  239,  361,  361,  177,  239,
      239,  176,  239,  363,  363,  363,  367,  367,  239,  239,
      239,  239,  253,  362,  362,  362,  371,  371,  362,  364,
      364,  364,  372,  372,  391,  391,  375,  375,  375,  253,
      253,  375,  376,  376,  376,  395,  395,  376,  253,  253,

      253,  256,  396,  396,  401,  401,  401,  256,  175,  401,
      404,  404,  405,  405,  405,  406,  406,  406,  409,  409,
      409,  412,  412,  409,  413,  413,  413,  256,  256,  256,
      256,  258,  172,  258,  414,  414,  414,  258,  416,  416,
      421,  421,  427,  427,  258,  428,  428,  428,  258,  258,
      428,  258,  429,  429,  429,  439,  439,  258,  258,  258,
      258,  265,  265,  265,  446,  446,  265,  430,  430,  430,
      440,  440,  440,  450,  450,  440,  441,  441,  441,  454,
      454,  265,  442,  442,  442,  455,  455,  455,  461,  461,
      455,  470,  470,  265,  456,  456,  456,  265,  269,  269,

      269,  478,  478,  269,  457,  457,  457,  462,  462,  462,
      490,  490,  462,  463,  463,  463,  498,  498,  269,  464,
      464,  464,  467,  467,  467,  170,  168,  467,  159,  158,
      269,  471,  471,  471,  269,  271,  271,  271,  157,  156,
      271,  472,  472,  472,  475,  475,  475,  155,  154,  475,
      479,  479,  479,  152,  151,  271,  480,  480,  480,  487,
      487,  487,  148,  147,  487,  145,  144,  271,  491,  491,
      491,  271,  282,  282,  282,  142,  137,  282,  492,  492,
      492,  495,  495,  495,  133,  130,  495,  499,  499,  499,
      128,  124,  282,  500,  500,  500,  117,  116,  114,  113,

      112,  111,  103,   98,  282,   95,   89,   88,  282,  285,
       86,   84,   80,   78,   76,  285,   74,   73,   67,   66,
       58,   57,   51,   49,   48,   46,  285,  285,   43,   42,
       39,   35,   29,   16,   15,  285,  285,  285,  285,  290,
       13,   11,   10,    9,    8,  290,    7,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  290,  290,    0,    0,
        0,    0,    0,    0,    0,  290,  290,  290,  290,  292,
        0,    0,    0,    0,    0,  292,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  292,  292,  292,  292,  294,

        0,  294,    0,    0,    0,  294,    0,    0,    0,    0,
        0,    0,  294,    0,    0,    0,  294,  294,    0,  294,
        0,    0,    0,    0,    0,  294,  294,  294,  294,  297,
        0,    0,    0,    0,    0,  297,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  297,  297,    0,    0,
        0,    0,    0,    0,    0,  297,  297,  297,  297,  299,
        0,    0,    0,    0,    0,  299,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  299,  299,    0,    0,
        0,    0,    0,    0,    0,  299,  299,  299,  299,  300,
      300,  300,    0,    0,  300,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,  300,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  300,    0,    0,    0,  300,  302,  302,  302,    0,
        0,  302,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  302,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  302,    0,
        0,    0,  302,  310,  310,  310,    0,    0,  310,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  310,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  310,    0,    0,    0,  310,

      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,    0,  315,    0,    0,    0,  315,  317,  317,  317,
        0,    0,  317,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  317,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  317,
        0,    0,    0,  317,  318,  318,  318,    0,    0,  318,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  318,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,  318,    0,    0,    0,
      318,  329,    0,    0,    0,    0,    0,  329,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  329,  329,
        0,    0,    0,    0,    0,    0,    0,  329,  329,  329,
      329,  335,    0,    0,    0,    0,    0,  335,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  335,  335,
        0,    0,    0,    0,    0,    0,    0,  335,  335,  335,
      335,  337,    0,    0,    0,    0,    0,  337,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  337,  337,
        0,    0,    0,    0,    0,    0,    0,  337,  337,  337,

      337,  346,  346,  346,    0,    0,  346,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  346,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  346,    0,    0,    0,  346,  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,    0,
      347,    0,    0,    0,  347,  351,  351,  351,    0,    0,
      351,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  351,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,  351,    0,    0,
        0,  351,  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,    0,  353,    0,    0,    0,  353,  358,
      358,  358,    0,    0,  358,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  358,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  358,    0,    0,    0,  358,  360,  360,  360,    0,
        0,  360,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,  360,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  360,    0,
        0,    0,  360,  368,  368,  368,    0,    0,  368,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  368,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  368,    0,    0,    0,  368,
      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,    0,  370,    0,    0,    0,  370,  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,    0,  374,
        0,    0,    0,  374,  392,  392,  392,    0,    0,  392,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  392,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  392,    0,    0,    0,
      392,  394,  394,  394,    0,    0,  394,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  394,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,  394,    0,    0,    0,  394,  398,  398,
      398,    0,    0,  398,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  398,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      398,    0,    0,    0,  398,  403,  403,  403,    0,    0,
      403,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  403,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  403,    0,    0,
        0,  403,  411,  411,  411,    0,    0,  411,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,  411,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  411,    0,    0,    0,  411,  418,
      418,  418,    0,    0,  418,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  418,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  418,    0,    0,    0,  418,  423,  423,  423,    0,
        0,  423,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  423,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  423,    0,
        0,    0,  423,  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,    0,  424,    0,    0,    0,  424,
      426,  426,  426,    0,    0,  426,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      426,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  426,    0,    0,    0,  426,  436,  436,  436,
        0,    0,  436,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  436,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  436,

        0,    0,    0,  436,  438,  438,  438,    0,    0,  438,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  438,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  438,    0,    0,    0,
      438,  443,  443,  443,    0,    0,  443,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  443,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  443,    0,    0,    0,  443,  445,  445,
      445,    0,    0,  445,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  445,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      445,    0,    0,    0,  445,  447,  447,  447,    0,    0,
      447,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  447,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  447,    0,    0,
        0,  447,  449,  449,  449,    0,    0,  449,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  449,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  449,    0,    0,    0,  449,  451,
      451,  451,    0,    0,  451,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,  451,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  451,    0,    0,    0,  451,  453,  453,  453,    0,
        0,  453,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  453,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  453,    0,
        0,    0,  453,  458,  458,  458,    0,    0,  458,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  458,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  458,    0,    0,    0,  458,

      460,  460,  460,    0,    0,  460,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      460,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  460,    0,    0,    0,  460,  469,  469,  469,
        0,    0,  469,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  469,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  469,
        0,    0,    0,  469,  477,  477,  477,    0,    0,  477,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  477,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,  477,    0,    0,    0,
      477,  489,  489,  489,    0,    0,  489,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  489,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  489,    0,    0,    0,  489,  497,  497,
      497,    0,    0,  497,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  497,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      497,    0,    0,    0,  497,  506,  506,  506,  506,  506,
      506,  507,  507,  507,  507,  507,  507,  508,    0,    0,

      508,  508,  509,  509,    0,    0,  509,  509,  510,  510,
      510,  510,  510,  510,  511,  511,    0,  511,  511,  511,
      512,  512,  512,  512,  512,  512,  513,  513,    0,  513,
      513,  513,  514,  514,  514,  514,  514,  514,  515,  515,
      515,  515,  515,  515,  516,  516,  516,  516,  516,  516,
      517,  517,    0,  517,  517,  517,  519,  519,    0,  519,
      519,  519,  520,  520,  520,  520,  520,  520,  521,  521,
      521,  521,  521,  521,  523,    0,    0,  523,  524,  524,
      524,  524,  524,  524,  525,    0,    0,  525,  526,  526,
      526,  526,  526,  526,  527,  527,  527,  527,  527,  527,

      528,  528,  528,  528,  528,  528,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505,  505,  505,  505,  505,
      505,  505,  505,  505,  505,  505
    } ;

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.ll"
/*

Copyright (C) 1993-2012 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 39 "lex.ll"

#include <cctype>
#include <cstring>

#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <stack>

#include <sys/types.h>
#include <unistd.h>

#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 <oct-parse.h>
#include <oct-gperf.h>

#if defined (GNULIB_NAMESPACE)
// Calls to the following functions appear in the generated output from
// flex without the namespace tag.  Redefine them so we will use them
// via the gnulib namespace.
#define fprintf GNULIB_NAMESPACE::fprintf
#define fwrite GNULIB_NAMESPACE::fwrite
#define isatty GNULIB_NAMESPACE::isatty
#define malloc GNULIB_NAMESPACE::malloc
#define realloc GNULIB_NAMESPACE::realloc
#endif

#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 DISPLAY_TOK_AND_RETURN(tok) \
  do \
    { \
      int tok_val = tok; \
      if (Vdisplay_tokens) \
        display_token (tok_val); \
      if (lexer_debug_flag) \
        { \
          std::cerr << "R: "; \
          display_token (tok_val); \
          std::cerr << std::endl;  \
        } \
      return tok_val; \
    } \
  while (0)

#define COUNT_TOK_AND_RETURN(tok) \
  do \
    { \
      Vtoken_count++; \
      DISPLAY_TOK_AND_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_INTERNAL(tok, convert, bos, qit) \
  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 = qit; \
      lexer_flags.convert_spaces_to_comma = convert; \
      lexer_flags.looking_for_object_index = false; \
      lexer_flags.at_beginning_of_statement = bos; \
      COUNT_TOK_AND_RETURN (tok); \
    } \
  while (0)

#define XBIN_OP_RETURN_INTERNAL(tok, convert, bos, qit) \
  do \
    { \
      gripe_matlab_incompatible_operator (octave_text); \
      BIN_OP_RETURN_INTERNAL (tok, convert, bos, qit); \
    } \
  while (0)

#define BIN_OP_RETURN(tok, convert, bos) \
  do \
    { \
      BIN_OP_RETURN_INTERNAL (tok, convert, bos, false); \
    } \
  while (0)

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

#define LEXER_DEBUG(pattern) \
  do \
    { \
      if (lexer_debug_flag) \
        lexer_debug (pattern, octave_text); \
    } \
  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 bool Vdisplay_tokens = false;

static unsigned int Vtoken_count = 0;

// The start state that was in effect when the beginning of a block
// comment was noticed.
static int block_comment_nesting_level = 0;

// Internal variable for lexer debugging state.
static bool lexer_debug_flag = false;

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

static int text_yyinput (void);
static void xunput (char c, char *buf);
static void fixup_column_count (char *s);
static void do_comma_insert_check (void);
static int is_keyword_token (const std::string& s);
static int process_comment (bool start_in_block, bool& eof);
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);
static int handle_close_bracket (bool spc_gobbled, int bracket_type);
static int handle_superclass_identifier (void);
static int handle_meta_identifier (void);
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);
static void display_token (int tok);
static void lexer_debug (const char *pattern, const char *text);

#line 1579 "lex.cc"

#define INITIAL 0
#define COMMAND_START 1
#define MATRIX_START 2
#define SCRIPT_FILE_BEGIN 3
#define FUNCTION_FILE_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
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#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 do { if (fwrite( octave_text, octave_leng, 1, octave_out )) {} } while (0)
#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 = '*'; \
		size_t 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 \
	if ( octave_leng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(octave_text[octave_leng - 1] == '\n'); \
	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 352 "lex.ll"



// Make script and function files start with a bogus token. This makes
// the parser go down a special path.


#line 1781 "lex.cc"

	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_current_state += YY_AT_BOL();
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 >= 506 )
					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] != 2707 );

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 359 "lex.ll"
{
    LEXER_DEBUG ("<SCRIPT_FILE_BEGIN>.");

    BEGIN (INITIAL);
    xunput (octave_text[0], octave_text);
    COUNT_TOK_AND_RETURN (SCRIPT_FILE);
  }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 367 "lex.ll"
{
    LEXER_DEBUG ("<FUNCTION_FILE_BEGIN>.");

    BEGIN (INITIAL);
    xunput (octave_text[0], octave_text);
    COUNT_TOK_AND_RETURN (FUNCTION_FILE);
  }
	YY_BREAK

// Help and other command-style functions.

case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 379 "lex.ll"
{
    LEXER_DEBUG ("<COMMAND_START>{NL}");

    BEGIN (INITIAL);
    input_line_number++;
    current_input_column = 1;

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

    COUNT_TOK_AND_RETURN ('\n');
  }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 394 "lex.ll"
{
    LEXER_DEBUG ("<COMMAND_START>[\\;\\,]");

    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = true;

    BEGIN (INITIAL);

    if (strcmp (octave_text, ",") == 0)
      TOK_RETURN (',');
    else
      TOK_RETURN (';');
  }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 408 "lex.ll"
{
    LEXER_DEBUG ("<COMMAND_START>[\\\"\\']");

    lexer_flags.at_beginning_of_statement = false;

    current_input_column++;
    int tok = handle_string (octave_text[0]);

    COUNT_TOK_AND_RETURN (tok);
  }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 419 "lex.ll"
{
    LEXER_DEBUG ("<COMMAND_START>[^#% \\t\\r\\n\\;\\,\\\"\\'][^ \\t\\r\\n\\;\\,]*{S}*");

    std::string tok = strip_trailing_whitespace (octave_text);

    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = false;

    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...

// FIXME -- we need to handle block comments here.

case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 444 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*\\]{S}*");

    scan_for_comments (octave_text);
    fixup_column_count (octave_text);

    lexer_flags.looking_at_object_index.pop_front ();

    lexer_flags.looking_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    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)
      xunput (' ', octave_text);

    COUNT_TOK_AND_RETURN (tok_to_return);
  }
	YY_BREAK

// FIXME -- we need to handle block comments here.

case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 470 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*\\}{S}*");

    scan_for_comments (octave_text);
    fixup_column_count (octave_text);

    lexer_flags.looking_at_object_index.pop_front ();

    lexer_flags.looking_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    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)
      xunput (' ', 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 498 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{S}*\\,{S}*");

    current_input_column += octave_leng;

    int tmp = eat_continuation ();

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

    if (! lexer_flags.looking_at_object_index.front ())
      {
        if ((tmp & ATE_NEWLINE) == ATE_NEWLINE)
          {
            maybe_warn_separator_insert (';');

            xunput (';', 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 530 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{S}+");

    current_input_column += octave_leng;

    lexer_flags.at_beginning_of_statement = false;

    int tmp = eat_continuation ();

    if (! lexer_flags.looking_at_object_index.front ())
      {
        bool bin_op = next_token_is_bin_op (true);
        bool postfix_un_op = next_token_is_postfix_unary_op (true);
        bool sep_op = next_token_is_sep_op ();

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

                xunput (';', octave_text);
              }

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

            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.

// FIXME -- we need to handle block comments here.

case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 575 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*;{SNLCMT}*");

    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;
    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = false;

    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.

// FIXME -- we need to handle block comments here.

case 12:
/* rule 12 can match eol */
#line 599 "lex.ll"
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 599 "lex.ll"
{
    LEXER_DEBUG ("<MATRIX_START>{S}*{COMMENT}{SNLCMT}*|<MATRIX_START>{S}*{NL}{SNLCMT}*");

    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;
    lexer_flags.at_beginning_of_statement = false;

    if (nesting_level.none ())
      return LEXICAL_ERROR;

    if (! lexer_flags.looking_at_object_index.front ()
        && nesting_level.is_bracket_or_brace ())
      {
        maybe_warn_separator_insert (';');

        COUNT_TOK_AND_RETURN (';');
      }
  }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 622 "lex.ll"
{
    LEXER_DEBUG ("\\[{S}*");

    nesting_level.bracket ();

    lexer_flags.looking_at_object_index.push_front (false);

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

    if (lexer_flags.defining_func
        && ! lexer_flags.parsed_function_name.top ())
      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 649 "lex.ll"
{
    LEXER_DEBUG ("\\]");

    nesting_level.remove ();

    lexer_flags.looking_at_object_index.pop_front ();

    lexer_flags.looking_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    TOK_RETURN (']');
  }
	YY_BREAK

// Imaginary numbers.

case 16:
YY_RULE_SETUP
#line 666 "lex.ll"
{
    LEXER_DEBUG ("{NUMBER}{Im}");

    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 679 "lex.ll"
case 18:
YY_RULE_SETUP
#line 679 "lex.ll"
{
    LEXER_DEBUG ("{D}+/\\.[\\*/\\^\\']|{NUMBER}");
    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 690 "lex.ll"
{
    current_input_column += octave_leng;
  }
	YY_BREAK

// Continuation lines.  Allow comments after continuations.

case 20:
/* rule 20 can match eol */
#line 699 "lex.ll"
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
#line 699 "lex.ll"
{
    LEXER_DEBUG ("{CONT}{S}*{NL}|{CONT}{S}*{COMMENT}");

    if (octave_text[0] == '\\')
      gripe_matlab_incompatible_continuation ();
    scan_for_comments (octave_text);
    promptflag--;
    input_line_number++;
    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(SCRIPT_FILE_BEGIN):
case YY_STATE_EOF(FUNCTION_FILE_BEGIN):
#line 714 "lex.ll"
{
    LEXER_DEBUG ("<<EOF>>");

    if (block_comment_nesting_level != 0)
      {
        warning ("block comment open at end of input");

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

    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 735 "lex.ll"
{
    LEXER_DEBUG ("{IDENT}{S}*");

    int id_tok = handle_identifier ();

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

// Superclass method identifiers.

case 23:
#line 749 "lex.ll"
case 24:
YY_RULE_SETUP
#line 749 "lex.ll"
{
    LEXER_DEBUG ("{IDENT}@{IDENT}{S}*|{IDENT}@{IDENT}.{IDENT}{S}*");

    int id_tok = handle_superclass_identifier ();

    if (id_tok >= 0)
      {
        lexer_flags.looking_for_object_index = true;

        COUNT_TOK_AND_RETURN (SUPERCLASSREF);
      }
  }
	YY_BREAK

// Metaclass query

case 25:
#line 767 "lex.ll"
case 26:
YY_RULE_SETUP
#line 767 "lex.ll"
{
    LEXER_DEBUG ("\?{IDENT}{S}* | \?{IDENT}.{IDENT}{S}*");

    int id_tok = handle_meta_identifier ();

    if (id_tok >= 0)
      {
        lexer_flags.looking_for_object_index = true;

        COUNT_TOK_AND_RETURN (METAQUERY);
      }
  }
	YY_BREAK

// Function handles and superclass references

case 27:
YY_RULE_SETUP
#line 784 "lex.ll"
{
    LEXER_DEBUG ("@");

    current_input_column++;

    lexer_flags.quote_is_transpose = false;
    lexer_flags.convert_spaces_to_comma = false;
    lexer_flags.looking_at_function_handle++;
    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = false;

    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 28:
/* rule 28 can match eol */
YY_RULE_SETUP
#line 805 "lex.ll"
{
    LEXER_DEBUG ("{NL}");

    input_line_number++;
    current_input_column = 1;

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

    if (nesting_level.none ())
      {
        lexer_flags.at_beginning_of_statement = true;
        COUNT_TOK_AND_RETURN ('\n');
      }
    else if (nesting_level.is_paren ())
      {
        lexer_flags.at_beginning_of_statement = false;
        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 29:
YY_RULE_SETUP
#line 833 "lex.ll"
{
    LEXER_DEBUG ("'");

    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
      {
        int tok = handle_string ('\'');
        COUNT_TOK_AND_RETURN (tok);
      }
  }
	YY_BREAK

// Double quotes always begin strings.

case 30:
YY_RULE_SETUP
#line 855 "lex.ll"
{
    LEXER_DEBUG ("\"");

    current_input_column++;
    int tok = handle_string ('"');

    COUNT_TOK_AND_RETURN (tok);
}
	YY_BREAK

// Gobble comments.

case 31:
YY_RULE_SETUP
#line 868 "lex.ll"
{
    LEXER_DEBUG ("{CCHAR}");

    lexer_flags.looking_for_object_index = false;

    xunput (octave_text[0], octave_text);

    bool eof = false;
    int tok = process_comment (false, eof);

    if (eof)
      TOK_RETURN (END_OF_INPUT);
    else if (tok > 0)
      COUNT_TOK_AND_RETURN (tok);
  }
	YY_BREAK

// Block comments.

case 32:
/* rule 32 can match eol */
YY_RULE_SETUP
#line 888 "lex.ll"
{
    LEXER_DEBUG ("^{S}*{CCHAR}\\{{S}*{NL}");

    lexer_flags.looking_for_object_index = false;

    input_line_number++;
    current_input_column = 1;
    block_comment_nesting_level++;
    promptflag--;

    bool eof = false;
    process_comment (true, eof);
  }
	YY_BREAK

// Other operators.

case 33:
YY_RULE_SETUP
#line 906 "lex.ll"
{ LEXER_DEBUG (":"); BIN_OP_RETURN (':', false, false); }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 908 "lex.ll"
{ LEXER_DEBUG (".+"); XBIN_OP_RETURN (EPLUS, false, false); }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 909 "lex.ll"
{ LEXER_DEBUG (".-"); XBIN_OP_RETURN (EMINUS, false, false); }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 910 "lex.ll"
{ LEXER_DEBUG (".*"); BIN_OP_RETURN (EMUL, false, false); }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 911 "lex.ll"
{ LEXER_DEBUG ("./"); BIN_OP_RETURN (EDIV, false, false); }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 912 "lex.ll"
{ LEXER_DEBUG (".\\"); BIN_OP_RETURN (ELEFTDIV, false, false); }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 913 "lex.ll"
{ LEXER_DEBUG (".^"); BIN_OP_RETURN (EPOW, false, false); }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 914 "lex.ll"
{ LEXER_DEBUG (".**"); XBIN_OP_RETURN (EPOW, false, false); }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 915 "lex.ll"
{ LEXER_DEBUG (".'"); do_comma_insert_check (); BIN_OP_RETURN (TRANSPOSE, true, false); }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 916 "lex.ll"
{ LEXER_DEBUG ("++"); do_comma_insert_check (); XBIN_OP_RETURN_INTERNAL (PLUS_PLUS, true, false, true); }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 917 "lex.ll"
{ LEXER_DEBUG ("--"); do_comma_insert_check (); XBIN_OP_RETURN_INTERNAL (MINUS_MINUS, true, false, true); }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 918 "lex.ll"
{ LEXER_DEBUG ("<="); BIN_OP_RETURN (EXPR_LE, false, false); }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 919 "lex.ll"
{ LEXER_DEBUG ("=="); BIN_OP_RETURN (EXPR_EQ, false, false); }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 920 "lex.ll"
{ LEXER_DEBUG ("~="); BIN_OP_RETURN (EXPR_NE, false, false); }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 921 "lex.ll"
{ LEXER_DEBUG ("!="); XBIN_OP_RETURN (EXPR_NE, false, false); }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 922 "lex.ll"
{ LEXER_DEBUG (">="); BIN_OP_RETURN (EXPR_GE, false, false); }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 923 "lex.ll"
{ LEXER_DEBUG ("&"); BIN_OP_RETURN (EXPR_AND, false, false); }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 924 "lex.ll"
{ LEXER_DEBUG ("|"); BIN_OP_RETURN (EXPR_OR, false, false); }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 925 "lex.ll"
{ LEXER_DEBUG ("<"); BIN_OP_RETURN (EXPR_LT, false, false); }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 926 "lex.ll"
{ LEXER_DEBUG (">"); BIN_OP_RETURN (EXPR_GT, false, false); }
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 927 "lex.ll"
{ LEXER_DEBUG ("+"); BIN_OP_RETURN ('+', false, false); }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 928 "lex.ll"
{ LEXER_DEBUG ("-"); BIN_OP_RETURN ('-', false, false); }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 929 "lex.ll"
{ LEXER_DEBUG ("*"); BIN_OP_RETURN ('*', false, false); }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 930 "lex.ll"
{ LEXER_DEBUG ("/"); BIN_OP_RETURN ('/', false, false); }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 931 "lex.ll"
{ LEXER_DEBUG ("\\"); BIN_OP_RETURN (LEFTDIV, false, false); }
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 932 "lex.ll"
{ LEXER_DEBUG (";"); BIN_OP_RETURN (';', true, true); }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 933 "lex.ll"
{ LEXER_DEBUG (","); BIN_OP_RETURN (',', true, ! lexer_flags.looking_at_object_index.front ()); }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 934 "lex.ll"
{ LEXER_DEBUG ("^"); BIN_OP_RETURN (POW, false, false); }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 935 "lex.ll"
{ LEXER_DEBUG ("**"); XBIN_OP_RETURN (POW, false, false); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 936 "lex.ll"
{ LEXER_DEBUG ("="); BIN_OP_RETURN ('=', true, false); }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 937 "lex.ll"
{ LEXER_DEBUG ("&&"); BIN_OP_RETURN (EXPR_AND_AND, false, false); }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 938 "lex.ll"
{ LEXER_DEBUG ("||"); BIN_OP_RETURN (EXPR_OR_OR, false, false); }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 939 "lex.ll"
{ LEXER_DEBUG ("<<"); XBIN_OP_RETURN (LSHIFT, false, false); }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 940 "lex.ll"
{ LEXER_DEBUG (">>"); XBIN_OP_RETURN (RSHIFT, false, false); }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 942 "lex.ll"
{
    LEXER_DEBUG ("{NOT}");

    if (octave_text[0] == '~')
      BIN_OP_RETURN (EXPR_NOT, false, false);
    else
      XBIN_OP_RETURN (EXPR_NOT, false, false);
  }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 951 "lex.ll"
{
    LEXER_DEBUG ("(");

    // If we are looking for an object index, then push TRUE for
    // looking_at_object_index.  Otherwise, just push whatever state
    // is current (so that we can pop it off the stack when we find
    // the matching close paren).

    lexer_flags.looking_at_object_index.push_front
      (lexer_flags.looking_for_object_index);

    lexer_flags.looking_at_indirect_ref = false;
    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = false;

    nesting_level.paren ();
    promptflag--;

    TOK_RETURN ('(');
  }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 972 "lex.ll"
{
    LEXER_DEBUG (")");

    nesting_level.remove ();
    current_input_column++;

    lexer_flags.looking_at_object_index.pop_front ();

    lexer_flags.quote_is_transpose = true;
    lexer_flags.convert_spaces_to_comma
      = (nesting_level.is_bracket_or_brace ()
         && ! lexer_flags.looking_at_anon_fcn_args);
    lexer_flags.looking_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    if (lexer_flags.looking_at_anon_fcn_args)
      lexer_flags.looking_at_anon_fcn_args = false;

    do_comma_insert_check ();

    COUNT_TOK_AND_RETURN (')');
  }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 995 "lex.ll"
{
    LEXER_DEBUG (".");

    lexer_flags.looking_for_object_index = false;
    lexer_flags.at_beginning_of_statement = false;

    TOK_RETURN ('.');
  }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 1004 "lex.ll"
{ LEXER_DEBUG ("+="); XBIN_OP_RETURN (ADD_EQ, false, false); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 1005 "lex.ll"
{ LEXER_DEBUG ("-="); XBIN_OP_RETURN (SUB_EQ, false, false); }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 1006 "lex.ll"
{ LEXER_DEBUG ("*="); XBIN_OP_RETURN (MUL_EQ, false, false); }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 1007 "lex.ll"
{ LEXER_DEBUG ("/="); XBIN_OP_RETURN (DIV_EQ, false, false); }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 1008 "lex.ll"
{ LEXER_DEBUG ("\\="); XBIN_OP_RETURN (LEFTDIV_EQ, false, false); }
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 1009 "lex.ll"
{ LEXER_DEBUG (".+="); XBIN_OP_RETURN (ADD_EQ, false, false); }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 1010 "lex.ll"
{ LEXER_DEBUG (".-="); XBIN_OP_RETURN (SUB_EQ, false, false); }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 1011 "lex.ll"
{ LEXER_DEBUG (".*="); XBIN_OP_RETURN (EMUL_EQ, false, false); }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 1012 "lex.ll"
{ LEXER_DEBUG ("./="); XBIN_OP_RETURN (EDIV_EQ, false, false); }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 1013 "lex.ll"
{ LEXER_DEBUG (".\\="); XBIN_OP_RETURN (ELEFTDIV_EQ, false, false); }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 1014 "lex.ll"
{ LEXER_DEBUG ("{POW}="); XBIN_OP_RETURN (POW_EQ, false, false); }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 1015 "lex.ll"
{ LEXER_DEBUG ("{EPOW}="); XBIN_OP_RETURN (EPOW_EQ, false, false); }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 1016 "lex.ll"
{ LEXER_DEBUG ("&="); XBIN_OP_RETURN (AND_EQ, false, false); }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 1017 "lex.ll"
{ LEXER_DEBUG ("|="); XBIN_OP_RETURN (OR_EQ, false, false); }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 1018 "lex.ll"
{ LEXER_DEBUG ("<<="); XBIN_OP_RETURN (LSHIFT_EQ, false, false); }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 1019 "lex.ll"
{ LEXER_DEBUG (">>="); XBIN_OP_RETURN (RSHIFT_EQ, false, false); }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 1021 "lex.ll"
{
    LEXER_DEBUG ("\\{{S}*");

    nesting_level.brace ();

    lexer_flags.looking_at_object_index.push_front
      (lexer_flags.looking_for_object_index);

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

    promptflag--;
    eat_whitespace ();

    lexer_flags.braceflag++;
    BEGIN (MATRIX_START);
    COUNT_TOK_AND_RETURN ('{');
  }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 1043 "lex.ll"
{
    LEXER_DEBUG ("}");

    lexer_flags.looking_at_object_index.pop_front ();

    lexer_flags.looking_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    nesting_level.remove ();

    TOK_RETURN ('}');
  }
	YY_BREAK

// Unrecognized input is a lexical error.

case 89:
YY_RULE_SETUP
#line 1060 "lex.ll"
{
    LEXER_DEBUG (".");

    xunput (octave_text[0], octave_text);

    int c = text_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 90:
YY_RULE_SETUP
#line 1081 "lex.ll"
ECHO;
	YY_BREAK
#line 2892 "lex.cc"

	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);
	yy_current_state += YY_AT_BOL();

	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 >= 506 )
				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 >= 506 )
			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 == 505);

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

	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');

	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 yybytes the byte buffer to scan
 * @param _yybytes_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 1081 "lex.ll"



// 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 = text_yyinput ();

  xunput (c, octave_text);

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

  lexer_flags.do_comma_insert = (! lexer_flags.looking_at_object_index.front ()
                                 && 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;

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

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

  // We are not in a block comment.
  block_comment_nesting_level = 0;

  // 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 || reading_classdef_file))
    {
      current_input_column = 1;
      input_line_number = command_editor::current_command_number ();
    }

  // Only ask for input from stdin if we are expecting interactive
  // input.

  if (! quitting_gracefully
      && (interactive || forced_interactive)
      && ! (reading_fcn_file
            || reading_classdef_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 ();
}

static void
display_character (char c)
{
  if (isgraph (c))
    std::cerr << c;
  else
    switch (c)
      {
      case 0:
        std::cerr << "NUL";
        break;

      case 1:
        std::cerr << "SOH";
        break;

      case 2:
        std::cerr << "STX";
        break;

      case 3:
        std::cerr << "ETX";
        break;

      case 4:
        std::cerr << "EOT";
        break;

      case 5:
        std::cerr << "ENQ";
        break;

      case 6:
        std::cerr << "ACK";
        break;

      case 7:
        std::cerr << "\\a";
        break;

      case 8:
        std::cerr << "\\b";
        break;

      case 9:
        std::cerr << "\\t";
        break;

      case 10:
        std::cerr << "\\n";
        break;

      case 11:
        std::cerr << "\\v";
        break;

      case 12:
        std::cerr << "\\f";
        break;

      case 13:
        std::cerr << "\\r";
        break;

      case 14:
        std::cerr << "SO";
        break;

      case 15:
        std::cerr << "SI";
        break;

      case 16:
        std::cerr << "DLE";
        break;

      case 17:
        std::cerr << "DC1";
        break;

      case 18:
        std::cerr << "DC2";
        break;

      case 19:
        std::cerr << "DC3";
        break;

      case 20:
        std::cerr << "DC4";
        break;

      case 21:
        std::cerr << "NAK";
        break;

      case 22:
        std::cerr << "SYN";
        break;

      case 23:
        std::cerr << "ETB";
        break;

      case 24:
        std::cerr << "CAN";
        break;

      case 25:
        std::cerr << "EM";
        break;

      case 26:
        std::cerr << "SUB";
        break;

      case 27:
        std::cerr << "ESC";
        break;

      case 28:
        std::cerr << "FS";
        break;

      case 29:
        std::cerr << "GS";
        break;

      case 30:
        std::cerr << "RS";
        break;

      case 31:
        std::cerr << "US";
        break;

      case 32:
        std::cerr << "SPACE";
        break;

      case 127:
        std::cerr << "DEL";
        break;
      }
}

static int
text_yyinput (void)
{
  int c = yyinput ();

  if (lexer_debug_flag)
    {
      std::cerr << "I: ";
      display_character (c);
      std::cerr << std::endl;
    }

  // Convert CRLF into just LF and single CR into LF.

  if (c == '\r')
    {
      c = yyinput ();

      if (lexer_debug_flag)
        {
          std::cerr << "I: ";
          display_character (c);
          std::cerr << std::endl;
        }

      if (c != '\n')
        {
          xunput (c, octave_text);
          c = '\n';
        }
    }

  if (c == '\n')
    input_line_number++;

  return c;
}

static void
xunput (char c, char *buf)
{
  if (lexer_debug_flag)
    {
      std::cerr << "U: ";
      display_character (c);
      std::cerr << std::endl;
    }

  if (c == '\n')
    input_line_number--;

  yyunput (c, buf);
}

// 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')
        {
          input_line_number++;
          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);
}

// Delete all buffers from the stack.
void
clear_all_buffers (void)
{                 
  while (current_buffer ())
    octave_pop_buffer_state ();
}

void
cleanup_parser (void)
{
  reset_parser ();

  clear_all_buffers ();
}

// 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 bool
inside_any_object_index (void)
{
  bool retval = false;

  for (std::list<bool>::const_iterator i = lexer_flags.looking_at_object_index.begin ();
       i != lexer_flags.looking_at_object_index.end (); i++)
    {
      if (*i)
        {
          retval = true;
          break;
        }
    }

  return retval;
}

// 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 catch_kw:
        case continue_kw:
        case else_kw:
        case otherwise_kw:
        case return_kw:
        case unwind_protect_cleanup_kw:
          lexer_flags.at_beginning_of_statement = true;
          break;

        case case_kw:
        case elseif_kw:
        case global_kw:
        case static_kw:
        case until_kw:
          break;

        case end_kw:
          if (! reading_classdef_file
              && (inside_any_object_index ()
                  || (lexer_flags.defining_func
                      && ! (lexer_flags.looking_at_return_list
                            || lexer_flags.parsed_function_name.top ()))))
            return 0;

          yylval.tok_val = new token (token::simple_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case end_try_catch_kw:
          yylval.tok_val = new token (token::try_catch_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case end_unwind_protect_kw:
          yylval.tok_val = new token (token::unwind_protect_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endfor_kw:
          yylval.tok_val = new token (token::for_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endfunction_kw:
          yylval.tok_val = new token (token::function_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endif_kw:
          yylval.tok_val = new token (token::if_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endparfor_kw:
          yylval.tok_val = new token (token::parfor_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endswitch_kw:
          yylval.tok_val = new token (token::switch_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endwhile_kw:
          yylval.tok_val = new token (token::while_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endclassdef_kw:
          yylval.tok_val = new token (token::classdef_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endenumeration_kw:
          yylval.tok_val = new token (token::enumeration_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endevents_kw:
          yylval.tok_val = new token (token::events_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endmethods_kw:
          yylval.tok_val = new token (token::methods_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;

        case endproperties_kw:
          yylval.tok_val = new token (token::properties_end, l, c);
          lexer_flags.at_beginning_of_statement = true;
          break;


        case for_kw:
        case parfor_kw:
        case while_kw:
          promptflag--;
          lexer_flags.looping++;
          break;

        case do_kw:
          lexer_flags.at_beginning_of_statement = true;
          promptflag--;
          lexer_flags.looping++;
          break;

        case try_kw:
        case unwind_protect_kw:
          lexer_flags.at_beginning_of_statement = true;
          promptflag--;
          break;

        case if_kw:
        case switch_kw:
          promptflag--;
          break;

        case get_kw:
        case set_kw:
          // 'get' and 'set' are keywords in classdef method
          // declarations.
          if (! lexer_flags.maybe_classdef_get_set_method)
            return 0;
          break;

        case enumeration_kw:
        case events_kw:
        case methods_kw:
        case properties_kw:
          // 'properties', 'methods' and 'events' are keywords for
          // classdef blocks.
          if (! lexer_flags.parsing_classdef)
            return 0;
          // fall through ...

        case classdef_kw:
          // 'classdef' is always a keyword.
          promptflag--;
          break;

        case function_kw:
          promptflag--;

          lexer_flags.defining_func++;
          lexer_flags.parsed_function_name.push (false);

          if (! (reading_fcn_file || reading_script_file
                 || reading_classdef_file))
            input_line_number = 1;
          break;

        case magic_file_kw:
          {
            if ((reading_fcn_file || reading_script_file
                 || reading_classdef_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;

        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;
}

static bool
is_variable (const std::string& name)
{
  return (symbol_table::is_variable (name)
          || (lexer_flags.pending_local_variables.find (name)
              != lexer_flags.pending_local_variables.end ()));
}

static std::string
grab_block_comment (stream_reader& reader, bool& eof)
{
  std::string buf;

  bool at_bol = true;
  bool look_for_marker = false;

  bool warned_incompatible = false;

  int c = 0;

  while ((c = reader.getc ()) != EOF)
    {
      current_input_column++;

      if (look_for_marker)
        {
          at_bol = false;
          look_for_marker = false;

          if (c == '{' || c == '}')
            {
              std::string tmp_buf (1, static_cast<char> (c));

              int type = c;

              bool done = false;

              while ((c = reader.getc ()) != EOF && ! done)
                {
                  current_input_column++;

                  switch (c)
                    {
                    case ' ':
                    case '\t':
                      tmp_buf += static_cast<char> (c);
                      break;

                    case '\n':
                      {
                        current_input_column = 0;
                        at_bol = true;
                        done = true;

                        if (type == '{')
                          {
                            block_comment_nesting_level++;
                            promptflag--;
                          }
                        else
                          {
                            block_comment_nesting_level--;
                            promptflag++;

                            if (block_comment_nesting_level == 0)
                              {
                                buf += grab_comment_block (reader, true, eof);

                                return buf;
                              }
                          }
                      }
                      break;

                    default:
                      at_bol = false;
                      tmp_buf += static_cast<char> (c);
                      buf += tmp_buf;
                      done = true;
                      break;
                    }
                }
            }
        }

      if (at_bol && (c == '%' || c == '#'))
        {
          if (c == '#' && ! warned_incompatible)
            {
              warned_incompatible = true;
              maybe_gripe_matlab_incompatible_comment (c);
            }

          at_bol = false;
          look_for_marker = true;
        }
      else
        {
          buf += static_cast<char> (c);

          if (c == '\n')
            {
              current_input_column = 0;
              at_bol = true;
            }
        }
    }

  if (c == EOF)
    eof = true;

  return buf;
}

std::string
grab_comment_block (stream_reader& reader, bool at_bol,
                    bool& eof)
{
  std::string buf;

  // TRUE means we are at the beginning of a comment block.
  bool begin_comment = false;

  // TRUE means we are currently reading a comment block.
  bool in_comment = false;

  bool warned_incompatible = false;

  int c = 0;

  while ((c = reader.getc ()) != EOF)
    {
      current_input_column++;

      if (begin_comment)
        {
          if (c == '%' || c == '#')
            {
              at_bol = false;
              continue;
            }
          else if (at_bol && c == '{')
            {
              std::string tmp_buf (1, static_cast<char> (c));

              bool done = false;

              while ((c = reader.getc ()) != EOF && ! done)
                {
                  current_input_column++;

                  switch (c)
                    {
                    case ' ':
                    case '\t':
                      tmp_buf += static_cast<char> (c);
                      break;

                    case '\n':
                      {
                        current_input_column = 0;
                        at_bol = true;
                        done = true;

                        block_comment_nesting_level++;
                        promptflag--;

                        buf += grab_block_comment (reader, eof);

                        in_comment = false;

                        if (eof)
                          goto done;
                      }
                      break;

                    default:
                      at_bol = false;
                      tmp_buf += static_cast<char> (c);
                      buf += tmp_buf;
                      done = true;
                      break;
                    }
                }
            }
          else
            {
              at_bol = false;
              begin_comment = false;
            }
        }

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

          if (c == '\n')
            {
              at_bol = true;
              current_input_column = 0;
              in_comment = false;

              // FIXME -- bailing out here prevents things like
              //
              //    octave> # comment
              //    octave> x = 1
              //
              // from failing at the command line, while still
              // allowing blocks of comments to be grabbed properly
              // for function doc strings.  But only the first line of
              // a mult-line doc string will be picked up for
              // functions defined on the command line.  We need a
              // better way of collecting these comments...
              if (! (reading_fcn_file || reading_script_file))
                goto done;
            }
        }
      else
        {
          switch (c)
            {
            case ' ':
            case '\t':
              break;

            case '#':
              if (! warned_incompatible)
                {
                  warned_incompatible = true;
                  maybe_gripe_matlab_incompatible_comment (c);
                }
              // fall through...

            case '%':
              in_comment = true;
              begin_comment = true;
              break;

            default:
              current_input_column--;
              reader.ungetc (c);
              goto done;
            }
        }
    }

 done:

  if (c == EOF)
    eof = true;

  return buf;
}

class
flex_stream_reader : public stream_reader
{
public:
  flex_stream_reader (char *buf_arg) : stream_reader (), buf (buf_arg) { }

  int getc (void) { return ::text_yyinput (); }
  int ungetc (int c) { ::xunput (c, buf); return 0; }

private:

  // No copying!

  flex_stream_reader (const flex_stream_reader&);

  flex_stream_reader& operator = (const flex_stream_reader&);

  char *buf;
};

static int
process_comment (bool start_in_block, bool& eof)
{
  eof = false;

  std::string help_txt;

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

  flex_stream_reader flex_reader (octave_text);

  // process_comment is only supposed to be called when we are not
  // initially looking at a block comment.

  std::string txt = start_in_block
    ? grab_block_comment (flex_reader, eof)
    : grab_comment_block (flex_reader, false, eof);

  if (lexer_debug_flag)
    std::cerr << "C: " << txt << std::endl;

  if (help_txt.empty () && nesting_level.none ())
    {
      if (! help_buf.empty ())
        help_buf.pop ();

      help_buf.push (txt);
    }

  octave_comment_buffer::append (txt);

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

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

  if (nesting_level.none ())
    return '\n';
  else if (nesting_level.is_bracket_or_brace ())
    return ';';
  else
    return 0;
}

// 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 c = text_yyinput ();

  retval = match_any (c, ",;\n]");

  xunput (c, 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 = text_yyinput ();

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

  xunput (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 = text_yyinput ();

  switch (c0)
    {
    case '+':
    case '-':
      {
        int c1 = text_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;
          }

        xunput (c1, octave_text);
      }
      break;

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

    // .+ .- ./ .\ .^ .* .**
    case '.':
      {
        int c1 = text_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;

        xunput (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 = text_yyinput ();

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

        xunput (c1, octave_text);
      }
      break;

    default:
      break;
    }

  xunput (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 != std::string::npos)
    retval.resize (pos);

  return retval;
}

// FIXME -- we need to handle block comments here.

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;

        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

// FIXME -- we need to handle block comments here.

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 = text_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;
            }

        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:
  xunput (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;
  lexer_flags.looking_for_object_index = false;
  lexer_flags.at_beginning_of_statement = false;

  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.

// FIXME -- we need to handle block comments here.

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 = text_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;

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

  xunput (c, octave_text);
  return false;

cleanup:

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

  int len = s.length ();
  while (len--)
    xunput (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 = text_yyinput ();
  if (c1 == '.')
    {
      char c2 = text_yyinput ();
      if (c2 == '.' && have_continuation (trailing_comments_ok))
        return true;
      else
        {
          xunput (c2, octave_text);
          xunput (c1, octave_text);
        }
    }
  else
    xunput (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 = text_yyinput ();

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

  return retval;
}

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

  int bos_line = input_line_number;
  int bos_col = current_input_column;

  int c;
  int escape_pending = 0;

  while ((c = text_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 = text_yyinput ();
              if (c == delim)
                {
                  buf << static_cast<char> (c);
                }
              else
                {
                  std::string s;
                  xunput (c, octave_text);

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

                  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 ();

                  lexer_flags.looking_for_object_index = true;
                  lexer_flags.at_beginning_of_statement = false;

                  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 = text_yyinput ();

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

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

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

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

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

    default:
      break;
    }

  xunput (c0, octave_text);

  return retval;
}

static bool
next_token_is_index_op (void)
{
  int c = text_yyinput ();
  xunput (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.front ())))
    {
      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 (',');

              xunput (',', 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.front ()))
    {
      int bin_op = next_token_is_bin_op (spc_gobbled);

      int postfix_un_op = next_token_is_postfix_unary_op (spc_gobbled);

      int c1 = text_yyinput ();
      int c2 = text_yyinput ();

      xunput (c2, octave_text);
      xunput (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 (',');

      xunput (',', octave_text);
    }
}

static bool
next_token_can_follow_bin_op (void)
{
  std::stack<char> buf;

  int c = EOF;

  // Skip whitespace in current statement on current line
  while (true)
    {
      c = text_yyinput ();

      buf.push (c);

      if (match_any (c, ",;\n") || (c != ' ' && c != '\t'))
        break;
    }

  // Restore input.
  while (! buf.empty ())
    {
      xunput (buf.top (), octave_text);

      buf.pop ();
    }

  return (isalnum (c) || match_any (c, "!\"'(-[_{~"));
}

static bool
can_be_command (const std::string& tok)
{
  // Don't allow these names to be treated as commands to avoid
  // surprises when parsing things like "NaN ^2".

  return ! (tok == "e"
            || tok == "I" || tok == "i"
            || tok == "J" || tok == "j"
            || tok == "Inf" || tok == "inf"
            || tok == "NaN" || tok == "nan");
}

static bool
looks_like_command_arg (void)
{
  bool retval = true;

  int c0 = text_yyinput ();

  switch (c0)
    {
    // = ==
    case '=':
      {
        int c1 = text_yyinput ();

        if (c1 == '=')
          {
            int c2 = text_yyinput ();

            if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                && next_token_can_follow_bin_op ())
              retval = false;

            xunput (c2, octave_text);
          }
        else
          retval = false;

        xunput (c1, octave_text);
      }
      break;

    case '(':
    case '{':
      // Indexing.
      retval = false;
      break;

    case '\n':
      // EOL.
      break;

    case '\'':
    case '"':
      // Beginning of a character string.
      break;

    // + - ++ -- += -=
    case '+':
    case '-':
      {
        int c1 = text_yyinput ();

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

          case '\t':
          case ' ':
            {
              if (next_token_can_follow_bin_op ())
                retval = false;
            }
            break;

          case '=':
            {
              int c2 = text_yyinput ();

              if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                  && next_token_can_follow_bin_op ())
                retval = false;

              xunput (c2, octave_text);
            }
            break;
          }

        xunput (c1, octave_text);
      }
      break;

    case ':':
    case '/':
    case '\\':
    case '^':
      {
        int c1 = text_yyinput ();

        if (! match_any (c1, ",;\n") && (c1 == ' ' || c1 == '\t')
            && next_token_can_follow_bin_op ())
          retval = false;

        xunput (c1, octave_text);
      }
      break;

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

        if (match_any (c1, "+-/\\^*"))
          {
            int c2 = text_yyinput ();

            if (c2 == '=')
              {
                int c3 = text_yyinput ();

                if (! match_any (c3, ",;\n") && (c3 == ' ' || c3 == '\t')
                    && next_token_can_follow_bin_op ())
                  retval = false;

                xunput (c3, octave_text);
              }
            else if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                     && next_token_can_follow_bin_op ())
              retval = false;

            xunput (c2, octave_text);
          }
        else if (! match_any (c1, ",;\n")
                 && (! isdigit (c1) && c1 != ' ' && c1 != '\t'
                     && c1 != '.'))
          {
            // Structure reference.  FIXME -- is this a complete check?

            retval = false;
          }

        xunput (c1, octave_text);
      }
      break;

    // & && | || * **
    case '&':
    case '|':
    case '*':
      {
        int c1 = text_yyinput ();

        if (c1 == c0)
          {
            int c2 = text_yyinput ();

            if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                && next_token_can_follow_bin_op ())
              retval = false;

            xunput (c2, octave_text);
          }
        else if (! match_any (c1, ",;\n") && (c1 == ' ' || c1 == '\t')
                 && next_token_can_follow_bin_op ())
          retval = false;

        xunput (c1, octave_text);
      }
      break;

    // < <= > >=
    case '<':
    case '>':
      {
        int c1 = text_yyinput ();

        if (c1 == '=')
          {
            int c2 = text_yyinput ();

            if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                && next_token_can_follow_bin_op ())
              retval = false;

            xunput (c2, octave_text);
          }
        else if (! match_any (c1, ",;\n") && (c1 == ' ' || c1 == '\t')
                 && next_token_can_follow_bin_op ())
          retval = false;

        xunput (c1, octave_text);
      }
      break;

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

        // ~ and ! can be unary ops, so require following =.
        if (c1 == '=')
          {
            int c2 = text_yyinput ();

            if (! match_any (c2, ",;\n") && (c2 == ' ' || c2 == '\t')
                && next_token_can_follow_bin_op ())
              retval = false;

            xunput (c2, octave_text);
          }
        else if (! match_any (c1, ",;\n") && (c1 == ' ' || c1 == '\t')
                 && next_token_can_follow_bin_op ())
          retval = false;

        xunput (c1, octave_text);
      }
      break;

    default:
      break;
    }

  xunput (c0, octave_text);

  return retval;
}

static int
handle_superclass_identifier (void)
{
  eat_continuation ();

  std::string pkg;
  std::string meth = strip_trailing_whitespace (octave_text);
  size_t pos = meth.find ("@");
  std::string cls = meth.substr (pos).substr (1);
  meth = meth.substr (0, pos - 1);

  pos = cls.find (".");
  if (pos != std::string::npos)
    {
      pkg = cls.substr (pos).substr (1);
      cls = cls.substr (0, pos - 1);
    }

  int kw_token = (is_keyword_token (meth) || is_keyword_token (cls)
                  || is_keyword_token (pkg));
  if (kw_token)
    {
      error ("method, class and package names may not be keywords");
      return LEXICAL_ERROR;
    }

  yylval.tok_val
    = new token (meth.empty () ? 0 : &(symbol_table::insert (meth)),
                 cls.empty () ? 0 : &(symbol_table::insert (cls)),
                 pkg.empty () ? 0 : &(symbol_table::insert (pkg)),
                 input_line_number, current_input_column);
  token_stack.push (yylval.tok_val);

  lexer_flags.convert_spaces_to_comma = true;
  current_input_column += octave_leng;

  return SUPERCLASSREF;
}

static int
handle_meta_identifier (void)
{
  eat_continuation ();

  std::string pkg;
  std::string cls = strip_trailing_whitespace (octave_text).substr (1);
  size_t pos = cls.find (".");

  if (pos != std::string::npos)
    {
      pkg = cls.substr (pos).substr (1);
      cls = cls.substr (0, pos - 1);
    }

  int kw_token = is_keyword_token (cls) || is_keyword_token (pkg);
  if (kw_token)
    {
       error ("class and package names may not be keywords");
      return LEXICAL_ERROR;
    }

  yylval.tok_val
    = new token (cls.empty () ? 0 : &(symbol_table::insert (cls)),
                 pkg.empty () ? 0 : &(symbol_table::insert (pkg)),
                 input_line_number, current_input_column);

  token_stack.push (yylval.tok_val);

  lexer_flags.convert_spaces_to_comma = true;
  current_input_column += octave_leng;

  return METAQUERY;
}

// 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)
{
  bool at_bos = lexer_flags.at_beginning_of_statement;

  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;
      lexer_flags.looking_for_object_index = true;

      current_input_column += octave_leng;

      return STRUCT_ELT;
    }

  lexer_flags.at_beginning_of_statement = false;

  // The is_keyword_token may reset
  // lexer_flags.at_beginning_of_statement.  For example, if it sees
  // an else token, then the next token is at the beginning of a
  // statement.

  int kw_token = is_keyword_token (tok);

  // If we found a keyword token, then the beginning_of_statement flag
  // is already set.  Otherwise, we won't be at the beginning of a
  // statement.

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

          return LEXICAL_ERROR;
        }
      else
        {
          yylval.tok_val = new token (tok, 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 = true;
          lexer_flags.looking_for_object_index = true;

          return FCN_HANDLE;
        }
    }

  // If we have a regular keyword, return it.
  // Keywords can be followed by identifiers.

  if (kw_token)
    {
      if (kw_token >= 0)
        {
          current_input_column += octave_leng;
          lexer_flags.quote_is_transpose = false;
          lexer_flags.convert_spaces_to_comma = true;
          lexer_flags.looking_for_object_index = false;
        }

      return kw_token;
    }

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

  int c1 = text_yyinput ();

  bool next_tok_is_eq = false;
  if (c1 == '=')
    {
      int c2 = text_yyinput ();
      xunput (c2, octave_text);

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

  xunput (c1, octave_text);

  // 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_variable (tok))
    {
      if (at_bos && spc_gobbled && can_be_command (tok)
          && looks_like_command_arg ())
        {
          BEGIN (COMMAND_START);
        }
      else if (next_tok_is_eq
               || lexer_flags.looking_at_decl_list
               || lexer_flags.looking_at_return_list
               || (lexer_flags.looking_at_parameter_list
                   && ! lexer_flags.looking_at_initializer_expression))
        {
          symbol_table::force_variable (tok);
        }
      else if (lexer_flags.looking_at_matrix_or_assign_lhs)
        {
          lexer_flags.pending_local_variables.insert (tok);
        }
    }

  // 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 (&(symbol_table::insert (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 || YY_START == COMMAND_START))
    {
      lexer_flags.quote_is_transpose = true;

      do_comma_insert_check ();

      maybe_unput_comma (spc_gobbled);
    }

  current_input_column += octave_leng;

  if (tok != "__end__")
    lexer_flags.looking_for_object_index = true;

  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.
  defining_func = 0;

  // Not parsing an object index.
  while (! parsed_function_name.empty ())
    parsed_function_name.pop ();

  parsing_class_method = false;

  // Not initially defining a class with classdef.
  maybe_classdef_get_set_method = false;
  parsing_classdef = false;

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

  // Not initiallly looking at an anonymous function argument list.
  looking_at_anon_fcn_args = 0;

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

  // Not looking at an argument list initializer expression.
  looking_at_initializer_expression = 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.
  while (! looking_at_object_index.empty ())
    looking_at_object_index.pop_front ();

  looking_at_object_index.push_front (false);

  // Object index not possible until we've seen something.
  looking_for_object_index = false;

  // Yes, we are at the beginning of a statement.
  at_beginning_of_statement = true;

  // 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 looking at indirect references.
  looking_at_indirect_ref = false;

  // Quote marks strings intially.
  quote_is_transpose = false;

  // Set of identifiers that might be local variable names is empty.
  pending_local_variables.clear ();
}

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

DEFUN (iskeyword, args, ,
  "-*- texinfo -*-\n\
@deftypefn  {Built-in Function} {} iskeyword ()\n\
@deftypefnx {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\
@seealso{isvarname, exist}\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.sort ());
    }
  else if (argc == 2)
    {
      retval = is_keyword (argv[1]);
    }
  else
    print_usage ();

  return retval;
}

/*

%!assert (iskeyword ("for"))
%!assert (iskeyword ("fort"), false)
%!assert (iskeyword ("fft"), false)

*/

void
prep_lexer_for_script_file (void)
{
  BEGIN (SCRIPT_FILE_BEGIN);
}

void
prep_lexer_for_function_file (void)
{
  BEGIN (FUNCTION_FILE_BEGIN);
}

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)
{
  std::string nm = curr_fcn_file_full_name;

  if (nm.empty ())
    warning_with_id ("Octave:matlab-incompatible",
                     "potential Matlab compatibility problem: %s",
                     msg.c_str ());
  else
    warning_with_id ("Octave:matlab-incompatible",
                     "potential Matlab compatibility problem: %s near line %d offile %s",
                     msg.c_str (), input_line_number, nm.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");
}

static void
display_token (int tok)
{
  switch (tok)
    {
    case '=': std::cerr << "'='\n"; break;
    case ':': std::cerr << "':'\n"; break;
    case '-': std::cerr << "'-'\n"; break;
    case '+': std::cerr << "'+'\n"; break;
    case '*': std::cerr << "'*'\n"; break;
    case '/': std::cerr << "'/'\n"; break;
    case ADD_EQ: std::cerr << "ADD_EQ\n"; break;
    case SUB_EQ: std::cerr << "SUB_EQ\n"; break;
    case MUL_EQ: std::cerr << "MUL_EQ\n"; break;
    case DIV_EQ: std::cerr << "DIV_EQ\n"; break;
    case LEFTDIV_EQ: std::cerr << "LEFTDIV_EQ\n"; break;
    case POW_EQ: std::cerr << "POW_EQ\n"; break;
    case EMUL_EQ: std::cerr << "EMUL_EQ\n"; break;
    case EDIV_EQ: std::cerr << "EDIV_EQ\n"; break;
    case ELEFTDIV_EQ: std::cerr << "ELEFTDIV_EQ\n"; break;
    case EPOW_EQ: std::cerr << "EPOW_EQ\n"; break;
    case AND_EQ: std::cerr << "AND_EQ\n"; break;
    case OR_EQ: std::cerr << "OR_EQ\n"; break;
    case LSHIFT_EQ: std::cerr << "LSHIFT_EQ\n"; break;
    case RSHIFT_EQ: std::cerr << "RSHIFT_EQ\n"; break;
    case LSHIFT: std::cerr << "LSHIFT\n"; break;
    case RSHIFT: std::cerr << "RSHIFT\n"; break;
    case EXPR_AND_AND: std::cerr << "EXPR_AND_AND\n"; break;
    case EXPR_OR_OR: std::cerr << "EXPR_OR_OR\n"; break;
    case EXPR_AND: std::cerr << "EXPR_AND\n"; break;
    case EXPR_OR: std::cerr << "EXPR_OR\n"; break;
    case EXPR_NOT: std::cerr << "EXPR_NOT\n"; break;
    case EXPR_LT: std::cerr << "EXPR_LT\n"; break;
    case EXPR_LE: std::cerr << "EXPR_LE\n"; break;
    case EXPR_EQ: std::cerr << "EXPR_EQ\n"; break;
    case EXPR_NE: std::cerr << "EXPR_NE\n"; break;
    case EXPR_GE: std::cerr << "EXPR_GE\n"; break;
    case EXPR_GT: std::cerr << "EXPR_GT\n"; break;
    case LEFTDIV: std::cerr << "LEFTDIV\n"; break;
    case EMUL: std::cerr << "EMUL\n"; break;
    case EDIV: std::cerr << "EDIV\n"; break;
    case ELEFTDIV: std::cerr << "ELEFTDIV\n"; break;
    case EPLUS: std::cerr << "EPLUS\n"; break;
    case EMINUS: std::cerr << "EMINUS\n"; break;
    case QUOTE: std::cerr << "QUOTE\n"; break;
    case TRANSPOSE: std::cerr << "TRANSPOSE\n"; break;
    case PLUS_PLUS: std::cerr << "PLUS_PLUS\n"; break;
    case MINUS_MINUS: std::cerr << "MINUS_MINUS\n"; break;
    case POW: std::cerr << "POW\n"; break;
    case EPOW: std::cerr << "EPOW\n"; break;

    case NUM:
    case IMAG_NUM:
      std::cerr << (tok == NUM ? "NUM" : "IMAG_NUM")
                << " [" << yylval.tok_val->number () << "]\n";
      break;

    case STRUCT_ELT:
      std::cerr << "STRUCT_ELT [" << yylval.tok_val->text () << "]\n"; break;

    case NAME:
      {
        symbol_table::symbol_record *sr = yylval.tok_val->sym_rec ();
        std::cerr << "NAME";
        if (sr)
          std::cerr << " [" << sr->name () << "]";
        std::cerr << "\n";
      }
      break;

    case END: std::cerr << "END\n"; break;

    case DQ_STRING:
    case SQ_STRING:
      std::cerr << (tok == DQ_STRING ? "DQ_STRING" : "SQ_STRING")
                << " [" << yylval.tok_val->text () << "]\n";
      break;

    case FOR: std::cerr << "FOR\n"; break;
    case WHILE: std::cerr << "WHILE\n"; break;
    case DO: std::cerr << "DO\n"; break;
    case UNTIL: std::cerr << "UNTIL\n"; break;
    case IF: std::cerr << "IF\n"; break;
    case ELSEIF: std::cerr << "ELSEIF\n"; break;
    case ELSE: std::cerr << "ELSE\n"; break;
    case SWITCH: std::cerr << "SWITCH\n"; break;
    case CASE: std::cerr << "CASE\n"; break;
    case OTHERWISE: std::cerr << "OTHERWISE\n"; break;
    case BREAK: std::cerr << "BREAK\n"; break;
    case CONTINUE: std::cerr << "CONTINUE\n"; break;
    case FUNC_RET: std::cerr << "FUNC_RET\n"; break;
    case UNWIND: std::cerr << "UNWIND\n"; break;
    case CLEANUP: std::cerr << "CLEANUP\n"; break;
    case TRY: std::cerr << "TRY\n"; break;
    case CATCH: std::cerr << "CATCH\n"; break;
    case GLOBAL: std::cerr << "GLOBAL\n"; break;
    case STATIC: std::cerr << "STATIC\n"; break;
    case FCN_HANDLE: std::cerr << "FCN_HANDLE\n"; break;
    case END_OF_INPUT: std::cerr << "END_OF_INPUT\n\n"; break;
    case LEXICAL_ERROR: std::cerr << "LEXICAL_ERROR\n\n"; break;
    case FCN: std::cerr << "FCN\n"; break;
    case CLOSE_BRACE: std::cerr << "CLOSE_BRACE\n"; break;
    case SCRIPT_FILE: std::cerr << "SCRIPT_FILE\n"; break;
    case FUNCTION_FILE: std::cerr << "FUNCTION_FILE\n"; break;
    case SUPERCLASSREF: std::cerr << "SUPERCLASSREF\n"; break;
    case METAQUERY: std::cerr << "METAQUERY\n"; break;
    case GET: std::cerr << "GET\n"; break;
    case SET: std::cerr << "SET\n"; break;
    case PROPERTIES: std::cerr << "PROPERTIES\n"; break;
    case METHODS: std::cerr << "METHODS\n"; break;
    case EVENTS: std::cerr << "EVENTS\n"; break;
    case CLASSDEF: std::cerr << "CLASSDEF\n"; break;
    case '\n': std::cerr << "\\n\n"; break;
    case '\r': std::cerr << "\\r\n"; break;
    case '\t': std::cerr << "TAB\n"; break;
    default:
      {
        if (tok < 256)
          std::cerr << static_cast<char> (tok) << "\n";
        else
          std::cerr << "UNKNOWN(" << tok << ")\n";
      }
      break;
    }
}

static void
display_state (void)
{
  std::cerr << "S: ";

  switch (YY_START)
    {
    case INITIAL:
      std::cerr << "INITIAL" << std::endl;
      break;

    case COMMAND_START:
      std::cerr << "COMMAND_START" << std::endl;
      break;

    case MATRIX_START:
      std::cerr << "MATRIX_START" << std::endl;
      break;

    case SCRIPT_FILE_BEGIN:
      std::cerr << "SCRIPT_FILE_BEGIN" << std::endl;
      break;

    case FUNCTION_FILE_BEGIN:
      std::cerr << "FUNCTION_FILE_BEGIN" << std::endl;
      break;

    default:
      std::cerr << "UNKNOWN START STATE!" << std::endl;
      break;
    }
}

static void
lexer_debug (const char *pattern, const char *text)
{
  std::cerr << std::endl;

  display_state ();

  std::cerr << "P: " << pattern << std::endl;
  std::cerr << "T: " << text << std::endl;
}

DEFUN (__display_tokens__, args, nargout,
  "-*- texinfo -*-\n\
@deftypefn {Built-in Function} {} __display_tokens__ ()\n\
Query or set the internal variable that determines whether Octave's\n\
lexer displays tokens as they are read.\n\
@end deftypefn")
{
  return SET_INTERNAL_VARIABLE (display_tokens);
}

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);
}

DEFUN (__lexer_debug_flag__, args, nargout,
  "-*- texinfo -*-\n\
@deftypefn {Built-in Function} {@var{old_val} =} __lexer_debug_flag__ (@var{new_val}))\n\
Undocumented internal function.\n\
@end deftypefn")
{
  octave_value retval;

  retval = set_internal_variable (lexer_debug_flag, args, nargout,
                                  "__lexer_debug_flag__");

  return retval;
}

