
# 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 "doors.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 74 "gram.y"
typedef union 
{
    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 GRAYSCALE 273
# define MONOCHROME 274
# define FUNCTION 275
# define ICONMGR_SHOW 276
# define ICONMGR 277
# define WINDOW_FUNCTION 278
# define ZOOM 279
# define ICONMGRS 280
# define ICONMGR_GEOMETRY 281
# define ICONMGR_NOSHOW 282
# define MAKE_TITLE 283
# define ICONIFY_BY_UNMAPPING 284
# define DONT_ICONIFY_BY_UNMAPPING 285
# define NO_TITLE 286
# define AUTO_RAISE 287
# define NO_HILITE 288
# define ICON_REGION 289
# define META 290
# define SHIFT 291
# define LOCK 292
# define CONTROL 293
# define WINDOW 294
# define TITLE 295
# define ICON 296
# define ROOT 297
# define FRAME 298
# define VIRTUAL 299
# define VIRTUAL_WIN 300
# define COLON 301
# define EQUALS 302
# define SQUEEZE_TITLE 303
# define DONT_SQUEEZE_TITLE 304
# define START_ICONIFIED 305
# define NO_TITLE_HILITE 306
# define TITLE_HILITE 307
# define CLIENT_BORDERS 308
# define MOVE 309
# define RESIZE 310
# define WAIT 311
# define SELECT 312
# define KILL 313
# define LEFT_TITLEBUTTON 314
# define RIGHT_TITLEBUTTON 315
# define NUMBER 316
# define KEYWORD 317
# define NKEYWORD 318
# define CKEYWORD 319
# define CLKEYWORD 320
# define FKEYWORD 321
# define FSKEYWORD 322
# define SKEYWORD 323
# define DKEYWORD 324
# define JKEYWORD 325
# define WINDOW_RING 326
# define WARP_CURSOR 327
# define ERRORTOKEN 328
# define NO_STACKMODE 329
# define NAILEDDOWN 330
# define VIRTUALDESKTOP 331
# define NO_SHOW_IN_DISPLAY 332
# define DOORS 333
# define DOOR 334
# define STRING 335
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern short yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
YYSTYPE yylval, yyval;
# define YYERRCODE 256

# line 649 "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 ||
	strcmp (s,  WARPRING_NEXTTOP) == 0 ||
	strcmp (s,  WARPRING_PREVTOP) == 0 ||
	strcmp (s,  WARPRING_NEXTICON) == 0 ||
	strcmp (s,  WARPRING_PREVICON) == 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);
}
short yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
-1, 15,
	257, 17,
	-2, 19,
-1, 21,
	257, 28,
	-2, 30,
-1, 24,
	257, 35,
	-2, 37,
-1, 25,
	257, 38,
	-2, 40,
-1, 26,
	257, 41,
	-2, 43,
-1, 27,
	257, 44,
	-2, 46,
-1, 40,
	257, 71,
	-2, 73,
-1, 48,
	257, 164,
	-2, 163,
-1, 49,
	257, 167,
	-2, 166,
-1, 269,
	257, 156,
	-2, 155,
	};
# define YYNPROD 205
# define YYLAST 443
short yyact[]={

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

-1000,-1000,-256,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-333,-333,-280,-153,-159,-1000,-333,-333,-281,-245,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-333,-333,-1000,-1000,-1000,-1000,-311,-311,
-1000,-1000,-1000,-333,-1000,-1000,-333,-280,-1000,-1000,
-160,-280,-1000,-315,-280,-1000,-1000,-1000,-1000,-1000,
-1000,-172,-259,-263,-1000,-1000,-1000,-1000,-333,-1000,
-1000,-1000,-172,-172,-161,-172,-172,-172,-172,-172,
-172,-172,-172,-172,-191,-1000,-163,-164,-164,-164,
-1000,-1000,-172,-172,-172,-280,-172,-1000,-1000,-167,
-172,-1000,-1000,-320,-1000,-198,-127,-1000,-1000,-311,
-311,-1000, -98,-114,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-333,-185,-173,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-203,-280,-1000,-1000,-333,-1000,-1000,
-333,-333,-333,-333,-333,-333,-333,-333,-333,-333,
-333,-207,-1000,-1000,-1000,-1000,-280,-1000,-1000,-1000,
-1000,-1000,-220,-237,-1000,-1000,-1000,-1000,-223,-212,
-246,-1000,-1000,-333,-280,-1000,-333,-333,-333,-333,
-333,-333,-333,-333,-333,-333,-333,-1000,-1000,-1000,
-134,-1000,-176,-1000,-1000,-333,-333,-253,-216,-1000,
-1000,-333,-1000,-1000,-333,-333,-1000,-322,-333,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-311,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-311,-1000,-1000,-1000,-1000,
-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
-282,-194,-1000,-1000,-222,-1000,-1000,-1000,-1000,-1000,
-1000,-221,-1000,-1000,-1000,-1000,-280,-1000,-1000,-333,
-174,-280,-1000,-280,-280,-1000,-185,-238,-1000,-1000,
-1000,-1000,-1000,-1000,-333,-257,-195,-1000,-1000,-333,
-311,-1000,-1000 };
short yypgo[]={

   0,  69, 141, 289, 153, 287, 286, 283, 282, 280,
 279, 278, 274, 273, 271, 270, 269, 268, 267, 232,
 255, 254, 247, 246, 245, 244, 243, 241, 240, 239,
 238, 237, 236, 235,  56, 234, 233, 219, 218, 216,
 215, 117, 214, 212, 211, 210, 209, 204, 126, 202,
 199, 196, 191, 190, 189, 188, 175, 174, 173, 172,
 157, 155, 152, 151, 149, 148, 147, 146, 145, 144,
 142, 140, 139, 137, 130, 129, 127, 111, 110 };
short yyr1[]={

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

   0,   1,   0,   2,   1,   1,   1,   1,   1,   1,
   6,   3,   2,   2,   1,   2,   2,   0,   3,   1,
   4,   4,   2,   2,   2,   2,   0,   3,   0,   3,
   1,   0,   3,   0,   3,   0,   3,   1,   0,   3,
   1,   0,   3,   1,   0,   3,   1,   0,   3,   0,
   3,   0,   3,   0,   3,   0,   9,   0,   4,   0,
   4,   0,   3,   0,   3,   0,   3,   0,   3,   2,
   2,   0,   3,   1,   0,   3,   0,   3,   3,   0,
   3,   1,   2,   2,   6,   6,   0,   2,   1,   1,
   1,   1,   2,   1,   0,   2,   1,   1,   1,   1,
   1,   1,   1,   1,   1,   1,   1,   1,   0,   2,
   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
   1,   1,   1,   3,   0,   2,   2,   3,   0,   2,
   3,   2,   3,   2,   3,   2,   3,   2,   3,   2,
   3,   2,   3,   2,   3,   2,   3,   2,   3,   2,
   3,   2,   3,   0,   2,   2,   0,   4,   2,   3,
   0,   2,   2,   1,   0,   5,   1,   0,   3,   0,
   5,   4,   0,   2,   3,   3,   0,   2,   3,   4,
   3,   0,   2,   1,   3,   0,   2,   2,   3,   0,
   2,   1,   3,   0,   2,   2,   7,   1,   2,   1,
   2,   2,   2,   1,   1 };
short yychk[]={

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

   2,  -2,   1,   3,   4,   5,   6,   7,   8,   9,
   0,   0,  14,   0,   0,  -2,   0,   0,   0,   0,
  26,  -2,  31,  33,  -2,  -2,  -2,  -2,  47,  49,
  51,  53,   0,   0,  61,  63,  65,  67,   0,   0,
  -2,  74,  76,   0,  79,  81,   0,   0,  -2,  -2,
   0,   0, 203,   0,  12,  13, 204,  15, 124,  16,
 128,   0,   0,   0,  22,  23,  25, 197,   0,  86,
  24,  86,   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,   0,   0,  57,  59,   0,   0,   0,   0,
  69,  70,   0,   0,   0,   0,   0,  82,  83,   0,
   0, 172, 202,   0,  11,   0,   0,  18, 181,   0,
   0, 198,   0,   0,  27,  29,  32, 176,  34,  36,
  39,  42,  45,  48,  50,  52,  54,   0,   0,   0,
  62, 185,  64, 153,  66,  68,  72,  75,  77,  78,
  80, 169, 168,   0,   0, 123, 125,   0, 127, 129,
   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
   0,   0,  20,  21,  94,  87,  88,  89,  90,  91,
  93, 108,   0,   0,  58, 193,  60, 189,   0,   0,
   0, 171, 173,   0,   0, 126, 131, 133, 135, 137,
 139, 141, 143, 145, 147, 149, 151, 180, 182, 183,
   0,  92,   0, 175, 177,   0,   0,   0,   0, 184,
 186,   0, 152, 154,   0,   0, 165,   0,   0,  10,
 130, 132, 134, 136, 138, 140, 142, 144, 146, 148,
 150,   0,  95,  96,  97,  98,  99, 100, 101, 102,
 103, 104, 105, 106, 107,   0, 109, 110, 111, 112,
 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
   0,   0, 192, 194,   0, 188, 190, 191, 187,  -2,
 158,   0, 174,  84,  85, 178,   0,  55, 195,   0,
   0,   0, 199,   0,   0, 179,   0,   0, 157, 160,
 170, 200, 201,  56,   0,   0,   0, 159, 161,   0,
   0, 162, 196 };
/*
 *	$Source: /afs/rel-eng.athena.mit.edu/project/release/current/source/bsd-4.3/common/usr.bin/yacc/RCS/yaccpar,v $
 *	$Author: epeisach $
 *	$Locker:  $
 *	$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/bsd-4.3/common/usr.bin/yacc/RCS/yaccpar,v 1.4 90/03/30 10:09:19 epeisach Exp $
 */

#ifndef lint
static char yaccpar_sccsid[] = "@(#)yaccpar	4.1	(Berkeley)	2/11/83";
#endif /* not lint */

# define YYFLAG -1000
# define YYERROR goto yyerrlab
# define YYACCEPT return(0)
# define YYABORT return(1)

/*	parser for yacc output	*/

#ifdef YYDEBUG
int yydebug = 0; /* 1 for debugging */
#endif
YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
int yychar = -1; /* current input token number */
int yynerrs = 0;  /* number of errors */
short yyerrflag = 0;  /* error recovery flag */

yyparse() {

	short yys[YYMAXDEPTH];
	short yyj, yym;
	register YYSTYPE *yypvt;
	register short yystate, *yyps, yyn;
	register YYSTYPE *yypv;
	register short *yyxi;

	yystate = 0;
	yychar = -1;
	yynerrs = 0;
	yyerrflag = 0;
	yyps= yys -1;
	yypv= yyv -1;

 yystack:    /* put a state and value onto the stack */

#ifdef YYDEBUG
	if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
#endif
		if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
		*yyps = yystate;
		++yypv;
		*yypv = yyval;

 yynewstate:

	yyn = yypact[yystate];

	if( yyn<= YYFLAG ) goto yydefault; /* simple state */

	if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
	if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;

	if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
		yychar = -1;
		yyval = yylval;
		yystate = yyn;
		if( yyerrflag > 0 ) --yyerrflag;
		goto yystack;
		}

 yydefault:
	/* default state action */

	if( (yyn=yydef[yystate]) == -2 ) {
		if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
		/* look through exception table */

		for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */

		while( *(yyxi+=2) >= 0 ){
			if( *yyxi == yychar ) break;
			}
		if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
		}

	if( yyn == 0 ){ /* error */
		/* error ... attempt to resume parsing */

		switch( yyerrflag ){

		case 0:   /* brand new error */

			yyerror( "syntax error" );
		yyerrlab:
			++yynerrs;

		case 1:
		case 2: /* incompletely recovered error ... try again */

			yyerrflag = 3;

			/* find a state where "error" is a legal shift action */

			while ( yyps >= yys ) {
			   yyn = yypact[*yyps] + YYERRCODE;
			   if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
			      yystate = yyact[yyn];  /* simulate a shift of "error" */
			      goto yystack;
			      }
			   yyn = yypact[*yyps];

			   /* the current yyps has no shift onn "error", pop stack */

#ifdef YYDEBUG
			   if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
#endif
			   --yyps;
			   --yypv;
			   }

			/* there is no state on the stack with an error shift ... abort */

	yyabort:
			return(1);


		case 3:  /* no shift yet; clobber input char */

#ifdef YYDEBUG
			if( yydebug ) printf( "error recovery discards char %d\n", yychar );
#endif

			if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
			yychar = -1;
			goto yynewstate;   /* try again in the same state */

			}

		}

	/* reduction by production yyn */

#ifdef YYDEBUG
		if( yydebug ) printf("reduce %d\n",yyn);
#endif
		yyps -= yyr2[yyn];
		yypvt = yypv;
		yypv -= yyr2[yyn];
		yyval = yypv[1];
		yym=yyn;
			/* consult goto table to find next state */
		yyn = yyr1[yyn];
		yyj = yypgo[yyn] + *yyps + 1;
		if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
		switch(yym){
			
case 10:
# line 116 "gram.y"
{ AddIconRegion(yypvt[-4].ptr, yypvt[-3].num, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num); } break;
case 11:
# line 117 "gram.y"
{ if (Scr->FirstTime)
						  {
						    Scr->iconmgr.geometry=yypvt[-1].ptr;
						    Scr->iconmgr.columns=yypvt[-0].num;
						  }
						} break;
case 12:
# line 123 "gram.y"
{ if (Scr->FirstTime)
						    Scr->iconmgr.geometry = yypvt[-0].ptr;
						} break;
case 13:
# line 126 "gram.y"
{ if (Scr->FirstTime)
					  {
						Scr->DoZoom = TRUE;
						Scr->ZoomCount = yypvt[-0].num;
					  }
					} break;
case 14:
# line 132 "gram.y"
{ if (Scr->FirstTime) 
						Scr->DoZoom = TRUE; } break;
case 15:
# line 134 "gram.y"
{} break;
case 16:
# line 135 "gram.y"
{} break;
case 17:
# line 136 "gram.y"
{ list = &Scr->IconifyByUn; } break;
case 19:
# line 138 "gram.y"
{ if (Scr->FirstTime) 
		    Scr->IconifyByUnmapping = TRUE; } break;
case 20:
# line 140 "gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, False);
					} break;
case 21:
# line 143 "gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, True);
					} break;
case 22:
# line 146 "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 23:
# line 150 "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 24:
# line 166 "gram.y"
{ GotKey(yypvt[-1].ptr, yypvt[-0].num); } break;
case 25:
# line 167 "gram.y"
{ GotButton(yypvt[-1].num, yypvt[-0].num); } break;
case 26:
# line 168 "gram.y"
{ list = &Scr->DontIconify; } break;
case 28:
# line 170 "gram.y"
{ list = &Scr->IconMgrNoShow; } break;
case 30:
# line 172 "gram.y"
{ Scr->IconManagerDontShow = TRUE; } break;
case 31:
# line 173 "gram.y"
{ list = &Scr->IconMgrs; } break;
case 33:
# line 175 "gram.y"
{ list = &Scr->IconMgrShow; } break;
case 35:
# line 177 "gram.y"
{ list = &Scr->NoTitleHighlight; } break;
case 37:
# line 179 "gram.y"
{ if (Scr->FirstTime)
						Scr->TitleHighlight = FALSE; } break;
case 38:
# line 181 "gram.y"
{ list = &Scr->NoHighlight; } break;
case 40:
# line 183 "gram.y"
{ if (Scr->FirstTime)
						Scr->Highlight = FALSE; } break;
case 41:
# line 185 "gram.y"
{ list = &Scr->NoStackModeL; } break;
case 43:
# line 187 "gram.y"
{ if (Scr->FirstTime)
						Scr->StackMode = FALSE; } break;
case 44:
# line 189 "gram.y"
{ list = &Scr->NoTitle; } break;
case 46:
# line 191 "gram.y"
{ if (Scr->FirstTime)
						Scr->NoTitlebar = TRUE; } break;
case 47:
# line 193 "gram.y"
{ list = &Scr->ClientBorders; } break;
case 49:
# line 195 "gram.y"
{ list = &Scr->MakeTitle; } break;
case 51:
# line 197 "gram.y"
{ list = &Scr->StartIconified; } break;
case 53:
# line 199 "gram.y"
{ list = &Scr->AutoRaise; } break;
case 55:
# line 201 "gram.y"
{
					root = GetRoot(yypvt[-5].ptr, yypvt[-3].ptr, yypvt[-1].ptr); } break;
case 56:
# line 203 "gram.y"
{ root->real_menu = TRUE;} break;
case 57:
# line 204 "gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } break;
case 58:
# line 205 "gram.y"
{ root->real_menu = TRUE; } break;
case 59:
# line 206 "gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } break;
case 61:
# line 208 "gram.y"
{ list = &Scr->IconNames; } break;
case 63:
# line 210 "gram.y"
{ color = COLOR; } break;
case 65:
# line 212 "gram.y"
{ color = GRAYSCALE; } break;
case 67:
# line 214 "gram.y"
{ color = MONOCHROME; } break;
case 69:
# line 216 "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 70:
# line 232 "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 71:
# line 240 "gram.y"
{ list = &Scr->WarpCursorL; } break;
case 73:
# line 242 "gram.y"
{ if (Scr->FirstTime) 
					    Scr->WarpCursor = TRUE; } break;
case 74:
# line 244 "gram.y"
{ list = &Scr->WindowRingL; } break;
case 76:
# line 246 "gram.y"
{ list = &Scr->NailedDown; } break;
case 78:
# line 249 "gram.y"
{ SetVirtualDesktop(yypvt[-1].ptr, yypvt[-0].num); } break;
case 79:
# line 250 "gram.y"
{ list = &Scr->DontShowInDisplay; } break;
case 81:
# line 255 "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 82:
# line 265 "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 83:
# line 275 "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 84:
# line 287 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 85:
# line 290 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 88:
# line 297 "gram.y"
{ mods |= Mod1Mask; } break;
case 89:
# line 298 "gram.y"
{ mods |= ShiftMask; } break;
case 90:
# line 299 "gram.y"
{ mods |= LockMask; } break;
case 91:
# line 300 "gram.y"
{ mods |= ControlMask; } break;
case 92:
# line 301 "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 93:
# line 311 "gram.y"
{ } break;
case 96:
# line 318 "gram.y"
{ cont |= C_WINDOW_BIT; } break;
case 97:
# line 319 "gram.y"
{ cont |= C_TITLE_BIT; } break;
case 98:
# line 320 "gram.y"
{ cont |= C_ICON_BIT; } break;
case 99:
# line 321 "gram.y"
{ cont |= C_ROOT_BIT; } break;
case 100:
# line 322 "gram.y"
{ cont |= C_FRAME_BIT; } break;
case 101:
# line 323 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 102:
# line 324 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 103:
# line 325 "gram.y"
{ cont |= C_VIRTUAL_BIT; } break;
case 104:
# line 326 "gram.y"
{ cont |= C_VIRTUAL_WIN_BIT; } break;
case 105:
# line 327 "gram.y"
{ cont |= C_DOOR_BIT; } break;
case 106:
# line 328 "gram.y"
{ cont |= C_ALL_BITS; } break;
case 107:
# line 329 "gram.y"
{  } break;
case 110:
# line 336 "gram.y"
{ cont |= C_WINDOW_BIT; } break;
case 111:
# line 337 "gram.y"
{ cont |= C_TITLE_BIT; } break;
case 112:
# line 338 "gram.y"
{ cont |= C_ICON_BIT; } break;
case 113:
# line 339 "gram.y"
{ cont |= C_ROOT_BIT; } break;
case 114:
# line 340 "gram.y"
{ cont |= C_FRAME_BIT; } break;
case 115:
# line 341 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 116:
# line 342 "gram.y"
{ cont |= C_ICONMGR_BIT; } break;
case 117:
# line 343 "gram.y"
{ cont |= C_VIRTUAL_BIT; } break;
case 118:
# line 344 "gram.y"
{ cont |= C_VIRTUAL_WIN_BIT; } break;
case 119:
# line 345 "gram.y"
{ cont |= C_DOOR_BIT; } break;
case 120:
# line 346 "gram.y"
{ cont |= C_ALL_BITS; } break;
case 121:
# line 347 "gram.y"
{ } break;
case 122:
# line 348 "gram.y"
{ Name = yypvt[-0].ptr; cont |= C_NAME_BIT; } break;
case 126:
# line 359 "gram.y"
{ SetHighlightPixmap (yypvt[-0].ptr); } break;
case 130:
# line 370 "gram.y"
{
			NewBitmapCursor(&Scr->FrameCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 131:
# line 372 "gram.y"
{
			NewFontCursor(&Scr->FrameCursor, yypvt[-0].ptr); } break;
case 132:
# line 374 "gram.y"
{
			NewBitmapCursor(&Scr->TitleCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 133:
# line 376 "gram.y"
{
			NewFontCursor(&Scr->TitleCursor, yypvt[-0].ptr); } break;
case 134:
# line 378 "gram.y"
{
			NewBitmapCursor(&Scr->IconCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 135:
# line 380 "gram.y"
{
			NewFontCursor(&Scr->IconCursor, yypvt[-0].ptr); } break;
case 136:
# line 382 "gram.y"
{
			NewBitmapCursor(&Scr->IconMgrCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 137:
# line 384 "gram.y"
{
			NewFontCursor(&Scr->IconMgrCursor, yypvt[-0].ptr); } break;
case 138:
# line 386 "gram.y"
{
			NewBitmapCursor(&Scr->ButtonCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 139:
# line 388 "gram.y"
{
			NewFontCursor(&Scr->ButtonCursor, yypvt[-0].ptr); } break;
case 140:
# line 390 "gram.y"
{
			NewBitmapCursor(&Scr->MoveCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 141:
# line 392 "gram.y"
{
			NewFontCursor(&Scr->MoveCursor, yypvt[-0].ptr); } break;
case 142:
# line 394 "gram.y"
{
			NewBitmapCursor(&Scr->ResizeCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 143:
# line 396 "gram.y"
{
			NewFontCursor(&Scr->ResizeCursor, yypvt[-0].ptr); } break;
case 144:
# line 398 "gram.y"
{
			NewBitmapCursor(&Scr->WaitCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 145:
# line 400 "gram.y"
{
			NewFontCursor(&Scr->WaitCursor, yypvt[-0].ptr); } break;
case 146:
# line 402 "gram.y"
{
			NewBitmapCursor(&Scr->MenuCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 147:
# line 404 "gram.y"
{
			NewFontCursor(&Scr->MenuCursor, yypvt[-0].ptr); } break;
case 148:
# line 406 "gram.y"
{
			NewBitmapCursor(&Scr->SelectCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 149:
# line 408 "gram.y"
{
			NewFontCursor(&Scr->SelectCursor, yypvt[-0].ptr); } break;
case 150:
# line 410 "gram.y"
{
			NewBitmapCursor(&Scr->DestroyCursor, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 151:
# line 412 "gram.y"
{
			NewFontCursor(&Scr->DestroyCursor, yypvt[-0].ptr); } break;
case 155:
# line 423 "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 156:
# line 432 "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 158:
# line 443 "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 162:
# line 462 "gram.y"
{ if (Scr->FirstTime &&
					      color == Scr->Monochrome)
					    AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 163:
# line 467 "gram.y"
{ 
#ifdef SHAPE
				    if (HasShape) Scr->SqueezeTitle = TRUE;
#endif
				} break;
case 164:
# line 472 "gram.y"
{ list = &Scr->SqueezeTitleL; 
#ifdef SHAPE
				  if (HasShape && Scr->SqueezeTitle == -1)
				    Scr->SqueezeTitle = TRUE;
#endif
				} break;
case 166:
# line 479 "gram.y"
{ Scr->SqueezeTitle = FALSE; } break;
case 167:
# line 480 "gram.y"
{ list = &Scr->DontSqueezeTitleL; } break;
case 170:
# line 485 "gram.y"
{
				if (Scr->FirstTime) {
				   do_squeeze_entry (list, yypvt[-3].ptr, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num);
				}
			} break;
case 174:
# line 501 "gram.y"
{
				(void) door_add(yypvt[-2].ptr, yypvt[-1].ptr, yypvt[-0].ptr);
			} break;
case 178:
# line 513 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-2].ptr, (char *)
						AllocateIconManager(yypvt[-2].ptr, NULLSTR,
							yypvt[-1].ptr,yypvt[-0].num));
					} break;
case 179:
# line 519 "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 183:
# line 533 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-0].ptr, 0);
					} break;
case 187:
# line 545 "gram.y"
{ if (Scr->FirstTime) AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } break;
case 191:
# line 555 "gram.y"
{ AddToMenu(root, "", Action, NULLSTR, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					} break;
case 195:
# line 568 "gram.y"
{ AddToMenu(root, yypvt[-1].ptr, Action, pull, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					  pull = NULL;
					} break;
case 196:
# line 573 "gram.y"
{
					  AddToMenu(root, yypvt[-6].ptr, Action, pull, yypvt[-0].num,
						yypvt[-4].ptr, yypvt[-2].ptr);
					  Action = "";
					  pull = NULL;
					} break;
case 197:
# line 581 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 198:
# line 582 "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;
				    }
				    break;
				  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 199:
# line 624 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 200:
# line 625 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
case 201:
# line 626 "gram.y"
{ yyval.num = -(yypvt[-0].num); } break;
case 202:
# line 629 "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 203:
# line 641 "gram.y"
{ ptr = (char *)malloc(strlen(yypvt[-0].ptr)+1);
					  strcpy(ptr, yypvt[-0].ptr);
					  RemoveDQuote(ptr);
					  yyval.ptr = ptr;
					} break;
case 204:
# line 646 "gram.y"
{ yyval.num = yypvt[-0].num; } break;
		}
		goto yystack;  /* stack new state and value */

	}
