
# line 40 "gram.y"
#include <stdio.h>
#include <ctype.h>
#include "twm.h"
#include "menus.h"
#include "list.h"
#include "util.h"
#include "screen.h"
#include "parse.h"
#include <X11/Xos.h>
#include <X11/Xmu/CharSet.h>

static char *Action = "";
static char *Name = "";
static MenuRoot	*root, *pull = NULL;

static MenuRoot *GetRoot();

static Bool CheckWarpScreenArg(), CheckWarpRingArg();
static Bool CheckColormapArg();
static void GotButton(), GotKey(), GotTitleButton();
static char *ptr;
static name_list **list;
static int cont = 0;
static int color;
int mods = 0;
unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask);

extern int do_single_keyword(), do_string_keyword(), do_number_keyword();
extern name_list **do_colorlist_keyword();
extern int do_color_keyword();
extern int yylineno;

# line 73 "gram.y"
typedef union
#ifdef __cplusplus
	YYSTYPE
#endif

{
    int num;
    char *ptr;
} YYSTYPE;
# define LB 257
# define RB 258
# define LP 259
# define RP 260
# define MENUS 261
# define MENU 262
# define BUTTON 263
# define DEFAULT_FUNCTION 264
# define PLUS 265
# define MINUS 266
# define ALL 267
# define OR 268
# define CURSORS 269
# define PIXMAPS 270
# define ICONS 271
# define COLOR 272
# define MONOCHROME 273
# define FUNCTION 274
# define ICONMGR_SHOW 275
# define ICONMGR 276
# define WINDOW_FUNCTION 277
# define ZOOM 278
# define ICONMGRS 279
# define ICONMGR_GEOMETRY 280
# define ICONMGR_NOSHOW 281
# define MAKE_TITLE 282
# define ICONIFY_BY_UNMAPPING 283
# define DONT_ICONIFY_BY_UNMAPPING 284
# define NO_TITLE 285
# define AUTO_RAISE 286
# define NO_HILITE 287
# define ICON_REGION 288
# define META 289
# define SHIFT 290
# define LOCK 291
# define CONTROL 292
# define WINDOW 293
# define TITLE 294
# define ICON 295
# define ROOT 296
# define FRAME 297
# define VIRTUAL 298
# define COLON 299
# define EQUALS 300
# define SQUEEZE_TITLE 301
# define DONT_SQUEEZE_TITLE 302
# define START_ICONIFIED 303
# define NO_TITLE_HILITE 304
# define TITLE_HILITE 305
# define MOVE 306
# define RESIZE 307
# define WAIT 308
# define SELECT 309
# define KILL 310
# define LEFT_TITLEBUTTON 311
# define RIGHT_TITLEBUTTON 312
# define NUMBER 313
# define KEYWORD 314
# define NKEYWORD 315
# define CKEYWORD 316
# define CLKEYWORD 317
# define FKEYWORD 318
# define FSKEYWORD 319
# define SKEYWORD 320
# define DKEYWORD 321
# define JKEYWORD 322
# define WINDOW_RING 323
# define WARP_CURSOR 324
# define ERRORTOKEN 325
# define NO_STACKMODE 326
# define NAILEDDOWN 327
# define VIRTUALDESKTOP 328
# define STRING 329

#include <malloc.h>
#include <memory.h>
#include <values.h>

#ifdef __cplusplus

#ifndef yyerror
	void yyerror(const char *);
#endif

#ifndef yylex
#ifdef __EXTERN_C__
	extern "C" { int yylex(void); }
#else
	int yylex(void);
#endif
#endif
	int yyparse(void);

#endif
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
YYSTYPE yylval;
YYSTYPE yyval;
typedef int yytabelem;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#if YYMAXDEPTH > 0
int yy_yys[YYMAXDEPTH], *yys = yy_yys;
YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
#else	/* user does initial allocation */
int *yys;
YYSTYPE *yyv;
#endif
static int yymaxdepth = YYMAXDEPTH;
# define YYERRCODE 256

# line 622 "gram.y"

yyerror(s) char *s;
{
    twmrc_error_prefix();
    fprintf (stderr, "error in input file:  %s\n", s ? s : "");
    ParseError = 1;
}
RemoveDQuote(str)
char *str;
{
    register char *i, *o;
    register n;
    register count;

    for (i=str+1, o=str; *i && *i != '\"'; o++)
    {
	if (*i == '\\')
	{
	    switch (*++i)
	    {
	    case 'n':
		*o = '\n';
		i++;
		break;
	    case 'b':
		*o = '\b';
		i++;
		break;
	    case 'r':
		*o = '\r';
		i++;
		break;
	    case 't':
		*o = '\t';
		i++;
		break;
	    case 'f':
		*o = '\f';
		i++;
		break;
	    case '0':
		if (*++i == 'x')
		    goto hex;
		else
		    --i;
	    case '1': case '2': case '3':
	    case '4': case '5': case '6': case '7':
		n = 0;
		count = 0;
		while (*i >= '0' && *i <= '7' && count < 3)
		{
		    n = (n<<3) + (*i++ - '0');
		    count++;
		}
		*o = n;
		break;
	    hex:
	    case 'x':
		n = 0;
		count = 0;
		while (i++, count++ < 2)
		{
		    if (*i >= '0' && *i <= '9')
			n = (n<<4) + (*i - '0');
		    else if (*i >= 'a' && *i <= 'f')
			n = (n<<4) + (*i - 'a') + 10;
		    else if (*i >= 'A' && *i <= 'F')
			n = (n<<4) + (*i - 'A') + 10;
		    else
			break;
		}
		*o = n;
		break;
	    case '\n':
		i++;	/* punt */
		o--;	/* to account for o++ at end of loop */
		break;
	    case '\"':
	    case '\'':
	    case '\\':
	    default:
		*o = *i++;
		break;
	    }
	}
	else
	    *o = *i++;
    }
    *o = '\0';
}

static MenuRoot *GetRoot(name, fore, back)
char *name;
char *fore, *back;
{
    MenuRoot *tmp;

    tmp = FindMenuRoot(name);
    if (tmp == NULL)
	tmp = NewMenuRoot(name);

    if (fore)
    {
	int save;

	save = Scr->FirstTime;
	Scr->FirstTime = TRUE;
	GetColor(COLOR, &tmp->hi_fore, fore);
	GetColor(COLOR, &tmp->hi_back, back);
	Scr->FirstTime = save;
    }

    return tmp;
}

static void GotButton(butt, func)
int butt, func;
{
    int i;

    for (i = 0; i < NUM_CONTEXTS; i++)
    {
	if ((cont & (1 << i)) == 0)
	    continue;

	Scr->Mouse[butt][i][mods].func = func;
	if (func == F_MENU)
	{
	    pull->prev = NULL;
	    Scr->Mouse[butt][i][mods].menu = pull;
	}
	else
	{
	    root = GetRoot(TWM_ROOT, NULLSTR, NULLSTR);
	    Scr->Mouse[butt][i][mods].item = AddToMenu(root,"x",Action,
		    NULLSTR, func, NULLSTR, NULLSTR);
	}
    }
    Action = "";
    pull = NULL;
    cont = 0;
    mods_used |= mods;
    mods = 0;
}

static void GotKey(key, func)
char *key;
int func;
{
    int i;

    for (i = 0; i < NUM_CONTEXTS; i++)
    {
	if ((cont & (1 << i)) == 0) 
	  continue;
	if (!AddFuncKey(key, i, mods, func, Name, Action)) 
	  break;
    }

    Action = "";
    pull = NULL;
    cont = 0;
    mods_used |= mods;
    mods = 0;
}


static void GotTitleButton (bitmapname, func, rightside)
    char *bitmapname;
    int func;
    Bool rightside;
{
    if (!CreateTitleButton (bitmapname, func, Action, pull, rightside, True)) {
	twmrc_error_prefix();
	fprintf (stderr, 
		 "unable to create %s titlebutton \"%s\"\n",
		 rightside ? "right" : "left", bitmapname);
    }
    Action = "";
    pull = NULL;
}

static Bool CheckWarpScreenArg (s)
    register char *s;
{
    XmuCopyISOLatin1Lowered (s, s);

    if (strcmp (s,  WARPSCREEN_NEXT) == 0 ||
	strcmp (s,  WARPSCREEN_PREV) == 0 ||
	strcmp (s,  WARPSCREEN_BACK) == 0)
      return True;

    for (; *s && isascii(*s) && isdigit(*s); s++) ;
    return (*s ? False : True);
}


static Bool CheckWarpRingArg (s)
    register char *s;
{
    XmuCopyISOLatin1Lowered (s, s);

    if (strcmp (s,  WARPSCREEN_NEXT) == 0 ||
	strcmp (s,  WARPSCREEN_PREV) == 0)
      return True;

    return False;
}


static Bool CheckColormapArg (s)
    register char *s;
{
    XmuCopyISOLatin1Lowered (s, s);

    if (strcmp (s, COLORMAP_NEXT) == 0 ||
	strcmp (s, COLORMAP_PREV) == 0 ||
	strcmp (s, COLORMAP_DEFAULT) == 0)
      return True;

    return False;
}


twmrc_error_prefix ()
{
    fprintf (stderr, "%s:  line %d:  ", ProgramName, yylineno);
}
yytabelem yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
-1, 2,
	0, 1,
	-2, 0,
-1, 14,
	257, 16,
	-2, 18,
-1, 20,
	257, 27,
	-2, 29,
-1, 23,
	257, 34,
	-2, 36,
-1, 24,
	257, 37,
	-2, 39,
-1, 25,
	257, 40,
	-2, 42,
-1, 26,
	257, 43,
	-2, 45,
-1, 37,
	257, 66,
	-2, 68,
-1, 44,
	257, 153,
	-2, 152,
-1, 45,
	257, 156,
	-2, 155,
-1, 248,
	257, 145,
	-2, 144,
	};
# define YYNPROD 190
# define YYLAST 410
yytabelem yyact[]={

     4,    47,   250,   131,   275,   241,    30,    46,    35,    94,
    62,    63,    51,    13,    12,    32,    33,    34,    31,    22,
    64,    36,    11,    21,    10,    20,    27,    14,    19,    26,
    29,    24,     9,   200,    51,   193,   187,   181,    62,    63,
   257,   261,   262,   101,   132,    44,    45,    28,    23,    47,
    47,   244,   236,   237,   100,    15,    16,    66,    41,    43,
   196,   233,   272,   190,    42,   161,   278,    38,    37,   255,
    25,    39,    40,    47,   234,    47,    47,   117,   228,   229,
   230,   231,   232,   235,   226,    18,   162,   267,   164,    51,
    99,   134,   129,    60,   123,    48,    49,   121,   108,    62,
    63,    57,    58,    59,    47,   135,    47,    47,    47,   145,
   141,    62,    63,    55,    47,    53,    78,    79,   199,   198,
   103,   122,   242,   140,   191,   245,    88,   192,    89,    83,
    84,   194,   165,   182,   148,   188,   224,   225,   159,    92,
   167,   138,   139,    91,   137,   221,    50,   276,   157,   102,
   273,   266,   157,   142,   143,   144,   146,   147,   222,   258,
   197,   166,   216,   217,   218,   219,   220,   223,   214,   153,
   154,   155,   156,   153,   154,   155,   156,   136,    97,   158,
   133,    96,   227,   151,   215,   152,   186,   104,   184,    87,
    90,    86,    85,    93,   149,   150,    95,    82,    81,   120,
    80,   163,   119,   160,   124,   118,   264,    77,    76,    75,
    74,    73,    72,    71,    70,   107,    69,    68,    67,    98,
   169,    56,    54,   170,   171,   172,   173,   174,   175,   176,
   177,   178,   179,   180,   183,   128,    52,     8,     7,     6,
     5,     3,     2,     1,    65,   189,    61,   259,    17,     0,
     0,   195,     0,   201,     0,     0,   203,   204,   205,   206,
   207,   208,   209,   210,   211,   212,   213,     0,     0,     0,
     0,     0,   238,     0,     0,   239,   240,   243,   168,     0,
     0,   247,     0,     0,   248,   249,   246,   105,   106,     0,
   109,   110,   111,   112,   113,   114,   115,   116,     0,     0,
   185,     0,     0,     0,     0,   125,   126,   127,   251,     0,
     0,     0,   130,     0,     0,   202,     0,     0,     0,     0,
   252,     0,     0,     0,     0,   254,     0,     0,     0,     0,
   271,     0,     0,     0,     0,     0,     0,   256,     0,     0,
     0,     0,     0,   265,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,   274,   277,
     0,     0,     0,   279,     0,     0,     0,     0,     0,     0,
     0,     0,   280,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,   253,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,   260,     0,     0,
     0,   263,     0,     0,     0,     0,   268,     0,   269,   270 };
yytabelem yypact[]={

-10000000,-10000000,  -256,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -328,
  -328,  -301,  -142,  -144,-10000000,  -328,  -328,  -280,  -243,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  -328,  -328,-10000000,-10000000,-10000000,  -308,  -308,-10000000,-10000000,-10000000,
  -328,-10000000,  -328,  -301,-10000000,-10000000,  -301,-10000000,  -312,  -301,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -167,  -246,  -257,-10000000,
-10000000,-10000000,-10000000,  -328,-10000000,-10000000,-10000000,  -167,  -167,  -159,
  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -182,-10000000,
  -160,  -163,  -163,-10000000,-10000000,  -167,  -167,  -167,  -301,-10000000,
-10000000,  -165,  -167,-10000000,  -318,-10000000,  -214,  -153,-10000000,-10000000,
  -308,  -308,-10000000,  -116,  -120,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -328,  -171,  -169,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,  -301,-10000000,-10000000,  -328,-10000000,-10000000,  -328,  -328,  -328,
  -328,  -328,  -328,  -328,  -328,  -328,  -328,  -328,  -221,-10000000,
-10000000,-10000000,-10000000,  -301,-10000000,-10000000,-10000000,-10000000,-10000000,  -222,
  -236,-10000000,-10000000,-10000000,-10000000,  -223,  -198,  -225,  -301,-10000000,
  -328,  -328,  -328,  -328,  -328,  -328,  -328,  -328,  -328,  -328,
  -328,-10000000,-10000000,-10000000,  -131,-10000000,  -215,-10000000,-10000000,  -328,
  -328,  -253,  -207,-10000000,-10000000,  -328,-10000000,-10000000,  -328,  -328,
-10000000,  -320,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,  -308,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -308,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -279,
  -191,-10000000,-10000000,  -219,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  -224,-10000000,-10000000,-10000000,  -301,-10000000,-10000000,  -328,  -170,  -301,
-10000000,  -301,  -301,-10000000,  -171,  -237,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,  -328,  -254,  -194,-10000000,-10000000,  -328,  -308,-10000000,
-10000000 };
yytabelem yypgo[]={

     0,    85,    93,   248,   146,   247,   246,   244,   243,   242,
   241,   240,   239,   238,   237,   236,   222,   221,   219,   218,
   217,   216,   215,   214,   213,   212,   211,   210,   209,   208,
   207,   206,    65,   205,   202,   201,   200,   199,   198,   121,
   197,   192,   191,   189,   120,   188,   186,   185,   184,   182,
   181,   180,   178,   177,   161,   160,   159,   151,   150,   147,
   143,   140,   139,   138,   135,   134,   133,   132,   131,   127,
   125,   124,   122 };
yytabelem yyr1[]={

     0,     8,     9,     9,    10,    10,    10,    10,    10,    10,
    10,    10,    10,    10,    10,    10,    17,    10,    10,    10,
    10,    10,    10,    10,    10,    19,    10,    20,    10,    10,
    21,    10,    23,    10,    24,    10,    10,    25,    10,    10,
    26,    10,    10,    27,    10,    10,    28,    10,    29,    10,
    30,    10,    31,    10,    33,    10,    34,    10,    36,    10,
    38,    10,    40,    10,    10,    10,    41,    10,    10,    42,
    10,    43,    10,    10,    11,    12,    13,     6,     7,    44,
    44,    47,    47,    47,    47,    47,    47,    45,    45,    48,
    48,    48,    48,    48,    48,    48,    48,    48,    48,    46,
    46,    49,    49,    49,    49,    49,    49,    49,    49,    49,
    49,    49,    15,    50,    50,    51,    16,    52,    52,    53,
    53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
    53,    53,    53,    53,    53,    53,    53,    53,    53,    53,
    53,    39,    54,    54,    55,    56,    55,    55,    57,    58,
    58,    59,    14,    60,    14,    14,    62,    14,    61,    61,
    22,    63,    63,    64,    64,    18,    65,    65,    66,    37,
    67,    67,    68,    35,    69,    69,    70,    32,    71,    71,
    72,    72,     2,     2,     5,     5,     5,     3,     1,     4 };
yytabelem yyr2[]={

     0,     2,     0,     4,     2,     2,     2,     2,     2,    13,
     7,     5,     5,     3,     5,     5,     1,     6,     3,     9,
     9,     5,     5,     5,     5,     1,     6,     1,     6,     3,
     1,     6,     1,     6,     1,     6,     3,     1,     6,     3,
     1,     6,     3,     1,     6,     3,     1,     6,     1,     6,
     1,     6,     1,    19,     1,     9,     1,     8,     1,     6,
     1,     6,     1,     6,     5,     5,     1,     6,     3,     1,
     6,     1,     6,     7,     3,     5,     5,    13,    13,     0,
     4,     3,     3,     3,     3,     5,     3,     0,     4,     3,
     3,     3,     3,     3,     3,     3,     3,     3,     3,     0,
     4,     3,     3,     3,     3,     3,     3,     3,     3,     3,
     3,     3,     6,     0,     4,     5,     6,     0,     4,     7,
     5,     7,     5,     7,     5,     7,     5,     7,     5,     7,
     5,     7,     5,     7,     5,     7,     5,     7,     5,     7,
     5,     6,     0,     4,     5,     1,     8,     5,     6,     0,
     4,     5,     3,     1,    10,     3,     1,     6,     0,    11,
     6,     0,     4,     7,     9,     6,     0,     4,     3,     6,
     0,     4,     5,     6,     0,     4,     3,     6,     0,     4,
     5,    15,     3,     5,     3,     5,     5,     5,     3,     3 };
yytabelem yychk[]={

-10000000,    -8,    -9,   -10,   256,   -11,   -12,   -13,   -14,   288,
   280,   278,   270,   269,   283,   311,   312,    -3,    -1,   284,
   281,   279,   275,   304,   287,   326,   285,   282,   303,   286,
   262,   274,   271,   272,   273,   264,   277,   324,   323,   327,
   328,   314,   320,   315,   301,   302,   263,   329,    -1,    -1,
    -4,   313,   -15,   257,   -16,   257,   -17,    -1,    -1,    -1,
    -2,    -6,   318,   319,   300,    -7,   300,   -19,   -20,   -21,
   -23,   -24,   -25,   -26,   -27,   -28,   -29,   -30,    -1,    -1,
   -36,   -38,   -40,    -2,    -2,   -41,   -42,   -43,    -1,    -1,
    -4,   -60,   -62,    -4,   321,    -4,   -50,   -52,   -18,   257,
   300,   300,    -1,   -44,   -44,   -18,   -18,   -22,   257,   -18,
   -18,   -18,   -18,   -18,   -18,   -18,   -18,   259,   -33,   -34,
   -37,   257,   -39,   257,   -39,   -18,   -18,   -18,    -4,   257,
   -18,   321,   258,   -51,   305,   258,   -53,   297,   294,   295,
   276,   263,   306,   307,   308,   262,   309,   310,   -65,    -2,
    -2,   299,   -47,   289,   290,   291,   292,   268,   299,   -63,
    -1,   -32,   257,   -35,   257,   -67,   -54,   -61,    -4,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   258,   -66,    -1,   -45,    -4,   -46,   258,   -64,    -1,
   299,   -71,   -69,   258,   -68,    -1,   258,   -55,   317,   316,
   258,    -1,    -4,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,   299,   -48,   293,   294,   295,   296,
   297,   276,   289,   298,   267,   268,   299,   -49,   293,   294,
   295,   296,   297,   276,   289,   298,   267,   268,    -1,    -1,
    -1,   258,   -72,    -1,   258,   -70,    -2,    -1,    -1,    -1,
   322,    -2,    -2,    -4,    -1,   260,    -2,   259,   -56,    -5,
    -4,   265,   266,    -4,   -31,    -1,   -57,   257,    -4,    -4,
    -4,   -32,   299,   -58,    -1,   258,   -59,    -1,   260,    -1,
    -2 };
yytabelem yydef[]={

     2,    -2,    -2,     3,     4,     5,     6,     7,     8,     0,
     0,    13,     0,     0,    -2,     0,     0,     0,     0,    25,
    -2,    30,    32,    -2,    -2,    -2,    -2,    46,    48,    50,
     0,     0,    58,    60,    62,     0,     0,    -2,    69,    71,
     0,    74,     0,     0,    -2,    -2,     0,   188,     0,    11,
    12,   189,    14,   113,    15,   117,     0,     0,     0,    21,
    22,    24,   182,     0,    79,    23,    79,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,    54,    56,
     0,     0,     0,    64,    65,     0,     0,     0,     0,    75,
    76,     0,     0,   187,     0,    10,     0,     0,    17,   166,
     0,     0,   183,     0,     0,    26,    28,    31,   161,    33,
    35,    38,    41,    44,    47,    49,    51,     0,     0,     0,
    59,   170,    61,   142,    63,    67,    70,    72,    73,   158,
   157,     0,   112,   114,     0,   116,   118,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,    19,
    20,    87,    80,    81,    82,    83,    84,    86,    99,     0,
     0,    55,   178,    57,   174,     0,     0,     0,     0,   115,
   120,   122,   124,   126,   128,   130,   132,   134,   136,   138,
   140,   165,   167,   168,     0,    85,     0,   160,   162,     0,
     0,     0,     0,   169,   171,     0,   141,   143,     0,     0,
   154,     0,     9,   119,   121,   123,   125,   127,   129,   131,
   133,   135,   137,   139,     0,    88,    89,    90,    91,    92,
    93,    94,    95,    96,    97,    98,     0,   100,   101,   102,
   103,   104,   105,   106,   107,   108,   109,   110,   111,     0,
     0,   177,   179,     0,   173,   175,   176,   172,    -2,   147,
     0,    77,    78,   163,     0,    52,   180,     0,     0,     0,
   184,     0,     0,   164,     0,     0,   146,   149,   159,   185,
   186,    53,     0,     0,     0,   148,   150,     0,     0,   151,
   181 };
typedef struct
#ifdef __cplusplus
	yytoktype
#endif
{ char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"LB",	257,
	"RB",	258,
	"LP",	259,
	"RP",	260,
	"MENUS",	261,
	"MENU",	262,
	"BUTTON",	263,
	"DEFAULT_FUNCTION",	264,
	"PLUS",	265,
	"MINUS",	266,
	"ALL",	267,
	"OR",	268,
	"CURSORS",	269,
	"PIXMAPS",	270,
	"ICONS",	271,
	"COLOR",	272,
	"MONOCHROME",	273,
	"FUNCTION",	274,
	"ICONMGR_SHOW",	275,
	"ICONMGR",	276,
	"WINDOW_FUNCTION",	277,
	"ZOOM",	278,
	"ICONMGRS",	279,
	"ICONMGR_GEOMETRY",	280,
	"ICONMGR_NOSHOW",	281,
	"MAKE_TITLE",	282,
	"ICONIFY_BY_UNMAPPING",	283,
	"DONT_ICONIFY_BY_UNMAPPING",	284,
	"NO_TITLE",	285,
	"AUTO_RAISE",	286,
	"NO_HILITE",	287,
	"ICON_REGION",	288,
	"META",	289,
	"SHIFT",	290,
	"LOCK",	291,
	"CONTROL",	292,
	"WINDOW",	293,
	"TITLE",	294,
	"ICON",	295,
	"ROOT",	296,
	"FRAME",	297,
	"VIRTUAL",	298,
	"COLON",	299,
	"EQUALS",	300,
	"SQUEEZE_TITLE",	301,
	"DONT_SQUEEZE_TITLE",	302,
	"START_ICONIFIED",	303,
	"NO_TITLE_HILITE",	304,
	"TITLE_HILITE",	305,
	"MOVE",	306,
	"RESIZE",	307,
	"WAIT",	308,
	"SELECT",	309,
	"KILL",	310,
	"LEFT_TITLEBUTTON",	311,
	"RIGHT_TITLEBUTTON",	312,
	"NUMBER",	313,
	"KEYWORD",	314,
	"NKEYWORD",	315,
	"CKEYWORD",	316,
	"CLKEYWORD",	317,
	"FKEYWORD",	318,
	"FSKEYWORD",	319,
	"SKEYWORD",	320,
	"DKEYWORD",	321,
	"JKEYWORD",	322,
	"WINDOW_RING",	323,
	"WARP_CURSOR",	324,
	"ERRORTOKEN",	325,
	"NO_STACKMODE",	326,
	"NAILEDDOWN",	327,
	"VIRTUALDESKTOP",	328,
	"STRING",	329,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"twmrc : stmts",
	"stmts : /* empty */",
	"stmts : stmts stmt",
	"stmt : error",
	"stmt : noarg",
	"stmt : sarg",
	"stmt : narg",
	"stmt : squeeze",
	"stmt : ICON_REGION string DKEYWORD DKEYWORD number number",
	"stmt : ICONMGR_GEOMETRY string number",
	"stmt : ICONMGR_GEOMETRY string",
	"stmt : ZOOM number",
	"stmt : ZOOM",
	"stmt : PIXMAPS pixmap_list",
	"stmt : CURSORS cursor_list",
	"stmt : ICONIFY_BY_UNMAPPING",
	"stmt : ICONIFY_BY_UNMAPPING win_list",
	"stmt : ICONIFY_BY_UNMAPPING",
	"stmt : LEFT_TITLEBUTTON string EQUALS action",
	"stmt : RIGHT_TITLEBUTTON string EQUALS action",
	"stmt : button string",
	"stmt : button action",
	"stmt : string fullkey",
	"stmt : button full",
	"stmt : DONT_ICONIFY_BY_UNMAPPING",
	"stmt : DONT_ICONIFY_BY_UNMAPPING win_list",
	"stmt : ICONMGR_NOSHOW",
	"stmt : ICONMGR_NOSHOW win_list",
	"stmt : ICONMGR_NOSHOW",
	"stmt : ICONMGRS",
	"stmt : ICONMGRS iconm_list",
	"stmt : ICONMGR_SHOW",
	"stmt : ICONMGR_SHOW win_list",
	"stmt : NO_TITLE_HILITE",
	"stmt : NO_TITLE_HILITE win_list",
	"stmt : NO_TITLE_HILITE",
	"stmt : NO_HILITE",
	"stmt : NO_HILITE win_list",
	"stmt : NO_HILITE",
	"stmt : NO_STACKMODE",
	"stmt : NO_STACKMODE win_list",
	"stmt : NO_STACKMODE",
	"stmt : NO_TITLE",
	"stmt : NO_TITLE win_list",
	"stmt : NO_TITLE",
	"stmt : MAKE_TITLE",
	"stmt : MAKE_TITLE win_list",
	"stmt : START_ICONIFIED",
	"stmt : START_ICONIFIED win_list",
	"stmt : AUTO_RAISE",
	"stmt : AUTO_RAISE win_list",
	"stmt : MENU string LP string COLON string RP",
	"stmt : MENU string LP string COLON string RP menu",
	"stmt : MENU string",
	"stmt : MENU string menu",
	"stmt : FUNCTION string",
	"stmt : FUNCTION string function",
	"stmt : ICONS",
	"stmt : ICONS icon_list",
	"stmt : COLOR",
	"stmt : COLOR color_list",
	"stmt : MONOCHROME",
	"stmt : MONOCHROME color_list",
	"stmt : DEFAULT_FUNCTION action",
	"stmt : WINDOW_FUNCTION action",
	"stmt : WARP_CURSOR",
	"stmt : WARP_CURSOR win_list",
	"stmt : WARP_CURSOR",
	"stmt : WINDOW_RING",
	"stmt : WINDOW_RING win_list",
	"stmt : NAILEDDOWN",
	"stmt : NAILEDDOWN win_list",
	"stmt : VIRTUALDESKTOP string number",
	"noarg : KEYWORD",
	"sarg : SKEYWORD string",
	"narg : NKEYWORD number",
	"full : EQUALS keys COLON contexts COLON action",
	"fullkey : EQUALS keys COLON contextkeys COLON action",
	"keys : /* empty */",
	"keys : keys key",
	"key : META",
	"key : SHIFT",
	"key : LOCK",
	"key : CONTROL",
	"key : META number",
	"key : OR",
	"contexts : /* empty */",
	"contexts : contexts context",
	"context : WINDOW",
	"context : TITLE",
	"context : ICON",
	"context : ROOT",
	"context : FRAME",
	"context : ICONMGR",
	"context : META",
	"context : VIRTUAL",
	"context : ALL",
	"context : OR",
	"contextkeys : /* empty */",
	"contextkeys : contextkeys contextkey",
	"contextkey : WINDOW",
	"contextkey : TITLE",
	"contextkey : ICON",
	"contextkey : ROOT",
	"contextkey : FRAME",
	"contextkey : ICONMGR",
	"contextkey : META",
	"contextkey : VIRTUAL",
	"contextkey : ALL",
	"contextkey : OR",
	"contextkey : string",
	"pixmap_list : LB pixmap_entries RB",
	"pixmap_entries : /* empty */",
	"pixmap_entries : pixmap_entries pixmap_entry",
	"pixmap_entry : TITLE_HILITE string",
	"cursor_list : LB cursor_entries RB",
	"cursor_entries : /* empty */",
	"cursor_entries : cursor_entries cursor_entry",
	"cursor_entry : FRAME string string",
	"cursor_entry : FRAME string",
	"cursor_entry : TITLE string string",
	"cursor_entry : TITLE string",
	"cursor_entry : ICON string string",
	"cursor_entry : ICON string",
	"cursor_entry : ICONMGR string string",
	"cursor_entry : ICONMGR string",
	"cursor_entry : BUTTON string string",
	"cursor_entry : BUTTON string",
	"cursor_entry : MOVE string string",
	"cursor_entry : MOVE string",
	"cursor_entry : RESIZE string string",
	"cursor_entry : RESIZE string",
	"cursor_entry : WAIT string string",
	"cursor_entry : WAIT string",
	"cursor_entry : MENU string string",
	"cursor_entry : MENU string",
	"cursor_entry : SELECT string string",
	"cursor_entry : SELECT string",
	"cursor_entry : KILL string string",
	"cursor_entry : KILL string",
	"color_list : LB color_entries RB",
	"color_entries : /* empty */",
	"color_entries : color_entries color_entry",
	"color_entry : CLKEYWORD string",
	"color_entry : CLKEYWORD string",
	"color_entry : CLKEYWORD string win_color_list",
	"color_entry : CKEYWORD string",
	"win_color_list : LB win_color_entries RB",
	"win_color_entries : /* empty */",
	"win_color_entries : win_color_entries win_color_entry",
	"win_color_entry : string string",
	"squeeze : SQUEEZE_TITLE",
	"squeeze : SQUEEZE_TITLE",
	"squeeze : SQUEEZE_TITLE LB win_sqz_entries RB",
	"squeeze : DONT_SQUEEZE_TITLE",
	"squeeze : DONT_SQUEEZE_TITLE",
	"squeeze : DONT_SQUEEZE_TITLE win_list",
	"win_sqz_entries : /* empty */",
	"win_sqz_entries : win_sqz_entries string JKEYWORD signed_number number",
	"iconm_list : LB iconm_entries RB",
	"iconm_entries : /* empty */",
	"iconm_entries : iconm_entries iconm_entry",
	"iconm_entry : string string number",
	"iconm_entry : string string string number",
	"win_list : LB win_entries RB",
	"win_entries : /* empty */",
	"win_entries : win_entries win_entry",
	"win_entry : string",
	"icon_list : LB icon_entries RB",
	"icon_entries : /* empty */",
	"icon_entries : icon_entries icon_entry",
	"icon_entry : string string",
	"function : LB function_entries RB",
	"function_entries : /* empty */",
	"function_entries : function_entries function_entry",
	"function_entry : action",
	"menu : LB menu_entries RB",
	"menu_entries : /* empty */",
	"menu_entries : menu_entries menu_entry",
	"menu_entry : string action",
	"menu_entry : string LP string COLON string RP action",
	"action : FKEYWORD",
	"action : FSKEYWORD string",
	"signed_number : number",
	"signed_number : PLUS number",
	"signed_number : MINUS number",
	"button : BUTTON number",
	"string : STRING",
	"number : NUMBER",
};
#endif /* YYDEBUG */
/*
 * Copyright (c) 1993 by Sun Microsystems, Inc.
 */

#pragma ident	"@(#)yaccpar	6.12	93/06/07 SMI"

/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#define YYERROR		goto yyerrlab
#define YYACCEPT	return(0)
#define YYABORT		return(1)
#define YYBACKUP( newtoken, newvalue )\
{\
	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
	{\
		yyerror( "syntax error - cannot backup" );\
		goto yyerrlab;\
	}\
	yychar = newtoken;\
	yystate = *yyps;\
	yylval = newvalue;\
	goto yynewstate;\
}
#define YYRECOVERING()	(!!yyerrflag)
#define YYNEW(type)	malloc(sizeof(type) * yynewmax)
#define YYCOPY(to, from, type) \
	(type *) memcpy(to, (char *) from, yynewmax * sizeof(type))
#define YYENLARGE( from, type) \
	(type *) realloc((char *) from, yynewmax * sizeof(type))
#ifndef YYDEBUG
#	define YYDEBUG	1	/* make debugging available */
#endif

/*
** user known globals
*/
int yydebug;			/* set to 1 to get debugging */

/*
** driver internal defines
*/
#define YYFLAG		(-10000000)

/*
** global variables used by the parser
*/
YYSTYPE *yypv;			/* top of value stack */
int *yyps;			/* top of state stack */

int yystate;			/* current state */
int yytmp;			/* extra var (lasts between blocks) */

int yynerrs;			/* number of errors */
int yyerrflag;			/* error recovery flag */
int yychar;			/* current input token number */



#ifdef YYNMBCHARS
#define YYLEX()		yycvtok(yylex())
/*
** yycvtok - return a token if i is a wchar_t value that exceeds 255.
**	If i<255, i itself is the token.  If i>255 but the neither 
**	of the 30th or 31st bit is on, i is already a token.
*/
#if defined(__STDC__) || defined(__cplusplus)
int yycvtok(int i)
#else
int yycvtok(i) int i;
#endif
{
	int first = 0;
	int last = YYNMBCHARS - 1;
	int mid;
	wchar_t j;

	if(i&0x60000000){/*Must convert to a token. */
		if( yymbchars[last].character < i ){
			return i;/*Giving up*/
		}
		while ((last>=first)&&(first>=0)) {/*Binary search loop*/
			mid = (first+last)/2;
			j = yymbchars[mid].character;
			if( j==i ){/*Found*/ 
				return yymbchars[mid].tvalue;
			}else if( j<i ){
				first = mid + 1;
			}else{
				last = mid -1;
			}
		}
		/*No entry in the table.*/
		return i;/* Giving up.*/
	}else{/* i is already a token. */
		return i;
	}
}
#else/*!YYNMBCHARS*/
#define YYLEX()		yylex()
#endif/*!YYNMBCHARS*/

/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
#if defined(__STDC__) || defined(__cplusplus)
int yyparse(void)
#else
int yyparse()
#endif
{
	register YYSTYPE *yypvt;	/* top of value stack for $vars */

#if defined(__cplusplus) || defined(lint)
/*
	hacks to please C++ and lint - goto's inside switch should never be
	executed; yypvt is set to 0 to avoid "used before set" warning.
*/
	static int __yaccpar_lint_hack__ = 0;
	switch (__yaccpar_lint_hack__)
	{
		case 1: goto yyerrlab;
		case 2: goto yynewstate;
	}
	yypvt = 0;
#endif

	/*
	** Initialize externals - yyparse may be called more than once
	*/
	yypv = &yyv[-1];
	yyps = &yys[-1];
	yystate = 0;
	yytmp = 0;
	yynerrs = 0;
	yyerrflag = 0;
	yychar = -1;

#if YYMAXDEPTH <= 0
	if (yymaxdepth <= 0)
	{
		if ((yymaxdepth = YYEXPAND(0)) <= 0)
		{
			yyerror("yacc initialization error");
			YYABORT;
		}
	}
#endif

	{
		register YYSTYPE *yy_pv;	/* top of value stack */
		register int *yy_ps;		/* top of state stack */
		register int yy_state;		/* current state */
		register int  yy_n;		/* internal state number info */
	goto yystack;	/* moved from 6 lines above to here to please C++ */

		/*
		** get globals into registers.
		** branch to here only if YYBACKUP was called.
		*/
	yynewstate:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;
		goto yy_newstate;

		/*
		** get globals into registers.
		** either we just started, or we just finished a reduction
		*/
	yystack:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;

		/*
		** top of for (;;) loop while no reductions done
		*/
	yy_stack:
		/*
		** put a state and value onto the stacks
		*/
#if YYDEBUG
		/*
		** if debugging, look up token value in list of value vs.
		** name pairs.  0 and negative (-1) are special values.
		** Note: linear search is used since time is not a real
		** consideration while debugging.
		*/
		if ( yydebug )
		{
			register int yy_i;

			printf( "State %d, token ", yy_state );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ++yy_ps >= &yys[ yymaxdepth ] )	/* room on stack? */
		{
			/*
			** reallocate and recover.  Note that pointers
			** have to be reset, or bad things will happen
			*/
			int yyps_index = (yy_ps - yys);
			int yypv_index = (yy_pv - yyv);
			int yypvt_index = (yypvt - yyv);
			int yynewmax;
#ifdef YYEXPAND
			yynewmax = YYEXPAND(yymaxdepth);
#else
			yynewmax = 2 * yymaxdepth;	/* double table size */
			if (yymaxdepth == YYMAXDEPTH)	/* first time growth */
			{
				char *newyys = (char *)YYNEW(int);
				char *newyyv = (char *)YYNEW(YYSTYPE);
				if (newyys != 0 && newyyv != 0)
				{
					yys = YYCOPY(newyys, yys, int);
					yyv = YYCOPY(newyyv, yyv, YYSTYPE);
				}
				else
					yynewmax = 0;	/* failed */
			}
			else				/* not first time */
			{
				yys = YYENLARGE(yys, int);
				yyv = YYENLARGE(yyv, YYSTYPE);
				if (yys == 0 || yyv == 0)
					yynewmax = 0;	/* failed */
			}
#endif
			if (yynewmax <= yymaxdepth)	/* tables not expanded */
			{
				yyerror( "yacc stack overflow" );
				YYABORT;
			}
			yymaxdepth = yynewmax;

			yy_ps = yys + yyps_index;
			yy_pv = yyv + yypv_index;
			yypvt = yyv + yypvt_index;
		}
		*yy_ps = yy_state;
		*++yy_pv = yyval;

		/*
		** we have a new state - find out what to do
		*/
	yy_newstate:
		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
			goto yydefault;		/* simple state */
#if YYDEBUG
		/*
		** if debugging, need to mark whether new token grabbed
		*/
		yytmp = yychar < 0;
#endif
		if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
			yychar = 0;		/* reached EOF */
#if YYDEBUG
		if ( yydebug && yytmp )
		{
			register int yy_i;

			printf( "Received token " );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
			goto yydefault;
		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/
		{
			yychar = -1;
			yyval = yylval;
			yy_state = yy_n;
			if ( yyerrflag > 0 )
				yyerrflag--;
			goto yy_stack;
		}

	yydefault:
		if ( ( yy_n = yydef[ yy_state ] ) == -2 )
		{
#if YYDEBUG
			yytmp = yychar < 0;
#endif
			if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
				yychar = 0;		/* reached EOF */
#if YYDEBUG
			if ( yydebug && yytmp )
			{
				register int yy_i;

				printf( "Received token " );
				if ( yychar == 0 )
					printf( "end-of-file\n" );
				else if ( yychar < 0 )
					printf( "-none-\n" );
				else
				{
					for ( yy_i = 0;
						yytoks[yy_i].t_val >= 0;
						yy_i++ )
					{
						if ( yytoks[yy_i].t_val
							== yychar )
						{
							break;
						}
					}
					printf( "%s\n", yytoks[yy_i].t_name );
				}
			}
#endif /* YYDEBUG */
			/*
			** look through exception table
			*/
			{
				register int *yyxi = yyexca;

				while ( ( *yyxi != -1 ) ||
					( yyxi[1] != yy_state ) )
				{
					yyxi += 2;
				}
				while ( ( *(yyxi += 2) >= 0 ) &&
					( *yyxi != yychar ) )
					;
				if ( ( yy_n = yyxi[1] ) < 0 )
					YYACCEPT;
			}
		}

		/*
		** check for syntax error
		*/
		if ( yy_n == 0 )	/* have an error */
		{
			/* no worry about speed here! */
			switch ( yyerrflag )
			{
			case 0:		/* new error */
				yyerror( "syntax error" );
				goto skip_init;
			yyerrlab:
				/*
				** get globals into registers.
				** we have a user generated syntax type error
				*/
				yy_pv = yypv;
				yy_ps = yyps;
				yy_state = yystate;
			skip_init:
				yynerrs++;
				/* FALLTHRU */
			case 1:
			case 2:		/* incompletely recovered error */
					/* try again... */
				yyerrflag = 3;
				/*
				** find state where "error" is a legal
				** shift action
				*/
				while ( yy_ps >= yys )
				{
					yy_n = yypact[ *yy_ps ] + YYERRCODE;
					if ( yy_n >= 0 && yy_n < YYLAST &&
						yychk[yyact[yy_n]] == YYERRCODE)					{
						/*
						** simulate shift of "error"
						*/
						yy_state = yyact[ yy_n ];
						goto yy_stack;
					}
					/*
					** current state has no shift on
					** "error", pop stack
					*/
#if YYDEBUG
#	define _POP_ "Error recovery pops state %d, uncovers state %d\n"
					if ( yydebug )
						printf( _POP_, *yy_ps,
							yy_ps[-1] );
#	undef _POP_
#endif
					yy_ps--;
					yy_pv--;
				}
				/*
				** there is no state on stack with "error" as
				** a valid shift.  give up.
				*/
				YYABORT;
			case 3:		/* no shift yet; eat a token */
#if YYDEBUG
				/*
				** if debugging, look up token in list of
				** pairs.  0 and negative shouldn't occur,
				** but since timing doesn't matter when
				** debugging, it doesn't hurt to leave the
				** tests here.
				*/
				if ( yydebug )
				{
					register int yy_i;

					printf( "Error recovery discards " );
					if ( yychar == 0 )
						printf( "token end-of-file\n" );
					else if ( yychar < 0 )
						printf( "token -none-\n" );
					else
					{
						for ( yy_i = 0;
							yytoks[yy_i].t_val >= 0;
							yy_i++ )
						{
							if ( yytoks[yy_i].t_val
								== yychar )
							{
								break;
							}
						}
						printf( "token %s\n",
							yytoks[yy_i].t_name );
					}
				}
#endif /* YYDEBUG */
				if ( yychar == 0 )	/* reached EOF. quit */
					YYABORT;
				yychar = -1;
				goto yy_newstate;
			}
		}/* end if ( yy_n == 0 ) */
		/*
		** reduction by production yy_n
		** put stack tops, etc. so things right after switch
		*/
#if YYDEBUG
		/*
		** if debugging, print the string that is the user's
		** specification of the reduction which is just about
		** to be done.
		*/
		if ( yydebug )
			printf( "Reduce by (%d) \"%s\"\n",
				yy_n, yyreds[ yy_n ] );
#endif
		yytmp = yy_n;			/* value to switch over */
		yypvt = yy_pv;			/* $vars top of value stack */
		/*
		** Look in goto table for next state
		** Sorry about using yy_state here as temporary
		** register variable, but why not, if it works...
		** If yyr2[ yy_n ] doesn't have the low order bit
		** set, then there is no action to be done for
		** this reduction.  So, no saving & unsaving of
		** registers done.  The only difference between the
		** code just after the if and the body of the if is
		** the goto yy_stack in the body.  This way the test
		** can be made before the choice of what to do is needed.
		*/
		{
			/* length of production doubled with extra bit */
			register int yy_len = yyr2[ yy_n ];

			if ( !( yy_len & 01 ) )
			{
				yy_len >>= 1;
				yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
				yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
					*( yy_ps -= yy_len ) + 1;
				if ( yy_state >= YYLAST ||
					yychk[ yy_state =
					yyact[ yy_state ] ] != -yy_n )
				{
					yy_state = yyact[ yypgo[ yy_n ] ];
				}
				goto yy_stack;
			}
			yy_len >>= 1;
			yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
			yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
				*( yy_ps -= yy_len ) + 1;
			if ( yy_state >= YYLAST ||
				yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
			{
				yy_state = yyact[ yypgo[ yy_n ] ];
			}
		}
					/* save until reenter driver code */
		yystate = yy_state;
		yyps = yy_ps;
		yypv = yy_pv;
	}
	/*
	** code supplied by user is placed in this switch
	*/
	switch( yytmp )
	{
		
case 9:
# line 113 "gram.y"
{ AddIconRegion(yypvt[-4].ptr, yypvt[-3].num, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num); } break;
case 10:
# line 114 "gram.y"
{ if (Scr->FirstTime)
						  {
						    Scr->iconmgr.geometry=yypvt[-1].ptr;
						    Scr->iconmgr.columns=yypvt[-0].num;
						  }
						} break;
case 11:
# line 120 "gram.y"
{ if (Scr->FirstTime)
						    Scr->iconmgr.geometry = yypvt[-0].ptr;
						} break;
case 12:
# line 123 "gram.y"
{ if (Scr->FirstTime)
					  {
						Scr->DoZoom = TRUE;
						Scr->ZoomCount = yypvt[-0].num;
					  }
					} break;
case 13:
# line 129 "gram.y"
{ if (Scr->FirstTime) 
						Scr->DoZoom = TRUE; } break;
case 14:
# line 131 "gram.y"
{} break;
case 15:
# line 132 "gram.y"
{} break;
case 16:
# line 133 "gram.y"
{ list = &Scr->IconifyByUn; } break;
case 18:
# line 135 "gram.y"
{ if (Scr->FirstTime) 
		    Scr->IconifyByUnmapping = TRUE; } break;
case 19:
# line 137 "gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, False);
					} break;
case 20:
# line 140 "gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, True);
					} break;
case 21:
# line 143 "gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR);
					  Scr->Mouse[yypvt[-1].num][C_ROOT][0].func = F_MENU;
					  Scr->Mouse[yypvt[-1].num][C_ROOT][0].menu = root;
					} break;
case 22:
# line 147 "gram.y"
{ Scr->Mouse[yypvt[-1].num][C_ROOT][0].func = yypvt[-0].num;
					  if (yypvt[-0].num == F_MENU)
					  {
					    pull->prev = NULL;
					    Scr->Mouse[yypvt[-1].num][C_ROOT][0].menu = pull;
					  }
					  else
					  {
					    root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
					    Scr->Mouse[yypvt[-1].num][C_ROOT][0].item = 
						AddToMenu(root,"x",Action,
							  NULLSTR,yypvt[-0].num,NULLSTR,NULLSTR);
					  }
					  Action = "";
					  pull = NULL;
					} break;
case 23:
# line 163 "gram.y"
{ GotKey(yypvt[-1].ptr, yypvt[-0].num); } break;
case 24:
# line 164 "gram.y"
{ GotButton(yypvt[-1].num, yypvt[-0].num); } break;
case 25:
# line 165 "gram.y"
{ list = &Scr->DontIconify; } break;
case 27:
# line 167 "gram.y"
{ list = &Scr->IconMgrNoShow; } break;
case 29:
# line 169 "gram.y"
{ Scr->IconManagerDontShow = TRUE; } break;
case 30:
# line 170 "gram.y"
{ list = &Scr->IconMgrs; } break;
case 32:
# line 172 "gram.y"
{ list = &Scr->IconMgrShow; } break;
case 34:
# line 174 "gram.y"
{ list = &Scr->NoTitleHighlight; } break;
case 36:
# line 176 "gram.y"
{ if (Scr->FirstTime)
						Scr->TitleHighlight = FALSE; } break;
case 37:
# line 178 "gram.y"
{ list = &Scr->NoHighlight; } break;
case 39:
# line 180 "gram.y"
{ if (Scr->FirstTime)
						Scr->Highlight = FALSE; } break;
case 40:
# line 182 "gram.y"
{ list = &Scr->NoStackModeL; } break;
case 42:
# line 184 "gram.y"
{ if (Scr->FirstTime)
						Scr->StackMode = FALSE; } break;
case 43:
# line 186 "gram.y"
{ list = &Scr->NoTitle; } break;
case 45:
# line 188 "gram.y"
{ if (Scr->FirstTime)
						Scr->NoTitlebar = TRUE; } break;
case 46:
# line 190 "gram.y"
{ list = &Scr->MakeTitle; } break;
case 48:
# line 192 "gram.y"
{ list = &Scr->StartIconified; } break;
case 50:
# line 194 "gram.y"
{ list = &Scr->AutoRaise; } break;
case 52:
# line 196 "gram.y"
{
					root = GetRoot(yypvt[-5].ptr, yypvt[-3].ptr, yypvt[-1].ptr); } break;
case 53:
# line 198 "gram.y"
{ root->real_menu = TRUE;} break;
case 54:
# line 199 "gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } break;
case 55:
# line 200 "gram.y"
{ root->real_menu = TRUE; } break;
case 56:
# line 201 "gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } break;
case 58:
# line 203 "gram.y"
{ list = &Scr->IconNames; } break;
case 60:
# line 205 "gram.y"
{ color = COLOR; } break;
case 62:
# line 207 "gram.y"
{ color = MONOCHROME; } break;
case 64:
# line 209 "gram.y"
{ Scr->DefaultFunction.func = yypvt[-0].num;
					  if (yypvt[-0].num == F_MENU)
					  {
					    pull->prev = NULL;
					    Scr->DefaultFunction.menu = pull;
					  }
					  else
					  {
					    root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
					    Scr->DefaultFunction.item = 
						AddToMenu(root,"x",Action,
							  NULLSTR,yypvt[-0].num, NULLSTR, NULLSTR);
					  }
					  Action = "";
					  pull = NULL;
					} break;
case 65:
# line 225 "gram.y"
{ Scr->WindowFunction.func = yypvt[-0].num;
					   root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
					   Scr->WindowFunction.item = 
						AddToMenu(root,"x",Action,
							  NULLSTR,yypvt[-0].num, NULLSTR, NULLSTR);
					   Action = "";
					   pull = NULL;
					} break;
case 66:
# line 233 "gram.y"
{ list = &Scr->WarpCursorL; } break;
case 68:
# line 235 "gram.y"
{ if (Scr->FirstTime) 
					    Scr->WarpCursor = TRUE; } break;
case 69:
# line 237 "gram.y"
{ list = &Scr->WindowRingL; } break;
case 71:
# line 239 "gram.y"
{ list = &Scr->NailedDown; } break;
case 73:
# line 242 "gram.y"
{ SetVirtualDesktop(yypvt[-1].ptr, yypvt[-0].num); } break;
case 74:
# line 246 "gram.y"
{ if (!do_single_keyword (yypvt[-0].num)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
					"unknown singleton keyword %d\n",
						     yypvt[-0].num);
					    ParseError = 1;
					  }
					} break;
case 75:
# line 256 "gram.y"
{ if (!do_string_keyword (yypvt[-1].num, yypvt[-0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
				"unknown string keyword %d (value \"%s\")\n",
						     yypvt[-1].num, yypvt[-0].ptr);
					    ParseError = 1;
					  }
					} break;
case 76:
# line 266 "gram.y"
{ if (!do_number_keyword (yypvt[-1].num, yypvt[-0].num)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
				"unknown numeric keyword %d (value %d)\n",
						     yypvt[-1].num, yypvt[-0].num);
					    ParseError = 1;
					  }
					} break;
case 77:
# line 278 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 78:
# line 281 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 81:
# line 288 "gram.y"
{ mods |= Mod1Mask; } break;
case 82:
# line 289 "gram.y"
{ mods |= ShiftMask; } break;
case 83:
# line 290 "gram.y"
{ mods |= LockMask; } break;
case 84:
# line 291 "gram.y"
{ mods |= ControlMask; } break;
case 85:
# line 292 "gram.y"
{ if (yypvt[-0].num < 1 || yypvt[-0].num > 5) {
					     twmrc_error_prefix();
					     fprintf (stderr, 
				"bad modifier number (%d), must be 1-5\n",
						      yypvt[-0].num);
					     ParseError = 1;
					  } else {
					     mods |= (Mod1Mask << (yypvt[-0].num - 1));
					  }
					} break;
case 86:
# line 302 "gram.y"
{ } break;
case 89:
# line 309 "gram.y"
{ cont |= C_WINDOW_BIT; } break;
case 90:
# line 310 "gram.y"
{ cont |= C_TITLE_BIT; } break;
case 91:
# line 311 "gram.y"
{ cont |= C_ICON_BIT; } break;
case 92:
# line 312 "gram.y"
{ cont |= C_ROOT_BIT; } break;
case 93:
# line 313 "gram.y"
{ cont |= C_FRAME_BIT; } break;
case 94:
# line 314 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 95:
# line 315 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 96:
# line 316 "gram.y"
{ cont |= C_VIRTUAL_BIT; } break;
case 97:
# line 317 "gram.y"
{ cont |= C_ALL_BITS; } break;
case 98:
# line 318 "gram.y"
{  } break;
case 101:
# line 325 "gram.y"
{ cont |= C_WINDOW_BIT; } break;
case 102:
# line 326 "gram.y"
{ cont |= C_TITLE_BIT; } break;
case 103:
# line 327 "gram.y"
{ cont |= C_ICON_BIT; } break;
case 104:
# line 328 "gram.y"
{ cont |= C_ROOT_BIT; } break;
case 105:
# line 329 "gram.y"
{ cont |= C_FRAME_BIT; } break;
case 106:
# line 330 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 107:
# line 331 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 108:
# line 332 "gram.y"
{ cont |= C_VIRTUAL_BIT; } break;
case 109:
# line 333 "gram.y"
{ cont |= C_ALL_BITS; } break;
case 110:
# line 334 "gram.y"
{ } break;
case 111:
# line 335 "gram.y"
{ Name = yypvt[-0].ptr; cont |= C_NAME_BIT; } break;
case 115:
# line 346 "gram.y"
{ SetHighlightPixmap (yypvt[-0].ptr); } break;
case 119:
# line 357 "gram.y"
{
			NewBitmapCursor(&Scr->FrameCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 120:
# line 359 "gram.y"
{
			NewFontCursor(&Scr->FrameCursor, yypvt[-0].ptr); } break;
case 121:
# line 361 "gram.y"
{
			NewBitmapCursor(&Scr->TitleCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 122:
# line 363 "gram.y"
{
			NewFontCursor(&Scr->TitleCursor, yypvt[-0].ptr); } break;
case 123:
# line 365 "gram.y"
{
			NewBitmapCursor(&Scr->IconCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 124:
# line 367 "gram.y"
{
			NewFontCursor(&Scr->IconCursor, yypvt[-0].ptr); } break;
case 125:
# line 369 "gram.y"
{
			NewBitmapCursor(&Scr->IconMgrCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 126:
# line 371 "gram.y"
{
			NewFontCursor(&Scr->IconMgrCursor, yypvt[-0].ptr); } break;
case 127:
# line 373 "gram.y"
{
			NewBitmapCursor(&Scr->ButtonCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 128:
# line 375 "gram.y"
{
			NewFontCursor(&Scr->ButtonCursor, yypvt[-0].ptr); } break;
case 129:
# line 377 "gram.y"
{
			NewBitmapCursor(&Scr->MoveCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 130:
# line 379 "gram.y"
{
			NewFontCursor(&Scr->MoveCursor, yypvt[-0].ptr); } break;
case 131:
# line 381 "gram.y"
{
			NewBitmapCursor(&Scr->ResizeCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 132:
# line 383 "gram.y"
{
			NewFontCursor(&Scr->ResizeCursor, yypvt[-0].ptr); } break;
case 133:
# line 385 "gram.y"
{
			NewBitmapCursor(&Scr->WaitCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 134:
# line 387 "gram.y"
{
			NewFontCursor(&Scr->WaitCursor, yypvt[-0].ptr); } break;
case 135:
# line 389 "gram.y"
{
			NewBitmapCursor(&Scr->MenuCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 136:
# line 391 "gram.y"
{
			NewFontCursor(&Scr->MenuCursor, yypvt[-0].ptr); } break;
case 137:
# line 393 "gram.y"
{
			NewBitmapCursor(&Scr->SelectCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 138:
# line 395 "gram.y"
{
			NewFontCursor(&Scr->SelectCursor, yypvt[-0].ptr); } break;
case 139:
# line 397 "gram.y"
{
			NewBitmapCursor(&Scr->DestroyCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 140:
# line 399 "gram.y"
{
			NewFontCursor(&Scr->DestroyCursor, yypvt[-0].ptr); } break;
case 144:
# line 410 "gram.y"
{ if (!do_colorlist_keyword (yypvt[-1].num, color,
								     yypvt[-0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled list color keyword %d (string \"%s\")\n",
						     yypvt[-1].num, yypvt[-0].ptr);
					    ParseError = 1;
					  }
					} break;
case 145:
# line 419 "gram.y"
{ list = do_colorlist_keyword(yypvt[-1].num,color,
								      yypvt[-0].ptr);
					  if (!list) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled color list keyword %d (string \"%s\")\n",
						     yypvt[-1].num, yypvt[-0].ptr);
					    ParseError = 1;
					  }
					} break;
case 147:
# line 430 "gram.y"
{ if (!do_color_keyword (yypvt[-1].num, color,
								 yypvt[-0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled color keyword %d (string \"%s\")\n",
						     yypvt[-1].num, yypvt[-0].ptr);
					    ParseError = 1;
					  }
					} break;
case 151:
# line 449 "gram.y"
{ if (Scr->FirstTime &&
					      color == Scr->Monochrome)
					    AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 152:
# line 454 "gram.y"
{ 
#ifdef SHAPE
				    if (HasShape) Scr->SqueezeTitle = TRUE;
#endif
				} break;
case 153:
# line 459 "gram.y"
{ list = &Scr->SqueezeTitleL; 
#ifdef SHAPE
				  if (HasShape && Scr->SqueezeTitle == -1)
				    Scr->SqueezeTitle = TRUE;
#endif
				} break;
case 155:
# line 466 "gram.y"
{ Scr->SqueezeTitle = FALSE; } break;
case 156:
# line 467 "gram.y"
{ list = &Scr->DontSqueezeTitleL; } break;
case 159:
# line 472 "gram.y"
{
				if (Scr->FirstTime) {
				   do_squeeze_entry (list, yypvt[-3].ptr, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num);
				}
			} break;
case 163:
# line 487 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-2].ptr, (char *)
						AllocateIconManager(yypvt[-2].ptr, NULLSTR,
							yypvt[-1].ptr,yypvt[-0].num));
					} break;
case 164:
# line 493 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-3].ptr, (char *)
						AllocateIconManager(yypvt[-3].ptr,yypvt[-2].ptr,
						yypvt[-1].ptr, yypvt[-0].num));
					} break;
case 168:
# line 507 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-0].ptr, 0);
					} break;
case 172:
# line 519 "gram.y"
{ if (Scr->FirstTime) AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 176:
# line 529 "gram.y"
{ AddToMenu(root, "", Action, NULLSTR, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					} break;
case 180:
# line 542 "gram.y"
{ AddToMenu(root, yypvt[-1].ptr, Action, pull, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					  pull = NULL;
					} break;
case 181:
# line 547 "gram.y"
{
					  AddToMenu(root, yypvt[-6].ptr, Action, pull, yypvt[-0].num,
						yypvt[-4].ptr, yypvt[-2].ptr);
					  Action = "";
					  pull = NULL;
					} break;
case 182:
# line 555 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 183:
# line 556 "gram.y"
{
				yyval.num = yypvt[-1].num;
				Action = yypvt[-0].ptr;
				switch (yypvt[-1].num) {
				  case F_MENU:
				    pull = GetRoot (yypvt[-0].ptr, NULLSTR,NULLSTR);
				    pull->prev = root;
				    break;
				  case F_WARPRING:
				    if (!CheckWarpRingArg (Action)) {
					twmrc_error_prefix();
					fprintf (stderr,
			"ignoring invalid f.warptoring argument \"%s\"\n",
						 Action);
					yyval.num = F_NOP;
				    }
				  case F_WARPTOSCREEN:
				    if (!CheckWarpScreenArg (Action)) {
					twmrc_error_prefix();
					fprintf (stderr, 
			"ignoring invalid f.warptoscreen argument \"%s\"\n", 
					         Action);
					yyval.num = F_NOP;
				    }
				    break;
				  case F_COLORMAP:
				    if (CheckColormapArg (Action)) {
					yyval.num = F_COLORMAP;
				    } else {
					twmrc_error_prefix();
					fprintf (stderr,
			"ignoring invalid f.colormap argument \"%s\"\n", 
						 Action);
					yyval.num = F_NOP;
				    }
				    break;
				} /* end switch */
				   } break;
case 184:
# line 597 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 185:
# line 598 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 186:
# line 599 "gram.y"
{ yyval.num = -(yypvt[-0].num); } break;
case 187:
# line 602 "gram.y"
{ yyval.num = yypvt[-0].num;
					  if (yypvt[-0].num == 0)
						yyerror("bad button 0");

					  if (yypvt[-0].num > MAX_BUTTONS)
					  {
						yyval.num = 0;
						yyerror("button number too large");
					  }
					} break;
case 188:
# line 614 "gram.y"
{ ptr = (char *)malloc(strlen(yypvt[-0].ptr)+1);
					  strcpy(ptr, yypvt[-0].ptr);
					  RemoveDQuote(ptr);
					  yyval.ptr = ptr;
					} break;
case 189:
# line 619 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
	}
	goto yystack;		/* reset registers in driver code */
}

