
#line 3 "<stdout>"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer tclscanYY_create_buffer
#define yy_delete_buffer tclscanYY_delete_buffer
#define yy_flex_debug tclscanYY_flex_debug
#define yy_init_buffer tclscanYY_init_buffer
#define yy_flush_buffer tclscanYY_flush_buffer
#define yy_load_buffer_state tclscanYY_load_buffer_state
#define yy_switch_to_buffer tclscanYY_switch_to_buffer
#define yyin tclscanYYin
#define yyleng tclscanYYleng
#define yylex tclscanYYlex
#define yylineno tclscanYYlineno
#define yyout tclscanYYout
#define yyrestart tclscanYYrestart
#define yytext tclscanYYtext
#define yywrap tclscanYYwrap
#define yyalloc tclscanYYalloc
#define yyrealloc tclscanYYrealloc
#define yyfree tclscanYYfree

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

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

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

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

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

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

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

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

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

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

#define YY_USE_CONST

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

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

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

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

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

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

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

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

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 262144
#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

extern yy_size_t tclscanYYleng;

extern FILE *tclscanYYin, *tclscanYYout;

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

    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
     *       access to the local variable yy_act. Since yyless() is a macro, it would break
     *       existing scanners that call yyless() from OUTSIDE tclscanYYlex. 
     *       One obvious solution it to make yy_act a global. I tried that, and saw
     *       a 5% performance hit in a non-tclscanYYlineno scanner, because yy_act is
     *       normally declared as a register variable-- so it is not worth it.
     */
    #define  YY_LESS_LINENO(n) \
            do { \
                int yyl;\
                for ( yyl = n; yyl < tclscanYYleng; ++yyl )\
                    if ( tclscanYYtext[yyl] == '\n' )\
                        --tclscanYYlineno;\
            }while(0)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up tclscanYYtext. */ \
        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 tclscanYYtext 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
	{
	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.
	 */
	yy_size_t 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 tclscanYYrestart()), so that the user can continue scanning by
	 * just pointing tclscanYYin 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 tclscanYYtext is formed. */
static char yy_hold_char;
static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
yy_size_t tclscanYYleng;

/* 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 tclscanYYwrap()'s to do buffer switches
 * instead of setting up a fresh tclscanYYin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void tclscanYYrestart (FILE *input_file  );
void tclscanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE tclscanYY_create_buffer (FILE *file,int size  );
void tclscanYY_delete_buffer (YY_BUFFER_STATE b  );
void tclscanYY_flush_buffer (YY_BUFFER_STATE b  );
void tclscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer  );
void tclscanYYpop_buffer_state (void );

static void tclscanYYensure_buffer_stack (void );
static void tclscanYY_load_buffer_state (void );
static void tclscanYY_init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER tclscanYY_flush_buffer(YY_CURRENT_BUFFER )

YY_BUFFER_STATE tclscanYY_scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE tclscanYY_scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE tclscanYY_scan_bytes (yyconst char *bytes,yy_size_t len  );

void *tclscanYYalloc (yy_size_t  );
void *tclscanYYrealloc (void *,yy_size_t  );
void tclscanYYfree (void *  );

#define yy_new_buffer tclscanYY_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        tclscanYYensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            tclscanYY_create_buffer(tclscanYYin,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        tclscanYYensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            tclscanYY_create_buffer(tclscanYYin,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 */

#define tclscanYYwrap(n) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;

FILE *tclscanYYin = (FILE *) 0, *tclscanYYout = (FILE *) 0;

typedef int yy_state_type;

extern int tclscanYYlineno;

int tclscanYYlineno = 1;

extern char *tclscanYYtext;
#define yytext_ptr tclscanYYtext

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 tclscanYYtext.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
	(yytext_ptr) -= (yy_more_len); \
	tclscanYYleng = (size_t) (yy_cp - (yytext_ptr)); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
	(yy_c_buf_p) = yy_cp;

#define YY_NUM_RULES 53
#define YY_END_OF_BUFFER 54
/* 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[180] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        5,    5,    0,    0,    0,    0,    0,    0,   25,   25,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
       54,   53,    1,    4,    3,    3,    2,    4,   38,   36,
       35,   33,   34,   38,   38,   52,   48,   50,   51,   47,
       46,   49,   44,   52,   45,   42,   43,   14,    5,   13,
       14,   53,   22,   23,   53,   53,   16,   17,   53,   53,
       19,   20,   53,   28,   25,   28,   24,   28,   53,   30,
       31,   53,    3,    0,   36,   35,   33,   34,    0,    0,
        0,    0,    0,   40,   41,   39,    5,    0,   11,   12,

        0,    0,    0,    0,   22,   23,    0,   21,    0,   16,
       17,    0,    0,   19,   20,    0,    0,   24,   25,    0,
        0,   30,   31,    0,   29,   32,    0,    0,    0,    7,
       12,    0,    0,    0,   10,    0,    0,    0,   27,   24,
        0,   37,    6,    0,    0,    0,    0,   26,    0,    0,
        0,    0,    0,    0,    0,    0,   11,    0,    0,    0,
        8,    8,    0,    0,    0,    0,    0,    0,    0,   15,
        0,   11,    0,    9,    9,    0,    0,   18,    0
    } ;

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

       31,    1,    1,    1,   32,    1,    1,    1,   33,   34,
       35,    1,    1,   36,    1,   37,    1,   38,    1,    1,
        1,    1,   39,    1,   40,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

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

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

static yyconst flex_int16_t yy_base[203] =
    {   0,
        0,    0,  126,  112,    0,    8,   32,   70,  108,  147,
       14,   22,   19,   27,   35,   42,   44,   51,   57,   63,
       73,   77,    0,    0,    0,    0,    0,    0,    0,    0,
      107,  567,  567,  567,   80,   91,  567,  100,  567,  116,
      567,  567,   99,   96,   89,  567,  567,  567,  567,  567,
      567,  567,  567,    3,  567,  567,  567,  567,   38,  567,
      119,   83,  567,  132,  134,   87,  567,  124,  151,  136,
      567,  139,  157,   88,  161,  567,   84,    4,  142,  567,
      166,  171,  175,   81,    0,  567,  567,  183,   75,  187,
       59,   60,   16,  567,  567,  567,   48,  194,  567,  198,

      200,  223,  259,  203,  567,  206,  210,  567,  212,  567,
      214,  218,  226,  567,  229,  235,    8,    0,  238,  250,
      252,  567,  254,  256,  567,  567,    0,  261,  264,  567,
      266,  268,  291,  296,  567,  298,  300,  303,  567,  305,
      310,  567,  567,  321,  319,  334,  338,  567,  344,  353,
      358,  367,  355,  370,  373,  380,  239,  382,  385,  388,
      567,  245,  395,  398,  413,  418,  427,  430,  434,  567,
      436,  278,  443,  567,  285,  445,  441,  567,  567,  478,
      482,  486,  490,  494,  498,  502,  506,  510,  514,  518,
      521,  524,  528,  532,  536,  540,  544,  548,  552,  556,

      560,  563
    } ;

static yyconst flex_int16_t yy_def[203] =
    {   0,
      180,  180,  181,  181,  182,  182,  183,  183,  184,  184,
      185,  185,  186,  186,  187,  187,  188,  188,  189,  189,
      190,  190,  180,  180,  180,  180,  180,  180,  180,  180,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  191,  179,  179,  179,  179,  179,  179,
      192,  193,  179,  193,  193,  194,  179,  194,  194,  195,
      179,  195,  195,  196,  196,  179,  196,  196,  197,  179,
      197,  197,  179,  179,   40,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  192,  179,  192,

      198,  192,  192,  193,  179,  193,  193,  179,  194,  179,
      194,  194,  195,  179,  195,  195,  196,  196,  196,  199,
      197,  179,  197,  197,  179,  179,  200,  192,  198,  179,
      198,  198,  192,  192,  179,  194,  195,  199,  179,  199,
      199,  179,  179,  192,  192,  194,  195,  179,  192,  192,
      194,  195,  192,  192,  194,  195,  201,  192,  194,  195,
      179,  201,  192,  194,  195,  192,  194,  195,  192,  179,
      195,  202,  195,  179,  202,  195,  195,  179,    0,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,

      179,  179
    } ;

static yyconst flex_int16_t yy_nxt[608] =
    {   0,
      179,   35,   36,  118,   35,   95,   37,  118,   35,   35,
       36,  118,   35,  120,   37,   59,   35,   60,   59,  179,
       61,   63,   64,   59,   38,   60,   59,   96,   61,   63,
       64,  179,   38,   40,   41,   42,   40,   67,   68,   97,
       43,   69,   97,   65,   67,   68,   71,   72,   69,   97,
       73,   65,   97,   71,   72,  127,   44,   73,   75,   76,
       77,   75,   90,   78,   75,   76,   77,   75,  126,   78,
       45,   40,   41,   42,   40,   80,   81,   85,   43,   80,
       81,   83,   83,   83,   83,  105,  106,  118,   83,  110,
      111,  118,   83,   83,   44,   83,   93,   82,   85,   83,

       90,   82,   83,   90,   84,   91,  179,  107,   45,   47,
       48,   49,   50,   51,   32,   84,   52,   85,   86,   87,
       85,   99,  100,   92,   88,  101,  110,  111,   32,  102,
      179,   53,   54,   55,  105,  106,  108,  106,  114,  115,
       89,  114,  115,  103,  122,  123,   56,   57,   47,   48,
       49,   50,   51,  110,  111,   52,  107,  179,  107,  114,
      115,  112,  119,  179,  118,  119,  124,  116,  122,  123,
       53,   54,   55,  125,  123,  112,   83,   83,  179,   83,
      179,  116,  179,   83,   90,   56,   57,   90,   90,   91,
      124,   90,  179,   91,  179,  124,   99,  100,  179,   84,

       99,  100,  130,  131,  179,  105,  106,   92,  105,  106,
      179,   92,  108,  106,  110,  111,  110,  111,  128,  179,
      110,  111,  128,  179,  132,   99,  100,  107,  114,  115,
      107,  114,  115,  136,  107,  179,  133,  114,  115,  119,
      162,  118,  119,  162,  179,  134,  162,  128,  136,  162,
      137,  133,  139,  140,  122,  123,  122,  123,  125,  123,
      134,  135,  100,  135,  100,  137,  130,  131,  130,  131,
      143,  131,  133,  179,  141,  179,  124,  179,  124,  175,
      124,  134,  175,  128,  179,  128,  175,  133,  132,  175,
      132,  179,  132,   99,  100,  179,  134,  179,   99,  100,

      110,  111,  114,  115,  179,  139,  140,  139,  140,  179,
      144,  145,  148,  140,  179,  128,  146,  179,  147,  179,
      128,   99,  100,   99,  100,  144,  145,  141,  179,  141,
      179,  146,  179,  147,  141,  149,  110,  111,  179,  150,
      114,  115,  179,  128,  179,  128,   99,  100,  151,  179,
      149,  179,  152,  179,  150,   99,  100,  157,  100,  153,
      110,  111,  179,  151,  179,  154,  179,  152,  128,  114,
      115,  155,   99,  100,  153,  110,  111,  128,  179,  128,
      154,  158,  114,  115,   99,  100,  155,  110,  111,  156,
      114,  115,  159,  179,  128,  160,  158,   99,  100,  164,

      110,  111,  179,  163,  156,  179,  128,  159,  165,  179,
      160,  166,  179,  167,  164,  114,  115,  179,  163,  128,
       99,  100,  179,  165,  179,  168,  166,  179,  167,  170,
      111,  179,  114,  115,  179,  169,  172,  100,  114,  115,
      168,  171,  128,  178,  115,  114,  115,  114,  115,  179,
      169,  179,  179,  179,  179,  179,  171,  173,  128,  176,
      179,  179,  177,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  173,  179,  176,  179,  179,  177,   32,   32,
       32,   32,   33,   33,   33,   33,   34,   34,   34,   34,
       39,   39,   39,   39,   46,   46,   46,   46,   58,   58,

       58,   58,   62,   62,   62,   62,   66,   66,   66,   66,
       70,   70,   70,   70,   74,   74,   74,   74,   79,   79,
       79,   79,   94,   94,   98,   98,   98,   98,  104,  104,
      104,  104,  109,  109,  109,  109,  113,  113,  113,  113,
      117,  117,  179,  117,  121,  121,  121,  121,  129,  129,
      129,  129,  138,  138,  138,  138,  142,  142,  179,  142,
      161,  161,  161,  174,  174,  174,   31,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,

      179,  179,  179,  179,  179,  179,  179
    } ;

static yyconst flex_int16_t yy_chk[608] =
    {   0,
        0,    5,    5,  118,    5,   54,    5,   78,    5,    6,
        6,  117,    6,   78,    6,   11,    6,   11,   11,    0,
       11,   13,   13,   12,    5,   12,   12,   54,   12,   14,
       14,    0,    6,    7,    7,    7,    7,   15,   15,   59,
        7,   15,   59,   13,   16,   16,   17,   17,   16,   97,
       17,   14,   97,   18,   18,   93,    7,   18,   19,   19,
       19,   19,   92,   19,   20,   20,   20,   20,   91,   20,
        7,    8,    8,    8,    8,   21,   21,   89,    8,   22,
       22,   35,   35,   84,   35,   62,   62,   77,   35,   66,
       66,   74,   36,   36,    8,   36,   45,   21,   44,   36,

       43,   22,   38,   43,   35,   43,   31,   62,    8,    9,
        9,    9,    9,    9,    4,   36,    9,   40,   40,   40,
       40,   61,   61,   43,   40,   61,   68,   68,    3,   61,
        0,    9,    9,    9,   64,   64,   65,   65,   70,   70,
       40,   72,   72,   61,   79,   79,    9,    9,   10,   10,
       10,   10,   10,   69,   69,   10,   64,    0,   65,   73,
       73,   69,   75,    0,   75,   75,   79,   73,   81,   81,
       10,   10,   10,   82,   82,   69,   83,   83,    0,   83,
        0,   73,    0,   83,   88,   10,   10,   88,   90,   88,
       81,   90,    0,   90,    0,   82,   98,   98,    0,   83,

      100,  100,  101,  101,    0,  104,  104,   88,  106,  106,
        0,   90,  107,  107,  109,  109,  111,  111,   98,    0,
      112,  112,  100,    0,  101,  102,  102,  104,  113,  113,
      106,  115,  115,  112,  107,    0,  102,  116,  116,  119,
      157,  119,  119,  157,    0,  102,  162,  102,  112,  162,
      116,  102,  120,  120,  121,  121,  123,  123,  124,  124,
      102,  103,  103,  128,  128,  116,  129,  129,  131,  131,
      132,  132,  103,    0,  120,    0,  121,    0,  123,  172,
      124,  103,  172,  103,    0,  128,  175,  103,  129,  175,
      131,    0,  132,  133,  133,    0,  103,    0,  134,  134,

      136,  136,  137,  137,    0,  138,  138,  140,  140,    0,
      133,  134,  141,  141,    0,  133,  136,    0,  137,    0,
      134,  145,  145,  144,  144,  133,  134,  138,    0,  140,
        0,  136,    0,  137,  141,  144,  146,  146,    0,  145,
      147,  147,    0,  145,    0,  144,  149,  149,  146,    0,
      144,    0,  147,    0,  145,  150,  150,  153,  153,  149,
      151,  151,    0,  146,    0,  150,    0,  147,  149,  152,
      152,  151,  154,  154,  149,  155,  155,  150,    0,  153,
      150,  154,  156,  156,  158,  158,  151,  159,  159,  152,
      160,  160,  155,    0,  154,  156,  154,  163,  163,  159,

      164,  164,    0,  158,  152,    0,  158,  155,  160,    0,
      156,  163,    0,  164,  159,  165,  165,    0,  158,  163,
      166,  166,    0,  160,    0,  165,  163,    0,  164,  167,
      167,    0,  168,  168,    0,  166,  169,  169,  171,  171,
      165,  168,  166,  177,  177,  173,  173,  176,  176,    0,
      166,    0,    0,    0,    0,    0,  168,  171,  169,  173,
        0,    0,  176,    0,    0,    0,    0,    0,    0,    0,
        0,    0,  171,    0,  173,    0,    0,  176,  180,  180,
      180,  180,  181,  181,  181,  181,  182,  182,  182,  182,
      183,  183,  183,  183,  184,  184,  184,  184,  185,  185,

      185,  185,  186,  186,  186,  186,  187,  187,  187,  187,
      188,  188,  188,  188,  189,  189,  189,  189,  190,  190,
      190,  190,  191,  191,  192,  192,  192,  192,  193,  193,
      193,  193,  194,  194,  194,  194,  195,  195,  195,  195,
      196,  196,    0,  196,  197,  197,  197,  197,  198,  198,
      198,  198,  199,  199,  199,  199,  200,  200,    0,  200,
      201,  201,  201,  202,  202,  202,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
      179,  179,  179,  179,  179,  179,  179,  179,  179,  179,

      179,  179,  179,  179,  179,  179,  179
    } ;

/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[54] =
    {   0,
0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 
    0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 
    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,     };

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int tclscanYY_flex_debug;
int tclscanYY_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 *tclscanYYtext;
#line 1 "tclscanner.l"
/*****************************************************************************
 * Parser for Tcl subset
 *
 * Copyright (C) 2010      by Rene Zaumseil
 * based on the work of Dimitri van Heesch.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 * Documents produced by Doxygen are derivative works derived from the
 * input used in their production; they are not affected by this license.
 *
 */ 
#line 18 "tclscanner.l"
#include <stdio.h> 
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include "qtbc.h"
#include <qarray.h>
#include <qstack.h>
#include <qregexp.h>
#include <unistd.h> 
#include <qfile.h>
#include <qdict.h>
#include "entry.h"
#include "message.h"
#include "config.h"
#include "doxygen.h"
#include "util.h"
#include "defargs.h"
#include "language.h"
#include "commentscan.h" 
#include "pre.h"
#include "tclscanner.h"
#include "outputlist.h"
#include "membername.h"
#include "searchindex.h"
#include "commentcnv.h"
#include "bufstr.h"
#include "portable.h"
#include <qstring.h>
#include <qstringlist.h>
#include <qlist.h>
#include <qmap.h>

#define YY_NEVER_INTERACTIVE 1

#define MAX_INCLUDE_DEPTH 10

//! Application error.
#define tcl_err \
  printf("Error %d %s() in %s line %d! ",__LINE__,__FUNCTION__,tcl.file_name.data(),tclscanYYlineno); \
  yy_push_state(ERROR); \
  yyless(0); \
  printf

//! Application warning.
#define tcl_war \
  printf("Warning %d %s() in %s line %d: ",__LINE__,__FUNCTION__,tcl.file_name.data(),tclscanYYlineno); \
  printf

//! Application message.
#define tcl_inf \
  if (0) printf("--- %.4d %s() %d@%d: ",__LINE__,__FUNCTION__,tclscanYYlineno,yy_start_stack_ptr) && printf

//! Debug message.
#define D\
  if (0) printf("--- %.4d %s() %d@%d: %s\n",__LINE__,__FUNCTION__,tclscanYYlineno,yy_start_stack_ptr,tclscanYYtext);

// BEGIN of copy from tclUtil.c
// - Tcl_Interp removed
// - changes are marked with RZ
// #define's to adapt the code:
#define CONST		const
#define UCHAR		(unsigned char)
#define TCL_ERROR	1
#define TCL_OK		0
#define ckalloc		malloc
#define ckfree		free
#define TclCopyAndCollapse(size,src,dest) memcpy(dest,src,size); *(dest+size)=0
int TclFindElement(
      CONST char *list,		/* Points to the first byte of a string
				 * containing a Tcl list with zero or more
				 * elements (possibly in braces). */
      int listLength,		/* Number of bytes in the list's string. */
      CONST char **elementPtr,	/* Where to put address of first significant
				 * character in first element of list. */
      CONST char **nextPtr,	/* Fill in with location of character just
				 * after all white space following end of
				 * argument (next arg or end of list). */
      int *sizePtr,		/* If non-zero, fill in with size of
				 * element. */
      int *bracePtr)		/* If non-zero, fill in with non-zero/zero to
				 * indicate that arg was/wasn't in braces. */
{
  CONST char *p = list;
  CONST char *elemStart;	/* Points to first byte of first element. */
  CONST char *limit;		/* Points just after list's last byte. */
  int openBraces = 0;		/* Brace nesting level during parse. */
  int inQuotes = 0;
  int size = 0;		/* lint. */
  //RZ    int numChars;

  /*
   * Skim off leading white space and check for an opening brace or quote.
   * We treat embedded NULLs in the list as bytes belonging to a list
   * element.
   */

  limit = (list + listLength);
  while ((p < limit) && (isspace(UCHAR(*p)))) 
  { /* INTL: ISO space. */
    p++;
  }
  if (p == limit) 
  {		/* no element found */
    elemStart = limit;
    goto done;
  }

  if (*p == '{') 
  {
    openBraces = 1;
    p++;
  } 
  else if (*p == '"') 
  {
    inQuotes = 1;
    p++;
  }
  elemStart = p;
  if (bracePtr != 0) 
  {
    *bracePtr = openBraces;
  }

  /*
   * Find element's end (a space, close brace, or the end of the string).
   */

  while (p < limit) 
  {
    switch (*p) 
    {
      /*
       * Open brace: don't treat specially unless the element is in
       * braces. In this case, keep a nesting count.
       */

      case '{':
	if (openBraces != 0) 
	{
	  openBraces++;
	}
	break;

	/*
	 * Close brace: if element is in braces, keep nesting count and
	 * quit when the last close brace is seen.
	 */

      case '}':
	if (openBraces > 1) 
	{
	  openBraces--;
	} 
	else if (openBraces == 1) 
	{
	  size = (p - elemStart);
	  p++;
	  if ((p >= limit) || isspace(UCHAR(*p))) 
	  {	/* INTL: ISO space. */
	    goto done;
	  }

	  /*
	   * Garbage after the closing brace; return an error.
	   */

	  return TCL_ERROR;
	}
	break;

	/*
	 * Backslash: skip over everything up to the end of the backslash
	 * sequence.
	 */

      case '\\':
	//RZ	    Tcl_UtfBackslash(p, &numChars, NULL);
	//RZ	    p += (numChars - 1);
	p++; //RZ
	break;

	/*
	 * Space: ignore if element is in braces or quotes; otherwise
	 * terminate element.
	 */

      case ' ':
      case '\f':
      case '\n':
      case '\r':
      case '\t':
      case '\v':
	if ((openBraces == 0) && !inQuotes) 
	{
	  size = (p - elemStart);
	  goto done;
	}
	break;

	/*
	 * Double-quote: if element is in quotes then terminate it.
	 */

      case '"':
	if (inQuotes) 
	{
	  size = (p - elemStart);
	  p++;
	  if ((p >= limit) || isspace(UCHAR(*p))) 
	  {	/* INTL: ISO space */
	    goto done;
	  }

	  /*
	   * Garbage after the closing quote; return an error.
	   */
	  return TCL_ERROR;
	}
	break;
    }
    p++;
  }

  /*
   * End of list: terminate element.
   */

  if (p == limit) 
  {
    if (openBraces != 0) 
    {
      return TCL_ERROR;
    } 
    else if (inQuotes) 
    {
      return TCL_ERROR;
    }
    size = (p - elemStart);
  }

done:
  while ((p < limit) && (isspace(UCHAR(*p)))) 
  { /* INTL: ISO space. */
    p++;
  }
  *elementPtr = elemStart;
  *nextPtr = p;
  if (sizePtr != 0) 
  {
    *sizePtr = size;
  }
  return TCL_OK;
}

int Tcl_SplitList(
    CONST char *list,		/* Pointer to string with list structure. */
    int *argcPtr,		/* Pointer to location to fill in with the
				 * number of elements in the list. */
    CONST char ***argvPtr)	/* Pointer to place to store pointer to array
				 * of pointers to list elements. */
{
  CONST char **argv, *l, *element;
  char *p;
  int length, size, i, result, elSize, brace;

  /*
   * Figure out how much space to allocate. There must be enough space for
   * both the array of pointers and also for a copy of the list. To estimate
   * the number of pointers needed, count the number of space characters in
   * the list.
   */

  for (size = 2, l = list; *l != 0; l++) 
  {
    if (isspace(UCHAR(*l))) 
    {			/* INTL: ISO space. */
      size++;

      /*
       * Consecutive space can only count as a single list delimiter.
       */

      while (1) 
      {
	char next = *(l + 1);

	if (next == '\0') 
	{
	  break;
	}
	++l;
	if (isspace(UCHAR(next))) 
	{		/* INTL: ISO space. */
	  continue;
	}
	break;
      }
    }
  }
  length = l - list;
  argv = (CONST char **) ckalloc((unsigned)
      ((size * sizeof(char *)) + length + 1));
  for (i = 0, p = ((char *) argv) + size*sizeof(char *);
      *list != 0;  i++) 
  {
    CONST char *prevList = list;

    result = TclFindElement(list, length, &element, &list,
	&elSize, &brace);
    length -= (list - prevList);
    if (result != TCL_OK) 
    {
      ckfree((char *) argv);
      return result;
    }
    if (*element == 0) 
    {
      break;
    }
    if (i >= size) 
    {
      ckfree((char *) argv);
      return TCL_ERROR;
    }
    argv[i] = p;
    if (brace) 
    {
      memcpy(p, element, (size_t) elSize);
      p += elSize;
      *p = 0;
      p++;
    } 
    else 
    {
      TclCopyAndCollapse(elSize, element, p);
      p += elSize+1;
    }
  }

  argv[i] = NULL;
  *argvPtr = argv;
  *argcPtr = i;
  return TCL_OK;
}
// END of tclUtil.c

void tcl_split_list(QString &str, QStringList &list)
{
  int argc;
  const char **argv;

  list.clear();
  if (str.left(1)=="{" && str.right(1)=="}")
  {
    str=str.mid(1,str.length()-2);
  }
  else if (str.left(1)=="\"" && str.right(1)=="\"")
  {
    str=str.mid(1,str.length()-2);
  }
  if (Tcl_SplitList(str.ascii(),&argc,&argv) != TCL_OK)
  {
    list.append(str);
  }
  else
  {
    for (int i = 0; i < argc; i++)
    {
      list.append(argv[i]);
    }
    ckfree((char *) argv);
  }
}

//! Structure containing information about current scan context.
typedef struct
{
  int type;
  QCString string_after;
  int line0; // start line of scan context
  int line1; // end line of scan context
  YY_BUFFER_STATE buffer_state; // value of scan context
  QString ns; // current namespace
  Entry *entry_fn; // if set contains the current proc/method/constructor/destructor
  Entry *entry_cl; // if set contain the current class
  Entry *entry_scan; // current scan entry
  Protection protection; // current protections state
} tcl_scan;

//* Structure containing all internal global variables.
static struct
{
  CodeOutputInterface * code; // if set then we are codifying the file
  int code_line; // current line of code
  int code_linenumbers; // if true create line numbers in code
  const char *code_font; // used font to codify
  bool config_autobrief; // value of configuration option
  QMap<QString,QString> config_subst; // map of configuration option values
  QCString input_string; // file contents
  int input_position; // position in file
  QCString file_name; // name of used file
  ParserInterface *this_parser; // myself
  int command; // true if command was found
  int comment; // set true if comment was scaned
  int brace_level; // bookkeeping of braces
  int bracket_level; // bookkeeping of brackets
  int bracket_quote; // bookkeeping of quotes (toggles)
  int word_is; // type of current word
  int line_comment; // line number of comment
  int line_commentline; // line number of comment after command
  int line_command; // line number of command
  int line_body0; // start line of body
  int line_body1; // end line of body
  QString string_command; // contain current command
  QString string_commentline; // contain current comment after command
  QString string_commentcodify; // current comment string used in codifying
  QString string_comment; // contain current comment
  QString string_last; // contain last read word or part of word
  QString string; // temporary string value
  Entry*		entry_main; // top level entry
  Entry*		entry_file; // entry of current file
  Entry*		entry_current; // currently used entry
  Entry*		entry_inside; // contain entry of current scan context
  QStringList list_commandwords; // list of command words
  QList<tcl_scan> scan; // stack of scan contexts
  QDict<Entry> ns; // all read namespace entries
  QDict<Entry> cl; // all read class entries
  QDict<Entry> fn; // all read function entries
  QList<Entry> entry; // list of all created entries, will be deleted after codifying
  Protection protection; // current protections state
  MemberDef *memberdef; // contain current MemberDef when codifying
} tcl;

// scanner functions
static int yyread(char *buf,int max_size);
static void tcl_scan_start(int type, QString content, const char *after, QString ns, Entry *entry_cls, Entry *entry_fn);
static void tcl_scan_end();
static void tcl_comment(int what,const char *text);
static void tcl_word(int what,const char *text);
static void tcl_command(int what,const char *text);

// helper functions

//! Create new entry.
// @return new initialised entry
Entry* tcl_entry_new()
{
  Entry *myEntry = new Entry;
  myEntry->section    = Entry::EMPTY_SEC;
  myEntry->name       = "";
//  myEntry->type       = "";
  myEntry->brief      = "";
//  myEntry->doc        = "";
  myEntry->protection = Package;
//  myEntry->mtype      = Method;
//  myEntry->virt       = Normal;
//  myEntry->stat       = FALSE;
  myEntry->fileName   = tcl.file_name;
  myEntry->lang       = SrcLangExt_Tcl;
  initGroupInfo(myEntry);
  // collect entries
  if (tcl.code==NULL)
  {
    tcl.entry.insert(0,myEntry);
  }
  return myEntry;
}

//! Set protection level.
void tcl_protection(Entry *entry) 
{
  if (entry->protection!=Public&&entry->protection!=Protected&&entry->protection!=Private)
  {
    entry->protection = tcl.protection;
  }
  if (entry->protection!=Protected&&entry->protection!=Private)
  {
    entry->protection = Public;
  }
}

//! Check name.
// @return 'ns' and 'name' of given current 'ns0' and 'name0'
static void tcl_name(const QString ns0, const QString name0, QString &ns, QString &name)
{
  QString myNm;
  int myStart;

  if (strncmp(name0.ascii(),"::",2)==0)
  {
    myNm = name0.mid(2);
  }
  else if (ns0.length())
  {
    myNm = ns0 + "::" + name0;
  }
  else
  {
    myNm = name0;
  }
  myStart = myNm.findRev("::");
  if (myStart == -1)
  {
    ns = "";
    name = myNm;
  }
  else
  {
    ns = myNm.mid(0,myStart);
    name = myNm.mid(myStart+2);
  }
}

// Check and return namespace entry.
// @return namespace entry
Entry* tcl_entry_namespace(const QString ns)
{
  Entry *myEntry;
  QString myNs = " ";
  if (strlen(ns.ascii())) {myNs = ns;}

  myEntry = tcl.ns.find(myNs);
  if (myEntry == NULL)
  {
    myEntry = tcl_entry_new();
    myEntry->section    = Entry::NAMESPACE_SEC;
    myEntry->name       = ns.ascii();
    tcl.entry_main->addSubEntry(myEntry);
    tcl.ns.insert(ns,myEntry);
  }
  return myEntry;
}

// Check and return class entry.
// @return class entry
Entry* tcl_entry_class(const QString cl)
{
  Entry *myEntry;
  QString myCl = " ";
  if (strlen(cl.ascii())) {myCl = cl;}

  myEntry = tcl.cl.find(myCl);
  if (myEntry == NULL)
  {
    myEntry = tcl_entry_new();
    myEntry->section    = Entry::CLASS_SEC;
    myEntry->name       = cl.ascii();
    tcl.entry_main->addSubEntry(myEntry);
    tcl.cl.insert(cl,myEntry);
  }
  return myEntry;
}

//! Check for keywords.
// @return 1 if keyword and 0 otherwise
static int tcl_keyword(QString str)
{
  static QStringList myList;
  static int myInit=1;
  if (myInit)
  {
    // tcl keywords TODO default, else, provide, require
    myList <<"append"<<"apply"<<"array"<<"auto_execok"<<"auto_import"<<"auto_load"<<"auto_mkindex"<<"auto_qualify"<<"auto_reset";
    myList <<"binary";
    myList <<"catch"<<"cd"<<"close"<<"clock"<<"concat";
    myList <<"eof"<<"eval"<<"exec"<<"exit"<<"expr";
    myList <<"fblocked"<<"fconfigure"<<"file"<<"fileevent"<<"flush"<<"for"<<"foreach"<<"format";
    myList <<"gets"<<"global";
    myList <<"http";
    myList <<"if"<<"incr"<<"info"<<"interp";
    myList <<"join";
    myList <<"lappend"<<"lassign"<<"lindex"<<"linsert"<<"llength"<<"load"<<"lrange"<<"lrepeat"<<"lreplace"<<"lreverse"<<"lset";
    myList <<"namespace";
    myList <<"package"<<"parray"<<"pid"<<"pkg_mkIndex"<<"proc"<<"puts"<<"pwd";
    myList <<"registry"<<"rename"<<"return";
    myList <<"scan"<<"set"<<"split"<<"string"<<"switch";
    myList <<"tclLog"<<"tcl_endOfWord"<<"tcl_findLibrary"<<"tcl_startOfNextWord"<<"tcl_startOfPreviousWord"<<"tcl_wordBreakAfter"<<"tcl_wordBreakBefore"<<"tell"<<"time";
    myList <<"unknown"<<"upvar";
    myList <<"variable"<<"vwait";
// tk keywords
    myList <<"bell"<<"bind"<<"bindtags";
    myList <<"clipboard"<<"console"<<"consoleinterp";
    myList <<"destroy";
    myList <<"event";
    myList <<"focus";
    myList <<"grid";
    myList <<"lower";
    myList <<"option";
    myList <<"pack"<<"place";
    myList <<"raise";
    myList <<"send";
    myList <<"tkerror"<<"tkwait"<<"tk_bisque"<<"tk_focusNext"<<"tk_focusPrev"<<"tk_focusFollowsMouse"<<"tk_popup"<<"tk_setPalette"<<"tk_textCut"<<"tk_TextCopy"<<"tk_textPaste"<<"chooseColor"<<"tk_chooseColor"<<"tk_chooseDirectory"<<"tk_dialog"<<"tk_getOpenFile"<<"tkDialog"<<"tk_getSaveFile"<<"tk_messageBox";
    myList <<"winfo"<<"wm";
    myList <<"button"<<"canvas"<<"checkbutton"<<"entry"<<"frame"<<"image"<<"label"<<"labelframe"<<"listbox"<<"menu"<<"menubutton"<<"message"<<"panedwindow"<<"radiobutton"<<"scale"<<"scrollbar"<<"spinbox"<<"toplevel";
    myList.sort();
    myInit=0;
  }
  str=str.stripWhiteSpace();
  if (str.left(2)=="::") {str=str.mid(2);}
  if (myList.findIndex(str) != -1) return(1);
  return 0;
}

//! End codifying with special font class.
static void tcl_font_end()
{
  if (tcl.code==NULL) return;
  if (tcl.code_font)
  {
    tcl.code->endFontClass();
    tcl.code_font=NULL;
  }
}

//! Codify 'str' with special font class 's'.
static void tcl_codify(const char *s,char *str)
{
  if (tcl.code==NULL||str==NULL) return;
  if (s)
  {
    tcl_font_end();
    tcl.code->startFontClass(s);
    tcl.code_font=s;
  }
  char *p=str,*sp=p;
  char c;
  bool done=FALSE;
  while (!done)
  {
    sp=p;
    while ((c=*p++) && c!='\n') {}
    if (c=='\n')
    {
      tcl.code_line++;
      *(p-1)='\0';
      tcl.code->codify(sp);
      //tcl_font_end();
      tcl.code->endCodeLine();
      if (tcl.code_linenumbers)
      {
        if (tcl.code_font!=NULL)
	{
          tcl.code->endFontClass();
          tcl.code->writeLineNumber(0,0,0,tcl.code_line);
	  tcl.code->startFontClass(tcl.code_font);
	}
	else
	{
          tcl.code->writeLineNumber(0,0,0,tcl.code_line);
	}
      }
    }
    else
    {
      tcl.code->codify(sp);
      done=TRUE;
    }
  }
  tcl_font_end();
}

//! Codify 'str' with special font class 's'.
static void tcl_codify(const char *s,const char *str)
{
  if (tcl.code==NULL) return;
  char *tmp= (char *) malloc(strlen(str)+1);
  strcpy(tmp, str);
  tcl_codify(s,tmp);
  free(tmp);
}

//! Codify 'str' with special font class 's'.
static void tcl_codify(const char *s,QString str)
{
  if (tcl.code==NULL) return;
  char *tmp= (char *) malloc(str.length()+1);
  strcpy(tmp, str.data());
  tcl_codify(s,tmp);
  free(tmp);
}

//! Codify 'str' with special font class 's'.
static void tcl_codify(const char *s,QCString str)
{
  if (tcl.code==NULL) return;
  char *tmp= (char *) malloc(str.length()+1);
  strcpy(tmp, str);
  tcl_codify(s,tmp);
  free(tmp);
}

//-----------------------------------------------------------------------------
#undef	YY_INPUT
#define	YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
//-----------------------------------------------------------------------------














#line 1417 "<stdout>"

#define INITIAL 0
#define ERROR 1
#define TOP 2
#define COMMAND 3
#define WORD 4
#define COMMENT 5
#define COMMENT_NL 6
#define COMMENT_CODE 7
#define COMMENT_VERB 8
#define COMMENTLINE 9
#define COMMENTLINE_NL 10
#define STRING 11
#define QUOTE 12
#define BRACE 13
#define BRACKET 14

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

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

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

int tclscanYYlex_destroy (void );

int tclscanYYget_debug (void );

void tclscanYYset_debug (int debug_flag  );

YY_EXTRA_TYPE tclscanYYget_extra (void );

void tclscanYYset_extra (YY_EXTRA_TYPE user_defined  );

FILE *tclscanYYget_in (void );

void tclscanYYset_in  (FILE * in_str  );

FILE *tclscanYYget_out (void );

void tclscanYYset_out  (FILE * out_str  );

yy_size_t tclscanYYget_leng (void );

char *tclscanYYget_text (void );

int tclscanYYget_lineno (void );

void tclscanYYset_lineno (int line_number  );

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

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

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

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

#ifndef YY_NO_INPUT

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

#endif

        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 );
    
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 262144
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO fwrite( tclscanYYtext, tclscanYYleng, 1, tclscanYYout )
#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 = '*'; \
		yy_size_t n; \
		for ( n = 0; n < max_size && \
			     (c = getc( tclscanYYin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( tclscanYYin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, tclscanYYin))==0 && ferror(tclscanYYin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(tclscanYYin); \
			} \
		}\
\

#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 tclscanYYlex (void);

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

/* Code executed at the beginning of each rule, after tclscanYYtext and tclscanYYleng
 * 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 734 "tclscanner.l"

#line 1625 "<stdout>"

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

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! tclscanYYin )
			tclscanYYin = stdin;

		if ( ! tclscanYYout )
			tclscanYYout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			tclscanYYensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				tclscanYY_create_buffer(tclscanYYin,YY_BUF_SIZE );
		}

		tclscanYY_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 tclscanYYtext. */
		*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 >= 180 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_base[yy_current_state] != 567 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
			yy_act = yy_accept[yy_current_state];
			}

		YY_DO_BEFORE_ACTION;

		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
			{
			int yyl;
			for ( yyl = (yy_more_len); yyl < tclscanYYleng; ++yyl )
				if ( tclscanYYtext[yyl] == '\n' )
					   
    tclscanYYlineno++;
;
			}

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 735 "tclscanner.l"
{
D
  yyterminate();
}
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ERROR):
case YY_STATE_EOF(TOP):
case YY_STATE_EOF(COMMAND):
case YY_STATE_EOF(WORD):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(COMMENT_NL):
case YY_STATE_EOF(COMMENT_CODE):
case YY_STATE_EOF(COMMENT_VERB):
case YY_STATE_EOF(COMMENTLINE):
case YY_STATE_EOF(COMMENTLINE_NL):
case YY_STATE_EOF(STRING):
case YY_STATE_EOF(QUOTE):
case YY_STATE_EOF(BRACE):
case YY_STATE_EOF(BRACKET):
#line 739 "tclscanner.l"
{
D
  if (tcl.scan.count()<1)
  {// error
D
    tcl_err("Tcl parser stack empty! Parser error in file '%s'.\n",tcl.file_name.data());
    yyterminate();
  }
  else if (tcl.scan.count()==1)
  {// exit, check on input?
D
    yyterminate();
  }
  else
  {// continue
D
    tcl_command(-1,"");
    tcl_scan_end();
  }
}
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 759 "tclscanner.l"
{
D
  yyless(0);
  tcl.line_comment=tclscanYYlineno;
  tcl_comment(0,"");
}
	YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 765 "tclscanner.l"
{
D
  tcl_codify(NULL,tclscanYYtext);
}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 769 "tclscanner.l"
{
D
  yyless(0);
  tcl.line_command=tclscanYYlineno;
  tcl_command(0,"");
}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 776 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
}
	YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
#line 780 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  QString t=tclscanYYtext;
  t = t.mid(2,t.length()-3);
  t.append('\n');
  tcl_comment(1,t.ascii());
  yy_push_state(COMMENT_NL);
}
	YY_BREAK
case 7:
/* rule 7 can match eol */
YY_RULE_SETUP
#line 789 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  tcl_comment(1,tclscanYYtext+2);
}
	YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 794 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  tcl_codify("comment",t.left(7));
  tcl_comment(2,"\n@code\n");
  yyless(7);
  yy_push_state(COMMENT_CODE);
}
	YY_BREAK
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
#line 802 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  tcl_codify("comment",t.left(11));
  tcl_comment(2,"\n@verbatim\n");
  yyless(11);
  yy_push_state(COMMENT_VERB);
}
	YY_BREAK
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
#line 810 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  QString t=tclscanYYtext;
  t = t.mid(1,t.length()-3);
  t.append('\n');
  tcl_comment(2,t.ascii());
  yy_push_state(COMMENT_NL);
}
	YY_BREAK
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
#line 819 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  tcl_comment(2,tclscanYYtext+1);
}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 824 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  t = t.mid(0,t.length()-1);
  tcl_codify("comment",t.ascii());
  t = t.mid(1,t.length());
  tcl_comment(-2,t.ascii());
  unput(0x1A);
}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 833 "tclscanner.l"
{
D
  tcl_comment(-2,"");
  unput(0x1A);
}
	YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 838 "tclscanner.l"
{
D
  tcl_comment(-2,tclscanYYtext);
  yyless(0);
}
	YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
#line 844 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  t = t.left(t.length()-10);
  tcl_comment(2,t.ascii());
  tcl_comment(2,"\n@endcode\n");
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
#line 853 "tclscanner.l"
{
D
  yymore();
}
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 857 "tclscanner.l"
{
D
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
#line 863 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  t = t.left(t.length()-14);
  tcl_comment(2,t.ascii());
  tcl_comment(2,"\n@endverbatim\n");
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
#line 872 "tclscanner.l"
{
D
  yymore();
}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 876 "tclscanner.l"
{
D
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
#line 882 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  tcl_comment(2,tclscanYYtext);
}
	YY_BREAK
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
#line 887 "tclscanner.l"
{
D
  tcl_codify("comment",tclscanYYtext);
  tcl_comment(2,tclscanYYtext);
  yy_pop_state();
}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 893 "tclscanner.l"
{
D
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 899 "tclscanner.l"
{
D
  yy_pop_state();
  yyless(0);
}
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 904 "tclscanner.l"
{
D
  tcl.string_commentcodify += tclscanYYtext;
}
	YY_BREAK
case 26:
/* rule 26 can match eol */
YY_RULE_SETUP
#line 908 "tclscanner.l"
{
D
  tcl.string_commentcodify += tclscanYYtext;
  QString t=tclscanYYtext;
  t = t.mid(2,t.length()-4);
  t.append('\n');
  tcl.string_commentline += t;
  yy_push_state(COMMENTLINE_NL);
}
	YY_BREAK
case 27:
/* rule 27 can match eol */
YY_RULE_SETUP
#line 917 "tclscanner.l"
{
D
  tcl.string_commentcodify += tclscanYYtext;
  tcl.string_commentline += (tclscanYYtext+2);
}
	YY_BREAK
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
#line 922 "tclscanner.l"
{
D
  yy_pop_state();
  if (tcl.string_commentline.length())
  {
    tcl.entry_current->brief = tcl.string_commentline;
    tcl.entry_current->briefLine = tcl.line_commentline;
    tcl.entry_current->briefFile = tcl.file_name;
  }
  yyless(0);
  tcl_command(-1,tcl.string_commentcodify.ascii());
  tcl.string_commentline="";
  tcl.string_commentcodify="";
}
	YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
#line 937 "tclscanner.l"
{
D
  tcl.string_commentcodify += tclscanYYtext;
  QString t=tclscanYYtext;
  t = t.left(t.length()-3);
  t.append('\n');
  tcl.string_commentline += t;
}
	YY_BREAK
case 30:
/* rule 30 can match eol */
YY_RULE_SETUP
#line 945 "tclscanner.l"
{
D
  tcl.string_commentcodify += tclscanYYtext;
  tcl.string_commentline += tclscanYYtext;
  yy_pop_state();
}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 951 "tclscanner.l"
{
D
  QString t=tclscanYYtext;
  t = t.left(t.length()-1);
  tcl.string_commentcodify += t;
  tcl.string_commentline += t;
  yy_pop_state();
  unput(0x1A);
}
	YY_BREAK
case 32:
/* rule 32 can match eol */
YY_RULE_SETUP
#line 961 "tclscanner.l"
{
D
  tcl.string_commentcodify = tclscanYYtext;
  tcl.string_commentcodify = tcl.string_commentcodify.left(tcl.string_commentcodify.length()-2);
  tcl.string_commentline = "";
  tcl.line_commentline = tclscanYYlineno;
  tcl.line_body1=tclscanYYlineno;
  unput('<');
  unput('#');
  yy_push_state(COMMENTLINE);
}
	YY_BREAK
case 33:
/* rule 33 can match eol */
YY_RULE_SETUP
#line 972 "tclscanner.l"
{
D
  tcl.string_commentcodify = "";
  tcl.string_commentline = "";
  tcl.line_body1=tclscanYYlineno;
  tcl_command(-1,"");
}
	YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
#line 979 "tclscanner.l"
{
D
  tcl.string_commentcodify = "";
  tcl.string_commentline = "";
  tcl.line_body1=tclscanYYlineno;
  tcl_command(-1,tclscanYYtext);
}
	YY_BREAK
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
#line 986 "tclscanner.l"
{
D
  tcl.string_commentcodify = "";
  tcl.string_commentline = "";
  tcl.line_body1=tclscanYYlineno-1;
  tcl_command(-1,tclscanYYtext);
}
	YY_BREAK
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
#line 993 "tclscanner.l"
{
D
  tcl_command(1,tclscanYYtext);
}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 997 "tclscanner.l"
{
D
  tcl.word_is = WORD;
  tcl.string_last = "{*}";
  tcl_word(0,&tclscanYYtext[3]);
}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 1003 "tclscanner.l"
{
D
  switch (tclscanYYtext[0])
  {
    case '{': tcl.word_is = BRACE; break;
    case '[': tcl.word_is = BRACKET; break;
    case '"': tcl.word_is = QUOTE; break;
    default: tcl.word_is = WORD;
  }
  tcl.string_last = "";
  tcl_word(0,tclscanYYtext);
}
	YY_BREAK
case 39:
#line 1017 "tclscanner.l"
case 40:
YY_RULE_SETUP
#line 1017 "tclscanner.l"
{
  tcl_word(1,tclscanYYtext);
}
	YY_BREAK
case 41:
/* rule 41 can match eol */
YY_RULE_SETUP
#line 1020 "tclscanner.l"
{
  tcl_word(2,tclscanYYtext);
}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 1023 "tclscanner.l"
{
  tcl_word(3,tclscanYYtext);
}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 1026 "tclscanner.l"
{
  tcl_word(4,tclscanYYtext);
}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 1029 "tclscanner.l"
{
  tcl_word(5,tclscanYYtext);
}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 1032 "tclscanner.l"
{
  tcl_word(6,tclscanYYtext);
}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 1035 "tclscanner.l"
{
  tcl_word(7,tclscanYYtext);
}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 1038 "tclscanner.l"
{
  tcl_word(8,tclscanYYtext);
}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 1041 "tclscanner.l"
{
  tcl_word(9,tclscanYYtext);
}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 1044 "tclscanner.l"
{
  tcl_word(10,tclscanYYtext);
}
	YY_BREAK
case 50:
/* rule 50 can match eol */
YY_RULE_SETUP
#line 1047 "tclscanner.l"
{
  tcl_word(11,tclscanYYtext);
}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 1050 "tclscanner.l"
{
  tcl_word(12,tclscanYYtext);
}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 1053 "tclscanner.l"
{
  tcl_word(1,tclscanYYtext);
}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 1056 "tclscanner.l"
ECHO;
	YY_BREAK
#line 2290 "<stdout>"

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

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

		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed tclscanYYin at a new source and called
			 * tclscanYYlex().  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 = tclscanYYin;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

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

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

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

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

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

				if ( tclscanYYwrap( ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * tclscanYYtext, 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 tclscanYYlex */

/* 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
		{
			yy_size_t 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 )
				{
				yy_size_t 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. */
					tclscanYYrealloc((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;
			tclscanYYrestart(tclscanYYin  );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

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

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

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

	return ret_val;
}

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

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

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 180 )
				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 >= 180 )
			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 == 179);

	return yy_is_jam ? 0 : yy_current_state;
}

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

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

	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register yy_size_t number_to_move = (yy_n_chars) + 2;
		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
		register char *source =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];

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

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

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

	*--yy_cp = (char) c;

    if ( c == '\n' ){
        --tclscanYYlineno;
    }

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

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

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

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

		else
			{ /* need more input */
			yy_size_t 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. */
					tclscanYYrestart(tclscanYYin );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( tclscanYYwrap( ) )
						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 tclscanYYtext */
	(yy_hold_char) = *++(yy_c_buf_p);

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

	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 tclscanYYrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        tclscanYYensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            tclscanYY_create_buffer(tclscanYYin,YY_BUF_SIZE );
	}

	tclscanYY_init_buffer(YY_CURRENT_BUFFER,input_file );
	tclscanYY_load_buffer_state( );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void tclscanYY_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		tclscanYYpop_buffer_state();
	 *		tclscanYYpush_buffer_state(new_buffer);
     */
	tclscanYYensure_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;
	tclscanYY_load_buffer_state( );

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

static void tclscanYY_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;
	tclscanYYin = 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 tclscanYY_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) tclscanYYalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in tclscanYY_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 *) tclscanYYalloc(b->yy_buf_size + 2  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in tclscanYY_create_buffer()" );

	b->yy_is_our_buffer = 1;

	tclscanYY_init_buffer(b,file );

	return b;
}

/** Destroy the buffer.
 * @param b a buffer created with tclscanYY_create_buffer()
 * 
 */
    void tclscanYY_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 )
		tclscanYYfree((void *) b->yy_ch_buf  );

	tclscanYYfree((void *) b  );
}

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

{
	int oerrno = errno;
    
	tclscanYY_flush_buffer(b );

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

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

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

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * 
 */
    void tclscanYY_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 )
		tclscanYY_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 tclscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
    	if (new_buffer == NULL)
		return;

	tclscanYYensure_buffer_stack();

	/* This block is copied from tclscanYY_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 tclscanYY_switch_to_buffer. */
	tclscanYY_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 tclscanYYpop_buffer_state (void)
{
    	if (!YY_CURRENT_BUFFER)
		return;

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

	if (YY_CURRENT_BUFFER) {
		tclscanYY_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 tclscanYYensure_buffer_stack (void)
{
	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;
		(yy_buffer_stack) = (struct yy_buffer_state**)tclscanYYalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in tclscanYYensure_buffer_stack()" );
								  
		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
				
		(yy_buffer_stack_max) = num_to_alloc;
		(yy_buffer_stack_top) = 0;
		return;
	}

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

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

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

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

/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * 
 * @return the newly allocated buffer state object. 
 */
YY_BUFFER_STATE tclscanYY_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) tclscanYYalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in tclscanYY_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;

	tclscanYY_switch_to_buffer(b  );

	return b;
}

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

/** Setup the input buffer state to scan the given bytes. The next call to tclscanYYlex() 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 tclscanYY_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n, i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) tclscanYYalloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in tclscanYY_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 = tclscanYY_scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in tclscanYY_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;
}

    static void yy_push_state (int  new_state )
{
    	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_start_stack_depth) * sizeof( int );

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

		else
			(yy_start_stack) = (int *) tclscanYYrealloc((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);
}

    static void yy_pop_state  (void)
{
    	if ( --(yy_start_stack_ptr) < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

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

    static int yy_top_state  (void)
{
    	return (yy_start_stack)[(yy_start_stack_ptr) - 1];
}

#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 tclscanYYtext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		tclscanYYtext[tclscanYYleng] = (yy_hold_char); \
		(yy_c_buf_p) = tclscanYYtext + yyless_macro_arg; \
		(yy_hold_char) = *(yy_c_buf_p); \
		*(yy_c_buf_p) = '\0'; \
		tclscanYYleng = yyless_macro_arg; \
		} \
	while ( 0 )

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

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

/** Get the input stream.
 * 
 */
FILE *tclscanYYget_in  (void)
{
        return tclscanYYin;
}

/** Get the output stream.
 * 
 */
FILE *tclscanYYget_out  (void)
{
        return tclscanYYout;
}

/** Get the length of the current token.
 * 
 */
yy_size_t tclscanYYget_leng  (void)
{
        return tclscanYYleng;
}

/** Get the current token.
 * 
 */

char *tclscanYYget_text  (void)
{
        return tclscanYYtext;
}

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

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

void tclscanYYset_out (FILE *  out_str )
{
        tclscanYYout = out_str ;
}

int tclscanYYget_debug  (void)
{
        return tclscanYY_flex_debug;
}

void tclscanYYset_debug (int  bdebug )
{
        tclscanYY_flex_debug = bdebug ;
}

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

    /* We do not touch tclscanYYlineno unless the option is enabled. */
    tclscanYYlineno =  1;
    
    (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;

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

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

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

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

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

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

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * tclscanYYlex() 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 *tclscanYYalloc (yy_size_t  size )
{
	return (void *) malloc( size );
}

void *tclscanYYrealloc  (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 tclscanYYfree (void * ptr )
{
	free( (char *) ptr );	/* see tclscanYYrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 1056 "tclscanner.l"



//! Start new scan context for given 'content'.
// @return created new scan context.
static void tcl_scan_start(int type, QString content, const char *after, QString ns, Entry *entry_cl, Entry *entry_fn)
{
  tcl_scan *myScan=tcl.scan.at(0);
  QString myName;
  char c[2]=" ";
tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.ascii());

  myScan->line1=tclscanYYlineno;
  yy_push_state(TOP);

  myScan=new tcl_scan;
  myScan->type = type;
  myScan->string_after=after;

  switch (myScan->type)
  {
    case QUOTE: c[0]='"';
      break;
    case BRACE: c[0]='{';
      break;
    case BRACKET: c[0]='[';
      break;
    default:
      break;
  }
  if (c[0]!=' ')
  {
    tcl_codify(NULL,c);
    content = content.mid(1,content.length()-2);
  }
  content += (char)0x1A;// for detection end of scan context
  myScan->ns = ns;
  myScan->entry_cl = entry_cl;
  myScan->entry_fn = entry_fn;
  myScan->entry_scan = tcl.entry_current;
  myScan->buffer_state=tclscanYY_scan_string(content.ascii());
  myScan->line0=tcl.line_body0;
  myScan->line1=tcl.line_body1;
  tclscanYYlineno=myScan->line0;
  myScan->protection = tcl.protection;

  tcl.entry_inside = myScan->entry_scan;
  tcl.entry_current = tcl_entry_new();
  tcl.scan.insert(0,myScan);
  tclscanYY_switch_to_buffer(myScan->buffer_state);
}

//! Close current scan context.
static void tcl_scan_end()
{
  tcl_scan *myScan=tcl.scan.at(0);
  char c[2]=" ";
tcl_inf("line=%d\n",myScan->line1);

  switch (myScan->type)
  {
    case QUOTE: c[0]='"'; break;
    case BRACE: c[0]='}'; break;
    case BRACKET: c[0]=']'; break;
  }
  if (c[0]!=' ') {tcl_codify(NULL,c);}
  if (myScan->string_after.length())
  {
    tcl_codify("comment",myScan->string_after);
  }
  tclscanYY_delete_buffer(myScan->buffer_state);
  tcl.scan.removeFirst();
  yy_pop_state();
  myScan=tcl.scan.at(0);
  tcl.entry_inside = myScan->entry_scan;
  tclscanYY_switch_to_buffer(myScan->buffer_state);
  tclscanYYlineno=myScan->line1;
  tcl.protection = myScan->protection;
}

//! Handling of word parsing.
static void tcl_word(int what,const char *text) 
{
  static char myList[1024]="";// nesting level list
  static int myLevel=0;// number of current nesting level
  static int myWhite=0;// set true when next char should be whitespace
  static char myWord;// internal state

  switch (what)
  {
  case 0:// start
    yy_push_state(WORD);
    switch (text[0])
    {
      case '{':
      case '[':
      case '"': myWord = text[0]; break;
      default: myWord = '.';
    }
    myList[0]=myWord;
    myLevel=1;
    myWhite=0;
  break;
  case 1:// all other chars
    if (myWhite)
    {// {x}y "x"y
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    if (myLevel==0)
    {
      myWord='.';
      myList[0]=myWord;
      myLevel=1;
    }
  break;
  case 2:// \\\n
    if (myLevel==0)
    {
      myWord=' ';
      yy_pop_state();
      yyless(0);
tcl_inf("(\\\n) ?%s?\n",tcl.string_last.ascii());
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      case '[':
      case '"':
      break;
      case '.':
        if (myLevel==1)
        {
          myWord=' ';
          yy_pop_state();
          yyless(0);
tcl_inf("(\\\n) ?%s?\n",tcl.string_last.ascii());
          return;
        }
      break;
    }
    myWhite=0;
  break;
  case 3:// {
    if (myWhite)
    {// {x}{ "x"{
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      case '[':
        myList[myLevel++]='{';
      break;
      case '"':
      case '.':
      break;
    }
    myWhite=0;
  break;
  case 4:// }
    if (myWhite)
    {// {x}{ "x"{
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':// {{x}}
        myLevel--;
        if (myLevel==0 && tcl.code==NULL) 
	{
          myWhite=1;
        }
      break;
      case '[':
      case '"':
      case '.':
      break;
    }
  break;
  case 5:// [
    if (myWhite)
    {// {x}[
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      break;
      case '[':
      case '"':
      case '.':
        myList[myLevel++]='[';
      break;
    }
    myWhite=0;
  break;
  case 6:// ]
    if (myWhite)
    {// {x}]
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      break;
      case '[':
	myLevel--;
      break;
      case '"':
      case '.':
      break;
    }
    myWhite=0;
  break;
  case 7:// "
    if (myWhite)
    {// {x}"
      tcl_err("expected word separator: %s\n",text);
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      break;
      case '[':
        myList[myLevel++]='"';
      break;
      case '"':
        myLevel--;
      case '.':
      break;
    }
  break;
  case 8:// ' '
  case 9:// \t
  case 10:// ;
  case 11:// \n
    if (myLevel==0)
    {
      myWord=' ';
      yy_pop_state();
      yyless(0);
tcl_inf("(%d) ?%s?\n",what,tcl.string_last.ascii());
      return;
    }
    switch (myList[myLevel-1])
    {
      case '{':
      case '[':
      case '"':
      break;
      case '.':
        if (myLevel==1)
        {
          myWord=' ';
          yy_pop_state();
          yyless(0);
tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.ascii());
          return;
	}
        else
        {
          myLevel--;
        }
      break;
    }
    myWhite=0;
  break;
  case 12:// \x1A
    if (myLevel==0)
    {
      myWord=' ';
      yy_pop_state();
      yyless(0);
tcl_inf("(%d) ?%s?\n",what,tcl.string_last.ascii());
      return;
    }
    if (myLevel!=1 || myList[0] != '.')
    {
      tcl_war("level=%d expected=%c\n",myLevel,myList[myLevel-1]);
    }
    myWord=' ';
    yy_pop_state();
    yyless(0);
tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.ascii());
    return;
    myWhite=0;
  break;
  default:
    tcl_err("wrong state: %d\n",what);
    return;
  }
  tcl.string_last += text;
}

//! Handling of comment parsing.
static void tcl_comment(int what,const char *text)
{
  if (what==0)
  { // begin of comment
    if (tcl.comment)
    {
      tcl_err("comment in comment\n");
      return;
    }
    yy_push_state(COMMENT);
tcl_inf("<- %s\n",text);
    tcl.string_comment="";
    tcl.comment=0;
  }
  else if (what==1)
  { // start new comment
    if (tcl.comment)
    {
      tcl_comment(99,""); // inbody
    }
    tcl.string_comment=text;
    tcl.comment=1;
  }
  else if (what==2)
  { // add to comment
    if (tcl.comment)
    {
      tcl.string_comment+=text;
    }
  }
  else if (what==-1 || what == -2)
  { // end of comment without/with command
    if (tcl.comment)
    {
      tcl.string_last=tcl.string_comment;
      tcl_comment(100+what,"");
    }
    else
    {
      tcl.string_last = "";
tcl_inf("-> %s\n",(const char *)tcl.string_comment);
    }
    yy_pop_state();
    tcl.string_comment="";
    tcl.comment=0;
  }
  else if (what==98 || what==99)
  { // 98=new 99=inbody
    if (tcl.this_parser && tcl.string_comment.length())
    {
tcl_inf("-> %s\n",(const char *)tcl.string_comment);
      int myPos=0;
      bool myNew=0;
      int myLine=tcl.line_comment;
      BufStr myI(1024);
      BufStr myO(1024);
      Protection myProt=tcl.protection;

      // resolve ALIASES
      myI.addArray("/*!",3);
      myI.addArray(tcl.string_comment.ascii(),tcl.string_comment.length());
      myI.addArray("*/",2);
      convertCppComments(&myI,&myO,tcl.file_name);
      myO.dropFromStart(3);
      myO.shrink(myO.curPos()-2);
      myO.addChar('\0');
      QCString myDoc = myO.data();
      if (what==99)
      { // inbody comment file or namespace or class or proc/method
        int myPos0;
        int myLine0;
        Entry myEntry0; // used to test parsing
        Entry *myEntry;

        Entry *myEntry1=NULL;
        if (tcl.scan.at(0)->entry_fn)
        {
          myEntry1=tcl.scan.at(0)->entry_fn;
        }
        else if (tcl.scan.at(0)->entry_cl)
        {
          myEntry1=tcl.scan.at(0)->entry_cl;
        }

        myPos0=myPos;
        myLine0=myLine;
        while (parseCommentBlock(tcl.this_parser, &myEntry0, myDoc, tcl.file_name,
	  myLine, FALSE, tcl.config_autobrief, FALSE, myProt, myPos, myNew))
        {
          if (myNew)
          { // we need a new entry in this case
            myNew=0;
            myEntry = tcl_entry_new();
            parseCommentBlock(tcl.this_parser, myEntry, myDoc, tcl.file_name,
	      myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
	    tcl.entry_inside->addSubEntry(myEntry);
          }
          else
          { // we can add to current entry in this case
            if (myEntry1==NULL)
            {
              myEntry1=tcl_entry_namespace(tcl.scan.at(0)->ns);
            }
            parseCommentBlock(tcl.this_parser, myEntry1, myDoc, tcl.file_name,
	      myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
          }
          myPos0=myPos;
          myLine0=myLine;
        }
        if (myNew)
        { // we need a new entry
          myNew=0;
          myEntry = tcl_entry_new();
          parseCommentBlock(tcl.this_parser, myEntry, myDoc, tcl.file_name,
	    myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
	  tcl.entry_inside->addSubEntry(myEntry);
        }
        else
        { // we can add to current entry
          if (myEntry1==NULL)
          {
            myEntry1=tcl_entry_namespace(tcl.scan.at(0)->ns);
          }
          parseCommentBlock(tcl.this_parser, myEntry1, myDoc, tcl.file_name,
	    myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
        }
      }
      else
      { // new entry
        tcl.entry_current = tcl_entry_new();
        while (parseCommentBlock(tcl.this_parser, tcl.entry_current, myDoc,
  	  tcl.file_name, myLine, FALSE, tcl.config_autobrief, FALSE,
	  myProt, myPos, myNew))
        {
          if (myNew)
          {
	    tcl.entry_inside->addSubEntry(tcl.entry_current);
	    tcl.entry_current = tcl_entry_new();
          }
          else
          {
	    tcl.entry_current->section = tcl.entry_inside->section;
	    tcl.entry_current->name = tcl.entry_inside->name;
          }
        }
        if (myNew)
        {
          tcl.entry_inside->addSubEntry(tcl.entry_current);
          tcl.entry_current = tcl_entry_new();
        }
        else
        {
          tcl.entry_current->section = tcl.entry_inside->section;
          tcl.entry_current->name = tcl.entry_inside->name;
        }
      }
      if (tcl.protection != myProt)
      {
        tcl.scan.at(0)->protection = tcl.protection = myProt;
      }
    }
  }
  else
  {
    tcl_err("what %d\n",what);
    return;
  }
}

//! Parse given \c arglist .
static void tcl_command_ARGLIST(QString &arglist)
{
D
  Argument *myArg;
  QStringList myArgs;
  QString myArglist="";

  if (tcl.entry_current->argList==NULL)
  {
    tcl.entry_current->argList=new ArgumentList;
  }
  tcl_split_list(arglist,myArgs);
  for (uint i=0;i<myArgs.count();i++)
  {
    QStringList myArgs1;
    myArg=new Argument;

    tcl_split_list(*myArgs.at(i),myArgs1);
    if (myArgs1.count()==2)
    {
      myArg->name= *myArgs1.at(0);
      myArg->defval= *myArgs1.at(1);
      if (myArg->defval.isEmpty())
      {
	myArg->defval = " ";
      }
      myArglist = myArglist + "?" + myArg->name.data() + "? ";
    }
    else
    {
      myArg->name= *myArgs.at(i);
      myArglist = myArglist + myArg->name.data() + " ";
    }
    tcl.entry_current->argList->append(myArg);
  }
  arglist = myArglist;
  tcl.entry_current->args = arglist;
}

//! Create link.
static void tcl_codify_link(const char *name)
{
  if (tcl.code == NULL || name == NULL) return;
  static int init=0;
  static QDict<MemberDef> fn;
  if (init==0) 
  {
    init=1;
    MemberNameSDict::Iterator mni(*Doxygen::memberNameSDict);
    MemberNameSDict::Iterator fni(*Doxygen::functionNameSDict);
    MemberName *mn=0;
    MemberDef *md;
    for (mni.toFirst();(mn=mni.current());++mni) 
    {
      MemberNameIterator mi(*mn);
      for (mi.toFirst();(md=mi.current());++mi) 
      {
	fn.insert(md->qualifiedName(),md);
      }
    }
    for (fni.toFirst();(mn=fni.current());++fni) 
    {
      MemberNameIterator fi(*mn);
      for (fi.toFirst();(md=fi.current());++fi) 
      {
	fn.insert(md->qualifiedName(),md);
      }
    }
  }
  MemberDef *myDef;
  QString myName=name; 

  if (strncmp(name,"::",2)==0) // fully qualified global command
  {
    myName = myName.mid(2);
    myDef = fn.find(myName);
  }
  else // not qualified name
  {
    myDef = NULL;
    myName = tcl.scan.at(0)->ns;
    myName = myName + "::" + myName;
    myDef = fn.find(myName); // search namespace command
    if (myDef == NULL)
    {
      myDef = fn.find(name); // search global command
    }
  }
  if (myDef != NULL) // documented command
  {
    tcl.code->writeCodeLink(myDef->getReference().data(),
		myDef->getOutputFileBase().data(),
		myDef->anchor().data(),
		name,
		myDef->qualifiedName().data());
    if (tcl.memberdef)
    {
	myDef->addSourceReferencedBy(tcl.memberdef);
	tcl.memberdef->addSourceReferences(myDef);
    }
  }
  else if (tcl_keyword(myName)) // check keyword
  {
    tcl_codify("keyword",name);
  }
  else
  {
    tcl_codify(NULL,name); // something else
  }
  
}
//! Handle all other commands.
// Create links of first command word or first command word inside [].
static void tcl_command_OTHER(const char *text)
{
  if (tcl.code == NULL) return;
D
  QCString myName; 

  for (unsigned int i=0; i< tcl.list_commandwords.count(); i++)
  {
    myName = *tcl.list_commandwords.at(i);
    if (i==0)
    {
      tcl_codify_link(myName.data());
    }
    else //TODO check on [... inside current string
    {
      QCString myStr="";
      int myCmd=0;
      for (unsigned int i=0;i<myName.length();i++)
      {
        char c = myName[i];
	if (myCmd) 
	{
	  if (c==' '||c=='\t'||c=='\n'||c==']') 
	  {//end of command
	    tcl_codify_link(myStr.data());
	    myStr="";
	    myCmd=0;
	  }
	  myStr+=c;
	} 
	else 
	{
	  myStr+=c;
	  if (c=='[') 
	  {//start of command
            tcl_codify(NULL,myStr);
	    myStr="";
	    myCmd=1;
	  }
	}
      }
      tcl_codify(NULL,myStr);
    }
  }
  tcl_codify(NULL,text);
}

//! Handle \c proc statements.
static void tcl_command_PROC(const char *text)
{
D
  QString myNs, myName;
  Entry *myEntryNs, *myEntry;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify(NULL,*tcl.list_commandwords.at(2));
  tcl_codify(NULL,*tcl.list_commandwords.at(3));
  tcl_codify(NULL,*tcl.list_commandwords.at(4));
  tcl_codify(NULL,*tcl.list_commandwords.at(5));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(2),myNs,myName);
  if (myNs.length())
  {
    myEntryNs = tcl_entry_namespace(myNs);
  }
  else
  {
    myEntryNs = tcl_entry_namespace(myScan->ns);
  }
  //why not needed here? tcl.fn.remove(myName);
  tcl.entry_current->section = Entry::FUNCTION_SEC;
  tcl.entry_current->mtype = Method;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl_protection(tcl.entry_current);
  tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
  myEntryNs->addSubEntry(tcl.entry_current);
  myEntry = tcl.entry_current;
  tcl.fn.insert(myName,myEntry);
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),text,
	myEntryNs->name,NULL,myEntry);
}

//! Handle \c itcl::body statements and \c oo::define method and method inside \c itcl::class statements.
static void tcl_command_METHOD(const char *text)
{
D
  QString myNs, myName;
  Entry *myEntryCl, *myEntry;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify(NULL,*tcl.list_commandwords.at(2));
  tcl_codify(NULL,*tcl.list_commandwords.at(3));
  tcl_codify(NULL,*tcl.list_commandwords.at(4));
  tcl_codify(NULL,*tcl.list_commandwords.at(5));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(2),myNs,myName);
  if (myNs.length())
  {
    myEntryCl = tcl_entry_class(myNs);
  }
  else
  {
    myNs = myScan->ns;
    myEntryCl = myScan->entry_cl;
  }
  // needed in case of more then one definition p.e. itcl::method and itcl::body
  // see also bug #
  tcl.fn.remove(myName);
  tcl.entry_current->section = Entry::FUNCTION_SEC;
  tcl.entry_current->mtype = Method;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl_protection(tcl.entry_current);
  tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
  myEntryCl->addSubEntry(tcl.entry_current);
  tcl.fn.insert(myName,tcl.entry_current);
  myEntry = tcl.entry_current;
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),text,
	myNs, myEntryCl, myEntry);
}

//! Handle \c constructor statements inside class definitions.
static void tcl_command_CONSTRUCTOR(const char *text)
{
D
  QString myNs, myName;
  Entry *myEntryCl, *myEntry;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify(NULL,*tcl.list_commandwords.at(2));
  tcl_codify(NULL,*tcl.list_commandwords.at(3));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(0),myNs,myName);
  if (myNs.length())
  {
    myEntryCl = tcl_entry_class(myNs);
  }
  else
  {
    myNs = myScan->ns;
    myEntryCl = myScan->entry_cl;
  }
  tcl.entry_current->section = Entry::FUNCTION_SEC;
  tcl.entry_current->mtype = Method;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl_protection(tcl.entry_current);
  tcl_command_ARGLIST(*tcl.list_commandwords.at(2));
  myEntryCl->addSubEntry(tcl.entry_current);
  myEntry = tcl.entry_current;
  tcl.fn.insert(myName,myEntry);
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),text,
	myNs, myEntryCl, myEntry);
}

//! Handle \c destructor statements inside class definitions.
static void tcl_command_DESTRUCTOR(const char *text)
{
D
  QString myNs, myName;
  Entry *myEntryCl, *myEntry;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(0),myNs,myName);
  if (myNs.length())
  {
    myEntryCl = tcl_entry_class(myNs);
  }
  else
  {
    myNs = myScan->ns;
    myEntryCl = myScan->entry_cl;
  }
  tcl.entry_current->section = Entry::FUNCTION_SEC;
  tcl.entry_current->mtype = Method;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl_protection(tcl.entry_current);
  myEntryCl->addSubEntry(tcl.entry_current);
  myEntry = tcl.entry_current;
  tcl.fn.insert(myName,myEntry);
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(2),text,
	myNs, myEntryCl, myEntry);
}

//! Handle \c namespace statements.
static void tcl_command_NAMESPACE(const char *text)
{
D
  QString myNs, myName, myStr;
  Entry *myEntryNs=NULL;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify("keyword",*tcl.list_commandwords.at(2));
  tcl_codify(NULL,*tcl.list_commandwords.at(3));
  tcl_codify(NULL,*tcl.list_commandwords.at(4));
  tcl_codify(NULL,*tcl.list_commandwords.at(5));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(4),myNs,myName);
  if (myNs.length())
  {
    myName = myNs+"::"+myName;
  }
  tcl.entry_current->section = Entry::NAMESPACE_SEC;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl.entry_main->addSubEntry(tcl.entry_current);
  tcl.ns.insert(myName,tcl.entry_current);
  myEntryNs = tcl.entry_current;
  myStr = *tcl.list_commandwords.at(6);
  if (tcl.list_commandwords.count() > 7)
  {
    for (uint i=7;i<tcl.list_commandwords.count();i++)
    {
      myStr.append(*tcl.list_commandwords.at(i));
    }
    tcl.word_is=STRING;
  }
  tcl_scan_start(tcl.word_is,myStr,text, myName, NULL, NULL);
}

//! Handle \c itcl::class statements.
static void tcl_command_ITCL_CLASS(const char *text)
{
D
  QString myNs, myName, myStr;
  Entry *myEntryCl;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify("NULL",*tcl.list_commandwords.at(2));
  tcl_codify("NULL",*tcl.list_commandwords.at(3));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(2),myNs,myName);
  if (myNs.length())
  {
    myName = myNs+"::"+myName;
  }
  tcl.entry_current->section = Entry::CLASS_SEC;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl.entry_main->addSubEntry(tcl.entry_current);
  tcl.cl.insert(myName,tcl.entry_current);
  myEntryCl = tcl.entry_current;
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),text,
	myName, myEntryCl, NULL);
}

//! Handle \c oo::class statements.
static void tcl_command_OO_CLASS(const char *text)
{
D
  QString myNs, myName, myStr;
  Entry *myEntryNs, *myEntryCl;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify("NULL",*tcl.list_commandwords.at(2));
  tcl_codify("NULL",*tcl.list_commandwords.at(3));
  tcl_codify("NULL",*tcl.list_commandwords.at(4));
  tcl_codify("NULL",*tcl.list_commandwords.at(5));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(4),myNs,myName);
  if (myNs.length())
  {
    myName = myNs+"::"+myName;
  }
  tcl.entry_current->section = Entry::CLASS_SEC;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl.entry_main->addSubEntry(tcl.entry_current);
  myEntryNs = tcl_entry_namespace(myName);
  tcl.cl.insert(myName,tcl.entry_current);
  myEntryCl = tcl.entry_current;
  tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),text,
	myName, myEntryCl, NULL);
}

//! Handle \c oo::define statements.
static void tcl_command_OO_DEFINE(const char *text)
{
D
  QString myNs, myName, myStr;
  Entry *myEntryCl;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  tcl_codify(NULL,*tcl.list_commandwords.at(1));
  tcl_codify("NULL",*tcl.list_commandwords.at(2));
  tcl_codify("NULL",*tcl.list_commandwords.at(3));
  tcl_name(myScan->ns,*tcl.list_commandwords.at(2),myNs,myName);
  if (myNs.length())
  {
    myName = myNs+"::"+myName;
  }
  myEntryCl = tcl_entry_class(myName);
  myStr = *tcl.list_commandwords.at(4);
  if (tcl.list_commandwords.count() > 5)
  {
    for (uint i=5;i<tcl.list_commandwords.count();i++)
    {
      myStr.append(*tcl.list_commandwords.at(i));
    }
    tcl.word_is=STRING;
  }
  tcl_scan_start(tcl.word_is,myStr,text,myName,myEntryCl,NULL);
}

//! Handle \c variable statements.
static void tcl_command_VARIABLE(const char *text, int inclass)
{
D
  QString myNs, myName;
  Entry *myEntry;
  tcl_scan *myScan = tcl.scan.at(0);

  tcl_codify("keyword",*tcl.list_commandwords.at(0));
  for (unsigned int i=1; i< tcl.list_commandwords.count(); i++)
  {
    tcl_codify(NULL,*tcl.list_commandwords.at(i));
  }
  tcl_name(myScan->ns,*tcl.list_commandwords.at(2),myNs,myName);
  if (myNs.length())
  {// qualified variables go into namespace
    myEntry = tcl_entry_namespace(myNs);
    tcl.entry_current->stat = true;
  }
  else
  {
    if (inclass)
    {
      myEntry = myScan->entry_cl;
      tcl.entry_current->stat = false;
    }
    else
    {
      myEntry = tcl_entry_namespace(myScan->ns);
      tcl.entry_current->stat = true;
    }
  }
  tcl.entry_current->section = Entry::VARIABLE_SEC;
  tcl.entry_current->name = myName;
  tcl.entry_current->startLine = tcl.line_command;
  tcl.entry_current->bodyLine = tcl.line_body0;
  tcl.entry_current->endBodyLine = tcl.line_body1;
  tcl_protection(tcl.entry_current);
  myEntry->addSubEntry(tcl.entry_current);
  tcl.entry_current = tcl_entry_new();
  tcl_codify("comment",text);
}

//! Handling of command parsing.
static void tcl_command(int what,const char *text)
{
  int myLine=0;
  if (what==0)
  {
    tcl.scan.at(0)->line1=tclscanYYlineno;// current line in scan context
    tcl.line_body0=tclscanYYlineno;// start line of command
tcl_inf("<- %s\n",text);
    yy_push_state(COMMAND);
    tcl.list_commandwords.clear();
    tcl.string_command="";
    tcl.string_last="";
    tcl.command=1;
    return;
  }
  if (what==1)
  {
    if (tcl.string_last.length())
    {
      tcl.list_commandwords.append(tcl.string_last);
      tcl.string_last="";
    }
    if (text) 
    {
      tcl.list_commandwords.append(text);
    }
    return;
  }
  if (what!=-1)
  {// should not happen
    tcl_err("what %d\n",what);
    return;
  }
tcl_inf("->\n");
  if (tcl.command==0)
  {
    return;//TODO check on inside comment
  }
  if (tcl.string_last != "")
  {// get last word
    tcl.list_commandwords.append(tcl.string_last);
    tcl.string_last="";
  }
  yy_pop_state();

  // check command
  QString myStr = *tcl.list_commandwords.at(0);
  int myLevel = 0;
  Protection myProt = tcl.protection;

  if (tcl.list_commandwords.count() < 3)
  {
    tcl_command_OTHER(text);
    goto command_end;
  }
  // remove leading "::" and apply TCL_SUBST
  if (myStr.left(2)=="::") myStr = myStr.mid(2);
  if (tcl.config_subst.contains(myStr))
  {
    myStr=tcl.config_subst[myStr];
  }
  if (strcmp("private",myStr)==0)
  {
    tcl.protection = Private;
    myLevel = 1;
  }
  else if (strcmp("protected",myStr)==0)
  {
    tcl.protection = Protected;
    myLevel = 1;
  }
  else if (strcmp("public",myStr)==0)
  {
    tcl.protection = Public;
    myLevel = 1;
  }
  if (myLevel)
  {
    tcl_codify("keyword",*tcl.list_commandwords.at(0));
    tcl_codify(NULL,*tcl.list_commandwords.at(1));
    tcl.list_commandwords.remove(tcl.list_commandwords.at(1));
    tcl.list_commandwords.remove(tcl.list_commandwords.at(0));
    if (tcl.list_commandwords.count()==1)
    {
      tcl_scan *myScan = tcl.scan.at(0);
      tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(0),text,
	myScan->ns,myScan->entry_cl,myScan->entry_fn);
      myProt = tcl.protection;
      goto command_end;
    }
    myStr	= *tcl.list_commandwords.at(0);
    // remove leading "::" and apply TCL_SUBST
    if (myStr.left(2)=="::") myStr = myStr.mid(2);
    if (tcl.config_subst.contains(myStr))
    {
      myStr=tcl.config_subst[myStr];
    }
  }
  if (strcmp("proc",myStr)==0)
  {
    if (tcl.list_commandwords.count() == 5)
    {// itcl::proc
      tcl.list_commandwords.append("");
      tcl.list_commandwords.append("");
    }
    if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
    tcl_command_PROC(text);
    goto command_end;
  }
  if (strcmp("method",myStr)==0)
  {
    if (tcl.list_commandwords.count() == 5)
    {// itcl::method
      tcl.list_commandwords.append("");
      tcl.list_commandwords.append("");
    }
    if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
    tcl_command_METHOD(text);
    goto command_end;
  }
  if (strcmp("constructor",myStr)==0)
  {
    if (tcl.list_commandwords.count() != 5) {myLine=__LINE__;goto command_warn;}
    tcl_command_CONSTRUCTOR(text);
    goto command_end;
  }
  if (strcmp("destructor",myStr)==0)
  {
    if (tcl.list_commandwords.count() != 3) {myLine=__LINE__;goto command_warn;}
    tcl_command_DESTRUCTOR(text);
    goto command_end;
  }
  if (strcmp("namespace",myStr)==0)
  {
    if (strcmp("eval",*tcl.list_commandwords.at(2))==0)
    {
      if (tcl.list_commandwords.count() < 7) {myLine=__LINE__;goto command_warn;}
      tcl_command_NAMESPACE(text);
      goto command_end;
    }
    tcl_command_OTHER(text);
    goto command_end;
  }
  if (strcmp("itcl::class",myStr)==0)
  {
    if (tcl.list_commandwords.count() != 5) {myLine=__LINE__;goto command_warn;}
    tcl_command_ITCL_CLASS(text);
    goto command_end;
  }
  if (strcmp("itcl::body",myStr)==0)
  {
    if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
    tcl_command_METHOD(text);
    goto command_end;
  }
  if (strcmp("oo::class",myStr)==0)
  {
    if (strcmp("create",*tcl.list_commandwords.at(2))==0)
    {
      if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
      tcl_command_OO_CLASS(text);
      goto command_end;
    }
    tcl_command_OTHER(text);
    goto command_end;
  }
  if (strcmp("oo::define",myStr)==0)
  {
    if (tcl.list_commandwords.count() < 5) {myLine=__LINE__;goto command_warn;}
    tcl_command_OO_DEFINE(text);
    goto command_end;
  }
  if (strcmp("variable",myStr)==0)
  {
    if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
    if (tcl.scan.at(0)->entry_fn == NULL)
    {// only parsed outside functions
      tcl_command_VARIABLE(text,tcl.scan.at(0)->entry_cl!=NULL&&tcl.scan.at(0)->entry_cl->name!="");
      goto command_end;
    }
  }
  if (strcmp("common",myStr)==0)
  {
    if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
    if (tcl.scan.at(0)->entry_fn == NULL)
    {// only parsed outside functions
      tcl_command_VARIABLE(text,0);
      goto command_end;
    }
  }
  if (strcmp("inherit",myStr)==0 || strcmp("superclass",myStr)==0)
  {
    if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
    if (tcl.scan.at(0)->entry_cl!=NULL&&tcl.scan.at(0)->entry_cl->name!="")
    {
      for (unsigned int i = 2; i < tcl.list_commandwords.count(); i++)
      {
        tcl.scan.at(0)->entry_cl->extends->append(new BaseInfo(*tcl.list_commandwords.at(i),Public,Normal));
      }
    }
  }
  tcl_command_OTHER(text);
  goto command_end;
  command_warn:
    tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").ascii());
    tcl_command_OTHER(text);
  command_end:
    tcl.list_commandwords.clear();
    tcl.command = 0;
    tcl.protection = myProt;
}

//----------------------------------------------------------------------------
//! Common initializations.
static void tcl_init()
{
  // Get values from option TCL_SUBST
  tcl.config_subst.clear();
  if (Config::instance()->get("TCL_SUBST")) 
  {
    QStrList myStrList = Config_getList("TCL_SUBST");
    const char *s=myStrList.first();
    while (s) 
    {
      QCString myStr=s;
      int i=myStr.find('=');
      if (i>0)
      {
        QCString myName=myStr.left(i).stripWhiteSpace();
        QCString myValue=myStr.right(myStr.length()-i-1).stripWhiteSpace();
        if (!myName.isEmpty() && !myValue.isEmpty())
tcl_inf("TCL_SUBST: use '%s'\n",s);
        tcl.config_subst[myName] = myValue;
      }
      s = myStrList.next();
    }
  }

  if (tcl.input_string.at(tcl.input_string.length()-1) == '\n') 
  {
    tcl.input_string[tcl.input_string.length()-1] = 0x1A;
  } 
  else 
  {
    tcl.input_string += 0x1A;
  }
  tcl.code = NULL;
  tcl.code_font=NULL;
  tcl.code_line=1;
  tcl.code_linenumbers=1;
  tcl.config_autobrief = Config_getBool("JAVADOC_AUTOBRIEF");
  tcl.input_position = 0;
  tcl.file_name = NULL;
  tcl.this_parser = NULL;
  tcl.command=0;
  tcl.comment=0;
  tcl.brace_level=0;
  tcl.bracket_level=0;
  tcl.bracket_quote=0;
  tcl.word_is=WORD;
  tcl.string_command="";
  tcl.string_commentline="";
  tcl.string_commentcodify="";
  tcl.string_comment	= "";
  tcl.string_last	= "";
  tcl.entry_main	= NULL;
  tcl.entry_file	= NULL;
  tcl.entry_current	= NULL;
  tcl.entry_inside	= NULL;
  tcl.list_commandwords.clear();
  tcl.scan.clear();
  tcl.ns.clear();
  tcl.cl.clear();
  tcl.fn.clear();
  tclscanYYlineno		= 1;
  tcl.protection	= Public;
  tcl.memberdef		= NULL;
}

//! Start parsing.
static void tcl_parse(const QString ns, const QString cls)
{
  tcl_scan *myScan;

  tcl.entry_file          = tcl_entry_new();
  tcl.entry_file->name    = tcl.file_name;
  tcl.entry_file->section = Entry::SOURCE_SEC;
  tcl.entry_file->protection = Public;
  tcl.entry_main->addSubEntry(tcl.entry_file);
  tcl.entry_current = tcl_entry_new();

  tclscanYYrestart( tclscanYYin );
  BEGIN( TOP );
  tclscanYYlineno=1;
  myScan = new tcl_scan;
  myScan->type=STRING;
  myScan->string_after="";
  myScan->line0=tclscanYYlineno;
  myScan->line1=tclscanYYlineno;
  myScan->buffer_state=YY_CURRENT_BUFFER;
  myScan->ns=ns;
  myScan->entry_cl=tcl_entry_class(cls);
  myScan->entry_fn=NULL;
  tcl.entry_inside = tcl.entry_file;
  myScan->entry_scan = tcl.entry_inside;
  tcl.scan.insert(0,myScan);

  tclscanYYlex();
  tcl.scan.clear();
  tcl.ns.clear();
  tcl.cl.clear();
  tcl.fn.clear();
  tcl.entry.clear();
}

//! Parse text file and build up entry tree.
void TclLanguageScanner::parseInput(const char *fileName,const char *input,Entry *root)
{
  QFile            myFile;
tcl_inf("%s\n",fileName);
  myFile.setName(fileName);
  if (!myFile.open(IO_ReadOnly)) return;
  if (strlen(input)<1) return;

  tcl.input_string = input;
  if (tcl.input_string.length()<1) return;

  msg("Parsing %s...\n",fileName);
  groupEnterFile(fileName,tclscanYYlineno);

  tcl_init();
  tcl.code = NULL;
  tcl.file_name = fileName;
  tcl.this_parser = this;
  tcl.entry_main          = root; /* toplevel entry */
  tcl_parse("","");

  groupLeaveFile(tcl.file_name,tclscanYYlineno);
  root->program.resize(0);
  myFile.close();
}

//! Parse file and codify.
void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
                   const char * scopeName,
                   const QCString & input,
                   bool isExampleBlock,
                   const char * exampleName,
                   FileDef * fileDef,
                   int startLine,
                   int endLine,
                   bool inlineFragment,
		   MemberDef *memberDef,
                   bool showLineNumbers
                  )
{
  (void)scopeName;
  (void)exampleName;
  (void)fileDef;
  (void)endLine;
  (void)inlineFragment;

  if (input.length()<1) return;
  tcl.input_string = input;

  QString myNs="";
  QString myCls="";
  if (memberDef)
  {
    if (memberDef->getClassDef())
    {
      myCls = memberDef->getClassDef()->displayName();
      myNs = myCls;
    }
    else if (memberDef->getNamespaceDef())
    {
      myNs = memberDef->getNamespaceDef()->displayName();
    }
  }

  QString myStr="Codifying..";
  if (scopeName)
  {
    myStr +=" scope=";
    myStr+=scopeName;
  }
  if (exampleName)
  {
    myStr+=" example=";
    myStr+=exampleName;
  }
  if (memberDef)
  {
    myStr+=" member=";
    myStr+=memberDef->memberTypeName();
    myStr+=" ";
    myStr+=memberDef->qualifiedName();
  }
  if (fileDef)
  {
    myStr+=" file=";
    myStr+=fileDef->fileName();
  }
tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inlineFragment);
//tcl_inf("%s\n"input.data());

  if (isExampleBlock)
  {
    tcl_codify(NULL,input);
    return;
  }
  tcl_init();
  tcl.memberdef = memberDef;
  tcl.code = &codeOutIntf;
  if (startLine<0) 
  {
    startLine=1;
  }
  tclscanYYlineno=startLine;
  tcl.code_linenumbers = showLineNumbers;
  tcl.code_line=tclscanYYlineno;
  if (tcl.code_linenumbers) 
  {
    tcl.code->writeLineNumber(0,0,0,tcl.code_line);
  }
  tcl.file_name = "";
  tcl.this_parser = NULL;
  tcl.entry_main = tcl_entry_new();
  tcl_parse(myNs,myCls);
  tcl.scan.clear();
  tcl.ns.clear();
  tcl.cl.clear();
  tcl.fn.clear();
  tcl.entry.clear();
}

bool TclLanguageScanner::needsPreprocessing(const QCString &extension)
{
  (void)extension;
  return FALSE;
}

void TclLanguageScanner::resetCodeParserState()
{
}

void TclLanguageScanner::parsePrototype(const char *text)
{
  (void)text;
}

static int yyread(char *buf,int max_size)
{
  int c=0;

  *buf = '\0';
  while ( c < max_size && tcl.input_string.at(tcl.input_position) )
  {
    *buf = tcl.input_string.at(tcl.input_position++) ;
    c++; buf++;
  }
  //printf("Read from=%d size=%d max=%d c=%d\n",tcl.input_position,strlen(&tcl.input_string[tcl.input_position]),max_size,c);
  return c;
}

//----------------------------------------------------------------------------

// to avoid a warning
void tclDummy()
{
  yy_top_state();
}

#if !defined(YY_FLEX_SUBMINOR_VERSION) 
//----------------------------------------------------------------------------
extern "C" { // some bogus code to keep the compiler happy
  void tclscannerYYdummy() { yy_flex_realloc(0,0); } 
}
#endif


