#line 1 "src/Slice/Scanner.cpp"
// Copyright (c) ZeroC, Inc.

#include "../Ice/ScannerConfig.h"
#include <cstdint>

// Clang detects unreachable code in the generated scanner, so we disable the warning.
#if defined(__clang__)
#    pragma clang diagnostic ignored "-Wunreachable-code"
#endif

// NOLINTBEGIN

#line 14 "src/Slice/Scanner.cpp"

#define  YY_INT_ALIGNED long int

/* A lexical scanner generated by flex */

/* %not-for-header */
/* %if-c-only */
/* %if-not-reentrant */
#define yy_create_buffer slice__create_buffer
#define yy_delete_buffer slice__delete_buffer
#define yy_scan_buffer slice__scan_buffer
#define yy_scan_string slice__scan_string
#define yy_scan_bytes slice__scan_bytes
#define yy_init_buffer slice__init_buffer
#define yy_flush_buffer slice__flush_buffer
#define yy_load_buffer_state slice__load_buffer_state
#define yy_switch_to_buffer slice__switch_to_buffer
#define yypush_buffer_state slice_push_buffer_state
#define yypop_buffer_state slice_pop_buffer_state
#define yyensure_buffer_stack slice_ensure_buffer_stack
#define yy_flex_debug slice__flex_debug
#define yyin slice_in
#define yyleng slice_leng
#define yylex slice_lex
#define yylineno slice_lineno
#define yyout slice_out
#define yyrestart slice_restart
#define yytext slice_text
#define yywrap slice_wrap
#define yyalloc slice_alloc
#define yyrealloc slice_realloc
#define yyfree slice_free

/* %endif */
/* %endif */
/* %ok-for-header */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

/* %if-c++-only */
/* %endif */

/* %if-c-only */
#ifdef yy_create_buffer
#define slice__create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer slice__create_buffer
#endif

#ifdef yy_delete_buffer
#define slice__delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer slice__delete_buffer
#endif

#ifdef yy_scan_buffer
#define slice__scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer slice__scan_buffer
#endif

#ifdef yy_scan_string
#define slice__scan_string_ALREADY_DEFINED
#else
#define yy_scan_string slice__scan_string
#endif

#ifdef yy_scan_bytes
#define slice__scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes slice__scan_bytes
#endif

#ifdef yy_init_buffer
#define slice__init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer slice__init_buffer
#endif

#ifdef yy_flush_buffer
#define slice__flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer slice__flush_buffer
#endif

#ifdef yy_load_buffer_state
#define slice__load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state slice__load_buffer_state
#endif

#ifdef yy_switch_to_buffer
#define slice__switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer slice__switch_to_buffer
#endif

#ifdef yypush_buffer_state
#define slice_push_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state slice_push_buffer_state
#endif

#ifdef yypop_buffer_state
#define slice_pop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state slice_pop_buffer_state
#endif

#ifdef yyensure_buffer_stack
#define slice_ensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack slice_ensure_buffer_stack
#endif

#ifdef yylex
#define slice_lex_ALREADY_DEFINED
#else
#define yylex slice_lex
#endif

#ifdef yyrestart
#define slice_restart_ALREADY_DEFINED
#else
#define yyrestart slice_restart
#endif

#ifdef yylex_init
#define slice_lex_init_ALREADY_DEFINED
#else
#define yylex_init slice_lex_init
#endif

#ifdef yylex_init_extra
#define slice_lex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra slice_lex_init_extra
#endif

#ifdef yylex_destroy
#define slice_lex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy slice_lex_destroy
#endif

#ifdef yyget_debug
#define slice_get_debug_ALREADY_DEFINED
#else
#define yyget_debug slice_get_debug
#endif

#ifdef yyset_debug
#define slice_set_debug_ALREADY_DEFINED
#else
#define yyset_debug slice_set_debug
#endif

#ifdef yyget_extra
#define slice_get_extra_ALREADY_DEFINED
#else
#define yyget_extra slice_get_extra
#endif

#ifdef yyset_extra
#define slice_set_extra_ALREADY_DEFINED
#else
#define yyset_extra slice_set_extra
#endif

#ifdef yyget_in
#define slice_get_in_ALREADY_DEFINED
#else
#define yyget_in slice_get_in
#endif

#ifdef yyset_in
#define slice_set_in_ALREADY_DEFINED
#else
#define yyset_in slice_set_in
#endif

#ifdef yyget_out
#define slice_get_out_ALREADY_DEFINED
#else
#define yyget_out slice_get_out
#endif

#ifdef yyset_out
#define slice_set_out_ALREADY_DEFINED
#else
#define yyset_out slice_set_out
#endif

#ifdef yyget_leng
#define slice_get_leng_ALREADY_DEFINED
#else
#define yyget_leng slice_get_leng
#endif

#ifdef yyget_text
#define slice_get_text_ALREADY_DEFINED
#else
#define yyget_text slice_get_text
#endif

#ifdef yyget_lineno
#define slice_get_lineno_ALREADY_DEFINED
#else
#define yyget_lineno slice_get_lineno
#endif

#ifdef yyset_lineno
#define slice_set_lineno_ALREADY_DEFINED
#else
#define yyset_lineno slice_set_lineno
#endif

#ifdef yywrap
#define slice_wrap_ALREADY_DEFINED
#else
#define yywrap slice_wrap
#endif

/* %endif */

#ifdef yyget_lval
#define slice_get_lval_ALREADY_DEFINED
#else
#define yyget_lval slice_get_lval
#endif

#ifdef yyset_lval
#define slice_set_lval_ALREADY_DEFINED
#else
#define yyset_lval slice_set_lval
#endif

#ifdef yyget_lloc
#define slice_get_lloc_ALREADY_DEFINED
#else
#define yyget_lloc slice_get_lloc
#endif

#ifdef yyset_lloc
#define slice_set_lloc_ALREADY_DEFINED
#else
#define yyset_lloc slice_set_lloc
#endif

#ifdef yyalloc
#define slice_alloc_ALREADY_DEFINED
#else
#define yyalloc slice_alloc
#endif

#ifdef yyrealloc
#define slice_realloc_ALREADY_DEFINED
#else
#define yyrealloc slice_realloc
#endif

#ifdef yyfree
#define slice_free_ALREADY_DEFINED
#else
#define yyfree slice_free
#endif

/* %if-c-only */

#ifdef yytext
#define slice_text_ALREADY_DEFINED
#else
#define yytext slice_text
#endif

#ifdef yyleng
#define slice_leng_ALREADY_DEFINED
#else
#define yyleng slice_leng
#endif

#ifdef yyin
#define slice_in_ALREADY_DEFINED
#else
#define yyin slice_in
#endif

#ifdef yyout
#define slice_out_ALREADY_DEFINED
#else
#define yyout slice_out
#endif

#ifdef yy_flex_debug
#define slice__flex_debug_ALREADY_DEFINED
#else
#define yy_flex_debug slice__flex_debug
#endif

#ifdef yylineno
#define slice_lineno_ALREADY_DEFINED
#else
#define yylineno slice_lineno
#endif

/* %endif */

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

/* begin standard C headers. */
/* %if-c-only */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* %endif */

/* %if-tables-serialization */
/* %endif */
/* end standard C headers. */

/* %if-c-or-c++ */
/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

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

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

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

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

#ifndef SIZE_MAX
#define SIZE_MAX               (~(size_t)0)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

/* %endif */

/* begin standard C++ headers. */
/* %if-c++-only */
/* %endif */

/* TODO: this is always defined, so inline it */
#define yyconst const

#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif

/* %not-for-header */
/* Returned upon end-of-file. */
#define YY_NULL 0
/* %ok-for-header */

/* %not-for-header */
/* Promotes a possibly negative, possibly signed char to an
 *   integer in range [0..255] for use as an array index.
 */
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* %ok-for-header */

/* %if-reentrant */
/* %endif */

/* %if-not-reentrant */

/* %endif */

/* 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 yyrestart( yyin  )
#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 * Ditto for the __ia64__ case accordingly.
 */
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif

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

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

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

/* %if-not-reentrant */
extern int yyleng;
/* %endif */

/* %if-c-only */
/* %if-not-reentrant */
extern FILE *yyin, *yyout;
/* %endif */
/* %endif */

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
    
    #define YY_LESS_LINENO(n)
    #define YY_LINENO_REWIND_TO(ptr)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        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 yytext again */ \
		} \
	while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr)  )

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
	{
/* %if-c-only */
	FILE *yy_input_file;
/* %endif */

/* %if-c++-only */
/* %endif */

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

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

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

	/* Whether 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 yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
/* %if-not-reentrant */

/* 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 = NULL; /**< Stack as an array. */
/* %endif */
/* %ok-for-header */

/* %endif */

/* 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)]

/* %if-c-only Standard (non-C++) definition */

/* %if-not-reentrant */
/* %not-for-header */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars;		/* number of characters read into yy_ch_buf */
int yyleng;

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

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;
/* %ok-for-header */

/* %endif */

void yyrestart ( FILE *input_file  );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size  );
void yy_delete_buffer ( YY_BUFFER_STATE b  );
void yy_flush_buffer ( YY_BUFFER_STATE b  );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer  );
void yypop_buffer_state ( void );

static void yyensure_buffer_stack ( void );
static void yy_load_buffer_state ( void );
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file  );
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size  );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str  );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len  );

/* %endif */

void *yyalloc ( yy_size_t  );
void *yyrealloc ( void *, yy_size_t  );
void yyfree ( void *  );

#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}
#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
	}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */

#define slice_wrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP

#define FLEX_DEBUG
typedef flex_uint8_t YY_CHAR;

FILE *yyin = NULL, *yyout = NULL;

typedef int yy_state_type;

extern int yylineno;
int yylineno = 1;

extern char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr yytext

/* %% [1.5] DFA */

/* %if-c-only Standard (non-C++) definition */

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 yynoreturn yy_fatal_error ( const char* msg  );

/* %endif */

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
	(yytext_ptr) -= (yy_more_len); \
	yyleng = (int) (yy_cp - (yytext_ptr)); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
	(yy_c_buf_p) = yy_cp;
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
#define YY_NUM_RULES 51
#define YY_END_OF_BUFFER 52
/* 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 const flex_int32_t yy_accept[220] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,   52,   49,   45,   46,   45,   50,
        1,   50,   50,   50,   19,   19,   50,   44,   35,   50,
       49,   45,   45,   29,   26,   26,   27,   25,   26,   26,
       26,   49,   33,   45,   34,   33,   33,   45,   29,   42,
       39,   37,   38,   42,   40,   42,   29,   51,   15,    3,
        3,   18,    3,   17,    3,    3,   45,   46,    0,   19,
       19,   20,   24,   22,   20,   19,    0,    0,    0,    0,
       43,   44,    0,   44,    0,   36,   44,    0,   45,   29,
       29,   31,    0,   26,   26,   27,   28,   22,   26,   26,

       26,   26,   26,    0,   33,   24,   22,   33,   31,   33,
       42,   39,   24,   22,   41,   42,   31,   42,    3,    3,
        3,    3,   16,    4,    5,    8,    6,   14,    2,    7,
       13,   10,    3,    3,    3,    3,    3,    0,   20,    0,
       22,   21,    0,   20,   19,   47,    0,    0,   22,   21,
       26,   26,   48,   33,   22,   21,   33,   33,   42,   22,
       21,   42,   42,    3,    3,    3,    8,   14,   14,    0,
       13,   13,    9,    3,    3,    0,   20,   23,   21,    0,
        0,   21,   26,   26,   23,   21,   33,   23,   21,   42,
        3,    3,    8,   14,    2,   13,    9,    3,    0,   32,

       30,   26,   26,   26,   30,   30,   14,   13,    3,    0,
       26,   14,   11,    3,   14,   14,   14,   12,    0
    } ;

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

       32,   33,   25,   25,   34,   25,   25,   35,   25,   36,
       25,   25,   25,   37,   25,   37,   38,   37,   25,   39,
       25,   25,    6,    6,    6,    6,   40,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   42,   41,   41,   41,
       43,   41,   41,   41,   41,   41,   41,   41,   41,   41,

       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   44,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   41,   41,   41
    } ;

static const YY_CHAR yy_meta[45] =
    {   0,
        1,    2,    3,    2,    2,    4,    5,    4,    4,    6,
        7,    4,    8,    4,    4,    9,   10,   10,   10,    6,
        4,   11,   11,   11,   12,   12,    4,   13,    8,   14,
       11,   11,   11,   12,   12,   12,   12,   12,   12,    1,
        4,    4,    4,    4
    } ;

static const flex_int32_t yy_base[252] =
    {   0,
        0,   43,   50,   65,   75,   90,  501,   55,   80,  123,
      166,  209,  253,  293,  544, 1343,   45,  536,   54, 1343,
     1343,   85,   70,   94,  319,   97,  513,  357,  496,    0,
      480,  128,  133,  140,    0,   60,  518,  500,   97,  142,
      146,  463,    0,   70, 1343,  106,  462,  172,  183,    0,
      500, 1343, 1343,  107,  469,  451,  188, 1343, 1343,  150,
      105, 1343,  187,  379,  222,  417,  182,  480,  143,    0,
      214,  436,  465,  450,    0,  244,  222,    0,  435,  240,
     1343,  468,  438,    0,    0, 1343,    0,  414,  266,  247,
      270,  297,  417,    0,  192,  399, 1343,  167,  275,  305,

      330,  301,  364,  347,    0,  361,  323,  321,  351,  320,
        0,  327,  306,  495, 1343,  269,  361,  270,  339,  117,
      217,  524, 1343, 1343, 1343,  191, 1343,  548,  250, 1343,
      571,    0,  379,  609,  643,  409,  348,  425, 1343,    0,
        0,    0,  267,  375,    0, 1343,  306,  237,  240,  224,
      324,  184, 1343,  445,  399,  427,    0,  179,  677,  477,
      505,    0,  168,  706,  473,  513,  230,  730,    0,  171,
      753,    0,    0,  460,  353,  273,  518, 1343,    0,  185,
      140,  155,  142,  124,    0,  436,  102,    0,  525,   79,
      369,  614, 1343,  776,   69,  799, 1343,  487,   83, 1343,

      138,  384,    0,  404,  418,  428,  822,  845,  490,  541,
      615,  868, 1343,  620,  891,  914,  937, 1343, 1343,  976,
      990, 1004, 1018, 1031, 1035, 1049, 1063, 1077, 1090, 1104,
     1118,  335, 1132, 1146, 1160, 1174,  414, 1188, 1202, 1216,
     1230, 1244, 1258, 1272, 1286, 1300,   59,   34,  435, 1314,
     1328
    } ;

static const flex_int32_t yy_def[252] =
    {   0,
      219,    1,  220,  220,  220,  220,    1,    1,  221,  221,
      222,  222,  223,  223,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  224,  219,  225,
      219,  219,  219,  219,  226,  226,  219,  219,  226,  226,
      226,  219,  227,  219,  219,  227,  227,  219,  227,  228,
      219,  219,  219,  228,  219,  228,  228,  219,  219,  229,
      229,  219,  229,  230,  229,  229,  219,  219,  219,   25,
      219,  219,  219,  231,   72,  219,  219,  232,  225,  219,
      219,  224,  219,   82,  225,  219,   82,  219,  219,  219,
      219,  219,  219,  226,  226,  219,  219,  233,  226,  226,

      226,  226,  226,  219,  227,  227,  234,  227,  227,  227,
      228,  219,  228,  235,  219,  228,  228,  228,  229,  229,
      229,  236,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  237,  229,  229,  229,  229,  229,  219,  219,  238,
      231,  239,  219,  219,  232,  219,  219,  219,  233,  240,
      226,  226,  219,  241,  234,  242,  227,  227,  243,  235,
      244,  228,  228,  245,  236,  246,  219,  219,  247,  219,
      219,  248,  249,  229,  229,  219,  219,  219,  239,  250,
      219,  240,  251,  226,  227,  242,  227,  228,  244,  228,
      229,  246,  219,  219,  219,  219,  219,  229,  250,  219,

      219,  251,  226,  226,  227,  228,  219,  219,  229,  219,
      226,  219,  219,  229,  219,  219,  219,  219,    0,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219
    } ;

static const flex_int32_t yy_nxt[1388] =
    {   0,
       16,   17,   18,   17,   19,   20,   21,   20,   20,   20,
       20,   22,   20,   22,   23,   24,   25,   26,   26,   27,
       20,   28,   28,   28,   28,   28,   29,   30,   20,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   20,
       16,   16,   16,   31,   32,  172,   67,   33,   67,   67,
       34,   36,   37,   36,   36,   67,   32,   67,   67,   33,
       38,   95,   34,   95,   95,   39,   40,   37,   36,   40,
      169,   67,   41,   67,   67,   38,   36,   37,   36,   36,
       39,   44,   45,   44,   44,   38,   72,   72,   72,  200,
       39,   40,   37,   36,   40,   46,  170,   41,   42,   69,

       38,   70,   71,   71,   73,   39,  219,   73,  219,   74,
      206,   75,   98,   71,   71,   71,  106,  113,  219,   77,
      219,  107,  114,   47,   48,   45,   44,   48,   77,   89,
       49,   67,   89,  205,   89,   90,   67,   89,   46,  210,
       90,   91,  210,   99,   91,   95,   99,  101,  203,  100,
      101,   67,  199,   67,  119,  204,   92,   92,   92,   72,
       72,   72,  102,  102,  102,  179,   47,   44,   51,   44,
       44,  201,   52,   89,   93,   67,   89,  141,   53,   90,
      103,   54,  150,   67,   91,   67,   67,   91,  219,   91,
      219,  200,   91,   95,   55,   95,   95,  121,  195,  109,

      109,  109,  122,  190,  117,  117,  117,  167,  167,   56,
       48,   51,   44,   48,  187,   52,   57,  110,  219,  184,
      219,   53,  118,   89,   54,   67,  133,  164,   75,  134,
       71,   71,   71,  143,  179,  143,   77,   55,  144,  144,
      144,   80,   80,   80,   80,   77,  193,  193,   91,   81,
      141,   91,   56,   58,   44,   59,   44,   60,   75,   62,
       76,   76,   71,   92,   92,   92,   77,   89,   63,   67,
       89,   91,  181,   90,   91,   77,   99,  170,   95,   99,
       64,   93,  100,  144,  144,  144,   92,   92,   92,  177,
      177,  177,   58,   58,   48,   59,   44,   65,  147,   62,

       66,  147,  151,  163,   93,  151,  101,  147,   63,  101,
      147,  162,  180,   92,   92,   92,  159,  102,  102,  102,
       64,  102,  102,  102,  141,  151,  141,  141,  151,  112,
      183,  101,   58,   75,  101,   76,   76,   71,  156,  103,
       67,   77,   67,  119,  145,  145,  102,  102,  102,  219,
       77,  219,  147,  158,  219,  147,  219,   78,   80,   80,
       80,   80,  147,  157,  103,  147,   81,  109,  109,  109,
      219,  154,  219,   82,   82,   82,   83,  117,  117,  117,
       89,  175,   67,  133,   85,  124,  134,  125,  198,  153,
      203,  144,  144,  144,  199,  126,  126,  152,  139,  127,

      141,   96,  141,  141,  128,  211,  129,  139,  211,  130,
      147,  130,  219,  174,  130,  130,  131,  132,   91,  210,
      219,  135,  210,  173,  173,  136,  136,  136,  179,  210,
      179,  179,  210,  136,  136,  136,  176,  179,  176,  179,
      179,  177,  177,  177,  197,  197,  178,  178,  178,  178,
      148,  137,   72,   72,   72,  105,  146,   79,  138,  139,
      105,  147,   85,  219,  174,  142,  180,  138,  139,   80,
       80,   80,   80,  141,  141,  140,  141,   81,  141,  141,
      141,  141,   68,  141,   82,   82,   82,   83,  219,  141,
      219,  210,  116,  219,  214,   85,  141,  115,  141,  141,

      141,  141,  112,  108,  104,  141,  179,  141,  179,  179,
      161,  179,  141,  179,  179,   97,  179,  179,  209,  179,
       96,   88,   86,  141,  141,  141,  179,  141,  179,  179,
      141,  179,   79,  179,  177,  177,  177,  179,   68,  166,
      179,  139,  210,  219,   42,  210,  219,  219,  219,  219,
      139,  141,  179,  179,  219,  219,  219,   92,   92,   92,
      219,  219,  219,  141,  168,  168,  168,  219,  219,  168,
      168,  168,  169,  169,  219,  219,  219,  219,  168,  168,
      168,  169,  169,  169,  169,  169,  169,  171,  171,  171,
      219,  219,  171,  171,  171,  172,  172,  219,  219,  219,

      219,  171,  171,  171,  172,  172,  172,  172,  172,  172,
       91,  219,  219,  135,  179,  179,  211,  179,  219,  211,
      179,  210,  219,  219,  214,  136,  136,  136,  219,  219,
      219,  102,  102,  102,  219,  219,  136,  136,  136,  219,
      219,  179,  219,  137,   91,  219,  219,  135,  219,  219,
      219,  219,  219,  179,  219,  219,  219,  219,  219,  136,
      136,  136,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  137,  178,  178,
      178,  178,  219,  178,  219,  219,  219,  111,  219,  178,
      219,  219,  111,  219,  219,  219,  219,  219,  219,  219,

      219,  219,  219,  219,  219,  178,  178,  178,  178,  178,
      219,  219,  178,  219,  219,  219,  120,  219,  219,  219,
      219,  120,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  178,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  178,  194,  194,  194,  219,
      219,  194,  194,  194,  169,  169,  219,  219,  219,  219,
      194,  194,  194,  169,  169,  169,  169,  169,  169,  196,
      196,  196,  219,  219,  196,  196,  196,  172,  172,  219,
      219,  219,  219,  196,  196,  196,  172,  172,  172,  172,
      172,  172,  207,  207,  207,  219,  219,  207,  207,  207,

      169,  169,  219,  219,  219,  219,  207,  207,  207,  169,
      169,  169,  169,  169,  169,  208,  208,  208,  219,  219,
      208,  208,  208,  172,  172,  219,  219,  219,  219,  208,
      208,  208,  172,  172,  172,  172,  172,  172,  212,  212,
      212,  219,  219,  212,  212,  212,  169,  169,  219,  219,
      219,  219,  212,  212,  212,  169,  169,  169,  169,  169,
      169,  213,  213,  213,  219,  219,  213,  213,  213,  172,
      172,  219,  219,  219,  219,  213,  213,  213,  172,  172,
      172,  172,  172,  172,  215,  215,  215,  219,  219,  215,
      215,  215,  169,  169,  219,  219,  219,  219,  215,  215,

      215,  169,  169,  169,  169,  169,  169,  216,  216,  216,
      219,  219,  216,  216,  216,  169,  169,  219,  219,  219,
      219,  216,  216,  216,  169,  169,  169,  169,  169,  169,
      217,  217,  217,  219,  219,  217,  217,  217,  169,  169,
      219,  219,  219,  219,  217,  217,  217,  169,  169,  169,
      169,  169,  169,  218,  218,  218,  219,  219,  218,  218,
      218,  169,  169,  219,  219,  219,  219,  218,  218,  218,
      169,  169,  169,  169,  169,  169,   35,   35,   35,   35,
       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,

       43,   43,   43,   43,   50,   50,   50,   50,   50,   50,
       50,   50,   50,   50,   50,   50,   50,   50,   61,   61,
       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
       61,   61,   84,   84,  219,  219,   84,  219,  219,  219,
       84,   84,   84,   84,   84,   87,   87,  219,   87,   94,
       94,  219,   94,   94,   94,  219,   94,   94,   94,   94,
       94,   94,   94,  105,  219,  219,  105,  105,  105,  105,
      105,  105,  105,  105,  105,  105,  105,  111,  219,  219,
      111,  219,  111,  111,  219,  111,  111,  111,  111,  111,
      111,  120,  219,  120,  219,  120,  120,  120,  120,  120,

      120,  120,  219,  120,  123,  123,  219,  123,  123,  123,
      123,  123,  123,  123,  123,  123,  123,  123,  141,  141,
      219,  141,  141,  141,  141,  141,  141,  141,  141,  141,
      141,  141,  149,  149,  219,  149,  149,  149,  149,  149,
      149,  149,  149,  149,  149,  149,  155,  155,  219,  155,
      155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
      160,  160,  219,  160,  160,  160,  160,  160,  160,  160,
      160,  160,  160,  160,  165,  165,  219,  165,  165,  165,
      165,  165,  165,  165,  165,  165,  165,  165,  178,  178,
      178,  178,  178,  178,  219,  178,  219,  178,  178,  178,

      178,  178,  179,  179,  219,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  182,  182,  219,  182,
      182,  182,  182,  182,  182,  182,  182,  182,  182,  182,
      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
      185,  185,  185,  185,  186,  186,  219,  186,  186,  186,
      186,  186,  186,  186,  186,  186,  186,  186,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  189,  189,  219,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  191,  191,  191,  191,
      191,  191,  191,  191,  191,  191,  191,  191,  191,  191,

      192,  192,  219,  192,  192,  192,  192,  192,  192,  192,
      192,  192,  192,  192,  199,  199,  219,  199,  199,  199,
      199,  199,  199,  199,  199,  199,  199,  199,  202,  202,
      219,  202,  202,  202,  202,  202,  202,  202,  202,  202,
      202,  202,   15,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219
    } ;

static const flex_int32_t yy_chk[1388] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    2,  248,   17,    2,   17,   17,
        2,    3,    3,    3,    3,   19,    8,   19,   19,    8,
        3,   36,    8,   36,   36,    3,    4,    4,    4,    4,
      247,   44,    4,   44,   44,    4,    5,    5,    5,    5,
        4,    9,    9,    9,    9,    5,   23,   23,   23,  199,
        5,    6,    6,    6,    6,    9,  195,    6,    8,   22,

        6,   22,   22,   22,   24,    6,   61,   39,   61,   24,
      190,   26,   39,   26,   26,   26,   46,   54,  120,   26,
      120,   46,   54,    9,   10,   10,   10,   10,   26,   32,
       10,   32,   32,  187,   33,   32,   33,   33,   10,  201,
       33,   34,  201,   40,   34,   40,   40,   41,  183,   40,
       41,   60,  183,   60,   60,  184,   34,   34,   34,   69,
       69,   69,   41,   41,   41,  182,   10,   11,   11,   11,
       11,  181,   11,   48,   34,   48,   48,   98,   11,   48,
       41,   11,   98,   67,   49,   67,   67,   49,   63,   57,
       63,  180,   57,   95,   11,   95,   95,   63,  170,   49,

       49,   49,   63,  163,   57,   57,   57,  126,  126,   11,
       12,   12,   12,   12,  158,   12,   12,   49,  121,  152,
      121,   12,   57,   65,   12,   65,   65,  121,   71,   65,
       71,   71,   71,   77,  150,   77,   71,   12,   77,   77,
       77,   80,   80,   80,   80,   71,  167,  167,   90,   80,
      149,   90,   12,   13,   13,   13,   13,   13,   76,   13,
       76,   76,   76,   90,   90,   90,   76,   89,   13,   89,
       89,   91,  148,   89,   91,   76,   99,  129,   99,   99,
       13,   90,   99,  143,  143,  143,   91,   91,   91,  176,
      176,  176,   13,   14,   14,   14,   14,   14,   92,   14,

       14,   92,  102,  118,   91,  102,  100,  147,   14,  100,
      147,  116,  147,   92,   92,   92,  113,  102,  102,  102,
       14,  100,  100,  100,  107,  151,  107,  107,  151,  112,
      151,  101,   14,   25,  101,   25,   25,   25,  107,  100,
      119,   25,  119,  119,  232,  232,  101,  101,  101,  137,
       25,  137,  109,  110,  175,  109,  175,   25,   28,   28,
       28,   28,  117,  108,  101,  117,   28,  109,  109,  109,
      191,  106,  191,   28,   28,   28,   28,  117,  117,  117,
      133,  137,  133,  133,   28,   64,  133,   64,  175,  104,
      202,  144,  144,  144,  202,   64,   64,  103,  144,   64,

      155,   96,  155,  155,   64,  204,   64,  144,  204,   64,
      136,   64,  136,  136,   64,   64,   64,   64,   66,  205,
       66,   66,  205,  237,  237,  136,  136,  136,  156,  206,
      156,  156,  206,   66,   66,   66,  138,  186,  138,  186,
      186,  138,  138,  138,  249,  249,  154,  154,  154,  154,
       93,   66,   72,   72,   72,  154,   88,   83,   72,   72,
      154,  174,   79,  174,  174,   74,  174,   72,   72,   82,
       82,   82,   82,  165,  165,   73,  165,   82,  160,  165,
      160,  160,   68,  160,   82,   82,   82,   82,  198,  160,
      198,  209,   56,  209,  209,   82,  114,   55,  114,  114,

      165,  114,   51,   47,   42,  160,  161,  114,  161,  161,
      114,  161,  165,  166,  166,   38,  166,  161,  198,  166,
       37,   31,   29,  114,  122,  122,  189,  122,  189,  189,
      122,  189,   27,  161,  177,  177,  177,  189,   18,  122,
      166,  177,  210,   15,    7,  210,    0,    0,    0,    0,
      177,  122,  166,  189,    0,    0,    0,  210,  210,  210,
        0,    0,    0,  122,  128,  128,  128,    0,    0,  128,
      128,  128,  128,  128,    0,    0,    0,    0,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  131,  131,  131,
        0,    0,  131,  131,  131,  131,  131,    0,    0,    0,

        0,  131,  131,  131,  131,  131,  131,  131,  131,  131,
      134,    0,  134,  134,  192,  192,  211,  192,    0,  211,
      192,  214,    0,  214,  214,  134,  134,  134,    0,    0,
        0,  211,  211,  211,    0,    0,  214,  214,  214,    0,
        0,  192,    0,  134,  135,    0,  135,  135,    0,    0,
        0,    0,    0,  192,    0,    0,    0,    0,    0,  135,
      135,  135,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,  135,  159,  159,
      159,  159,    0,  159,    0,    0,    0,  159,    0,  159,
        0,    0,  159,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,  159,  164,  164,  164,  164,
        0,    0,  164,    0,    0,    0,  164,    0,    0,    0,
        0,  164,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  164,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,  164,  168,  168,  168,    0,
        0,  168,  168,  168,  168,  168,    0,    0,    0,    0,
      168,  168,  168,  168,  168,  168,  168,  168,  168,  171,
      171,  171,    0,    0,  171,  171,  171,  171,  171,    0,
        0,    0,    0,  171,  171,  171,  171,  171,  171,  171,
      171,  171,  194,  194,  194,    0,    0,  194,  194,  194,

      194,  194,    0,    0,    0,    0,  194,  194,  194,  194,
      194,  194,  194,  194,  194,  196,  196,  196,    0,    0,
      196,  196,  196,  196,  196,    0,    0,    0,    0,  196,
      196,  196,  196,  196,  196,  196,  196,  196,  207,  207,
      207,    0,    0,  207,  207,  207,  207,  207,    0,    0,
        0,    0,  207,  207,  207,  207,  207,  207,  207,  207,
      207,  208,  208,  208,    0,    0,  208,  208,  208,  208,
      208,    0,    0,    0,    0,  208,  208,  208,  208,  208,
      208,  208,  208,  208,  212,  212,  212,    0,    0,  212,
      212,  212,  212,  212,    0,    0,    0,    0,  212,  212,

      212,  212,  212,  212,  212,  212,  212,  215,  215,  215,
        0,    0,  215,  215,  215,  215,  215,    0,    0,    0,
        0,  215,  215,  215,  215,  215,  215,  215,  215,  215,
      216,  216,  216,    0,    0,  216,  216,  216,  216,  216,
        0,    0,    0,    0,  216,  216,  216,  216,  216,  216,
      216,  216,  216,  217,  217,  217,    0,    0,  217,  217,
      217,  217,  217,    0,    0,    0,    0,  217,  217,  217,
      217,  217,  217,  217,  217,  217,  220,  220,  220,  220,
      220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
      221,  221,  221,  221,  221,  221,  221,  221,  221,  221,

      221,  221,  221,  221,  222,  222,  222,  222,  222,  222,
      222,  222,  222,  222,  222,  222,  222,  222,  223,  223,
      223,  223,  223,  223,  223,  223,  223,  223,  223,  223,
      223,  223,  224,  224,    0,    0,  224,    0,    0,    0,
      224,  224,  224,  224,  224,  225,  225,    0,  225,  226,
      226,    0,  226,  226,  226,    0,  226,  226,  226,  226,
      226,  226,  226,  227,    0,    0,  227,  227,  227,  227,
      227,  227,  227,  227,  227,  227,  227,  228,    0,    0,
      228,    0,  228,  228,    0,  228,  228,  228,  228,  228,
      228,  229,    0,  229,    0,  229,  229,  229,  229,  229,

      229,  229,    0,  229,  230,  230,    0,  230,  230,  230,
      230,  230,  230,  230,  230,  230,  230,  230,  231,  231,
        0,  231,  231,  231,  231,  231,  231,  231,  231,  231,
      231,  231,  233,  233,    0,  233,  233,  233,  233,  233,
      233,  233,  233,  233,  233,  233,  234,  234,    0,  234,
      234,  234,  234,  234,  234,  234,  234,  234,  234,  234,
      235,  235,    0,  235,  235,  235,  235,  235,  235,  235,
      235,  235,  235,  235,  236,  236,    0,  236,  236,  236,
      236,  236,  236,  236,  236,  236,  236,  236,  238,  238,
      238,  238,  238,  238,    0,  238,    0,  238,  238,  238,

      238,  238,  239,  239,    0,  239,  239,  239,  239,  239,
      239,  239,  239,  239,  239,  239,  240,  240,    0,  240,
      240,  240,  240,  240,  240,  240,  240,  240,  240,  240,
      241,  241,  241,  241,  241,  241,  241,  241,  241,  241,
      241,  241,  241,  241,  242,  242,    0,  242,  242,  242,
      242,  242,  242,  242,  242,  242,  242,  242,  243,  243,
      243,  243,  243,  243,  243,  243,  243,  243,  243,  243,
      243,  243,  244,  244,    0,  244,  244,  244,  244,  244,
      244,  244,  244,  244,  244,  244,  245,  245,  245,  245,
      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,

      246,  246,    0,  246,  246,  246,  246,  246,  246,  246,
      246,  246,  246,  246,  250,  250,    0,  250,  250,  250,
      250,  250,  250,  250,  250,  250,  250,  250,  251,  251,
        0,  251,  251,  251,  251,  251,  251,  251,  251,  251,
      251,  251,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  219,  219,  219
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int yy_flex_debug;
int yy_flex_debug = 1;

static const flex_int32_t yy_rule_linenum[51] =
    {   0,
      130,  144,  145,  152,  153,  154,  161,  180,  193,  203,
      210,  211,  223,  224,  232,  243,  253,  261,  279,  302,
      330,  335,  339,  344,  350,  351,  356,  362,  387,  392,
      398,  399,  414,  419,  427,  432,  438,  448,  453,  457,
      462,  468,  481,  514,  524,  527,  541,  542,  548,  562
    } ;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
static int yy_more_flag = 0;
static int yy_more_len = 0;
#define yymore() ((yy_more_flag) = 1)
#define YY_MORE_ADJ (yy_more_len)
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "src/Slice/Scanner.l"

#line 17 "src/Slice/Scanner.l"

#include "GrammarUtil.h"
#include "Grammar.h"

#include <iostream>
#include <cstdlib>
#include <cmath>

using namespace std;
using namespace Slice;

namespace Slice
{
    // Definitions for the case-insensitive keyword-token map.
    using StringTokenMap = map<string, int>;
    StringTokenMap keywordMap;

    int checkKeyword(string& identifier);
    int checkIsScoped(const string& identifier);
}

// Stores the scanner's current column position. Flex also automatically
// generates 'yylineno', which stores the scanner's current line number.
int yycolno = 0;
// Stores a copy of the filename that the scanner is currently scanning.
string yyfilename;

namespace
{
    void nextLine(int count = 1);
    int scanPosition(const char* s);
    void setLocation(TokenContext* location);
    void startLocation(TokenContext* location);
    void endLocation(TokenContext* location);

    void initScanner();
    void preAction();
    void pushState(int newState);
    void popState();

    void yynoreturn fatalError(const char* msg);
}

// Override some of the functions flex auto-generates with our own implementations.
#define YY_USER_INIT initScanner();
#define YY_USER_ACTION preAction();
#define YY_FATAL_ERROR(msg) fatalError(msg);

#line 1260 "src/Slice/Scanner.cpp"
#line 68 "src/Slice/Scanner.l"
  /* Changes the default prefix of 'yy' to 'slice_' for functions and variables in the generated code. */
  /* Instructs flex to not suppress any warnings when generating the scanner. */
  /* Instructs flex to generate a scanner that supports verbose outputting (debug mode). */
  /* By default flex will 'default match' any text it encounters that doesn't match any specified rules. This
   * option disables default-matching (it throws 'scanner jammed' instead) to make grammar holes more obvious. */
  /* Directs flex to generate a scanner tailored for use by bison, and that supports bison's token location mechanism.
   * These options change the signature of the main lexing function, which must match the one declared in Grammar.y */
  /* Enables the use of flex's built in start-condition state stack. */
  /* Ensures flex generates a scanner that supports reading 8-bit characters. */
  /* Directs flex to generate lookup tables that are better aligned in memory to
   * improve access speeds, even if this means allocating larger tables. */
  /* Enables batching for improved performance. */
  /* Directs flex to store matched text as 'char *' instead of char arrays, for improved performance. */
  /* Disables the scanner's interactive modes for improved performance. */
  /* Disables the generation of functions we don't use to reduce clutter, and possibly improve performance. */
#define YY_NO_INPUT 1
  /* List of start-condition states the scanner can be in. This lets the scanning be context dependent. */






  /* The scanner also has a built in 'INITIAL' start-condition state, which is the state the scanner is initialized in.
   * We use it solely to check for and consume any BOMs at the start of files. See Bug 3140. */
#line 1287 "src/Slice/Scanner.cpp"

#define INITIAL 0
#define C_COMMENT 1
#define C_DOC_COMMENT 2
#define SLICE 3
#define PREPROCESS 4
#define METADATA 5
#define STRING_LITERAL 6

#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.
 */
/* %if-c-only */
#include <unistd.h>
/* %endif */
/* %if-c++-only */
/* %endif */
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

/* %if-c-only Reentrant structure and macros (non-C++). */
/* %if-reentrant */
/* %if-c-only */

static int yy_init_globals ( void );

/* %endif */
/* %if-reentrant */
/* %endif */
/* %endif End reentrant structures and macros. */

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

int yylex_destroy ( void );

/* %if-bison-bridge */

void yyset_lval ( YYSTYPE * yylval_param  );

/* %endif */

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

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

/* %not-for-header */
#ifndef YY_NO_UNPUT
    
#endif
/* %ok-for-header */

/* %endif */

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

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

#ifndef YY_NO_INPUT
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
#ifdef __cplusplus
static int yyinput ( void );
#else
static int input ( void );
#endif
/* %ok-for-header */

/* %endif */
#endif

/* %if-c-only */

        static int yy_start_stack_ptr = 0;
        static int yy_start_stack_depth = 0;
        static int *yy_start_stack = NULL;
    
    static void yy_push_state ( int _new_state );
    
    static void yy_pop_state ( void );
    
    static int yy_top_state ( void );
    
/* %endif */

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* %if-c-only Standard (non-C++) definition */
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#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) \
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		int n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\
/* %if-c++-only C++ definition \ */\
/* %endif */

#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
/* %if-c-only */
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
/* %endif */
/* %if-c++-only */
/* %endif */
#endif

/* %if-tables-serialization structures and prototypes */
/* %not-for-header */
/* %ok-for-header */

/* %not-for-header */
/* %tables-yydmap generated elements */
/* %endif */
/* end tables serialization structures and prototypes */

/* %ok-for-header */

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */

extern int yylex \
               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param );

#define YY_DECL int yylex \
               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param )
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif /* !YY_DECL */

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

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

/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

/* %not-for-header */
/** The main scanner function which does all the work.
 */
YY_DECL
{
	yy_state_type yy_current_state;
	char *yy_cp, *yy_bp;
	int yy_act;
    
        YYSTYPE * yylval;
    
        YYLTYPE * yylloc;
    
    yylval = yylval_param;

    yylloc = yylloc_param;

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

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! yyin )
/* %if-c-only */
			yyin = stdin;
/* %endif */
/* %if-c++-only */
/* %endif */

		if ( ! yyout )
/* %if-c-only */
			yyout = stdout;
/* %endif */
/* %if-c++-only */
/* %endif */

		if ( ! YY_CURRENT_BUFFER ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				yy_create_buffer( yyin, YY_BUF_SIZE );
		}

		yy_load_buffer_state(  );
		}

	{
/* %% [7.0] user's declarations go here */
#line 126 "src/Slice/Scanner.l"


  /* ========== Literals ========== */
  /* Matches the start of a double-quoted string literal. */
#line 1578 "src/Slice/Scanner.cpp"

	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
		{
/* %% [8.0] yymore()-related code goes here */
		(yy_more_len) = 0;
		if ( (yy_more_flag) )
			{
			(yy_more_len) = (int) ((yy_c_buf_p) - (yytext_ptr));
			(yy_more_flag) = 0;
			}
		yy_cp = (yy_c_buf_p);

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

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

/* %% [9.0] code to set up and find next match goes here */
		yy_current_state = (yy_start);
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			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 >= 220 )
					yy_c = yy_meta[yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
			++yy_cp;
			}
		while ( yy_current_state != 219 );
		yy_cp = (yy_last_accepting_cpos);
		yy_current_state = (yy_last_accepting_state);

yy_find_action:
/* %% [10.0] code to find the action number goes here */
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

/* %% [11.0] code for yylineno update goes here */

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

/* %% [12.0] debug code goes here */
		if ( yy_flex_debug )
			{
			if ( yy_act == 0 )
				fprintf( stderr, "--scanner backing up\n" );
			else if ( yy_act < 51 )
				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
				         (long)yy_rule_linenum[yy_act], yytext );
			else if ( yy_act == 51 )
				fprintf( stderr, "--accepting default rule (\"%s\")\n",
				         yytext );
			else if ( yy_act == 52 )
				fprintf( stderr, "--(end of buffer or a NUL)\n" );
			else
				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
			}

		switch ( yy_act )
	{ /* beginning of action switch */
/* %% [13.0] actions go here */
			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 130 "src/Slice/Scanner.l"
{
    pushState(STRING_LITERAL);
    startLocation(yylloc);

    StringTokPtr str = make_shared<StringTok>();
    str->literal = "\"";
    *yylval = str;
}
	YY_BREAK
/* Matches a single escaped backslash, or as many characters as it can,
   * except backslashes, new-lines, double quotes, and non-printable ASCII characters. */
/* Matches Escaped backslashes and any other valid string characters. Invalid characters are
   * new-lines, non-printable ASCII characters, and double-quotes. */
case 2:
#line 145 "src/Slice/Scanner.l"
case 3:
YY_RULE_SETUP
#line 145 "src/Slice/Scanner.l"
{
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += yytext;
}
	YY_BREAK
/* Matches an escaped double-quote, single-quote, or question mark. */
case 4:
#line 153 "src/Slice/Scanner.l"
case 5:
#line 154 "src/Slice/Scanner.l"
case 6:
YY_RULE_SETUP
#line 154 "src/Slice/Scanner.l"
{
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += yytext[1];
}
	YY_BREAK
/* Matches an ANSI-C escape code pattern. */
case 7:
YY_RULE_SETUP
#line 161 "src/Slice/Scanner.l"
{
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    char ansiCode;
    switch(yytext[1])
    {
        case 'a': ansiCode = '\a'; break;
        case 'b': ansiCode = '\b'; break;
        case 'f': ansiCode = '\f'; break;
        case 'n': ansiCode = '\n'; break;
        case 'r': ansiCode = '\r'; break;
        case 't': ansiCode = '\t'; break;
        case 'v': ansiCode = '\v'; break;
        default: ansiCode = '\0'; assert(false);
    }
    str->literal += yytext;
    str->v += ansiCode;
}
	YY_BREAK
/* Matches an escaped octal value. Octal literals are limited to a max of 3 digits. */
case 8:
YY_RULE_SETUP
#line 180 "src/Slice/Scanner.l"
{
    int64_t value = std::stoll((yytext + 1), nullptr, 8);
    if (value > 255)
    {
        currentUnit->error("octal escape sequence out of range: '\\" + string(yytext + 1) + "'");
    }

    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += static_cast<char>(value);
}
	YY_BREAK
/* Matches an escaped hexadecimal value. Hexadecimal literals are limited to a max of 2 digits. */
case 9:
YY_RULE_SETUP
#line 193 "src/Slice/Scanner.l"
{
    int64_t value = std::stoll((yytext + 2), nullptr, 16);
    assert(value <= 255);

    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += static_cast<char>(value);
}
	YY_BREAK
/* Matches an empty hexadecimal escape value. */
case 10:
YY_RULE_SETUP
#line 203 "src/Slice/Scanner.l"
{
    currentUnit->error("no hex digit in hex escape sequence");
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
}
	YY_BREAK
/* Matches a 4-char or 8-char size universal character code. */
case 11:
#line 211 "src/Slice/Scanner.l"
case 12:
YY_RULE_SETUP
#line 211 "src/Slice/Scanner.l"
{
    int64_t codePoint = std::stoll((yytext + 2), nullptr, 16);
    if (codePoint <= 0xdfff && codePoint >= 0xd800)
    {
        currentUnit->error("a universal character name cannot designate a surrogate: '" + string(yytext) + "'");
    }
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += yytext;
}
	YY_BREAK
/* Matches a universal character code that isn't the correct size, or uses incorrect characters. */
case 13:
#line 224 "src/Slice/Scanner.l"
case 14:
YY_RULE_SETUP
#line 224 "src/Slice/Scanner.l"
{
    currentUnit->error("unknown escape sequence in string literal: '" + string(yytext) + "'");
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    str->v += yytext;
}
	YY_BREAK
/* Matches an unescaped newline in a string literal, and issues an error. */
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 232 "src/Slice/Scanner.l"
{
    popState();
    endLocation(yylloc);
    nextLine();

    currentUnit->error("encountered un-escaped EOL while scanning a string literal.");
    return ICE_STRING_LITERAL;
}
	YY_BREAK
/* Matches an unknown escape value. This rule has a lower priority than all the other escape rules because
   * it only matches 2 characters (the lowest any match), and it's beneath the others. */
case 16:
YY_RULE_SETUP
#line 243 "src/Slice/Scanner.l"
{
    currentUnit->warning(All, "unknown escape sequence in string literal: '" + string{yytext} + "'");

    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    // Escape the entire sequence.
    str->literal += yytext;
    str->v += "\\" + string(yytext);
}
	YY_BREAK
/* Matches a dangling backslash, with nothing to escape. This rule is mostly included for grammar completeness. */
case 17:
YY_RULE_SETUP
#line 253 "src/Slice/Scanner.l"
{
    currentUnit->warning(All, "dangling backslash in string literal");
    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
}
	YY_BREAK
/* Matches the end of a double-quoted string literal, but only while scanning a string literal. Flex always prefers
   * to match the longest string it can, so quotes preceeded with a literal '\' will match the rules above this one. */
case 18:
YY_RULE_SETUP
#line 261 "src/Slice/Scanner.l"
{
    popState();
    endLocation(yylloc);

    StringTokPtr str = dynamic_pointer_cast<StringTok>(*yylval);
    str->literal += yytext;
    return ICE_STRING_LITERAL;
}
	YY_BREAK
/* Matches EOF, but only while scanning a string literal. */
case YY_STATE_EOF(STRING_LITERAL):
#line 271 "src/Slice/Scanner.l"
{
    popState();
    endLocation(yylloc);

    currentUnit->error("encountered EOF while scanning a string literal");
    return ICE_STRING_LITERAL;
}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 279 "src/Slice/Scanner.l"
{
    setLocation(yylloc);

    IntegerTokPtr itp = make_shared<IntegerTok>();
    itp->literal = string(yytext);
    *yylval = itp;
    try
    {
        itp->v = std::stoll(string(yytext), nullptr, 0);
    }
    catch (const std::out_of_range&)
    {
        currentUnit->error("integer constant '" + string(yytext) + "' out of range");
        itp->v = INT64_MAX;
    }
    catch (const std::invalid_argument&)
    {
        currentUnit->error("invalid integer constant '" + string(yytext) + "'");
        itp->v = INT64_MAX;
    }
    return ICE_INTEGER_LITERAL;
}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 302 "src/Slice/Scanner.l"
{
    setLocation(yylloc);

    errno = 0;
    FloatingTokPtr ftp = make_shared<FloatingTok>();
    *yylval = ftp;
    string literal(yytext);
    ftp->literal = literal;
    char lastChar = literal[literal.size() - 1];
    if (lastChar == 'f' || lastChar == 'F')
    {
        literal = literal.substr(0, literal.size() - 1);    // Clobber trailing 'f' or 'F' suffix
    }
    ftp->v = strtod(literal.c_str(), nullptr);
    if ((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE)
    {
        currentUnit->error("floating-point constant '" + string{yytext} + "' too large (overflow)");
    }
    else if (ftp->v == 0 && errno == ERANGE)
    {
        currentUnit->error("floating-point constant '" + string{yytext} + "' too small (underflow)");
    }
    return ICE_FLOATING_POINT_LITERAL;
}
	YY_BREAK
/* ========== Comments ========== */
/* Matches and records a triple-slash style doc-comment. */
case 21:
YY_RULE_SETUP
#line 330 "src/Slice/Scanner.l"
{
    currentUnit->appendToDocComment(yytext + 3);
}
	YY_BREAK
/* Matches and consumes a C++ style comment. */
case 22:
YY_RULE_SETUP
#line 335 "src/Slice/Scanner.l"
{}
	YY_BREAK
/* Matches the start of a C style doc-comment, and switches the scanner to the C_DOC_COMMENT state.
   * Specifically we match a forward slash and 2 stars when they are _not_ followed by either a '/' or '*' character. */
case 23:
/* rule 23 can match eol */
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
YY_LINENO_REWIND_TO(yy_bp + 3);
(yy_c_buf_p) = yy_cp = yy_bp + 3;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 339 "src/Slice/Scanner.l"
{
    pushState(C_DOC_COMMENT);
}
	YY_BREAK
/* Matches the start of a C style comment, and switches the scanner to the C_COMMENT state. */
case 24:
YY_RULE_SETUP
#line 344 "src/Slice/Scanner.l"
{
    pushState(C_COMMENT);
}
	YY_BREAK
/* Matches any character except for newlines and adds them to the comments. '*' are matched one at a time to ensure
   * Flex scans '* /' correctly. Flex prioritizes longer matches over shorter ones, so '* /' will match before '*'. */
case 25:
#line 351 "src/Slice/Scanner.l"
case 26:
YY_RULE_SETUP
#line 351 "src/Slice/Scanner.l"
{
    yymore();
}
	YY_BREAK
/* Matches as many newlines as are available and adds them to the comment, after incrementing the line count. */
case 27:
/* rule 27 can match eol */
YY_RULE_SETUP
#line 356 "src/Slice/Scanner.l"
{
    nextLine(yyleng);
    yymore();
}
	YY_BREAK
/* Matches the end of a C style comment, and reverts the scanner state to what it previously was. */
case 28:
YY_RULE_SETUP
#line 362 "src/Slice/Scanner.l"
{
    string comment(yytext);
    // The last 2 characters are the '*/' matched by this rule.
    if (YY_START == C_DOC_COMMENT)
    {
        currentUnit->setDocComment(comment.substr(0, yyleng - 2));
    }

    popState();
}
	YY_BREAK
/* Handles reaching EOF while scanning a C style comment by issuing a warning but continuing normally. */
case YY_STATE_EOF(C_COMMENT):
case YY_STATE_EOF(C_DOC_COMMENT):
#line 374 "src/Slice/Scanner.l"
{
    currentUnit->error("encountered EOF while scanning a comment");
    if (YY_START == C_DOC_COMMENT)
    {
        currentUnit->setDocComment(yytext);
    }

    popState();
}
	YY_BREAK
/* ========== Preprocessor Statements ========== */
/* Matches the empty preprocessor directive. */
case 29:
YY_RULE_SETUP
#line 387 "src/Slice/Scanner.l"
{
    pushState(PREPROCESS);
}
	YY_BREAK
/* Matches a line preprocessor directive, but missing a line number. */
case 30:
YY_RULE_SETUP
#line 392 "src/Slice/Scanner.l"
{
    pushState(PREPROCESS);
    currentUnit->error("missing line number in line preprocessor directive");
}
	YY_BREAK
/* Matches a line preprocessor directive (optionally with a file specified afterwards). */
case 31:
#line 399 "src/Slice/Scanner.l"
case 32:
YY_RULE_SETUP
#line 399 "src/Slice/Scanner.l"
{
    int includeAction = scanPosition(yytext);
    if (yylineno == 0 || includeAction == 1) // Push: Indicated the scanner has started scanning a new file.
    {
        pushState(INITIAL);
    }
    else if (includeAction == 2) // Pop: Indicates the scanner has completed scanning a file.
    {
        popState();
    }
    pushState(PREPROCESS);
}
	YY_BREAK
/* Matches any non white-space character. This is a catch-all to report any invalid characters
   * found while scanning a preprocessor directive. */
case 33:
YY_RULE_SETUP
#line 414 "src/Slice/Scanner.l"
{
    currentUnit->error("encountered unexpected token while scanning preprocessor directive: '" + string(yytext) + "'");
}
	YY_BREAK
/* Matches a new-line character or EOF. This signals the end of the preprocessor statement. */
case 34:
/* rule 34 can match eol */
#line 420 "src/Slice/Scanner.l"
YY_RULE_SETUP
case YY_STATE_EOF(PREPROCESS):
#line 420 "src/Slice/Scanner.l"
{
    popState();
    nextLine();
}
	YY_BREAK
/* ========== Metadata ========== */
case 35:
YY_RULE_SETUP
#line 427 "src/Slice/Scanner.l"
{
    pushState(METADATA);
    return ICE_METADATA_OPEN;
}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 432 "src/Slice/Scanner.l"
{
    pushState(METADATA);
    return ICE_FILE_METADATA_OPEN;
}
	YY_BREAK
/* Matches the start of a metadata string, then switches the scanner into STRING_LITERAL mode. */
case 37:
YY_RULE_SETUP
#line 438 "src/Slice/Scanner.l"
{
    pushState(STRING_LITERAL);
    startLocation(yylloc);

    StringTokPtr str = make_shared<StringTok>();
    str->literal = "\"";
    *yylval = str;
}
	YY_BREAK
/* Matches commas between string literals in quoted metadata and forwards them to the parser. */
case 38:
YY_RULE_SETUP
#line 448 "src/Slice/Scanner.l"
{
    return yytext[0];
}
	YY_BREAK
/* Matches and consumes newlines in between metadata after incrementing the line count. */
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
#line 453 "src/Slice/Scanner.l"
{
    nextLine(yyleng);
}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 457 "src/Slice/Scanner.l"
{
    popState();
    return ICE_METADATA_CLOSE;
}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 462 "src/Slice/Scanner.l"
{
    popState();
    return ICE_FILE_METADATA_CLOSE;
}
	YY_BREAK
/* Matches any characters not matched by another metadata rule (except whitespace), and reports an error. */
case 42:
YY_RULE_SETUP
#line 468 "src/Slice/Scanner.l"
{
    ostringstream msg;
    msg << "invalid tokens in metadata: '" << yytext << "' (maybe you forgot to wrap it in quotes?)";
    currentUnit->error(msg.str());

    StringTokPtr str = make_shared<StringTok>();
    str->literal = yytext;
    *yylval = str;
    return ICE_STRING_LITERAL;
}
	YY_BREAK
/* ========== Identifiers and Keywords ========== */
case 43:
/* rule 43 can match eol */
YY_RULE_SETUP
#line 481 "src/Slice/Scanner.l"
{
    StringTokPtr ident = make_shared<StringTok>();
    ident->v = *yytext == '\\' ? yytext + 1 : yytext;
    ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f("));
    *yylval = ident;
    if (*yytext == '\\')
    {
        if (checkIsScoped(ident->v) == ICE_SCOPED_IDENTIFIER)
        {
            currentUnit->error("Operation identifiers cannot be scoped: '" + (ident->v) + "'");
        }
        return ICE_IDENT_OPEN;
    }
    int st = checkKeyword(ident->v);
    if (st == ICE_IDENTIFIER)
    {
        return ICE_IDENT_OPEN;
    }
    else if (st == ICE_SCOPED_IDENTIFIER)
    {
        currentUnit->error("Operation identifiers cannot be scoped: '" + (ident->v) + "'");
        return ICE_IDENT_OPEN;
    }
    else if (st == ICE_OPTIONAL)
    {
        return ICE_OPTIONAL_OPEN;
    }
    else
    {
        return ICE_KEYWORD_OPEN;
    }
}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 514 "src/Slice/Scanner.l"
{
    StringTokPtr ident = make_shared<StringTok>();
    ident->v = *yytext == '\\' ? yytext + 1 : yytext;
    *yylval = ident;
    return *yytext == '\\' ? checkIsScoped(ident->v) : checkKeyword(ident->v);
}
	YY_BREAK
/* ========== Whitespace ========== */
/* Matches and consumes any whitespace, except for newlines. */
case 45:
YY_RULE_SETUP
#line 524 "src/Slice/Scanner.l"
{}
	YY_BREAK
/* Matches and consumes newlines, but only when the scanner isn't in a sub-scanner. */
case 46:
/* rule 46 can match eol */
YY_RULE_SETUP
#line 527 "src/Slice/Scanner.l"
{
    nextLine(yyleng);
}
	YY_BREAK
/* ========== Others ========== */
/* Handles UTF-8 BOMs.
   * The scanner has a special 'INITIAL' state, which it enters whenever it hits the start of a file.
   * This occurs when parsing initially begins, but also when we see the start of an '#include'd file.
   * As soon as the scanner sees a token, it will transition into a more specific state: SLICE, METADATA, etc.
   * depending on what token it sees.
   *
   * Since BOMs are only allowed at the beginning of files, we only allow them in this 'INITIAL' state.
   * If we see a BOM in any other state, we emit an error and throw it away. */
case 47:
YY_RULE_SETUP
#line 541 "src/Slice/Scanner.l"
{ /* do nothing */ }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 542 "src/Slice/Scanner.l"
{
    currentUnit->error("encountered unexpected UTF-8 BOM in input; BOMs can only appear at the beginning of files");
}
	YY_BREAK
/* Matches invalid characters, one at a time to make this the 2nd lowest priority rule. All printable ASCII
   * characters are valid (those between 32 and 127 inclusively), anything outside this range is invalid. */
case 49:
/* rule 49 can match eol */
YY_RULE_SETUP
#line 548 "src/Slice/Scanner.l"
{
    stringstream s;
    s << "illegal input character: '\\";
    s.width(3);
    s.fill('0');
    s << oct << static_cast<int>(static_cast<unsigned char>(yytext[0]));
    s << "'";

    currentUnit->error(s.str());
    return BAD_TOKEN;
}
	YY_BREAK
/* Matches any valid character (except newlines) not matched by another rule and fowards it to the parser.
   * This is the lowest priority rule in the scanner, and is only active while not in a sub-scanner. */
case 50:
YY_RULE_SETUP
#line 562 "src/Slice/Scanner.l"
{
    setLocation(yylloc);
    return yytext[0];
}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 567 "src/Slice/Scanner.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 2251 "src/Slice/Scanner.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(SLICE):
case YY_STATE_EOF(METADATA):
	yyterminate();

	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 yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between YY_CURRENT_BUFFER and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
/* %if-c-only */
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
/* %endif */
/* %if-c++-only */
/* %endif */
			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
				{
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
				yy_cp = (yy_last_accepting_cpos);
				yy_current_state = (yy_last_accepting_state);
				goto yy_find_action;
				}
			}

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

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

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

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

				yy_current_state = yy_get_previous_state(  );

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

			case EOB_ACT_LAST_MATCH:
				(yy_c_buf_p) =
				&YY_CURRENT_BUFFER_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 user's declarations */
} /* end of yylex */
/* %ok-for-header */

/* %if-c++-only */
/* %not-for-header */
/* %ok-for-header */

/* %endif */

/* 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
 */
/* %if-c-only */
static int yy_get_next_buffer (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	char *source = (yytext_ptr);
	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_LVALUE;

			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. */
					yyrealloc( (void *) b->yy_ch_buf,
							 (yy_size_t) (b->yy_buf_size + 2)  );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = NULL;

			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), 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;
			yyrestart( yyin  );
			}

		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_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
		/* "- 2" to take care of EOB's */
		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
	}

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

/* %if-c-only */
/* %not-for-header */
    static yy_state_type yy_get_previous_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	yy_state_type yy_current_state;
	char *yy_cp;
    
/* %% [15.0] code to get the start state into yy_current_state goes here */
	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 )
		{
/* %% [16.0] code to find the next state goes here */
		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 >= 220 )
				yy_c = yy_meta[yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 );
 */
/* %if-c-only */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	int yy_is_jam;
    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
	char *yy_cp = (yy_c_buf_p);

	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 >= 220 )
			yy_c = yy_meta[yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	yy_is_jam = (yy_current_state == 219);

		return yy_is_jam ? 0 : yy_current_state;
}

#ifndef YY_NO_UNPUT
/* %if-c-only */

/* %endif */
#endif

/* %if-c-only */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
    static int yyinput (void)
#else
    static int input  (void)
#endif

/* %endif */
/* %if-c++-only */
/* %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 = (int) ((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. */
					yyrestart( yyin );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap(  ) )
						return 0;

					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 yytext */
	(yy_hold_char) = *++(yy_c_buf_p);

/* %% [19.0] update BOL and yylineno */
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');

	return c;
}
/* %if-c-only */
#endif	/* ifndef YY_NO_INPUT */
/* %endif */

/** 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 .
 */
/* %if-c-only */
    void yyrestart  (FILE * input_file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer( yyin, YY_BUF_SIZE );
	}

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

/* %if-c++-only */
/* %endif */

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
/* %if-c-only */
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypop_buffer_state();
	 *		yypush_buffer_state(new_buffer);
     */
	yyensure_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;
	yy_load_buffer_state(  );

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

/* %if-c-only */
static void yy_load_buffer_state  (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
/* %if-c-only */
	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
/* %endif */
/* %if-c++-only */
/* %endif */
	(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.
 */
/* %if-c-only */
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
}

/* %if-c++-only */
/* %endif */

/** Destroy the buffer.
 * @param b a buffer created with yy_create_buffer()
 * 
 */
/* %if-c-only */
    void yy_delete_buffer (YY_BUFFER_STATE  b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
	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 )
		yyfree( (void *) b->yy_ch_buf  );

	yyfree( (void *) b  );
}

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a yyrestart() or at EOF.
 */
/* %if-c-only */
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
/* %endif */
/* %if-c++-only */
/* %endif */

{
	int oerrno = errno;
    
	yy_flush_buffer( b );

/* %if-c-only */
	b->yy_input_file = file;
/* %endif */
/* %if-c++-only */
/* %endif */
	b->yy_fill_buffer = 1;

    /* If b is the current buffer, then yy_init_buffer was _probably_
     * called from yyrestart() 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;
    }

/* %if-c-only */

        b->yy_is_interactive = 0;
    
/* %endif */
/* %if-c++-only */
/* %endif */
	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.
 * 
 */
/* %if-c-only */
    void yy_flush_buffer (YY_BUFFER_STATE  b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	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 )
		yy_load_buffer_state(  );
}

/* %if-c-or-c++ */
/** 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.
 *  
 */
/* %if-c-only */
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	if (new_buffer == NULL)
		return;

	yyensure_buffer_stack();

	/* This block is copied from yy_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 yy_switch_to_buffer. */
	yy_load_buffer_state(  );
	(yy_did_buffer_switch_on_eof) = 1;
}
/* %endif */

/* %if-c-or-c++ */
/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  
 */
/* %if-c-only */
void yypop_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	if (!YY_CURRENT_BUFFER)
		return;

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

	if (YY_CURRENT_BUFFER) {
		yy_load_buffer_state(  );
		(yy_did_buffer_switch_on_eof) = 1;
	}
}
/* %endif */

/* %if-c-or-c++ */
/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
/* %if-c-only */
static void yyensure_buffer_stack (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	yy_size_t 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; /* After all that talk, this was set to 1 anyways... */
		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_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. */
		yy_size_t grow_size = 8 /* arbitrary grow size */;

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_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;
	}
}
/* %endif */

/* %if-c-only */
    static void yy_push_state (int  _new_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
		{
		yy_size_t new_size;

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

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

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

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

	(yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;

	BEGIN(_new_state);
}

/* %if-c-only */
    static void yy_pop_state  (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	if ( --(yy_start_stack_ptr) < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
}

/* %if-c-only */
    static int yy_top_state  (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	return (yy_start_stack)[(yy_start_stack_ptr) - 1];
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

/* %if-c-only */
static void yynoreturn yy_fatal_error (const char* msg )
{
			fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}
/* %endif */
/* %if-c++-only */
/* %endif */

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

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

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

/* %if-c-only */
/* %if-reentrant */
/* %endif */

/** Get the current token.
 * 
 */

/* %if-reentrant */
/* %endif */

/* %endif */

/* %if-reentrant */
/* %if-bison-bridge */
/* %endif */
/* %endif if-c-only */

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

    (yy_buffer_stack) = NULL;
    (yy_buffer_stack_top) = 0;
    (yy_buffer_stack_max) = 0;
    (yy_c_buf_p) = NULL;
    (yy_init) = 0;
    (yy_start) = 0;

    (yy_start_stack_ptr) = 0;
    (yy_start_stack_depth) = 0;
    (yy_start_stack) =  NULL;

/* Defined in main.c */
#ifdef YY_STDINIT
    yyin = stdin;
    yyout = stdout;
#else
    yyin = NULL;
    yyout = NULL;
#endif

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

/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		yy_delete_buffer( YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		yypop_buffer_state();
	}

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

    /* Destroy the start condition stack. */
        yyfree( (yy_start_stack)  );
        (yy_start_stack) = NULL;

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

/* %if-reentrant */
/* %endif */
    return 0;
}
/* %endif */

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

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

void *yyrealloc  (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 realloc(ptr, size);
}

void yyfree (void * ptr )
{
			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

/* %if-tables-serialization definitions */
/* %define-yytables   The name for this specific scanner's tables. */
#define YYTABLES_NAME "yytables"
/* %endif */

/* %ok-for-header */

#line 567 "src/Slice/Scanner.l"


// NOLINTEND

namespace Slice
{
    // Check if an identifier looks like a keyword.
    // If the identifier is a keyword, return the
    // corresponding keyword token; otherwise, return
    // an identifier token.
    int checkKeyword(string& identifier)
    {
        const auto pos = keywordMap.find(identifier);
        if (pos != keywordMap.end())
        {
            if (pos->first != identifier)
            {
                currentUnit->error(
                    "illegal identifier: '" + identifier + "' differs from keyword '" + pos->first +
                    "' only in capitalization");
                identifier = pos->first;
            }
            return pos->second;
        }
        return checkIsScoped(identifier);
    }

    // Checks if an identifier is scoped or not, and returns the corresponding token.
    int checkIsScoped(const string& identifier)
    {
        return identifier.find("::") == string::npos ? ICE_IDENTIFIER : ICE_SCOPED_IDENTIFIER;
    }
}

namespace
{
    void nextLine(int count)
    {
        yylineno += count;
        yycolno = 0;
    }

    int scanPosition(const char* s)
    {
        string line(s);
        // Skip the leading '#', optional 'line', and any whitespace before the line number.
        string::size_type idx = line.find_first_not_of(" \t\r", (line.find('#') + 1));
        if (line.find("line", idx) == idx)
        {
            idx = line.find_first_not_of(" \t\r", (idx + 4));
        }
        line.erase(0, idx);

        // Read the line number
        int newLineNumber = stoi(line.c_str(), &idx) - 1;

        // Scan the remainder of the line for a filename.
        idx = line.find_first_not_of(" \t\r", idx);
        line.erase(0, idx);

        int lineTypeCode = 0;
        if (!line.empty())
        {
            if (line[0] == '"')
            {
                string::size_type edx = line.rfind('"');
                if (edx != string::npos)
                {
                    line = line.substr(1, edx - 1);
                }
                else
                {
                    currentUnit->error("mismatched quotations in line directive");
                    line = line.substr(1);
                }
            }
            lineTypeCode = currentUnit->setCurrentFile(line, newLineNumber);
            yyfilename = string(line);
        }
        yylineno = newLineNumber;
        return lineTypeCode;
    }

    void setLocation(TokenContext* location)
    {
        startLocation(location);
        endLocation(location);
    }

    void startLocation(TokenContext* location)
    {
        location->firstLine = yylineno;
        // The string has already been scanned, so the scanner is positioned at the end of it.
        location->firstColumn = yycolno - yyleng;
        location->filename = yyfilename;
    }

    void endLocation(TokenContext* location)
    {
        location->lastLine = yylineno;
        location->lastColumn = yycolno;
    }

    // This function is always called once, right before scanning begins.
    void initScanner()
    {
        // Ensure the scanner starts at line number 1, column position 0.
        yylineno = 1;

        keywordMap["module"] = ICE_MODULE;
        keywordMap["class"] = ICE_CLASS;
        keywordMap["interface"] = ICE_INTERFACE;
        keywordMap["exception"] = ICE_EXCEPTION;
        keywordMap["struct"] = ICE_STRUCT;
        keywordMap["sequence"] = ICE_SEQUENCE;
        keywordMap["dictionary"] = ICE_DICTIONARY;
        keywordMap["enum"] = ICE_ENUM;
        keywordMap["out"] = ICE_OUT;
        keywordMap["extends"] = ICE_EXTENDS;
        keywordMap["throws"] = ICE_THROWS;
        keywordMap["void"] = ICE_VOID;
        keywordMap["byte"] = ICE_BYTE;
        keywordMap["bool"] = ICE_BOOL;
        keywordMap["short"] = ICE_SHORT;
        keywordMap["int"] = ICE_INT;
        keywordMap["long"] = ICE_LONG;
        keywordMap["float"] = ICE_FLOAT;
        keywordMap["double"] = ICE_DOUBLE;
        keywordMap["string"] = ICE_STRING;
        keywordMap["Object"] = ICE_OBJECT;
        keywordMap["const"] = ICE_CONST;
        keywordMap["false"] = ICE_FALSE;
        keywordMap["true"] = ICE_TRUE;
        keywordMap["idempotent"] = ICE_IDEMPOTENT;
        keywordMap["optional"] = ICE_OPTIONAL;
        keywordMap["Value"] = ICE_VALUE;
    }

    // This function is always called directly after a match has been made, but directly before it's action block is run.
    void preAction()
    {
        yycolno += yyleng;

        // We only use the 'INITIAL' state to consume BOMs, which can only validly be the first match in a file. This
        // function being called means a match has already been made, so we switch states since BOMs are no longer valid.
        if (YY_START == INITIAL)
        {
            BEGIN(SLICE);
        }
    }

    void printStateStack()
    {
        (void)fprintf(stderr, "current state stack [ " );
        for (int i = 0; i < yy_start_stack_ptr; i++)
        {
            (void)fprintf(stderr, "%d ", yy_start_stack[i]);
        }
        (void)fprintf(stderr, "(%d) ]\n", YY_START);
    }

    void pushState(int newState)
    {
        yy_push_state(newState);
        if (yy_flex_debug)
        {
            (void)fprintf(stderr, "--pushed: ");
            printStateStack();
        }
    }

    void popState()
    {
        yy_pop_state();
        if (yy_flex_debug)
        {
            (void)fprintf(stderr, "--popped: ");
            printStateStack();
        }
    }

    // This function is called whenever the scanner encounters an unrecoverable error.
    void yynoreturn fatalError(const char* msg)
    {
        cerr << yyfilename << ":" << yylineno << ":" << yycolno << ": fatal error: " << msg << endl
             << "\tlast matched text: '" << yytext << "'" << endl
             << "\tlast scanner state: '" << YY_START << "'" << endl;
        exit(YY_EXIT_FAILURE);
    }
}

