
#line 3 "<stdout>"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

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

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

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

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

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

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

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

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

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

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

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

#define YY_USE_CONST

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

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

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

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

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

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

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

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

#define YY_END_OF_BUFFER_CHAR 0

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

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

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

extern int octave_leng;

extern FILE *octave_in, *octave_out;

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

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

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

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

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

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

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

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

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

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

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

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */
    
	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;

#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
	/* When an EOF's been seen but there's still some text to process
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
	 * shouldn't try reading from the input source any more.  We might
	 * still have a bunch of tokens to match, though, because of
	 * possible backing-up.
	 *
	 * When we actually see the EOF, we change the status to "new"
	 * (via octave_restart()), so that the user can continue scanning by
	 * just pointing octave_in at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

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

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 *
 * Returns the top of the stack, or NULL.
 */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)

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

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

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

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

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

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

#define YY_FLUSH_BUFFER octave__flush_buffer(YY_CURRENT_BUFFER )

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

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

#define yy_new_buffer octave__create_buffer

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

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

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

typedef unsigned char YY_CHAR;

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

typedef int yy_state_type;

extern int octave_lineno;

int octave_lineno = 1;

extern char *octave_text;
#define yytext_ptr octave_text

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

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

#define YY_NUM_RULES 87
#define YY_END_OF_BUFFER 88
/* 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[453] =
    {   0,
       20,   20,   20,   20,   20,   20,    0,    0,    0,    0,
        0,    0,   88,   86,   20,   25,   25,   64,   27,   28,
       23,   46,   26,   65,   66,   52,   50,   56,   51,   67,
       53,   19,   19,   30,   55,   48,   59,   49,   24,   15,
       54,   16,   57,   84,   47,   85,   64,   20,   28,    7,
        4,    4,    7,    6,    7,    7,    6,    7,    7,    7,
        7,    5,    7,    7,    7,    7,    7,    7,    5,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,   11,   14,   14,   28,   10,   12,    8,    9,   11,
       28,    1,   87,    2,    3,   20,   25,   44,   23,   23,

       60,   80,   58,   70,   39,   68,   40,   69,   38,   33,
       31,   32,    0,   34,   19,   35,   36,   71,   19,   19,
        0,   17,    0,   62,   41,   42,   45,   63,   15,    0,
       21,   21,    0,   72,   78,   84,   81,   61,   43,   20,
        0,    0,    7,    7,    4,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,   11,   14,   14,    0,   10,
       12,    8,    9,   14,   14,    0,   14,    0,   13,   13,

       10,   12,   12,    0,    8,    9,   11,    0,    0,   37,
       75,   73,   74,    0,   76,    0,   77,   79,   18,   19,
        0,   19,   19,   82,   83,    0,   22,   22,    0,   29,
       29,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,   14,
       14,    0,   14,   14,   13,   13,    0,   13,   13,   13,
        0,   12,    8,    9,   12,    0,   12,   12,    0,   13,
       13,    0,   19,   22,    7,    7,   14,   14,   14,    0,
       12,    8,    9,   13,    0,   13,   13,   13,   13,    0,
       13,   13,   12,   12,   12,    0,    8,    9,   12,   12,

       12,    0,   13,   14,   14,   12,   12,   12,    0,    8,
        9,   13,   13,   13,    0,   12,    8,    9,   13,   13,
       13,    0,   12,    8,    9,   12,   12,    0,   12,   12,
       12,    0,    0,   12,   12,   12,   12,   12,   12,    0,
       12,   12,   12,    0,    0,   12,   12,   13,   13,   12,
       12,   12,    0,    8,    9,   13,   13,   12,   12,   12,
        0,    8,    9,   12,    0,   12,   12,   12,   12,    0,
       12,   12,   12,   12,   12,    0,   12,    8,    9,   12,
       12,   12,   12,   12,   12,    0,   12,    8,    9,   12,
       12,   12,    0,   12,   12,   12,    0,   12,   12,   12,

        0,   12,    8,    9,   12,   12,   12,    0,   12,    8,
        9,   12,   12,   12,   12,   12,    0,    8,    9,   12,
       12,   12,   12,   12,    0,    8,    9,   12,   12,   12,
       12,   12,   12,   12,   12,   12,    0,    8,    9,   12,
       12,   12,   12,   12,    0,    8,    9,   12,   12,   12,
       12,    0
    } ;

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

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

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

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

static yyconst flex_int16_t yy_base[469] =
    {   0,
        0,   37,   44,   81,   87,   85,  858,  856,  855,  854,
      853,  852,  854, 2036,  851, 2036,  849,  827, 2036, 2036,
      848,   75, 2036, 2036, 2036,   72,   79, 2036,   81,  115,
      825,  133,   87, 2036, 2036,   17,  824,   18, 2036,  845,
      115, 2036,  822,  842,   62, 2036,  819,   93,  803,  835,
     2036,  833,   99, 2036,  162,  112, 2036,  832,  831,  124,
      141, 2036,  142,  191,  106,  224,  802,  829, 2036,  136,
      143,  144,  828,  827,  170,  826,  152,  825,  176,  824,
      155,  253,  289,  822,  107,  821,  181,  820,  819,  149,
      183, 2036, 2036, 2036, 2036,  818, 2036, 2036,  817,  816,

     2036, 2036,  793, 2036, 2036, 2036, 2036, 2036, 2036,  182,
      792,  784,  790,  778,  200,  777,  774, 2036,  317,  217,
      183, 2036,  194,  763, 2036, 2036, 2036,  762,  782,  228,
     2036,  780,  109, 2036, 2036,  770, 2036, 2036, 2036,  173,
      736,  138,  764,  763, 2036,  760,  749,    0,  748,  746,
      214,  745,  734,  733,  728,  727,  724,  237,  225,  238,
      231,  240,  269,  245,  249,  713,  342,  684,  263,  688,
      282,  256,  652,  616,  580,  257,  544,  301,  310,  518,
      506,  488,  463,  441,  438,    0,    0,  434,  263,  430,
      313,  419,  414,    0,  403,  291,    0,  296,  375,  411,

      373,  336,  361,  303,  371,  339,    0,  315,  354,  307,
     2036, 2036, 2036,  381, 2036,  328, 2036, 2036, 2036,  361,
      304,  367,  372, 2036, 2036,  325, 2036,  330,  367, 2036,
      318,  261,  285,  276,  274,  391,  272,  403,  270,  268,
      222,  390,  409,  422,  450,  215,  213,  423,  400,    0,
        0,  350,    0,  478,    0,  195,  363,  514,    0,  550,
      427,  432,  451,  454,  457,  443,  464,  484,  470,    0,
      586,  430,  464, 2036,  487,  490,  622,    0,  658,  459,
      492,  499,  510,    0,  472,    0,  694,    0,    0,  494,
        0,  730,  520,  766,  802,  501,  526,  529,  535,  541,

      556,  522,    0,    0,    0,  562,  838,  874,  531,  571,
      574,  910,    0,  946,  537,  577,  592,  595,  982,    0,
     1018,  546,  598,  607,  610,    0,  193,  552, 1054,    0,
     1090,  558,  564,    0, 1126,  613,  628,    0,  168,  567,
     1162,    0, 1198,  582,  588,    0, 1234,    0,    0,  634,
        0, 1270,  600,  643,  646,    0,    0,  649,    0, 1306,
      603,  664,  667,    0,  618,    0, 1342,    0,    0,  624,
        0, 1378, 1414,    0, 1450,  630,  670,  679,  682,    0,
        0,    0, 1486,    0, 1522,  636,  685,  700,  703, 1558,
        0, 1594,  639, 1630,    0, 1666,  654, 1702,    0, 1738,

      660,  706,  715,  718, 1774,    0, 1810,  672,  721,  736,
      739,    0,    0,  742,    0, 1846,  675,  751,  754,    0,
        0,  757,    0, 1882,  690,  772,  775,    0,    0,    0,
        0,    0,    0,  778,    0, 1918,  696,  787,  790,    0,
        0,  793,    0, 1954,  708,  808,  811,    0,    0,    0,
        0, 2036, 1991, 1994, 1997,  125, 2000, 2002, 2005, 2008,
     2011, 2014, 2017, 2020, 2023, 2026, 2029, 2032
    } ;

static yyconst flex_int16_t yy_def[469] =
    {   0,
      452,    1,  452,    3,    1,    5,  453,  453,  454,  454,
      455,  455,  452,  452,  452,  452,  452,  452,  452,  452,
      456,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  457,
      452,  452,  457,  452,  457,  457,  452,  457,  457,  457,
      457,  452,  457,  457,  457,  457,   66,  457,  452,  457,
      457,  457,  457,  457,  457,  457,  457,  457,  457,  457,
      457,  452,  452,   83,  458,  452,  452,  452,  452,   82,
      458,  452,  452,  452,  452,  452,  452,  452,  452,  456,

      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  459,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  457,  452,  452,  457,  452,   55,  457,  457,
      457,  457,  457,  457,  457,  457,  457,  457,  457,  457,
      457,  457,  457,  457,  457,  457,   66,   66,  457,  457,
      457,  457,  457,  457,  457,  457,  452,  452,  460,  457,
      457,  452,  457,  457,  457,   82,   83,   83,  458,  452,
      452,  452,  452,   83,   83,  461,   83,  458,  452,  458,

      452,  452,  452,  462,  452,  452,   90,  458,  458,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  459,  452,  459,  452,  452,
      452,  457,  457,  457,  457,  457,  457,  457,  457,  457,
      457,   66,  457,  457,  457,  457,  457,  460,  459,   83,
       83,  461,   83,  461,  199,  199,  463,  458,  199,  458,
      464,  458,  458,  458,  452,  462,  452,  462,  458,  199,
      458,  452,  452,  452,  457,  457,  461,   83,  461,  461,
      461,  461,  461,  199,  463,  199,  463,  199,  199,  464,
      199,  464,  458,  452,  458,  465,  458,  458,  462,  452,

      462,  462,  199,   83,   83,  461,  452,  461,  466,  461,
      461,  463,  199,  463,  463,  463,  463,  463,  464,  199,
      464,  464,  464,  464,  464,  294,  294,  467,  458,  294,
      458,  468,  465,  294,  465,  452,  452,  307,  307,  466,
      461,  307,  461,  466,  466,  307,  466,  199,  199,  463,
      294,  463,  467,  463,  463,  199,  199,  464,  294,  464,
      468,  464,  464,  294,  467,  294,  467,  294,  294,  468,
      294,  468,  465,  294,  465,  468,  465,  465,  465,  307,
      307,  307,  466,  307,  466,  466,  466,  466,  466,  463,
      294,  463,  467,  464,  294,  464,  468,  467,  294,  467,

      467,  467,  467,  467,  468,  294,  468,  468,  468,  468,
      468,  294,  294,  465,  294,  465,  465,  465,  465,  307,
      307,  466,  307,  466,  466,  466,  466,  294,  294,  294,
      294,  294,  294,  467,  294,  467,  467,  467,  467,  294,
      294,  468,  294,  468,  468,  468,  468,  294,  307,  294,
      294,    0,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452
    } ;

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

      144,   86,  106,  119,  108,  120,  120,  144,   87,  199,
      200,  227,  228,  144,  121,  122,  130,  131,  132,   88,
      149,  133,  146,   89,  109,  144,  100,  110,  111,  166,
      112,  113,  114,  115,  115,  150,  151,  144,  134,  229,
      230,  231,  144,  144,  144,  144,  116,  152,  117,  119,
      207,  120,  120,  144,  153,  208,  144,  155,  172,  173,
      121,  122,  123,  147,  154,  156,  174,  175,  176,  148,
      380,  178,  131,  132,  140,  181,  179,  144,  185,  141,
      148,  148,  202,  202,  203,  199,  200,  204,  148,  148,
      148,  148,  144,  180,  210,  364,  221,  284,  221,  183,

      157,  222,  222,  158,  159,  211,  160,  161,  162,  163,
      163,  184,  223,  223,  144,  144,  144,  209,  115,  115,
      223,  223,  164,  144,  165,  144,  144,  216,  122,  130,
      131,  132,  144,  119,  133,  120,  120,  181,  144,  144,
      167,  144,  168,  168,  121,  122,  144,  236,  234,  232,
      144,  169,  170,  171,  186,  187,  188,  144,  144,  189,
      233,  235,  144,  237,  144,  199,  200,  190,  239,  144,
      144,  144,  240,  144,  191,  144,  243,  144,  243,  246,
      247,  244,  244,  144,  240,  192,  144,  163,  163,  193,
      194,  194,  195,  253,  254,  196,  238,  170,  199,  200,

      245,  245,  178,  131,  132,  267,  268,  133,  245,  245,
      191,  249,  227,  228,  202,  202,  203,  199,  200,  204,
      230,  192,  222,  222,  226,  193,  219,  227,  228,  219,
      218,  226,  274,  228,  219,  220,  220,  202,  202,  203,
      206,  272,  204,  272,  121,  122,  273,  273,  219,  209,
      219,  241,  253,  254,  241,  269,  270,  271,  143,  241,
      242,  242,  202,  265,  203,  286,  287,  204,  229,  230,
      231,  143,  205,  241,  201,  241,  255,  255,  256,  220,
      220,  257,  130,  131,  132,  222,  222,  133,  121,  122,
      223,  223,  178,  131,  132,  122,  191,  179,  223,  223,

      122,  249,  227,  228,  144,  251,  143,  192,  242,  242,
      144,  193,  258,  259,  260,  206,  275,  261,  275,  143,
      205,  276,  276,  144,  249,  227,  228,  244,  244,  291,
      292,  201,  262,  293,  294,  295,  250,  226,  296,  144,
      244,  244,  144,  263,  226,  267,  268,  264,  273,  273,
      170,  144,  297,  199,  200,  298,  199,  200,  202,  202,
      203,  253,  254,  204,  144,  202,  202,  203,  245,  245,
      204,  269,  270,  271,  286,  287,  245,  245,  170,  277,
      278,  279,  273,  273,  280,  299,  300,  301,  144,  182,
      302,  144,  122,  306,  307,  308,  291,  292,  309,  281,

      310,  253,  254,  334,  335,  276,  276,  144,  276,  276,
      282,  311,  253,  254,  283,  258,  288,  260,  170,  144,
      261,  293,  294,  295,  267,  268,  296,  297,  199,  200,
      298,  199,  200,  346,  347,  262,  299,  336,  301,  286,
      287,  302,  202,  202,  203,  177,  263,  204,  291,  292,
      264,  258,  289,  260,  366,  367,  261,  299,  337,  301,
      371,  372,  302,  306,  307,  308,  334,  335,  309,  346,
      347,  262,  310,  253,  254,  311,  253,  254,  350,  351,
      352,  144,  263,  353,  346,  347,  264,  258,  303,  260,
      346,  347,  261,  354,  286,  287,  355,  286,  287,  358,

      359,  360,  366,  367,  361,  371,  372,  262,  362,  291,
      292,  363,  291,  292,  202,  202,  203,  144,  263,  204,
      366,  367,  264,  277,  304,  279,  371,  372,  280,  202,
      202,  203,  371,  372,  204,  350,  351,  352,  346,  347,
      353,  366,  367,  281,  354,  286,  287,  355,  286,  287,
      358,  359,  360,  144,  282,  361,  371,  372,  283,  277,
      305,  279,  366,  367,  280,  362,  291,  292,  363,  291,
      292,  414,  415,  416,  371,  372,  417,  334,  335,  281,
      418,  334,  335,  419,  334,  335,  422,  423,  424,  144,
      282,  425,  346,  347,  283,  312,  313,  314,  366,  367,

      315,  426,  346,  347,  427,  346,  347,  434,  435,  436,
      371,  372,  437,  143,  144,  316,  438,  366,  367,  439,
      366,  367,  442,  443,  444,  144,  317,  445,  144,  144,
      318,  319,  320,  321,  144,  144,  322,  446,  371,  372,
      447,  371,  372,  414,  415,  416,  144,  144,  417,  144,
      147,  323,  418,  334,  335,  419,  334,  335,  422,  423,
      424,  144,  324,  425,  144,  144,  325,  326,  326,  327,
      142,  136,  328,  426,  346,  347,  427,  346,  347,  434,
      435,  436,  131,  129,  437,  225,  224,  191,  438,  366,
      367,  439,  366,  367,  442,  443,  444,  218,  192,  445,

      217,  215,  193,  329,  330,  331,  214,  213,  332,  446,
      371,  372,  447,  371,  372,  212,  135,   99,   99,   96,
      206,  205,  201,  262,  197,  144,  182,  144,  177,  144,
      144,  143,  144,  144,  263,  145,  144,  142,  264,  338,
      338,  339,  139,  136,  340,  135,  129,  126,  118,   99,
       98,   97,   96,  452,   93,   93,   93,   93,   93,  191,
       93,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      192,  452,  452,  452,  193,  341,  342,  343,  452,  452,
      344,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  281,  452,  452,  452,  452,

      452,  452,  452,  452,  452,  452,  282,  452,  452,  452,
      283,  312,  348,  314,  452,  452,  315,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  316,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  317,  452,  452,  452,  318,  312,  349,  314,
      452,  452,  315,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  316,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  317,  452,
      452,  452,  318,  319,  356,  321,  452,  452,  322,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,

      452,  452,  452,  323,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  324,  452,  452,  452,  325,  319,
      357,  321,  452,  452,  322,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  323,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      324,  452,  452,  452,  325,  329,  368,  331,  452,  452,
      332,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  262,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  263,  452,  452,  452,
      264,  329,  369,  331,  452,  452,  332,  452,  452,  452,

      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  262,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  263,  452,  452,  452,  264,  373,  374,  375,
      452,  452,  376,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  377,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  378,  452,
      452,  452,  379,  341,  381,  343,  452,  452,  344,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  281,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  282,  452,  452,  452,  283,  341,

      382,  343,  452,  452,  344,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  281,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      282,  452,  452,  452,  283,  383,  384,  385,  452,  452,
      386,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  387,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  388,  452,  452,  452,
      389,  390,  391,  392,  452,  452,  393,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  316,  452,  452,  452,  452,  452,  452,  452,  452,

      452,  452,  317,  452,  452,  452,  318,  394,  395,  396,
      452,  452,  397,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  323,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  324,  452,
      452,  452,  325,  398,  399,  400,  452,  452,  401,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  402,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  403,  452,  452,  452,  404,  405,
      406,  407,  452,  452,  408,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  409,

      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      410,  452,  452,  452,  411,  373,  412,  375,  452,  452,
      376,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  377,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  378,  452,  452,  452,
      379,  373,  413,  375,  452,  452,  376,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  377,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  378,  452,  452,  452,  379,  383,  420,  385,
      452,  452,  386,  452,  452,  452,  452,  452,  452,  452,

      452,  452,  452,  452,  452,  452,  452,  387,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  388,  452,
      452,  452,  389,  383,  421,  385,  452,  452,  386,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  387,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  388,  452,  452,  452,  389,  390,
      428,  392,  452,  452,  393,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  316,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      317,  452,  452,  452,  318,  390,  429,  392,  452,  452,

      393,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  316,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  317,  452,  452,  452,
      318,  394,  430,  396,  452,  452,  397,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  323,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  324,  452,  452,  452,  325,  394,  431,  396,
      452,  452,  397,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  323,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  324,  452,

      452,  452,  325,  398,  432,  400,  452,  452,  401,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  402,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  403,  452,  452,  452,  404,  398,
      433,  400,  452,  452,  401,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  402,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      403,  452,  452,  452,  404,  405,  440,  407,  452,  452,
      408,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  409,  452,  452,  452,  452,

      452,  452,  452,  452,  452,  452,  410,  452,  452,  452,
      411,  405,  441,  407,  452,  452,  408,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  409,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  410,  452,  452,  452,  411,  373,  448,  375,
      452,  452,  376,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  377,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  378,  452,
      452,  452,  379,  383,  449,  385,  452,  452,  386,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,

      452,  452,  452,  387,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  388,  452,  452,  452,  389,  398,
      450,  400,  452,  452,  401,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  402,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      403,  452,  452,  452,  404,  405,  451,  407,  452,  452,
      408,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  409,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  410,  452,  452,  452,
      411,   92,   92,   92,   94,   94,   94,   95,   95,   95,

      143,  143,  198,  198,  198,  226,  226,  226,  248,  248,
      248,  252,  252,  252,  266,  266,  266,  285,  285,  285,
      290,  290,  290,  333,  333,  333,  345,  345,  345,  365,
      365,  365,  370,  370,  370,   13,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452
    } ;

static yyconst flex_int16_t yy_chk[2075] =
    {   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,    2,   36,
       36,   38,   38,    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,    4,   22,   26,   45,    6,    4,    5,    5,
        5,    6,   27,    5,   48,   26,   29,   45,   22,   48,

       53,    5,   27,   33,   29,   33,   33,   65,    5,   85,
       85,  133,  133,   56,   33,   33,   41,   41,   41,    5,
       56,   41,   53,    5,   30,   60,  456,   30,   30,   65,
       30,   30,   30,   30,   30,   56,   60,   70,   41,  142,
      142,  142,   61,   63,   71,   72,   30,   60,   30,   32,
       90,   32,   32,   77,   61,   90,   81,   63,   70,   70,
       32,   32,   32,   55,   61,   63,   71,   72,   72,   55,
      339,   75,   75,   75,  140,   77,   75,   79,   81,  140,
       55,   55,   87,   87,   87,   91,   91,   87,   55,   55,
       55,   55,   64,   75,  110,  327,  121,  256,  121,   79,

       64,  121,  121,   64,   64,  110,   64,   64,   64,   64,
       64,   79,  123,  123,  247,  151,  246,   91,  115,  115,
      123,  123,   64,  241,   64,   66,  159,  115,  115,  130,
      130,  130,  161,  120,  130,  120,  120,  151,  158,  160,
       66,  162,   66,   66,  120,  120,  164,  161,  159,  158,
      165,   66,   66,   66,   82,   82,   82,  172,  176,   82,
      158,  160,  232,  162,  169,  189,  189,   82,  164,  240,
      163,  239,  165,  237,   82,  235,  169,  234,  169,  172,
      176,  169,  169,  171,  232,   82,  233,  163,  163,   82,
       83,   83,   83,  196,  196,   83,  163,  163,  198,  198,

      171,  171,  178,  178,  178,  204,  204,  178,  171,  171,
       83,  179,  179,  179,  191,  191,  191,  208,  208,  191,
      231,   83,  221,  221,  179,   83,  119,  226,  226,  119,
      210,  179,  228,  228,  119,  119,  119,  202,  202,  202,
      206,  216,  202,  216,  119,  119,  216,  216,  119,  208,
      119,  167,  252,  252,  167,  209,  209,  209,  167,  167,
      167,  167,  203,  203,  203,  257,  257,  203,  229,  229,
      229,  167,  205,  167,  201,  167,  199,  199,  199,  220,
      220,  199,  214,  214,  214,  222,  222,  214,  220,  220,
      223,  223,  236,  236,  236,  222,  199,  236,  223,  223,

      223,  249,  249,  249,  238,  195,  242,  199,  242,  242,
      243,  199,  200,  200,  200,  193,  238,  200,  238,  242,
      192,  238,  238,  244,  248,  248,  248,  243,  243,  261,
      261,  190,  200,  262,  262,  262,  188,  248,  262,  185,
      244,  244,  184,  200,  248,  266,  266,  200,  272,  272,
      244,  245,  263,  263,  263,  264,  264,  264,  265,  265,
      265,  280,  280,  265,  183,  267,  267,  267,  245,  245,
      267,  269,  269,  269,  285,  285,  245,  245,  245,  254,
      254,  254,  273,  273,  254,  268,  268,  268,  275,  182,
      268,  276,  273,  281,  281,  281,  290,  290,  281,  254,

      282,  282,  282,  296,  296,  275,  275,  181,  276,  276,
      254,  283,  283,  283,  254,  258,  258,  258,  276,  180,
      258,  293,  293,  293,  302,  302,  293,  297,  297,  297,
      298,  298,  298,  309,  309,  258,  299,  299,  299,  315,
      315,  299,  300,  300,  300,  177,  258,  300,  322,  322,
      258,  260,  260,  260,  328,  328,  260,  301,  301,  301,
      332,  332,  301,  306,  306,  306,  333,  333,  306,  340,
      340,  260,  310,  310,  310,  311,  311,  311,  316,  316,
      316,  175,  260,  316,  344,  344,  260,  271,  271,  271,
      345,  345,  271,  317,  317,  317,  318,  318,  318,  323,

      323,  323,  353,  353,  323,  361,  361,  271,  324,  324,
      324,  325,  325,  325,  336,  336,  336,  174,  271,  336,
      365,  365,  271,  277,  277,  277,  370,  370,  277,  337,
      337,  337,  376,  376,  337,  350,  350,  350,  386,  386,
      350,  393,  393,  277,  354,  354,  354,  355,  355,  355,
      358,  358,  358,  173,  277,  358,  397,  397,  277,  279,
      279,  279,  401,  401,  279,  362,  362,  362,  363,  363,
      363,  377,  377,  377,  408,  408,  377,  417,  417,  279,
      378,  378,  378,  379,  379,  379,  387,  387,  387,  170,
      279,  387,  425,  425,  279,  287,  287,  287,  437,  437,

      287,  388,  388,  388,  389,  389,  389,  402,  402,  402,
      445,  445,  402,  168,  166,  287,  403,  403,  403,  404,
      404,  404,  409,  409,  409,  157,  287,  409,  156,  155,
      287,  292,  292,  292,  154,  153,  292,  410,  410,  410,
      411,  411,  411,  414,  414,  414,  152,  150,  414,  149,
      147,  292,  418,  418,  418,  419,  419,  419,  422,  422,
      422,  146,  292,  422,  144,  143,  292,  294,  294,  294,
      141,  136,  294,  426,  426,  426,  427,  427,  427,  434,
      434,  434,  132,  129,  434,  128,  124,  294,  438,  438,
      438,  439,  439,  439,  442,  442,  442,  117,  294,  442,

      116,  114,  294,  295,  295,  295,  113,  112,  295,  446,
      446,  446,  447,  447,  447,  111,  103,  100,   99,   96,
       89,   88,   86,  295,   84,   80,   78,   76,   74,   73,
       68,   67,   59,   58,  295,   52,   50,   49,  295,  307,
      307,  307,   47,   44,  307,   43,   40,   37,   31,   21,
       18,   17,   15,   13,   12,   11,   10,    9,    8,  307,
        7,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      307,    0,    0,    0,  307,  308,  308,  308,    0,    0,
      308,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  308,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,  308,    0,    0,    0,
      308,  312,  312,  312,    0,    0,  312,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  312,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  312,    0,    0,    0,  312,  314,  314,  314,
        0,    0,  314,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  314,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  314,    0,
        0,    0,  314,  319,  319,  319,    0,    0,  319,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,  319,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  319,    0,    0,    0,  319,  321,
      321,  321,    0,    0,  321,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  321,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      321,    0,    0,    0,  321,  329,  329,  329,    0,    0,
      329,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  329,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  329,    0,    0,    0,
      329,  331,  331,  331,    0,    0,  331,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  331,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  331,    0,    0,    0,  331,  335,  335,  335,
        0,    0,  335,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  335,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  335,    0,
        0,    0,  335,  341,  341,  341,    0,    0,  341,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  341,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  341,    0,    0,    0,  341,  343,

      343,  343,    0,    0,  343,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  343,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      343,    0,    0,    0,  343,  347,  347,  347,    0,    0,
      347,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  347,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  347,    0,    0,    0,
      347,  352,  352,  352,    0,    0,  352,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  352,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,  352,    0,    0,    0,  352,  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,  360,    0,
        0,    0,  360,  367,  367,  367,    0,    0,  367,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  367,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  367,    0,    0,    0,  367,  372,
      372,  372,    0,    0,  372,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  372,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      372,    0,    0,    0,  372,  373,  373,  373,    0,    0,
      373,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  373,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  373,    0,    0,    0,
      373,  375,  375,  375,    0,    0,  375,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  375,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  375,    0,    0,    0,  375,  383,  383,  383,
        0,    0,  383,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,  383,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  383,    0,
        0,    0,  383,  385,  385,  385,    0,    0,  385,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  385,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  385,    0,    0,    0,  385,  390,
      390,  390,    0,    0,  390,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  390,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      390,    0,    0,    0,  390,  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,  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,  394,    0,    0,    0,  394,  396,  396,  396,
        0,    0,  396,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  396,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  396,    0,

        0,    0,  396,  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,  398,    0,    0,    0,  398,  400,
      400,  400,    0,    0,  400,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  400,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      400,    0,    0,    0,  400,  405,  405,  405,    0,    0,
      405,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  405,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,  405,    0,    0,    0,
      405,  407,  407,  407,    0,    0,  407,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  407,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  407,    0,    0,    0,  407,  416,  416,  416,
        0,    0,  416,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  416,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  416,    0,
        0,    0,  416,  424,  424,  424,    0,    0,  424,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,  424,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  424,    0,    0,    0,  424,  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,
      436,    0,    0,    0,  436,  444,  444,  444,    0,    0,
      444,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  444,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  444,    0,    0,    0,
      444,  453,  453,  453,  454,  454,  454,  455,  455,  455,

      457,  457,  458,  458,  458,  459,  459,  459,  460,  460,
      460,  461,  461,  461,  462,  462,  462,  463,  463,  463,
      464,  464,  464,  465,  465,  465,  466,  466,  466,  467,
      467,  467,  468,  468,  468,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int octave__flex_debug;
int octave__flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *octave_text;
#line 1 "lex.l"
/*

Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
              2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
              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 36 "lex.l"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <cctype>
#include <cstring>

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

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

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

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

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

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

#define yylval octave_lval

// Arrange to get input via readline.

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

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

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

#define 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(tok, convert, bos) \
  do \
    { \
      yylval.tok_val = new token (input_line_number, current_input_column); \
      token_stack.push (yylval.tok_val); \
      current_input_column += octave_leng; \
      lexer_flags.quote_is_transpose = false; \
      lexer_flags.convert_spaces_to_comma = convert; \
      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(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 void prep_for_function (void);
static void prep_for_nested_function (void);
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_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 1378 "<stdout>"

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

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

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

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

int octave_lex_destroy (void );

int octave_get_debug (void );

void octave_set_debug (int debug_flag  );

YY_EXTRA_TYPE octave_get_extra (void );

void octave_set_extra (YY_EXTRA_TYPE user_defined  );

FILE *octave_get_in (void );

void octave_set_in  (FILE * in_str  );

FILE *octave_get_out (void );

void octave_set_out  (FILE * out_str  );

int octave_get_leng (void );

char *octave_get_text (void );

int octave_get_lineno (void );

void octave_set_lineno (int line_number  );

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

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

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

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

#ifndef YY_NO_INPUT

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

#endif

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

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO fwrite( octave_text, octave_leng, 1, octave_out )
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		int n; \
		for ( n = 0; n < max_size && \
			     (c = getc( octave_in )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( octave_in ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, octave_in))==0 && ferror(octave_in)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(octave_in); \
			} \
		}\
\

#endif

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

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

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

/* end tables serialization structures and prototypes */

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

extern int octave_lex (void);

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

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

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

#define YY_RULE_SETUP \
	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 330 "lex.l"


#line 1571 "<stdout>"

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

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! octave_in )
			octave_in = stdin;

		if ( ! octave_out )
			octave_out = stdout;

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

		octave__load_buffer_state( );
		}

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

		/* Support of octave_text. */
		*yy_cp = (yy_hold_char);

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

		yy_current_state = (yy_start);
		yy_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 >= 453 )
					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] != 2036 );

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

    BEGIN (INITIAL);
    xunput (octave_text[0], octave_text);
    COUNT_TOK_AND_RETURN (SCRIPT);
  }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 340 "lex.l"
{
    LEXER_DEBUG ("<NESTED_FUNCTION_END>.");

    BEGIN (NESTED_FUNCTION_BEGIN);
    xunput (octave_text[0], octave_text);

    lexer_flags.at_beginning_of_statement = true;

    COUNT_TOK_AND_RETURN (';');
  }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 351 "lex.l"
{
    LEXER_DEBUG ("<NESTED_FUNCTION_BEGIN>.");

    BEGIN (INITIAL);
    xunput (octave_text[0], octave_text);

    prep_for_nested_function ();

    COUNT_TOK_AND_RETURN (FCN);
  }
	YY_BREAK

// Help and other command-style functions.

case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 366 "lex.l"
{
    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 5:
YY_RULE_SETUP
#line 381 "lex.l"
{
    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 6:
YY_RULE_SETUP
#line 395 "lex.l"
{
    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 7:
YY_RULE_SETUP
#line 406 "lex.l"
{
    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 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 431 "lex.l"
{
    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 9:
/* rule 9 can match eol */
YY_RULE_SETUP
#line 457 "lex.l"
{
    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 10:
YY_RULE_SETUP
#line 485 "lex.l"
{
    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 11:
YY_RULE_SETUP
#line 517 "lex.l"
{
    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;

	    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 12:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 561 "lex.l"
{
    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 13:
/* rule 13 can match eol */
#line 585 "lex.l"
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 585 "lex.l"
{
    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 15:
YY_RULE_SETUP
#line 608 "lex.l"
{
    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)
      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 16:
YY_RULE_SETUP
#line 634 "lex.l"
{
    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 17:
YY_RULE_SETUP
#line 651 "lex.l"
{
    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 18:
*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 664 "lex.l"
case 19:
YY_RULE_SETUP
#line 664 "lex.l"
{
    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 20:
YY_RULE_SETUP
#line 675 "lex.l"
{
    current_input_column += octave_leng;
  }
	YY_BREAK

// Continuation lines.  Allow comments after continuations.

case 21:
/* rule 21 can match eol */
#line 684 "lex.l"
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
#line 684 "lex.l"
{
    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(NESTED_FUNCTION_END):
case YY_STATE_EOF(NESTED_FUNCTION_BEGIN):
#line 699 "lex.l"
{
    LEXER_DEBUG ("<<EOF>>");

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

	if ((reading_fcn_file || reading_script_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 23:
YY_RULE_SETUP
#line 720 "lex.l"
{
    LEXER_DEBUG ("{IDENT}{S}*");

    int id_tok = handle_identifier ();

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

        COUNT_TOK_AND_RETURN (id_tok);
      }
  }
	YY_BREAK

// Function handles.

case 24:
YY_RULE_SETUP
#line 737 "lex.l"
{
    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 25:
/* rule 25 can match eol */
YY_RULE_SETUP
#line 757 "lex.l"
{
    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 26:
YY_RULE_SETUP
#line 785 "lex.l"
{
    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 27:
YY_RULE_SETUP
#line 807 "lex.l"
{
    LEXER_DEBUG ("\"");

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

    COUNT_TOK_AND_RETURN (tok);
}
	YY_BREAK

// Gobble comments.

case 28:
YY_RULE_SETUP
#line 820 "lex.l"
{
    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 29:
/* rule 29 can match eol */
YY_RULE_SETUP
#line 840 "lex.l"
{
    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 30:
YY_RULE_SETUP
#line 858 "lex.l"
{ LEXER_DEBUG (":"); BIN_OP_RETURN (':', false, false); }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 860 "lex.l"
{ LEXER_DEBUG (".+"); XBIN_OP_RETURN (EPLUS, false, false); }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 861 "lex.l"
{ LEXER_DEBUG (".-"); XBIN_OP_RETURN (EMINUS, false, false); }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 862 "lex.l"
{ LEXER_DEBUG (".*"); BIN_OP_RETURN (EMUL, false, false); }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 863 "lex.l"
{ LEXER_DEBUG ("./"); BIN_OP_RETURN (EDIV, false, false); }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 864 "lex.l"
{ LEXER_DEBUG (".\\"); BIN_OP_RETURN (ELEFTDIV, false, false); }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 865 "lex.l"
{ LEXER_DEBUG (".^"); BIN_OP_RETURN (EPOW, false, false); }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 866 "lex.l"
{ LEXER_DEBUG (".**"); XBIN_OP_RETURN (EPOW, false, false); }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 867 "lex.l"
{ LEXER_DEBUG (".'"); do_comma_insert_check (); BIN_OP_RETURN (TRANSPOSE, true, false); }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 868 "lex.l"
{ LEXER_DEBUG ("++"); do_comma_insert_check (); XBIN_OP_RETURN (PLUS_PLUS, true, false); }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 869 "lex.l"
{ LEXER_DEBUG ("--"); do_comma_insert_check (); XBIN_OP_RETURN (MINUS_MINUS, true, false); }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 870 "lex.l"
{ LEXER_DEBUG ("<="); BIN_OP_RETURN (EXPR_LE, false, false); }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 871 "lex.l"
{ LEXER_DEBUG ("=="); BIN_OP_RETURN (EXPR_EQ, false, false); }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 872 "lex.l"
{ LEXER_DEBUG ("~="); BIN_OP_RETURN (EXPR_NE, false, false); }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 873 "lex.l"
{ LEXER_DEBUG ("!="); XBIN_OP_RETURN (EXPR_NE, false, false); }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 874 "lex.l"
{ LEXER_DEBUG (">="); BIN_OP_RETURN (EXPR_GE, false, false); }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 875 "lex.l"
{ LEXER_DEBUG ("&"); BIN_OP_RETURN (EXPR_AND, false, false); }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 876 "lex.l"
{ LEXER_DEBUG ("|"); BIN_OP_RETURN (EXPR_OR, false, false); }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 877 "lex.l"
{ LEXER_DEBUG ("<"); BIN_OP_RETURN (EXPR_LT, false, false); }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 878 "lex.l"
{ LEXER_DEBUG (">"); BIN_OP_RETURN (EXPR_GT, false, false); }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 879 "lex.l"
{ LEXER_DEBUG ("+"); BIN_OP_RETURN ('+', false, false); }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 880 "lex.l"
{ LEXER_DEBUG ("-"); BIN_OP_RETURN ('-', false, false); }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 881 "lex.l"
{ LEXER_DEBUG ("*"); BIN_OP_RETURN ('*', false, false); }
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 882 "lex.l"
{ LEXER_DEBUG ("/"); BIN_OP_RETURN ('/', false, false); }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 883 "lex.l"
{ LEXER_DEBUG ("\\"); BIN_OP_RETURN (LEFTDIV, false, false); }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 884 "lex.l"
{ LEXER_DEBUG (";"); BIN_OP_RETURN (';', true, true); }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 885 "lex.l"
{ LEXER_DEBUG (","); BIN_OP_RETURN (',', true, ! lexer_flags.looking_at_object_index.front ()); }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 886 "lex.l"
{ LEXER_DEBUG ("^"); BIN_OP_RETURN (POW, false, false); }
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 887 "lex.l"
{ LEXER_DEBUG ("**"); XBIN_OP_RETURN (POW, false, false); }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 888 "lex.l"
{ LEXER_DEBUG ("="); BIN_OP_RETURN ('=', true, false); }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 889 "lex.l"
{ LEXER_DEBUG ("&&"); BIN_OP_RETURN (EXPR_AND_AND, false, false); }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 890 "lex.l"
{ LEXER_DEBUG ("||"); BIN_OP_RETURN (EXPR_OR_OR, false, false); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 891 "lex.l"
{ LEXER_DEBUG ("<<"); XBIN_OP_RETURN (LSHIFT, false, false); }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 892 "lex.l"
{ LEXER_DEBUG (">>"); XBIN_OP_RETURN (RSHIFT, false, false); }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 895 "lex.l"
{
    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 65:
YY_RULE_SETUP
#line 904 "lex.l"
{
    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 66:
YY_RULE_SETUP
#line 925 "lex.l"
{
    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_for_object_index = true;
    lexer_flags.at_beginning_of_statement = false;

    do_comma_insert_check ();

    COUNT_TOK_AND_RETURN (')');
  }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 943 "lex.l"
{
    LEXER_DEBUG (".");

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

    TOK_RETURN ('.');
  }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 952 "lex.l"
{ LEXER_DEBUG ("+="); XBIN_OP_RETURN (ADD_EQ, false, false); }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 953 "lex.l"
{ LEXER_DEBUG ("-="); XBIN_OP_RETURN (SUB_EQ, false, false); }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 954 "lex.l"
{ LEXER_DEBUG ("*="); XBIN_OP_RETURN (MUL_EQ, false, false); }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 955 "lex.l"
{ LEXER_DEBUG ("/="); XBIN_OP_RETURN (DIV_EQ, false, false); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 956 "lex.l"
{ LEXER_DEBUG ("\\="); XBIN_OP_RETURN (LEFTDIV_EQ, false, false); }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 957 "lex.l"
{ LEXER_DEBUG (".+="); XBIN_OP_RETURN (ADD_EQ, false, false); }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 958 "lex.l"
{ LEXER_DEBUG (".-="); XBIN_OP_RETURN (SUB_EQ, false, false); }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 959 "lex.l"
{ LEXER_DEBUG (".*="); XBIN_OP_RETURN (EMUL_EQ, false, false); }
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 960 "lex.l"
{ LEXER_DEBUG ("./="); XBIN_OP_RETURN (EDIV_EQ, false, false); }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 961 "lex.l"
{ LEXER_DEBUG (".\\="); XBIN_OP_RETURN (ELEFTDIV_EQ, false, false); }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 962 "lex.l"
{ LEXER_DEBUG ("{POW}="); XBIN_OP_RETURN (POW_EQ, false, false); }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 963 "lex.l"
{ LEXER_DEBUG ("{EPOW}="); XBIN_OP_RETURN (EPOW_EQ, false, false); }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 964 "lex.l"
{ LEXER_DEBUG ("&="); XBIN_OP_RETURN (AND_EQ, false, false); }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 965 "lex.l"
{ LEXER_DEBUG ("|="); XBIN_OP_RETURN (OR_EQ, false, false); }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 966 "lex.l"
{ LEXER_DEBUG ("<<="); XBIN_OP_RETURN (LSHIFT_EQ, false, false); }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 967 "lex.l"
{ LEXER_DEBUG (">>="); XBIN_OP_RETURN (RSHIFT_EQ, false, false); }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 969 "lex.l"
{
    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 85:
YY_RULE_SETUP
#line 991 "lex.l"
{
    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 86:
YY_RULE_SETUP
#line 1008 "lex.l"
{
    LEXER_DEBUG (".");

    // EOF happens here if we are parsing nested functions.

    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 87:
YY_RULE_SETUP
#line 1031 "lex.l"
ECHO;
	YY_BREAK
#line 2656 "<stdout>"

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

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

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

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

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

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

			else
				{
				yy_cp = (yy_c_buf_p);
				goto yy_find_action;
				}
			}

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

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

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

			case EOB_ACT_CONTINUE_SCAN:
				(yy_c_buf_p) =
					(yytext_ptr) + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state(  );

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

			case EOB_ACT_LAST_MATCH:
				(yy_c_buf_p) =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];

				yy_current_state = yy_get_previous_state(  );

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

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

/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */
static int yy_get_next_buffer (void)
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = (yytext_ptr);
	register int number_to_move, i;
	int ret_val;

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

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

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

	/* Try to read more data. */

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

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

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

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

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

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

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

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

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

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

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

			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

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

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

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

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

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

	return ret_val;
}

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

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

	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 bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE octave__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) octave_alloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in octave__scan_bytes()" );

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

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

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

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

	return b;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

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

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

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

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

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

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

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

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

/** Get the current token.
 * 
 */

char *octave_get_text  (void)
{
        return octave_text;
}

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

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

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

int octave_get_debug  (void)
{
        return octave__flex_debug;
}

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

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

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

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

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

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

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

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

    return 0;
}

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

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

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

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

#define YYTABLES_NAME "yytables"

#line 1031 "lex.l"



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

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

  int c = 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;
  end_tokens_expected = 0;

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

  symbol_table::reset_parent_scope ();

  // 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))
    {
      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 ((interactive || forced_interactive)
      && ! (reading_fcn_file
	    || reading_script_file
	    || get_input_from_eval_string
	    || input_from_startup_file))
    octave_restart (stdin);

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

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

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

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

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

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

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

static void
prep_for_function (void)
{
  end_tokens_expected++;

  promptflag--;

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

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

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

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 (inside_any_object_index ()
	      || (lexer_flags.defining_func
		  && ! (lexer_flags.looking_at_return_list
			|| lexer_flags.parsed_function_name)))
	    return 0;
	  else
	    {
	      if (reading_fcn_file && end_tokens_expected == 1)
		return -1;
	      else
		{
		  yylval.tok_val = new token (token::simple_end, l, c);
		  lexer_flags.at_beginning_of_statement = true;
		  end_tokens_expected--;
		}
	    }
	  break;

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

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

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

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

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

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

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

	case for_kw:
	case while_kw:
	  end_tokens_expected++;
	  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;
	  end_tokens_expected++;
	  promptflag--;
	  break;

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

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

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

			lexer_flags.at_beginning_of_statement = true;

			return END;
		      }
		    else
		      {
			prep_for_nested_function ();

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

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

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

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

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

	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:
  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 = true;
  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
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;
}

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

      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;

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

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

  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 = false;
  parsed_function_name = false;
  parsing_nested_function = 0;
  parsing_class_method = false;

  // Not initiallly looking at a function handle.
  looking_at_function_handle = 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 (@var{name})\n\
Return true if @var{name} is an Octave keyword.  If @var{name}\n\
is omitted, return a list of keywords.\n\
@end deftypefn")
{
  octave_value retval;

  int argc = args.length () + 1;

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

  if (error_state)
    return retval;

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

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

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

  return retval;
}

void
prep_lexer_for_script (void)
{
  BEGIN (SCRIPT_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: std::cerr << "NUM\n"; break;
    case IMAG_NUM: std::cerr << "IMAG_NUM\n"; break;
    case STRUCT_ELT: std::cerr << "STRUCT_ELT\n"; break;
    case NAME: std::cerr << "NAME\n"; break;
    case END: std::cerr << "END\n"; break;
    case DQ_STRING: std::cerr << "DQ_STRING\n"; break;
    case SQ_STRING: std::cerr << "SQ_STRING\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 '\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 NESTED_FUNCTION_END:
      std::cerr << "NESTED_FUNCTION_END" << std::endl;
      break;

    case NESTED_FUNCTION_BEGIN:
      std::cerr << "NESTED_FUNCTION_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;
}

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

