/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

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

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

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

#ifdef __TURBOC__
 #pragma warn -rch
 #pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

#ifdef YY_USE_CONST
#define TreeYYconst const
#else
#define TreeYYconst
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#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 TreeYY_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 ((TreeYY_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 TreeYYrestart( TreeYYin )

#define YY_END_OF_BUFFER_CHAR 0

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

typedef struct TreeYY_buffer_state *YY_BUFFER_STATE;

extern int TreeYYleng;
extern FILE *TreeYYin, *TreeYYout;

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

/* The funky do-while in the following #define is used to turn the definition
 * int a single C statement (which needs a semi-colon terminator).  This
 * avoids problems with code like:
 *
 * 	if ( condition_holds )
 *		TreeYYless( 5 );
 *	else
 *		do_something_else();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the TreeYYless() call.
 */

/* Return all but the first 'n' matched characters back to the input stream. */

#define TreeYYless(n) \
	do \
		{ \
		/* Undo effects of setting up TreeYYtext. */ \
		*TreeYY_cp = TreeYY_hold_char; \
		TreeYY_c_buf_p = TreeYY_cp = TreeYY_bp + n - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up TreeYYtext again */ \
		} \
	while ( 0 )

#define unput(c) TreeYYunput( c, TreeYYtext_ptr )

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


struct TreeYY_buffer_state
	{
	FILE *TreeYY_input_file;

	char *TreeYY_ch_buf;		/* input buffer */
	char *TreeYY_buf_pos;		/* current position in input buffer */

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

	/* Number of characters read into TreeYY_ch_buf, not including EOB
	 * characters.
	 */
	int TreeYY_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 TreeYY_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 TreeYY_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 TreeYY_at_bol;

	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int TreeYY_fill_buffer;

	int TreeYY_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 TreeYYrestart()), so that the user can continue scanning by
	 * just pointing TreeYYin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2
	};

static YY_BUFFER_STATE TreeYY_current_buffer = 0;

/* 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".
 */
#define YY_CURRENT_BUFFER TreeYY_current_buffer


/* TreeYY_hold_char holds the character lost when TreeYYtext is formed. */
static char TreeYY_hold_char;

static int TreeYY_n_chars;		/* number of characters read into TreeYY_ch_buf */


int TreeYYleng;

/* Points to current character in buffer. */
static char *TreeYY_c_buf_p = (char *) 0;
static int TreeYY_init = 1;		/* whether we need to initialize */
static int TreeYY_start = 0;	/* start state number */

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

void TreeYYrestart YY_PROTO(( FILE *input_file ));

void TreeYY_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void TreeYY_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE TreeYY_create_buffer YY_PROTO(( FILE *file, int size ));
void TreeYY_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void TreeYY_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void TreeYY_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER TreeYY_flush_buffer( TreeYY_current_buffer )

YY_BUFFER_STATE TreeYY_scan_buffer YY_PROTO(( char *base, TreeYY_size_t size ));
YY_BUFFER_STATE TreeYY_scan_string YY_PROTO(( TreeYYconst char *str ));
YY_BUFFER_STATE TreeYY_scan_bytes YY_PROTO(( TreeYYconst char *bytes, int len ));

static void *TreeYY_flex_alloc YY_PROTO(( TreeYY_size_t ));
static void *TreeYY_flex_realloc YY_PROTO(( void *, TreeYY_size_t ));
static void TreeYY_flex_free YY_PROTO(( void * ));

#define TreeYY_new_buffer TreeYY_create_buffer

#define TreeYY_set_interactive(is_interactive) \
	{ \
	if ( ! TreeYY_current_buffer ) \
		TreeYY_current_buffer = TreeYY_create_buffer( TreeYYin, YY_BUF_SIZE ); \
	TreeYY_current_buffer->TreeYY_is_interactive = is_interactive; \
	}

#define TreeYY_set_bol(at_bol) \
	{ \
	if ( ! TreeYY_current_buffer ) \
		TreeYY_current_buffer = TreeYY_create_buffer( TreeYYin, YY_BUF_SIZE ); \
	TreeYY_current_buffer->TreeYY_at_bol = at_bol; \
	}

#define YY_AT_BOL() (TreeYY_current_buffer->TreeYY_at_bol)

typedef unsigned char YY_CHAR;
FILE *TreeYYin = (FILE *) 0, *TreeYYout = (FILE *) 0;
typedef int TreeYY_state_type;
extern char *TreeYYtext;
#define TreeYYtext_ptr TreeYYtext

static TreeYY_state_type TreeYY_get_previous_state YY_PROTO(( void ));
static TreeYY_state_type TreeYY_try_NUL_trans YY_PROTO(( TreeYY_state_type current_state ));
static int TreeYY_get_next_buffer YY_PROTO(( void ));
static void TreeYY_fatal_error YY_PROTO(( TreeYYconst char msg[] ));

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up TreeYYtext.
 */
#define YY_DO_BEFORE_ACTION \
	TreeYYtext_ptr = TreeYY_bp; \
	TreeYYtext_ptr -= TreeYY_more_len; \
	TreeYYleng = (int) (TreeYY_cp - TreeYYtext_ptr); \
	TreeYY_hold_char = *TreeYY_cp; \
	*TreeYY_cp = '\0'; \
	TreeYY_c_buf_p = TreeYY_cp;

#define YY_NUM_RULES 9
#define YY_END_OF_BUFFER 10
static TreeYYconst short int TreeYY_accept[74] =
    {   0,
        0,    0,    8,    8,   10,    1,    2,    2,    3,    3,
        8,    1,    7,    7,    8,    7,    8,    7,    8,    7,
        8,    7,    8,    7,    8,    7,    7,    7,    8,    7,
        7,    7,    8,    7,    7,    7,    8,    7,    4,    5,
        8,    7,    8,    6,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
        8,    8,    0
    } ;

static TreeYYconst int TreeYY_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    1,    1,    4,    1,    1,    1,    1,    5,
        5,    1,    1,    5,    1,    5,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    6,    1,    7,    8,    9,   10,
       11,   12,   13,    1,    1,    1,    1,   14,   15,    1,
        1,   16,    1,   17,    1,    1,   18,    1,    1,    1,
        5,    1,    5,    1,    1,    1,    6,    1,    7,    8,

        9,   10,   11,   12,   13,    1,    1,    1,    1,   14,
       15,    1,    1,   16,    1,   17,    1,    1,   18,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    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 TreeYYconst int TreeYY_meta[19] =
    {   0,
        1,    2,    2,    2,    2,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1
    } ;

static TreeYYconst short int TreeYY_base[117] =
    {   0,
        0,    4,    0,    0,  113,    0,  114,  114,   94,  114,
        0,    0,    0,   98,    0,  102,    0,   98,    0,   99,
        0,   90,    0,    3,    0,   94,   91,   88,    0,   97,
        9,    9,    0,    3,    0,    5,    0,    2,    0,    0,
        0,    3,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,  114,  114,   20,   22,   10,    0,   24,   26,   28,
       30,   32,   34,   36,   38,   40,   42,   44,   46,   48,
       50,   52,   54,   56,   58,   60,   62,   64,   66,   68,

       70,   72,   74,   76,   78,   80,   82,   84,   86,   88,
       90,   92,   94,   96,   98,  100
    } ;

static TreeYYconst short int TreeYY_def[117] =
    {   0,
       74,   74,   75,   75,   73,   76,   73,   73,   77,   73,
       78,   76,   77,   77,   79,   77,   80,   77,   81,   77,
       82,   77,   83,   77,   84,   77,   77,   77,   85,   77,
       77,   77,   86,   77,   77,   77,   87,   77,   77,   77,
       88,   77,   89,   77,   90,   91,   92,   93,   94,   95,
       96,   97,   98,   99,  100,  101,  102,  103,  104,  105,
      106,  107,  108,  109,  110,  111,  112,  113,  114,  115,
      116,   73,    0,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,

       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73
    } ;

static TreeYYconst short int TreeYY_nxt[133] =
    {   0,
       13,    7,    8,    9,   10,    7,    8,    9,   10,   26,
       12,   44,   42,   40,   39,   27,   38,   36,   35,   28,
        6,    6,   11,   11,   15,   15,   17,   17,   19,   19,
       21,   21,   23,   23,   25,   25,   29,   29,   33,   33,
       37,   37,   41,   41,   43,   43,   45,   45,   46,   46,
       47,   47,   48,   48,   49,   49,   50,   50,   51,   51,
       52,   52,   53,   53,   54,   54,   55,   55,   56,   56,
       57,   57,   58,   58,   59,   59,   60,   60,   61,   61,
       62,   62,   63,   63,   64,   64,   65,   65,   66,   66,
       67,   67,   68,   68,   69,   69,   70,   70,   71,   71,

       72,   72,   34,   32,   31,   30,   24,   22,   20,   18,
       16,   14,   73,    5,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73
    } ;

static TreeYYconst short int TreeYY_chk[133] =
    {   0,
       77,    1,    1,    1,    1,    2,    2,    2,    2,   24,
       76,   42,   38,   36,   35,   24,   34,   32,   31,   24,
       74,   74,   75,   75,   78,   78,   79,   79,   80,   80,
       81,   81,   82,   82,   83,   83,   84,   84,   85,   85,
       86,   86,   87,   87,   88,   88,   89,   89,   90,   90,
       91,   91,   92,   92,   93,   93,   94,   94,   95,   95,
       96,   96,   97,   97,   98,   98,   99,   99,  100,  100,
      101,  101,  102,  102,  103,  103,  104,  104,  105,  105,
      106,  106,  107,  107,  108,  108,  109,  109,  110,  110,
      111,  111,  112,  112,  113,  113,  114,  114,  115,  115,

      116,  116,   30,   28,   27,   26,   22,   20,   18,   16,
       14,    9,    5,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73
    } ;

static TreeYY_state_type TreeYY_last_accepting_state;
static char *TreeYY_last_accepting_cpos;

/* 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 TreeYY_more_flag = 0;
static int TreeYY_more_len = 0;
#define TreeYYmore() (TreeYY_more_flag = 1)
#define YY_MORE_ADJ TreeYY_more_len
char *TreeYYtext;
#line 1 "./lwidgettree.l"
#define INITIAL 0
#define ERROR 1

#line 4 "./lwidgettree.l"
#include <stdlib.h>
#include "mymalloc.h"
#include "widgettree.h"
#include "ywidgettree.tab.h"

#define YYTEXT   ((char *) TreeYYtext)
#define YYLENG   ((size_t) TreeYYleng)
#define ECHO     (void) fwrite(YYTEXT, YYLENG, 1, TreeYYout)

extern int   isatty(int fd);
extern int   TreeYYlex(void);

static void Insert(const char *Text);
static const char *TreeMacro(const char *Name);

typedef struct _macrostack_ {
    struct _macrostack_ *Next;
    YY_BUFFER_STATE State;
    const char     *Ptr;
    int             StrLength;
} MacroStack;

static MacroStack *Stack;
static MacroStack  StackBase = { NULL };

static Widget      ContextWidget;

/* Xrm.c trashes memory with resources bigger than BUFSIZ. So if we get
   a resource longer than that, we are in trouble */
#ifdef BUFSIZ
# define MAXRESLEN (BUFSIZ-10)
#else /* BUFSIZ */
# define MAXRESLEN (1024-10)
#endif /* BUFSIZ */

#define LENRESTEXT "very long resource (%d bytes): %.1024s..."
static const char WidgetInfo[] =
    " widgetInfo.TopLevelShell.widgetInfo "
        "(collect.Paned "
            "(buttons.Box"
                "(restreeClose.Command"
                " parent.Command.parent"
                " children.Command.children"
                " popups.Command.popups"
                " change.Command"
                ")"
            " info.AsciiText"
            ")"
        ")";
static const char WidgetTree[] =
    " widgetTree.TopLevelShell.widgetTree "
        "(collect.Paned "
            "(buttons.Box "
                "(restreeClose.Command"
                ")"
            "viewport.Viewport"
                "(tree.Tree"
                ")"
            ")"
        ")";
static const char WidgetChange[] =
    " widgetChange.TopLevelShell.widgetChange "
        "(box.Box "
            "(cancel.Command"
            " ok.Command"
            " name.AsciiText  [editType.editType]"
            " value.AsciiText [editType.editType]"
            ")"
        ")";

#define YYTEXT  ((char *) TreeYYtext)
#define YYLENG  ((size_t) TreeYYleng)
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size)                             \
do {                                                                \
    if (max_size > Stack->StrLength) result = Stack->StrLength;     \
    else                             result = max_size;             \
    memcpy(buf, Stack->Ptr, (size_t) result);                       \
    Stack->Ptr += result;                                           \
    Stack->StrLength -= result;                                     \
} while(0)
#define YY_BREAK

TreeTemplate *TreeResult;
NameClassList NameBase;
extern int TreeYYparse(void);
#line 513 "lex.TreeYY.c"

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

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

#ifndef YY_NO_UNPUT
static void TreeYYunput YY_PROTO(( int c, char *buf_ptr ));
#endif

#ifndef TreeYYtext_ptr
static void TreeYY_flex_strncpy YY_PROTO(( char *, TreeYYconst char *, int ));
#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int TreeYYinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif
#endif

#if YY_STACK_USED
static int TreeYY_start_stack_ptr = 0;
static int TreeYY_start_stack_depth = 0;
static int *TreeYY_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void TreeYY_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void TreeYY_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int TreeYY_top_state YY_PROTO(( void ));
#endif

#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

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

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( TreeYYtext, TreeYYleng, 1, TreeYYout )
#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 ( TreeYY_current_buffer->TreeYY_is_interactive ) \
		{ \
		int c = '*', n; \
		for ( n = 0; n < max_size && \
			     (c = getc( TreeYYin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( TreeYYin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else if ( ((result = fread( buf, 1, max_size, TreeYYin )) == 0) \
		  && ferror( TreeYYin ) ) \
		YY_FATAL_ERROR( "input in flex scanner failed" );
#endif

/* No semi-colon after return; correct usage is to write "TreeYYterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef TreeYYterminate
#define TreeYYterminate() 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) TreeYY_fatal_error( msg )
#endif

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int TreeYYlex YY_PROTO(( void ))
#endif

/* Code executed at the beginning of each rule, after TreeYYtext and TreeYYleng
 * 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

YY_DECL
	{
	register TreeYY_state_type TreeYY_current_state;
	register char *TreeYY_cp, *TreeYY_bp;
	register int TreeYY_act;

#line 96 "./lwidgettree.l"

#line 662 "lex.TreeYY.c"

	if ( TreeYY_init )
		{
		TreeYY_init = 0;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! TreeYYin )
			TreeYYin = stdin;

		if ( ! TreeYYout )
			TreeYYout = stdout;

		if ( ! TreeYY_current_buffer )
			TreeYY_current_buffer =
				TreeYY_create_buffer( TreeYYin, YY_BUF_SIZE );

		TreeYY_load_buffer_state();
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		TreeYY_more_len = 0;
		if ( TreeYY_more_flag )
			{
			TreeYY_more_len = TreeYYleng;
			TreeYY_more_flag = 0;
			}
		TreeYY_cp = TreeYY_c_buf_p;

		/* Support of TreeYYtext. */
		*TreeYY_cp = TreeYY_hold_char;

		/* TreeYY_bp points to the position in TreeYY_ch_buf of the start of
		 * the current run.
		 */
		TreeYY_bp = TreeYY_cp;

		TreeYY_current_state = TreeYY_start;
TreeYY_match:
		do
			{
			register YY_CHAR TreeYY_c = TreeYY_ec[YY_SC_TO_UI(*TreeYY_cp)];
			if ( TreeYY_accept[TreeYY_current_state] )
				{
				TreeYY_last_accepting_state = TreeYY_current_state;
				TreeYY_last_accepting_cpos = TreeYY_cp;
				}
			while ( TreeYY_chk[TreeYY_base[TreeYY_current_state] + TreeYY_c] != TreeYY_current_state )
				{
				TreeYY_current_state = (int) TreeYY_def[TreeYY_current_state];
				if ( TreeYY_current_state >= 74 )
					TreeYY_c = TreeYY_meta[(unsigned int) TreeYY_c];
				}
			TreeYY_current_state = TreeYY_nxt[TreeYY_base[TreeYY_current_state] + (unsigned int) TreeYY_c];
			++TreeYY_cp;
			}
		while ( TreeYY_base[TreeYY_current_state] != 114 );

TreeYY_find_action:
		TreeYY_act = TreeYY_accept[TreeYY_current_state];
		if ( TreeYY_act == 0 )
			{ /* have to back up */
			TreeYY_cp = TreeYY_last_accepting_cpos;
			TreeYY_current_state = TreeYY_last_accepting_state;
			TreeYY_act = TreeYY_accept[TreeYY_current_state];
			}

		YY_DO_BEFORE_ACTION;


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


		switch ( TreeYY_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*TreeYY_cp = TreeYY_hold_char;
			TreeYY_cp = TreeYY_last_accepting_cpos;
			TreeYY_current_state = TreeYY_last_accepting_state;
			goto TreeYY_find_action;

case 1:
YY_RULE_SETUP
#line 97 "./lwidgettree.l"
{ TreeYYlval.Name = mystrndup(YYTEXT, YYLENG);
                                return NAME; }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 99 "./lwidgettree.l"
{ break; }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 100 "./lwidgettree.l"
{ return YYTEXT[0]; }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 101 "./lwidgettree.l"
{ Insert(WidgetInfo);
                                break; }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 103 "./lwidgettree.l"
{ Insert(WidgetTree);
                                break; }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 105 "./lwidgettree.l"
{ Insert(WidgetChange);
                                break; }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 107 "./lwidgettree.l"
{ const char *Result;
                                
                                Result = TreeMacro(YYTEXT+1);
                                if (Result) Insert(Result);
                                else
                                    WidgetWarning(ContextWidget, "Could not "
                                                  "find definition of macro "
                                                  "%.40s", YYTEXT+1);
                                break; }
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ERROR):
#line 116 "./lwidgettree.l"
{ MacroStack *Deeper;

                                if (Stack == &StackBase) TreeYYterminate();
                                else {
                                    Deeper = Stack;
                                    Stack = Stack->Next;
                                    TreeYY_delete_buffer(YY_CURRENT_BUFFER);
                                    TreeYY_switch_to_buffer(Stack->State);
                                    myfree(Deeper);
                                }
                                break; }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 128 "./lwidgettree.l"
{ TreeYYlval.Name = mystrndup(YYTEXT, YYLENG);
                                TreeYYmore();
                                return NAME; }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 131 "./lwidgettree.l"
ECHO;
	YY_BREAK
#line 825 "lex.TreeYY.c"

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int TreeYY_amount_of_matched_text = (int) (TreeYY_cp - TreeYYtext_ptr) - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*TreeYY_cp = TreeYY_hold_char;

		if ( TreeYY_current_buffer->TreeYY_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 TreeYYin at a new source and called
			 * TreeYYlex().  If so, then we have to assure
			 * consistency between TreeYY_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.
			 */
			TreeYY_n_chars = TreeYY_current_buffer->TreeYY_n_chars;
			TreeYY_current_buffer->TreeYY_input_file = TreeYYin;
			TreeYY_current_buffer->TreeYY_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for TreeYY_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since TreeYY_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 ( TreeYY_c_buf_p <= &TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars] )
			{ /* This was really a NUL. */
			TreeYY_state_type TreeYY_next_state;

			TreeYY_c_buf_p = TreeYYtext_ptr + TreeYY_amount_of_matched_text;

			TreeYY_current_state = TreeYY_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * TreeYY_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).
			 */

			TreeYY_next_state = TreeYY_try_NUL_trans( TreeYY_current_state );

			TreeYY_bp = TreeYYtext_ptr + YY_MORE_ADJ;

			if ( TreeYY_next_state )
				{
				/* Consume the NUL. */
				TreeYY_cp = ++TreeYY_c_buf_p;
				TreeYY_current_state = TreeYY_next_state;
				goto TreeYY_match;
				}

			else
				{
				TreeYY_cp = TreeYY_c_buf_p;
				goto TreeYY_find_action;
				}
			}

		else switch ( TreeYY_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
				TreeYY_did_buffer_switch_on_eof = 0;

				if ( TreeYYwrap() )
					{
					/* Note: because we've taken care in
					 * TreeYY_get_next_buffer() to have set up
					 * TreeYYtext, we can now set up
					 * TreeYY_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.
					 */
					TreeYY_c_buf_p = TreeYYtext_ptr + YY_MORE_ADJ;

					TreeYY_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

			case EOB_ACT_CONTINUE_SCAN:
				TreeYY_c_buf_p =
					TreeYYtext_ptr + TreeYY_amount_of_matched_text;

				TreeYY_current_state = TreeYY_get_previous_state();

				TreeYY_cp = TreeYY_c_buf_p;
				TreeYY_bp = TreeYYtext_ptr + YY_MORE_ADJ;
				goto TreeYY_match;

			case EOB_ACT_LAST_MATCH:
				TreeYY_c_buf_p =
				&TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars];

				TreeYY_current_state = TreeYY_get_previous_state();

				TreeYY_cp = TreeYY_c_buf_p;
				TreeYY_bp = TreeYYtext_ptr + YY_MORE_ADJ;
				goto TreeYY_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 TreeYYlex */


/* TreeYY_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 TreeYY_get_next_buffer()
	{
	register char *dest = TreeYY_current_buffer->TreeYY_ch_buf;
	register char *source = TreeYYtext_ptr;
	register int number_to_move, i;
	int ret_val;

	if ( TreeYY_c_buf_p > &TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( TreeYY_current_buffer->TreeYY_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( TreeYY_c_buf_p - TreeYYtext_ptr - YY_MORE_ADJ == 1 )
			{
			/* We matched a singled characater, 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) (TreeYY_c_buf_p - TreeYYtext_ptr) - 1;

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

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

	else
		{
		int num_to_read =
			TreeYY_current_buffer->TreeYY_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

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

			int TreeYY_c_buf_p_offset =
				(int) (TreeYY_c_buf_p - b->TreeYY_ch_buf);

			if ( b->TreeYY_is_our_buffer )
				{
				int new_size = b->TreeYY_buf_size * 2;

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

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

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

			TreeYY_c_buf_p = &b->TreeYY_ch_buf[TreeYY_c_buf_p_offset];

			num_to_read = TreeYY_current_buffer->TreeYY_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&TreeYY_current_buffer->TreeYY_ch_buf[number_to_move]),
			TreeYY_n_chars, num_to_read );
		}

	if ( TreeYY_n_chars == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			TreeYYrestart( TreeYYin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			TreeYY_current_buffer->TreeYY_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	TreeYY_n_chars += number_to_move;
	TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars] = YY_END_OF_BUFFER_CHAR;
	TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

	TreeYYtext_ptr = &TreeYY_current_buffer->TreeYY_ch_buf[0];

	return ret_val;
	}


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

static TreeYY_state_type TreeYY_get_previous_state()
	{
	register TreeYY_state_type TreeYY_current_state;
	register char *TreeYY_cp;

	TreeYY_current_state = TreeYY_start;

	for ( TreeYY_cp = TreeYYtext_ptr + YY_MORE_ADJ; TreeYY_cp < TreeYY_c_buf_p; ++TreeYY_cp )
		{
		register YY_CHAR TreeYY_c = (*TreeYY_cp ? TreeYY_ec[YY_SC_TO_UI(*TreeYY_cp)] : 1);
		if ( TreeYY_accept[TreeYY_current_state] )
			{
			TreeYY_last_accepting_state = TreeYY_current_state;
			TreeYY_last_accepting_cpos = TreeYY_cp;
			}
		while ( TreeYY_chk[TreeYY_base[TreeYY_current_state] + TreeYY_c] != TreeYY_current_state )
			{
			TreeYY_current_state = (int) TreeYY_def[TreeYY_current_state];
			if ( TreeYY_current_state >= 74 )
				TreeYY_c = TreeYY_meta[(unsigned int) TreeYY_c];
			}
		TreeYY_current_state = TreeYY_nxt[TreeYY_base[TreeYY_current_state] + (unsigned int) TreeYY_c];
		}

	return TreeYY_current_state;
	}


/* TreeYY_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = TreeYY_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static TreeYY_state_type TreeYY_try_NUL_trans( TreeYY_state_type TreeYY_current_state )
#else
static TreeYY_state_type TreeYY_try_NUL_trans( TreeYY_current_state )
TreeYY_state_type TreeYY_current_state;
#endif
	{
	register int TreeYY_is_jam;
	register char *TreeYY_cp = TreeYY_c_buf_p;

	register YY_CHAR TreeYY_c = 1;
	if ( TreeYY_accept[TreeYY_current_state] )
		{
		TreeYY_last_accepting_state = TreeYY_current_state;
		TreeYY_last_accepting_cpos = TreeYY_cp;
		}
	while ( TreeYY_chk[TreeYY_base[TreeYY_current_state] + TreeYY_c] != TreeYY_current_state )
		{
		TreeYY_current_state = (int) TreeYY_def[TreeYY_current_state];
		if ( TreeYY_current_state >= 74 )
			TreeYY_c = TreeYY_meta[(unsigned int) TreeYY_c];
		}
	TreeYY_current_state = TreeYY_nxt[TreeYY_base[TreeYY_current_state] + (unsigned int) TreeYY_c];
	TreeYY_is_jam = (TreeYY_current_state == 73);

	return TreeYY_is_jam ? 0 : TreeYY_current_state;
	}


#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void TreeYYunput( int c, register char *TreeYY_bp )
#else
static void TreeYYunput( c, TreeYY_bp )
int c;
register char *TreeYY_bp;
#endif
	{
	register char *TreeYY_cp = TreeYY_c_buf_p;

	/* undo effects of setting up TreeYYtext */
	*TreeYY_cp = TreeYY_hold_char;

	if ( TreeYY_cp < TreeYY_current_buffer->TreeYY_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = TreeYY_n_chars + 2;
		register char *dest = &TreeYY_current_buffer->TreeYY_ch_buf[
					TreeYY_current_buffer->TreeYY_buf_size + 2];
		register char *source =
				&TreeYY_current_buffer->TreeYY_ch_buf[number_to_move];

		while ( source > TreeYY_current_buffer->TreeYY_ch_buf )
			*--dest = *--source;

		TreeYY_cp += (int) (dest - source);
		TreeYY_bp += (int) (dest - source);
		TreeYY_n_chars = TreeYY_current_buffer->TreeYY_buf_size;

		if ( TreeYY_cp < TreeYY_current_buffer->TreeYY_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--TreeYY_cp = (char) c;


	TreeYYtext_ptr = TreeYY_bp;
	TreeYY_hold_char = *TreeYY_cp;
	TreeYY_c_buf_p = TreeYY_cp;
	}
#endif	/* ifndef YY_NO_UNPUT */


#ifdef __cplusplus
static int TreeYYinput()
#else
static int input()
#endif
	{
	int c;

	*TreeYY_c_buf_p = TreeYY_hold_char;

	if ( *TreeYY_c_buf_p == YY_END_OF_BUFFER_CHAR )
		{
		/* TreeYY_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 ( TreeYY_c_buf_p < &TreeYY_current_buffer->TreeYY_ch_buf[TreeYY_n_chars] )
			/* This was really a NUL. */
			*TreeYY_c_buf_p = '\0';

		else
			{ /* need more input */
			TreeYYtext_ptr = TreeYY_c_buf_p;
			++TreeYY_c_buf_p;

			switch ( TreeYY_get_next_buffer() )
				{
				case EOB_ACT_END_OF_FILE:
					{
					if ( TreeYYwrap() )
						{
						TreeYY_c_buf_p =
						TreeYYtext_ptr + YY_MORE_ADJ;
						return EOF;
						}

					if ( ! TreeYY_did_buffer_switch_on_eof )
						YY_NEW_FILE;
#ifdef __cplusplus
					return TreeYYinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					TreeYY_c_buf_p = TreeYYtext_ptr + YY_MORE_ADJ;
					break;

				case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
					YY_FATAL_ERROR(
					"unexpected last match in TreeYYinput()" );
#else
					YY_FATAL_ERROR(
					"unexpected last match in input()" );
#endif
				}
			}
		}

	c = *(unsigned char *) TreeYY_c_buf_p;	/* cast for 8-bit char's */
	*TreeYY_c_buf_p = '\0';	/* preserve TreeYYtext */
	TreeYY_hold_char = *++TreeYY_c_buf_p;


	return c;
	}


#ifdef YY_USE_PROTOS
void TreeYYrestart( FILE *input_file )
#else
void TreeYYrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! TreeYY_current_buffer )
		TreeYY_current_buffer = TreeYY_create_buffer( TreeYYin, YY_BUF_SIZE );

	TreeYY_init_buffer( TreeYY_current_buffer, input_file );
	TreeYY_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void TreeYY_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void TreeYY_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	if ( TreeYY_current_buffer == new_buffer )
		return;

	if ( TreeYY_current_buffer )
		{
		/* Flush out information for old buffer. */
		*TreeYY_c_buf_p = TreeYY_hold_char;
		TreeYY_current_buffer->TreeYY_buf_pos = TreeYY_c_buf_p;
		TreeYY_current_buffer->TreeYY_n_chars = TreeYY_n_chars;
		}

	TreeYY_current_buffer = new_buffer;
	TreeYY_load_buffer_state();

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


#ifdef YY_USE_PROTOS
void TreeYY_load_buffer_state( void )
#else
void TreeYY_load_buffer_state()
#endif
	{
	TreeYY_n_chars = TreeYY_current_buffer->TreeYY_n_chars;
	TreeYYtext_ptr = TreeYY_c_buf_p = TreeYY_current_buffer->TreeYY_buf_pos;
	TreeYYin = TreeYY_current_buffer->TreeYY_input_file;
	TreeYY_hold_char = *TreeYY_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE TreeYY_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE TreeYY_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) TreeYY_flex_alloc( sizeof( struct TreeYY_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in TreeYY_create_buffer()" );

	b->TreeYY_buf_size = size;

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

	b->TreeYY_is_our_buffer = 1;

	TreeYY_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void TreeYY_delete_buffer( YY_BUFFER_STATE b )
#else
void TreeYY_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( ! b )
		return;

	if ( b == TreeYY_current_buffer )
		TreeYY_current_buffer = (YY_BUFFER_STATE) 0;

	if ( b->TreeYY_is_our_buffer )
		TreeYY_flex_free( (void *) b->TreeYY_ch_buf );

	TreeYY_flex_free( (void *) b );
	}


#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif

#ifdef YY_USE_PROTOS
void TreeYY_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void TreeYY_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif


	{
	TreeYY_flush_buffer( b );

	b->TreeYY_input_file = file;
	b->TreeYY_fill_buffer = 1;

#if YY_ALWAYS_INTERACTIVE
	b->TreeYY_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
	b->TreeYY_is_interactive = 0;
#else
	b->TreeYY_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
	}


#ifdef YY_USE_PROTOS
void TreeYY_flush_buffer( YY_BUFFER_STATE b )
#else
void TreeYY_flush_buffer( b )
YY_BUFFER_STATE b;
#endif

	{
	b->TreeYY_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->TreeYY_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->TreeYY_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

	b->TreeYY_buf_pos = &b->TreeYY_ch_buf[0];

	b->TreeYY_at_bol = 1;
	b->TreeYY_buffer_status = YY_BUFFER_NEW;

	if ( b == TreeYY_current_buffer )
		TreeYY_load_buffer_state();
	}


#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE TreeYY_scan_buffer( char *base, TreeYY_size_t size )
#else
YY_BUFFER_STATE TreeYY_scan_buffer( base, size )
char *base;
TreeYY_size_t size;
#endif
	{
	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) TreeYY_flex_alloc( sizeof( struct TreeYY_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in TreeYY_scan_buffer()" );

	b->TreeYY_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->TreeYY_buf_pos = b->TreeYY_ch_buf = base;
	b->TreeYY_is_our_buffer = 0;
	b->TreeYY_input_file = 0;
	b->TreeYY_n_chars = b->TreeYY_buf_size;
	b->TreeYY_is_interactive = 0;
	b->TreeYY_at_bol = 1;
	b->TreeYY_fill_buffer = 0;
	b->TreeYY_buffer_status = YY_BUFFER_NEW;

	TreeYY_switch_to_buffer( b );

	return b;
	}
#endif


#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE TreeYY_scan_string( TreeYYconst char *str )
#else
YY_BUFFER_STATE TreeYY_scan_string( str )
TreeYYconst char *str;
#endif
	{
	int len;
	for ( len = 0; str[len]; ++len )
		;

	return TreeYY_scan_bytes( str, len );
	}
#endif


#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE TreeYY_scan_bytes( TreeYYconst char *bytes, int len )
#else
YY_BUFFER_STATE TreeYY_scan_bytes( bytes, len )
TreeYYconst char *bytes;
int len;
#endif
	{
	YY_BUFFER_STATE b;
	char *buf;
	TreeYY_size_t n;
	int i;

	/* Get memory for full buffer, including space for trailing EOB's. */
	n = len + 2;
	buf = (char *) TreeYY_flex_alloc( n );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in TreeYY_scan_bytes()" );

	for ( i = 0; i < len; ++i )
		buf[i] = bytes[i];

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

	b = TreeYY_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in TreeYY_scan_bytes()" );

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

	return b;
	}
#endif


#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void TreeYY_push_state( int new_state )
#else
static void TreeYY_push_state( new_state )
int new_state;
#endif
	{
	if ( TreeYY_start_stack_ptr >= TreeYY_start_stack_depth )
		{
		TreeYY_size_t new_size;

		TreeYY_start_stack_depth += YY_START_STACK_INCR;
		new_size = TreeYY_start_stack_depth * sizeof( int );

		if ( ! TreeYY_start_stack )
			TreeYY_start_stack = (int *) TreeYY_flex_alloc( new_size );

		else
			TreeYY_start_stack = (int *) TreeYY_flex_realloc(
					(void *) TreeYY_start_stack, new_size );

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

	TreeYY_start_stack[TreeYY_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}
#endif


#ifndef YY_NO_POP_STATE
static void TreeYY_pop_state()
	{
	if ( --TreeYY_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(TreeYY_start_stack[TreeYY_start_stack_ptr]);
	}
#endif


#ifndef YY_NO_TOP_STATE
static int TreeYY_top_state()
	{
	return TreeYY_start_stack[TreeYY_start_stack_ptr - 1];
	}
#endif

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

#ifdef YY_USE_PROTOS
static void TreeYY_fatal_error( TreeYYconst char msg[] )
#else
static void TreeYY_fatal_error( msg )
char msg[];
#endif
	{
	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
	}



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

#undef TreeYYless
#define TreeYYless(n) \
	do \
		{ \
		/* Undo effects of setting up TreeYYtext. */ \
		TreeYYtext[TreeYYleng] = TreeYY_hold_char; \
		TreeYY_c_buf_p = TreeYYtext + n - YY_MORE_ADJ; \
		TreeYY_hold_char = *TreeYY_c_buf_p; \
		*TreeYY_c_buf_p = '\0'; \
		TreeYYleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

#ifndef TreeYYtext_ptr
#ifdef YY_USE_PROTOS
static void TreeYY_flex_strncpy( char *s1, TreeYYconst char *s2, int n )
#else
static void TreeYY_flex_strncpy( s1, s2, n )
char *s1;
TreeYYconst char *s2;
int n;
#endif
	{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
	}
#endif


#ifdef YY_USE_PROTOS
static void *TreeYY_flex_alloc( TreeYY_size_t size )
#else
static void *TreeYY_flex_alloc( size )
TreeYY_size_t size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *TreeYY_flex_realloc( void *ptr, TreeYY_size_t size )
#else
static void *TreeYY_flex_realloc( ptr, size )
void *ptr;
TreeYY_size_t size;
#endif
	{
	/* 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 );
	}

#ifdef YY_USE_PROTOS
static void TreeYY_flex_free( void *ptr )
#else
static void TreeYY_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}

#if YY_MAIN
int main()
	{
	TreeYYlex();
	return 0;
	}
#endif
#line 131 "./lwidgettree.l"


static const char Empty[] = "text";
#define XtNtext ((String) Empty)
#define XtCText "Text"

typedef struct {
    String Text;
} MacroData, *MacroDataPtr;

#ifndef XtRString
# define XtRString "String"
#endif /* XtRString */

#define offset(field) XtOffset(MacroDataPtr, field)
static XtResource Modelresources[] = {
    { (String) XtNtext, (String) XtCText, (String) XtRString, sizeof(String),
      offset(Text), (String) XtRString, (XtPointer) NULL }, 
};
#undef offset

static const char *TreeMacro(const char *Name)
{
    MacroData macrodata;
    XtResource resource;

    resource = Modelresources[0];
    resource.resource_name = (String) Name;
    macrodata.Text = NULL;
    XtGetSubresources(ContextWidget, (XtPointer) &macrodata, "widgetTreeMacro",
                      "WidgetTreeMacro", &resource, 1, NULL, 0);
    return (const char *) macrodata.Text;
}

static void Insert(const char *Text)
{
    MacroStack *Deeper;
    Deeper = mynew(MacroStack);
    Deeper->Next = Stack;
    Deeper->Ptr  = Text;
                                
    Deeper->StrLength = strlen(Deeper->Ptr);
    if (Deeper->StrLength > MAXRESLEN)
        WidgetWarning(ContextWidget, LENRESTEXT,
                      Deeper->StrLength, Deeper->Ptr);
    Stack->State = YY_CURRENT_BUFFER;
    TreeYY_switch_to_buffer(TreeYY_create_buffer(0, YY_BUF_SIZE));
    Stack = Deeper;
}

TreeTemplate *treeParse(const NameClassList Base, Widget w,
                        const char *Str, int Len)
{
    MacroStack *Next;

    Stack = &StackBase;

    NameBase      = Base;
    ContextWidget = w;

    Stack->Ptr = Str;
    if (Len < 0) Stack->StrLength = strlen(Stack->Ptr);
    else         Stack->StrLength = Len;
    if (Stack->StrLength > MAXRESLEN)
        WidgetWarning(ContextWidget, LENRESTEXT, Stack->StrLength, Stack->Ptr);

    TreeYY_init = 1;
    TreeYYparse();
    while (Stack != &StackBase) {
        Next = Stack->Next;
        myfree(Stack);
        Stack = Next;
    }
    return TreeResult;
}

extern char *_TreeText(void);
char *_TreeText(void)
{
    static char Error[42];

    BEGIN(ERROR);
    TreeYYmore();
    TreeYYlex();
    if (YYLENG < sizeof(Error)) strcpy(Error, TreeYYlval.Name);
    else {
        memcpy(Error, TreeYYlval.Name, sizeof(Error)-1);
        Error[sizeof(Error)-1] = 0;
    }
    myfree(TreeYYlval.Name);
    return Error;
}

/****************************************** flex fun **********************/
/*
void TreeYY_flex_free(void *Data)
{
    myfree(Data);
}

void *TreeYY_flex_alloc(int size)
{
    return mymalloc(size);
}

void *TreeYY_flex_realloc(void *ptr, int size)
{
    return myrealloc(ptr, size);
}
*/

int TreeYYwrap(void)
{
    return 1;
}

/* Kludge to shut up some compiler warnings for some versions of flex */
#include "except.h"
static void TreeYY_flex_strcpy(char *s1, const char *s2);

static void loopy(void)
{
    TreeYY_flex_strcpy(NULL, NULL);
}

static void TreeYY_flex_strcpy(char *s1, const char *s2)
{
    Raise1(AssertException, "flex kludge function called");
#ifndef YY_NO_PUSH_STATE
    TreeYY_push_state(s1 == s2);
#endif
#ifndef YY_NO_POP_STATE
    TreeYY_pop_state();
#endif
#ifndef YY_NO_TOP_STATE
    TreeYY_top_state();
#endif
    unput(' ');
    loopy();
}
