#line 2 "kate_lexer.c"

#line 4 "kate_lexer.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

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

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

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

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

#if __STDC_VERSION__ >= 199901L

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

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

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

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_CONST

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

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

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

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

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

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

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

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

#define YY_END_OF_BUFFER_CHAR 0

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

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

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

extern int katedesc_leng;

extern FILE *katedesc_in, *katedesc_out;

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

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

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

/* The following is because we cannot portably get our hands on size_t
 * (without autoconf's help, which isn't available because we want
 * flex-generated scanners to compile on their own).
 */

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef unsigned int yy_size_t;
#endif

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

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

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

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

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

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

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

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

	int yy_buffer_status;

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

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

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

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

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

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

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

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

void katedesc_restart (FILE *input_file  );
void katedesc__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE katedesc__create_buffer (FILE *file,int size  );
void katedesc__delete_buffer (YY_BUFFER_STATE b  );
void katedesc__flush_buffer (YY_BUFFER_STATE b  );
void katedesc_push_buffer_state (YY_BUFFER_STATE new_buffer  );
void katedesc_pop_buffer_state (void );

static void katedesc_ensure_buffer_stack (void );
static void katedesc__load_buffer_state (void );
static void katedesc__init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER katedesc__flush_buffer(YY_CURRENT_BUFFER )

YY_BUFFER_STATE katedesc__scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE katedesc__scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE katedesc__scan_bytes (yyconst char *bytes,int len  );

void *katedesc_alloc (yy_size_t  );
void *katedesc_realloc (void *,yy_size_t  );
void katedesc_free (void *  );

#define yy_new_buffer katedesc__create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        katedesc_ensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            katedesc__create_buffer(katedesc_in,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        katedesc_ensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            katedesc__create_buffer(katedesc_in,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

typedef unsigned char YY_CHAR;

FILE *katedesc_in = (FILE *) 0, *katedesc_out = (FILE *) 0;

typedef int yy_state_type;

extern int katedesc_lineno;

int katedesc_lineno = 1;

extern char *katedesc_text;
#define yytext_ptr katedesc_text

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

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

#define YY_NUM_RULES 145
#define YY_END_OF_BUFFER 146
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static yyconst flex_int16_t yy_accept[687] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      146,    3,    3,   16,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,  144,
       15,   16,  144,  144,  144,  144,  144,  144,  144,  137,
      137,  144,  144,  144,  144,  144,  144,  144,  144,  144,
      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
      144,  144,  144,    5,    7,    5,  145,  145,    9,   10,
       12,   13,  145,   15,    0,  136,    0,   14,    0,   18,

        0,  137,  137,    0,  139,  139,  141,    0,  141,    0,
        0,    0,   46,   61,    0,   29,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,   86,  134,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,   60,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,   64,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    1,    4,    5,    6,    0,    8,    9,   10,

       12,   11,    0,   18,   51,    0,    0,    0,    0,  141,
      138,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,   48,
        0,    0,    0,    0,   62,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,  116,
        0,    0,    0,    0,    0,  116,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      105,    0,    0,  108,  117,    0,    0,    0,    0,  117,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,   98,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    2,    0,  140,    0,  141,
        0,    0,    0,    0,   87,    0,    0,    0,    0,    0,
      107,   79,    0,    0,    0,    0,    0,   19,    0,   83,
        0,   45,    0,    0,    0,   75,    0,   63,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,   17,
        0,    0,   78,   97,    0,    0,    0,    0,    0,    0,
        0,  115,    0,    0,    0,   55,    0,    0,   69,    0,
        0,    0,    0,    0,    0,    0,    0,   93,    0,    0,
        0,    0,    0,    0,    0,    0,   33,    0,    0,    0,
        0,    0,    0,   27,   49,    0,    0,   81,    0,    0,

        0,    0,    0,   41,    0,  114,  113,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,   30,    0,   26,
        0,    0,    0,    0,   20,    0,   77,   54,  132,    0,
        0,    0,    0,   38,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  111,    0,   65,    0,    0,    0,    0,
        0,   67,    0,    0,    0,  135,    0,    0,  121,   80,
        0,    0,   76,    0,   99,    0,    0,    0,    0,   94,
        0,    0,   47,    0,    0,   24,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,   95,    0,    0,
        0,    0,   73,  100,    0,  110,    0,    0,   74,    0,

        0,   23,    0,    0,    0,    0,   34,    0,   96,    0,
       40,    0,    0,    0,    0,    0,    0,  126,    0,    0,
      101,   31,  109,    0,   52,  112,    0,    0,    0,  120,
        0,   37,    0,    0,   25,    0,    0,    0,    0,    0,
        0,   82,   44,  125,   90,    0,    0,    0,    0,    0,
        0,   35,    0,    0,    0,    0,  142,    0,    0,    0,
      129,    0,    0,   22,   36,    0,    0,    0,   92,   39,
        0,    0,   88,  106,  116,    0,    0,   53,  102,    0,
       72,  123,    0,  133,    0,  117,    0,    0,   70,    0,
        0,  119,  118,    0,    0,   43,   42,    0,   84,    0,

        0,    0,    0,   85,    0,    0,   50,   57,    0,   58,
       21,    0,    0,    0,   91,   32,    0,    0,    0,    0,
       66,    0,  104,  143,   59,    0,    0,    0,    0,    0,
        0,    0,    0,    0,   68,   56,    0,   89,   28,    0,
        0,    0,  103,    0,  124,  122,    0,    0,    0,  127,
        0,    0,    0,    0,  128,    0,    0,    0,    0,    0,
        0,   71,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  130,    0,
        0,    0,    0,    0,  131,    0
    } ;

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

       23,   24,   25,   26,   27,   28,   29,   30,   31,   32,
       33,   34,   35,   36,   37,   38,   39,   40,   41,   42,
       43,   44,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,   45,    1,    1,    1,
       46,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,   47,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,   48,   49
    } ;

static yyconst flex_int32_t yy_meta[50] =
    {   0,
        1,    1,    2,    1,    1,    1,    1,    3,    1,    1,
        1,    1,    4,    4,    4,    1,    5,    6,    7,    7,
        7,    7,    7,    7,    6,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
        6,    6,    6,    6,    1,    1,    1,    1,    1
    } ;

static yyconst flex_int16_t yy_base[700] =
    {   0,
        0,    0,   49,    0,   96,   98,  106,    0,  153,  154,
     1060, 1061, 1057, 1061, 1061, 1053,  169,    0,  147,  153,
      160, 1045,  183,  188,  139,  185,  146,  190,  188,  188,
      150,  212,  205, 1017, 1036,  217,  230, 1021, 1029,  233,
      249,  244,  258,  163,  274,  253, 1007, 1002, 1002, 1061,
     1047, 1061, 1043,  310,    0,  289,  295,  301,  197,  324,
      329,  208,  326,  288,  331,  219,  284,  151,  341,  343,
     1008, 1027,  353,  265, 1012, 1020,  360,  375,  378,  391,
      182,  400,  376,    0, 1061,    0,  246, 1061, 1041,    0,
        0, 1061, 1039, 1039, 1035, 1061, 1036, 1061,  426,    0,

      342,  419,  440, 1022,  445,  451,  456, 1034,  462,  479,
        0, 1009, 1061, 1014,  990, 1061,  995,  209,  998,  290,
     1004,  377,  994, 1005,  992, 1008,  990, 1003, 1001,  985,
      986,  243,  317,  978, 1001,  989,  995,  990,  993,  979,
      987, 1061,  975,  993,  974,  972,  973,  246,  984,  975,
      985,  969,  348,  966,  973,   67,  970,  977,  387,  964,
      957,  973,  351,  974,  966,  357,  970, 1061,  969,  963,
      436,  965,  317,  952,  454,  970,  947,  957,  953,  966,
      963,  961,  953,  949,  958,  944,  942,  945,  955,  940,
      956,  928, 1061, 1061,    0, 1061,  423, 1061,  971,    0,

        0, 1061,  485,    0, 1061,    0,  501,  969,  467,  488,
        0,  946,  941,  942,  937,  945,  928,  935,  924,  405,
      929,  939,  928,  929,  919,  459,  935,  916,  937,  918,
      922,  930,  915,  913, 1061,  919,  918,  914,  915,  919,
      913,  919,  919,  915,  916,  917,  909,  900,  914,  918,
      910,  896,  895,  909,  912,  912,  893,  894,  466,  908,
      896,  891,  897,  900,  885,  898,  894,  882,  416,  895,
     1061,  885,  889, 1061,  897,  889,  890,  885,  885,  892,
      308,  890,  884,  873,  883,  869,  481,  877,  873,  884,
      863,  877, 1061,  881,  875,  861,  869,  857,  862,  855,

      865,  857,  852,  867,  854, 1061,  507,    0,  510,  519,
      855,  861,  862,  865, 1061,  850,  855,  862,  855,  840,
     1061, 1061,  842,  854,  853,  836,  842, 1061,  852, 1061,
      834, 1061,  833,  834,  831, 1061,  845, 1061,  841,  827,
      840,  826,  837,  824,  817,  834,  823,  831,  830, 1061,
      818,  816, 1061,  836,  834,  822,  813,  817,  822,  821,
      184, 1061,  820,  820,  812, 1061,  821,  805, 1061,  819,
      818,  807,  809,  800,  799,  798,  812, 1061,  801,  795,
      794,  799,  803,  797,  790,  797, 1061,  805,  787,  797,
      794,  799,  482, 1061,  801,  505,  784, 1061,  794,  780,

      779,  789,  795, 1061,  788, 1061, 1061,  529,  782,  776,
      775,  776,  778,  776,  770,  773,  775,  767,  771, 1061,
      772,  778,  762,  772, 1061,  766, 1061, 1061, 1061,  767,
      764,  772,  756, 1061,  760,  754,  759,  769,  765,  773,
      768,  748,  749, 1061,  746, 1061,  751,  750,  745,  746,
      746, 1061,  746,  739,  738, 1061,  743,  752,  736,  517,
      745,  756, 1061,  738,  751,  730,  745,  733,  727, 1061,
      741,  740,  725,  740,  737, 1061,  744,  743,  738,  718,
      717,  724,  721,  719,  728,  729,  719, 1061,  542,  725,
      714,  728, 1061, 1061,  722, 1061,  708,  713, 1061,  704,

      703, 1061,  713,  706,  719,  714, 1061,  700, 1061,  703,
     1061,  715,  696,  689,  711,  705,  696, 1061,  708,  702,
      689, 1061, 1061,  693, 1061, 1061,  701,  685,  695, 1061,
      685, 1061,  687,  699, 1061,  680,  697,  697,  683,  687,
      695, 1061, 1061, 1061, 1061,  676,  681,  673,  673,  678,
      680, 1061,  675,  669,  685,  680,  554,  670,  662,  679,
     1061,  656,  680, 1061, 1061,  664,  664,  665, 1061, 1061,
      656,  663, 1061, 1061, 1061,  669,  673, 1061, 1061,  652,
     1061,  670,  667, 1061,  655, 1061,  653,  649, 1061,  663,
      645, 1061, 1061,  659,  649, 1061, 1061,  650, 1061,  566,

      641,  646,  638, 1061,  640,  643, 1061, 1061,  655, 1061,
     1061,  637,  646,  646, 1061, 1061,  652,  626,  631,  640,
     1061,  643, 1061,  662, 1061,  641,  642,  626,  639,  617,
      616,  603,  613,  599, 1061, 1061,  592, 1061, 1061,  595,
      553,  553, 1061,  557, 1061, 1061,  549,  548,  549, 1061,
      533,  533,  534,  525, 1061,  508,  500,  499,  518,  470,
      459, 1061,  453,  429,  418,  418,  404,  508,  396,  372,
      361,  342,  344,  296,  296,  276,  254,  244, 1061,  210,
      201,  180,  144,  133, 1061, 1061,  590,  597,  604,  611,
      613,  620,  627,  631,  638,  642,  649,  653,  657

    } ;

static yyconst flex_int16_t yy_def[700] =
    {   0,
      686,    1,  686,    3,  687,  687,  686,    7,  688,  688,
      686,  686,  686,  686,  686,  689,  690,  691,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  689,  690,  691,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  692,  686,  692,  693,  686,  686,  694,
      695,  686,  686,  686,  689,  686,  690,  686,   54,  696,

      686,  686,  686,  686,  686,  686,  686,  697,  686,  686,
      698,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  692,  686,  693,  686,  686,  694,

      695,  686,   54,  696,  686,  699,  686,  697,  686,  686,
      698,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,

      686,  686,  686,  686,  686,  686,   54,  699,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,

      686,  686,  686,  686,  686,  686,  686,   54,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,   54,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,

      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,   54,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,   54,

      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  690,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,    0,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686

    } ;

static yyconst flex_int16_t yy_nxt[1111] =
    {   0,
       12,   13,   14,   15,   16,   17,   18,   12,   19,   20,
       21,   22,   23,   24,   24,   12,   12,   12,   25,   26,
       27,   28,   29,   30,   31,   32,   33,   34,   35,   36,
       37,   38,   39,   40,   12,   41,   42,   43,   44,   45,
       46,   12,   12,   12,   12,   12,   47,   48,   49,   50,
       51,   14,   52,   53,   54,   55,   50,   56,   57,   58,
       59,   60,   61,   61,   50,   50,   50,   62,   63,   64,
       65,   66,   67,   68,   69,   70,   71,   72,   73,   74,
       75,   76,   77,   50,   78,   79,   80,   81,   82,   83,
       50,   50,   50,   50,   50,   50,   50,   50,   85,   86,

       85,   86,  262,   87,  263,   87,   88,   89,   88,   88,
       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,   88,   90,   90,   90,   90,   90,   90,   90,
       90,   90,   90,   90,   90,   90,   90,   90,   90,   90,
       90,   90,   90,   90,   90,   90,   90,   90,   90,   90,
       88,   88,   88,   88,   88,   92,   92,  101,  685,  102,
      103,  103,  104,  101,  120,  105,  106,  106,  112,   93,
       93,   98,  107,  107,  107,  121,  113,  684,  122,  134,
      134,   99,   99,   99,  123,  135,  135,   99,   99,   99,
       99,   99,   99,  109,  181,  103,  103,  103,  109,  182,

      103,  103,  103,  114,  194,  110,  449,  115,  108,  116,
      110,  117,  124,  181,  131,  683,  125,  118,  182,  128,
      132,  119,  450,  133,  111,  126,  142,  129,  127,  130,
      136,  147,  137,  682,  138,  148,  143,  112,  216,  149,
      681,  139,  144,  150,  140,  113,  217,  141,  153,  151,
      128,  159,  154,  197,  152,  160,  155,  198,  129,  161,
      130,  680,  156,  165,  162,  163,  171,  166,  164,  172,
      173,  167,  176,  168,  234,  169,  174,  251,  235,  189,
      177,  175,  252,  153,  178,  190,  170,  154,  191,  679,
      179,  155,  183,  184,  185,  180,  186,  156,  678,  101,

      187,  102,  103,  103,  104,  101,  120,  105,  106,  106,
      131,  188,   98,  107,  107,  107,  132,  121,  677,  133,
      122,  219,   99,   99,   99,  676,  123,  220,   99,   99,
       99,   99,   99,   99,  109,  236,  103,  103,  103,  109,
      382,  103,  103,  103,  114,  383,  110,  284,  115,  237,
      116,  110,  117,  124,  107,  107,  107,  125,  118,  136,
      285,  137,  119,  138,  142,  111,  126,  147,  257,  127,
      139,  148,  675,  140,  143,  149,  141,  272,  159,  150,
      144,  258,  160,  259,  674,  151,  161,  273,  276,  165,
      152,  162,  163,  166,  277,  164,  673,  167,  222,  168,

      171,  169,  189,  172,  173,  176,  223,  224,  190,  672,
      174,  191,  170,  177,  671,  175,  266,  178,  183,  184,
      185,  668,  186,  179,  267,  268,  187,  319,  180,  109,
      197,  103,  103,  103,  198,  320,  371,  188,  203,  203,
      203,  110,  372,  667,  203,  203,  203,  203,  203,  203,
      109,  666,  103,  103,  103,  109,  281,  106,  106,  106,
      111,  109,  110,  106,  106,  106,  282,  110,  107,  107,
      107,  665,  287,  110,  107,  107,  107,  326,  207,  210,
      210,  210,  664,  663,  110,  327,  206,  209,  209,  288,
      360,  210,  210,  210,  361,  328,  289,  307,  307,  307,

      210,  210,  210,  307,  307,  307,  307,  307,  307,  309,
      309,  477,  662,  310,  310,  310,  389,  478,  390,  408,
      408,  408,  310,  310,  310,  408,  408,  408,  408,  408,
      408,  310,  310,  310,  480,  661,  586,  575,  669,  531,
      481,  489,  489,  489,  670,  660,  659,  489,  489,  489,
      489,  489,  489,  532,  557,  557,  557,  658,  657,  656,
      557,  557,  557,  557,  557,  557,  600,  600,  600,  655,
      654,  653,  600,  600,  600,  600,  600,  600,  624,  624,
      624,  652,  651,  650,  624,  624,  624,  624,  624,  624,
       84,   84,   84,   84,   84,   84,   84,   91,   91,   91,

       91,   91,   91,   91,   95,   95,   95,   95,   95,   95,
       95,   97,   97,   97,   97,   97,   97,   97,  100,  100,
      195,  649,  648,  195,  195,  195,  195,  196,  647,  196,
      196,  196,  196,  196,  200,  646,  200,  200,  201,  645,
      201,  201,  644,  201,  201,  204,  643,  204,  204,  208,
      208,  208,  208,  208,  208,  208,  211,  642,  641,  211,
      308,  640,  639,  308,   98,  638,  637,  636,  635,  634,
      633,  632,  631,  630,  629,  628,  627,  626,  625,  623,
      622,  621,  620,  619,  618,  617,  616,  615,  614,  613,
      612,  611,  610,  609,  608,  607,  606,  605,  604,  603,

      602,  601,  599,  598,  597,  596,  595,  593,  592,  594,
      593,  592,  591,  590,  589,  588,  586,  587,  586,  585,
      584,  583,  582,  581,  580,  579,  578,  575,  577,  576,
      575,  574,  573,  572,  571,  570,  569,  568,  567,  566,
      565,  564,  563,  562,  561,  560,  559,  558,  556,  555,
      554,  553,  552,  551,  550,  549,  548,  547,  546,  545,
      544,  543,  542,  541,  540,  539,  538,  537,  536,  535,
      534,  533,  530,  529,  528,  527,  526,  525,  524,  523,
      522,  521,  520,  519,  518,  517,  516,  515,  514,  513,
      512,  511,  510,  509,  508,  507,  506,  505,  504,  503,

      502,  501,  500,  499,  498,  497,  496,  495,  494,  493,
      492,  491,  490,  488,  487,  486,  485,  484,  483,  482,
      479,  476,  475,  474,  473,  472,  471,  470,  469,  468,
      467,  466,  465,  464,  463,  462,  461,  460,  459,  458,
      457,  456,  455,  454,  453,  452,  451,  448,  447,  446,
      445,  444,  443,  442,  441,  440,  439,  438,  437,  436,
      435,  434,  433,  432,  431,  430,  429,  428,  427,  426,
      425,  424,  423,  422,  421,  420,  419,  418,  417,  416,
      415,  414,  413,  412,  411,  410,  409,  407,  406,  405,
      404,  403,  402,  401,  400,  399,  398,  397,  396,  395,

      394,  393,  392,  391,  388,  387,  386,  385,  384,  381,
      380,  379,  378,  377,  376,  375,  374,  373,  370,  369,
      368,  367,  366,  365,  364,  363,  362,  359,  358,  357,
      356,  355,  354,  353,  352,  351,  350,  349,  348,  347,
      346,  345,  344,  343,  342,  341,  340,  339,  338,  337,
      336,  335,  334,  333,  332,  331,  330,  329,  325,  324,
      323,  322,  321,  318,  317,  316,  315,  314,  313,  312,
      311,   98,  199,  306,  305,  304,  303,  302,  301,  300,
      299,  298,  297,  296,  295,  294,  293,  292,  291,  290,
      286,  283,  280,  279,  278,  275,  274,  271,  270,  269,

      265,  264,  261,  260,  256,  255,  254,  253,  250,  249,
      248,  247,  246,  245,  244,  243,  242,  241,  240,  239,
      238,  233,  232,  231,  230,  229,  228,  227,  226,  225,
      221,  218,  215,  214,  213,  212,   98,  205,   98,   96,
       94,  202,  199,  158,  157,  146,  145,   96,   94,  193,
      193,  192,  158,  157,  146,  145,  108,   96,   94,  686,
       11,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,

      686,  686,  686,  686,  686,  686,  686,  686,  686,  686
    } ;

static yyconst flex_int16_t yy_chk[1111] =
    {   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,    1,    1,    1,    1,    1,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    5,    5,

        6,    6,  156,    5,  156,    6,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    9,   10,   19,  684,   19,
       19,   19,   20,   20,   27,   20,   20,   20,   25,    9,
       10,   17,   21,   21,   21,   27,   25,  683,   27,   31,
       68,   17,   17,   17,   27,   31,   68,   17,   17,   17,
       17,   17,   17,   23,   44,   23,   23,   23,   24,   44,

       24,   24,   24,   26,   59,   23,  361,   26,   59,   26,
       24,   26,   28,   81,   30,  682,   28,   26,   81,   29,
       30,   26,  361,   30,   23,   28,   33,   29,   28,   29,
       32,   36,   32,  681,   32,   36,   33,   62,  118,   36,
      680,   32,   33,   36,   32,   62,  118,   32,   37,   36,
       66,   40,   37,   87,   36,   40,   37,   87,   66,   40,
       66,  678,   37,   41,   40,   40,   42,   41,   40,   42,
       42,   41,   43,   41,  132,   41,   42,  148,  132,   46,
       43,   42,  148,   74,   43,   46,   41,   74,   46,  677,
       43,   74,   45,   45,   45,   43,   45,   74,  676,   56,

       45,   56,   56,   56,   57,   57,   64,   57,   57,   57,
       67,   45,   54,   58,   58,   58,   67,   64,  675,   67,
       64,  120,   54,   54,   54,  674,   64,  120,   54,   54,
       54,   54,   54,   54,   60,  133,   60,   60,   60,   61,
      281,   61,   61,   61,   63,  281,   60,  173,   63,  133,
       63,   61,   63,   65,  101,  101,  101,   65,   63,   69,
      173,   69,   63,   69,   70,   60,   65,   73,  153,   65,
       69,   73,  673,   69,   70,   73,   69,  163,   77,   73,
       70,  153,   77,  153,  672,   73,   77,  163,  166,   78,
       73,   77,   77,   78,  166,   77,  671,   78,  122,   78,

       79,   78,   83,   79,   79,   80,  122,  122,   83,  670,
       79,   83,   78,   80,  669,   79,  159,   80,   82,   82,
       82,  667,   82,   80,  159,  159,   82,  220,   80,  102,
      197,  102,  102,  102,  197,  220,  269,   82,   99,   99,
       99,  102,  269,  666,   99,   99,   99,   99,   99,   99,
      103,  665,  103,  103,  103,  105,  171,  105,  105,  105,
      102,  106,  103,  106,  106,  106,  171,  105,  107,  107,
      107,  664,  175,  106,  109,  109,  109,  226,  107,  209,
      209,  209,  663,  661,  109,  226,  105,  110,  110,  175,
      259,  110,  110,  110,  259,  226,  175,  203,  203,  203,

      210,  210,  210,  203,  203,  203,  203,  203,  203,  207,
      207,  393,  660,  207,  207,  207,  287,  393,  287,  307,
      307,  307,  309,  309,  309,  307,  307,  307,  307,  307,
      307,  310,  310,  310,  396,  659,  658,  657,  668,  460,
      396,  408,  408,  408,  668,  656,  654,  408,  408,  408,
      408,  408,  408,  460,  489,  489,  489,  653,  652,  651,
      489,  489,  489,  489,  489,  489,  557,  557,  557,  649,
      648,  647,  557,  557,  557,  557,  557,  557,  600,  600,
      600,  644,  642,  641,  600,  600,  600,  600,  600,  600,
      687,  687,  687,  687,  687,  687,  687,  688,  688,  688,

      688,  688,  688,  688,  689,  689,  689,  689,  689,  689,
      689,  690,  690,  690,  690,  690,  690,  690,  691,  691,
      692,  640,  637,  692,  692,  692,  692,  693,  634,  693,
      693,  693,  693,  693,  694,  633,  694,  694,  695,  632,
      695,  695,  631,  695,  695,  696,  630,  696,  696,  697,
      697,  697,  697,  697,  697,  697,  698,  629,  628,  698,
      699,  627,  626,  699,  624,  622,  620,  619,  618,  617,
      614,  613,  612,  609,  606,  605,  603,  602,  601,  598,
      595,  594,  591,  590,  588,  587,  585,  583,  582,  580,
      577,  576,  572,  571,  568,  567,  566,  563,  562,  560,

      559,  558,  556,  555,  554,  553,  551,  550,  549,  548,
      547,  546,  541,  540,  539,  538,  537,  536,  534,  533,
      531,  529,  528,  527,  524,  521,  520,  519,  517,  516,
      515,  514,  513,  512,  510,  508,  506,  505,  504,  503,
      501,  500,  498,  497,  495,  492,  491,  490,  487,  486,
      485,  484,  483,  482,  481,  480,  479,  478,  477,  475,
      474,  473,  472,  471,  469,  468,  467,  466,  465,  464,
      462,  461,  459,  458,  457,  455,  454,  453,  451,  450,
      449,  448,  447,  445,  443,  442,  441,  440,  439,  438,
      437,  436,  435,  433,  432,  431,  430,  426,  424,  423,

      422,  421,  419,  418,  417,  416,  415,  414,  413,  412,
      411,  410,  409,  405,  403,  402,  401,  400,  399,  397,
      395,  392,  391,  390,  389,  388,  386,  385,  384,  383,
      382,  381,  380,  379,  377,  376,  375,  374,  373,  372,
      371,  370,  368,  367,  365,  364,  363,  360,  359,  358,
      357,  356,  355,  354,  352,  351,  349,  348,  347,  346,
      345,  344,  343,  342,  341,  340,  339,  337,  335,  334,
      333,  331,  329,  327,  326,  325,  324,  323,  320,  319,
      318,  317,  316,  314,  313,  312,  311,  305,  304,  303,
      302,  301,  300,  299,  298,  297,  296,  295,  294,  292,

      291,  290,  289,  288,  286,  285,  284,  283,  282,  280,
      279,  278,  277,  276,  275,  273,  272,  270,  268,  267,
      266,  265,  264,  263,  262,  261,  260,  258,  257,  256,
      255,  254,  253,  252,  251,  250,  249,  248,  247,  246,
      245,  244,  243,  242,  241,  240,  239,  238,  237,  236,
      234,  233,  232,  231,  230,  229,  228,  227,  225,  224,
      223,  222,  221,  219,  218,  217,  216,  215,  214,  213,
      212,  208,  199,  192,  191,  190,  189,  188,  187,  186,
      185,  184,  183,  182,  181,  180,  179,  178,  177,  176,
      174,  172,  170,  169,  167,  165,  164,  162,  161,  160,

      158,  157,  155,  154,  152,  151,  150,  149,  147,  146,
      145,  144,  143,  141,  140,  139,  138,  137,  136,  135,
      134,  131,  130,  129,  128,  127,  126,  125,  124,  123,
      121,  119,  117,  115,  114,  112,  108,  104,   97,   95,
       94,   93,   89,   76,   75,   72,   71,   53,   51,   49,
       48,   47,   39,   38,   35,   34,   22,   16,   13,   11,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,
      686,  686,  686,  686,  686,  686,  686,  686,  686,  686,

      686,  686,  686,  686,  686,  686,  686,  686,  686,  686
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int katedesc__flex_debug;
int katedesc__flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
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 *katedesc_text;
#line 1 "kate_lexer.l"
/* Copyright (C) 2008 Vincent Penquerc'h.
   This file is part of the Kate codec library.
   Written by Vincent Penquerc'h.

   Use, distribution and reproduction of this library is governed
   by a BSD style source license included with this source in the
   file 'COPYING'. Please read these terms before distributing. */
#line 11 "kate_lexer.l"

#define KATE_INTERNAL
#include "kate_internal.h"

#include <stdarg.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "kate/kate.h"
#include "katedesc.h"
#include "kate_parser.h"

#define YY_DECL extern int katedesc_lex(YYSTYPE *lvalp)

static int previous_state=-1;

static size_t nmacros=0;
static char **macro_names=NULL;
static char **macro_bodies=NULL;

static void replace_macro(const char *name);
static const char *find_macro(const char *name);

static void process_nlines(const char *text);

static int freeze_nlines=0;

static YY_BUFFER_STATE main_buffer=NULL;

int nlines=1;

/* string   [a-zA-Z ,\.;:!\?\-\(\)\'\`0-9#/\\:@%_]+ */



/* single_quoted_string \'[^\<\>\&']*\' */
/* double_quoted_string \"[^\<\>\&"]*\" */
/* single_quoted_string \'[^']*\' */
/* double_quoted_string \"[^"\n]*\" */
#line 977 "kate_lexer.c"

#define INITIAL 0
#define NORMAL 1
#define BLOCK_COMMENT 2
#define MACRO_1 3
#define MACRO_2 4

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

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

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

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

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

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

#ifndef YY_NO_INPUT

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

#endif

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

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

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

#endif

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

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

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

/* end tables serialization structures and prototypes */

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

extern int katedesc_lex (void);

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

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

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

#define YY_RULE_SETUP \
	YY_USER_ACTION

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



#line 1136 "kate_lexer.c"

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

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! katedesc_in )
			katedesc_in = stdin;

		if ( ! katedesc_out )
			katedesc_out = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			katedesc_ensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				katedesc__create_buffer(katedesc_in,YY_BUF_SIZE );
		}

		katedesc__load_buffer_state( );
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		(yy_more_len) = 0;
		if ( (yy_more_flag) )
			{
			(yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
			(yy_more_flag) = 0;
			}
		yy_cp = (yy_c_buf_p);

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

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

		yy_current_state = (yy_start);
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				(yy_last_accepting_state) = yy_current_state;
				(yy_last_accepting_cpos) = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 687 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_current_state != 686 );
		yy_cp = (yy_last_accepting_cpos);
		yy_current_state = (yy_last_accepting_state);

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

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

		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = (yy_hold_char);
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
			goto yy_find_action;

case 1:
YY_RULE_SETUP
#line 84 "kate_lexer.l"
{
                                      fprintf(stderr,"This file seems to be encoded in UTF-16, Kate only supports UTF-8\n");
                                      fprintf(stderr,"You will need to convert it to UTF-8 first (eg, use iconv)\n");
                                    }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 88 "kate_lexer.l"
{BEGIN(NORMAL);}
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 89 "kate_lexer.l"
{yyless(0);BEGIN(NORMAL);}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 91 "kate_lexer.l"
{previous_state=NORMAL;BEGIN(BLOCK_COMMENT);}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 92 "kate_lexer.l"
{}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 93 "kate_lexer.l"
{}
	YY_BREAK
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 94 "kate_lexer.l"
{if (!freeze_nlines) nlines++;}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 95 "kate_lexer.l"
{BEGIN(previous_state);}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 97 "kate_lexer.l"
{}
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 98 "kate_lexer.l"
{BEGIN(MACRO_2);lvalp->string=katedesc_text;return IDENTIFIER;}
	YY_BREAK
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 100 "kate_lexer.l"
{katedesc_text[katedesc_leng-2]=' ';yymore();}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 101 "kate_lexer.l"
{yymore();}
	YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
#line 102 "kate_lexer.l"
{BEGIN(previous_state);lvalp->string=katedesc_text;process_nlines(katedesc_text);return MACRO_BODY;}
	YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 104 "kate_lexer.l"
{if (!freeze_nlines) nlines++;}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 105 "kate_lexer.l"
{}
	YY_BREAK
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
#line 106 "kate_lexer.l"
{if (!freeze_nlines) nlines++;}
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 108 "kate_lexer.l"
{return KATE;}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 110 "kate_lexer.l"
{replace_macro(katedesc_text+1);}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 112 "kate_lexer.l"
{return DEFS;}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 113 "kate_lexer.l"
{return EVENT;}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 114 "kate_lexer.l"
{return LANGUAGE;}
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 115 "kate_lexer.l"
{return COMMENT;}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 116 "kate_lexer.l"
{return DEFINE;}
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 117 "kate_lexer.l"
{return STYLE;}
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 118 "kate_lexer.l"
{return REGION;}
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 119 "kate_lexer.l"
{return CURVE;}
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 120 "kate_lexer.l"
{return TEXT;}
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 121 "kate_lexer.l"
{return BACKGROUND;}
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 122 "kate_lexer.l"
{return BACKGROUND;}
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 123 "kate_lexer.l"
{return COLOR;}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 124 "kate_lexer.l"
{return MARKER;}
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 125 "kate_lexer.l"
{return POSITION;}
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 126 "kate_lexer.l"
{return SIZE;}
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 127 "kate_lexer.l"
{return HALIGN;}
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 128 "kate_lexer.l"
{return VALIGN;}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 129 "kate_lexer.l"
{return DEFAULT;}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 130 "kate_lexer.l"
{return POINTS;}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 131 "kate_lexer.l"
{return HLEFT;}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 132 "kate_lexer.l"
{return HCENTER;}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 133 "kate_lexer.l"
{return HRIGHT;}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 134 "kate_lexer.l"
{return VTOP;}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 135 "kate_lexer.l"
{return VCENTER;}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 136 "kate_lexer.l"
{return VBOTTOM;}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 137 "kate_lexer.l"
{return STARTS;}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 138 "kate_lexer.l"
{return ENDS;}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 139 "kate_lexer.l"
{return AT;}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 140 "kate_lexer.l"
{return START;}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 141 "kate_lexer.l"
{return END;}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 142 "kate_lexer.l"
{return TIME;}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 143 "kate_lexer.l"
{return DURATION;}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 144 "kate_lexer.l"
{return ARROW;}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 145 "kate_lexer.l"
{return MOTION;}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 146 "kate_lexer.l"
{return MAPPING;}
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 147 "kate_lexer.l"
{return FRAME;}
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 148 "kate_lexer.l"
{return NONE;}
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 149 "kate_lexer.l"
{return SEMANTICS;}
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 150 "kate_lexer.l"
{return EXTERNAL;}
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 151 "kate_lexer.l"
{return INTERNAL;}
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 152 "kate_lexer.l"
{return ALIGNMENT;}
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 153 "kate_lexer.l"
{return RG;}
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 154 "kate_lexer.l"
{return BA;}
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 155 "kate_lexer.l"
{return FOR;}
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 156 "kate_lexer.l"
{return FROM;}
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 157 "kate_lexer.l"
{return TO;}
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 158 "kate_lexer.l"
{return MACRO;}
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 159 "kate_lexer.l"
{return TIMEBASE;}
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 160 "kate_lexer.l"
{return MORPH;}
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 161 "kate_lexer.l"
{return SECONDARY;}
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 162 "kate_lexer.l"
{return PATH;}
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 163 "kate_lexer.l"
{return SECTION;}
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 164 "kate_lexer.l"
{return DIRECTIONALITY;}
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 165 "kate_lexer.l"
{return PALETTE;}
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 166 "kate_lexer.l"
{return BITMAP;}
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 167 "kate_lexer.l"
{return COLORS;}
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 168 "kate_lexer.l"
{return FONT;}
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 169 "kate_lexer.l"
{return RANGE;}
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 170 "kate_lexer.l"
{return FIRST;}
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 171 "kate_lexer.l"
{return LAST;}
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 172 "kate_lexer.l"
{return CODE;}
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 173 "kate_lexer.l"
{return POINT;}
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 174 "kate_lexer.l"
{return USER;}
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 175 "kate_lexer.l"
{return SOURCE;}
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 176 "kate_lexer.l"
{return DRAW;}
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 177 "kate_lexer.l"
{return VISIBLE;}
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 178 "kate_lexer.l"
{return CATEGORY;}
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 179 "kate_lexer.l"
{return ID;}
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 180 "kate_lexer.l"
{return BOLD;}
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 181 "kate_lexer.l"
{return ITALICS;}
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 182 "kate_lexer.l"
{return UNDERLINE;}
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 183 "kate_lexer.l"
{return STRIKE;}
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 184 "kate_lexer.l"
{return PERIODIC;}
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 185 "kate_lexer.l"
{return GRANULE;}
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 186 "kate_lexer.l"
{return RATE;}
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 187 "kate_lexer.l"
{return SHIFT;}
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 188 "kate_lexer.l"
{return WIDTH;}
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 189 "kate_lexer.l"
{return HEIGHT;}
	YY_BREAK
case 97:
YY_RULE_SETUP
#line 190 "kate_lexer.l"
{return LEFT;}
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 191 "kate_lexer.l"
{return TOP;}
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 192 "kate_lexer.l"
{return RIGHT;}
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 193 "kate_lexer.l"
{return BOTTOM;}
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 194 "kate_lexer.l"
{return MARGIN;}
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 195 "kate_lexer.l"
{return MARGINS;}
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 196 "kate_lexer.l"
{return HORIZONTAL;}
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 197 "kate_lexer.l"
{return VERTICAL;}
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 198 "kate_lexer.l"
{return PNG;}
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 199 "kate_lexer.l"
{return JUSTIFY;}
	YY_BREAK
case 107:
YY_RULE_SETUP
#line 200 "kate_lexer.l"
{return CLIP;}
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 201 "kate_lexer.l"
{return PRE;}
	YY_BREAK
case 109:
YY_RULE_SETUP
#line 202 "kate_lexer.l"
{return MARKUP;}
	YY_BREAK
case 110:
YY_RULE_SETUP
#line 203 "kate_lexer.l"
{return CANVAS;}
	YY_BREAK
case 111:
YY_RULE_SETUP
#line 204 "kate_lexer.l"
{return LOCAL;}
	YY_BREAK
case 112:
YY_RULE_SETUP
#line 205 "kate_lexer.l"
{return OFFSET;}
	YY_BREAK
case 113:
YY_RULE_SETUP
#line 206 "kate_lexer.l"
{return WRAP;}
	YY_BREAK
case 114:
YY_RULE_SETUP
#line 207 "kate_lexer.l"
{return WORD;}
	YY_BREAK
case 115:
YY_RULE_SETUP
#line 208 "kate_lexer.l"
{return META;}
	YY_BREAK
case 116:
YY_RULE_SETUP
#line 212 "kate_lexer.l"
{return L2R_T2B;}
	YY_BREAK
case 117:
YY_RULE_SETUP
#line 213 "kate_lexer.l"
{return R2L_T2B;}
	YY_BREAK
case 118:
YY_RULE_SETUP
#line 214 "kate_lexer.l"
{return T2B_R2L;}
	YY_BREAK
case 119:
YY_RULE_SETUP
#line 215 "kate_lexer.l"
{return T2B_L2R;}
	YY_BREAK
case 120:
YY_RULE_SETUP
#line 217 "kate_lexer.l"
{lvalp->number=kate_pixel;return METRIC;}
	YY_BREAK
case 121:
YY_RULE_SETUP
#line 218 "kate_lexer.l"
{lvalp->number=kate_pixel;return METRIC;}
	YY_BREAK
case 122:
YY_RULE_SETUP
#line 219 "kate_lexer.l"
{lvalp->number=kate_percentage;return METRIC;}
	YY_BREAK
case 123:
YY_RULE_SETUP
#line 220 "kate_lexer.l"
{lvalp->number=kate_percentage;return METRIC;}
	YY_BREAK
case 124:
YY_RULE_SETUP
#line 221 "kate_lexer.l"
{lvalp->number=kate_millionths;return METRIC;}
	YY_BREAK
case 125:
YY_RULE_SETUP
#line 223 "kate_lexer.l"
{return STATIC;}
	YY_BREAK
case 126:
YY_RULE_SETUP
#line 224 "kate_lexer.l"
{return LINEAR;}
	YY_BREAK
case 127:
YY_RULE_SETUP
#line 225 "kate_lexer.l"
{return CATMULL_ROM;}
	YY_BREAK
case 128:
YY_RULE_SETUP
#line 226 "kate_lexer.l"
{return BEZIER_CUBIC;}
	YY_BREAK
case 129:
YY_RULE_SETUP
#line 227 "kate_lexer.l"
{return BSPLINE;}
	YY_BREAK
case 130:
YY_RULE_SETUP
#line 229 "kate_lexer.l"
{return SIMPLE_TIMED_GLYPH_MARKER;}
	YY_BREAK
case 131:
YY_RULE_SETUP
#line 230 "kate_lexer.l"
{return SIMPLE_TIMED_GLYPH_STYLE_MORPH;}
	YY_BREAK
case 132:
YY_RULE_SETUP
#line 231 "kate_lexer.l"
{return GLYPH;}
	YY_BREAK
case 133:
YY_RULE_SETUP
#line 232 "kate_lexer.l"
{return POINTER;}
	YY_BREAK
case 134:
YY_RULE_SETUP
#line 233 "kate_lexer.l"
{return IN;}
	YY_BREAK
case 135:
YY_RULE_SETUP
#line 234 "kate_lexer.l"
{return PAUSE;}
	YY_BREAK
case 136:
/* rule 136 can match eol */
YY_RULE_SETUP
#line 236 "kate_lexer.l"
{
                                 katedesc_text[strlen(katedesc_text)-1]=0;
                                 lvalp->string=katedesc_text+1;
                                 process_nlines(katedesc_text);
                                 return STRING;
                               }
	YY_BREAK
case 137:
YY_RULE_SETUP
#line 242 "kate_lexer.l"
{lvalp->unumber=strtoul(katedesc_text,NULL,10);return UNUMBER;}
	YY_BREAK
case 138:
YY_RULE_SETUP
#line 243 "kate_lexer.l"
{lvalp->unumber=strtoul(katedesc_text,NULL,16);return UNUMBER;}
	YY_BREAK
case 139:
YY_RULE_SETUP
#line 244 "kate_lexer.l"
{lvalp->number=strtol(katedesc_text,NULL,10);return NUMBER;}
	YY_BREAK
case 140:
YY_RULE_SETUP
#line 245 "kate_lexer.l"
{lvalp->number=strtol(katedesc_text,NULL,16);return NUMBER;}
	YY_BREAK
case 141:
YY_RULE_SETUP
#line 246 "kate_lexer.l"
{lvalp->fp=(kate_float)atof(katedesc_text);return FLOAT;}
	YY_BREAK
case 142:
YY_RULE_SETUP
#line 247 "kate_lexer.l"
{lvalp->color=strtol(katedesc_text+1,NULL,16);return COLORSPEC;}
	YY_BREAK
case 143:
YY_RULE_SETUP
#line 248 "kate_lexer.l"
{lvalp->color=strtol(katedesc_text+1,NULL,16);return COLORSPEC;}
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(NORMAL):
case YY_STATE_EOF(BLOCK_COMMENT):
case YY_STATE_EOF(MACRO_1):
case YY_STATE_EOF(MACRO_2):
#line 251 "kate_lexer.l"
{
                               katedesc_text="<EOF>";
                               if (freeze_nlines) --freeze_nlines;
                               katedesc__delete_buffer(YY_CURRENT_BUFFER);
                               if (main_buffer) {
                                 katedesc__switch_to_buffer(main_buffer);
                                 main_buffer=NULL;
                               }
                               else yyterminate();
                             }
	YY_BREAK
case 144:
YY_RULE_SETUP
#line 262 "kate_lexer.l"
{return katedesc_text[0];}
	YY_BREAK
case 145:
YY_RULE_SETUP
#line 265 "kate_lexer.l"
ECHO;
	YY_BREAK
#line 1977 "kate_lexer.c"

	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 katedesc_in at a new source and called
			 * katedesc_lex().  If so, then we have to assure
			 * consistency between YY_CURRENT_BUFFER and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = katedesc_in;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

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

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

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

			else
				{
				yy_cp = (yy_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 ( katedesc_wrap( ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * katedesc_text, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

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

				yy_current_state = yy_get_previous_state(  );

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

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

				yy_current_state = yy_get_previous_state(  );

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

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

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

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

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

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

	/* Try to read more data. */

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

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

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

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

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

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

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

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

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

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

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

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

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
			(yy_n_chars), 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;
			katedesc_restart(katedesc_in  );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

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

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

	return ret_val;
}

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

    static yy_state_type yy_get_previous_state (void)
{
	register yy_state_type yy_current_state;
	register char *yy_cp;
    
	yy_current_state = (yy_start);

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 687 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	return yy_current_state;
}

/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	register int yy_is_jam;
    	register char *yy_cp = (yy_c_buf_p);

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		(yy_last_accepting_state) = yy_current_state;
		(yy_last_accepting_cpos) = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 687 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	yy_is_jam = (yy_current_state == 686);

	return yy_is_jam ? 0 : yy_current_state;
}

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

{
	int c;
    
	*(yy_c_buf_p) = (yy_hold_char);

	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
			/* This was really a NUL. */
			*(yy_c_buf_p) = '\0';

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

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

					/* Reset buffer status. */
					katedesc_restart(katedesc_in );

					/*FALLTHROUGH*/

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

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

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

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

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

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

	katedesc__init_buffer(YY_CURRENT_BUFFER,input_file );
	katedesc__load_buffer_state( );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void katedesc__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		katedesc_pop_buffer_state();
	 *		katedesc_push_buffer_state(new_buffer);
     */
	katedesc_ensure_buffer_stack ();
	if ( YY_CURRENT_BUFFER == new_buffer )
		return;

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

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	katedesc__load_buffer_state( );

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

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

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

	b->yy_is_our_buffer = 1;

	katedesc__init_buffer(b,file );

	return b;
}

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

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

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

	katedesc_free((void *) b  );
}

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a katedesc_restart() or at EOF.
 */
    static void katedesc__init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	katedesc__flush_buffer(b );

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

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

        b->yy_is_interactive = 0;
    
	errno = oerrno;
}

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

	b->yy_n_chars = 0;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

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

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

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

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

	katedesc_ensure_buffer_stack();

	/* This block is copied from katedesc__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 katedesc__switch_to_buffer. */
	katedesc__load_buffer_state( );
	(yy_did_buffer_switch_on_eof) = 1;
}

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

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

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

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

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

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

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

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)katedesc_realloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);

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

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

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

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

	katedesc__switch_to_buffer(b  );

	return b;
}

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

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

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

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

	b = katedesc__scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in katedesc__scan_bytes()" );

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

	return b;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

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

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

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

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

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

/** Get the input stream.
 * 
 */
FILE *katedesc_get_in  (void)
{
        return katedesc_in;
}

/** Get the output stream.
 * 
 */
FILE *katedesc_get_out  (void)
{
        return katedesc_out;
}

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

/** Get the current token.
 * 
 */

char *katedesc_get_text  (void)
{
        return katedesc_text;
}

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

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

void katedesc_set_out (FILE *  out_str )
{
        katedesc_out = out_str ;
}

int katedesc_get_debug  (void)
{
        return katedesc__flex_debug;
}

void katedesc_set_debug (int  bdebug )
{
        katedesc__flex_debug = bdebug ;
}

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

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

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

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

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

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

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

    return 0;
}

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

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

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

void katedesc_free (void * ptr )
{
	free( (char *) ptr );	/* see katedesc_realloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 265 "kate_lexer.l"



int katedesc_wrap()
{
  return 1;
}

void set_macro_mode()
{
  BEGIN(MACRO_1);
}

void unset_macro_mode()
{
  BEGIN(NORMAL);
}

static void replace_macro(const char *name)
{
  const char *body=find_macro(name);
  if (body) {
    ++freeze_nlines;
    main_buffer=YY_CURRENT_BUFFER;
    katedesc__scan_string(body);
  }
}

void add_macro(const char *name,const char *body)
{
  size_t nlen,blen;

  if (!name || !body) {
    katedesc_error("name and body cannot be null");
    exit(-1);
  }

  ++nmacros;
  macro_names=(char**)kate_realloc(macro_names,nmacros*sizeof(char*));
  macro_bodies=(char**)kate_realloc(macro_bodies,nmacros*sizeof(char*));
  if (!macro_names || !macro_bodies) {
    katedesc_error("out of memory");
    exit(-1);
  }

  nlen=strlen(name);
  blen=strlen(body);
  macro_names[nmacros-1]=kate_malloc(nlen+1);
  macro_bodies[nmacros-1]=kate_malloc(blen+1);
  if (!macro_names[nmacros-1] || !macro_bodies[nmacros-1]) {
    katedesc_error("out of memory");
    exit(-1);
  }
  strcpy(macro_names[nmacros-1],name);
  strcpy(macro_bodies[nmacros-1],body);
}

static const char *find_macro(const char *name)
{
  size_t n;
  if (!name) {
    katedesc_error("macro name cannot be null");
    exit(-1);
  }
  for (n=0;n<nmacros;++n) {
    if (!strcmp(macro_names[n],name)) return macro_bodies[n];
  }
  katedesc_error("undefined macro");
  return NULL;
}

void free_macros(void)
{
  size_t n;
  for (n=0;n<nmacros;++n) {
    kate_free(macro_names[n]);
    kate_free(macro_bodies[n]);
  }
  kate_free(macro_names);
  kate_free(macro_bodies);
}

static int get_nlines(const char *text)
{
  int text_nlines=0;
  if (!text) {
    katedesc_error("null text");
    return 0;
  }
  while (*text) if (*text++=='\n') ++text_nlines;
  return text_nlines;
}

static void process_nlines(const char *text)
{
  if (!freeze_nlines) {
    nlines+=get_nlines(text);
  }
}

void cleanup_lexer(void)
{
#ifdef FLEX_SCANNER
#if (YY_FLEX_MAJOR_VERSION+0)*0x10000+(YY_FLEX_MINOR_VERSION+0)*0x100+(YY_FLEX_SUBMINOR_VERSION+0)>=0x020509
  katedesc_lex_destroy();
#endif
#endif
}


