
# line 17 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
#ifndef lint
static char sccsid[] = "@(#)57  1.3  src/gos/2d/XTOP/programs/twm/gram.y, xsample, gos720 12/18/96 16:52:27";
#endif 

# line 88 "../../../../../../../src/gos/2d/XTOP/programs/twm/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(), do_string_savecolor();
extern int yylineno;

# line 121 "../../../../../../../src/gos/2d/XTOP/programs/twm/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 SAVECOLOR 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 GRAYSCALE 284
# define ICONIFY_BY_UNMAPPING 285
# define DONT_ICONIFY_BY_UNMAPPING 286
# define NO_TITLE 287
# define AUTO_RAISE 288
# define NO_HILITE 289
# define ICON_REGION 290
# define META 291
# define SHIFT 292
# define LOCK 293
# define CONTROL 294
# define WINDOW 295
# define TITLE 296
# define ICON 297
# define ROOT 298
# define FRAME 299
# define COLON 300
# define EQUALS 301
# define SQUEEZE_TITLE 302
# define DONT_SQUEEZE_TITLE 303
# define START_ICONIFIED 304
# define NO_TITLE_HILITE 305
# define TITLE_HILITE 306
# define MOVE 307
# define RESIZE 308
# define WAIT 309
# define SELECT 310
# define KILL 311
# define LEFT_TITLEBUTTON 312
# define RIGHT_TITLEBUTTON 313
# define NUMBER 314
# define KEYWORD 315
# define NKEYWORD 316
# define CKEYWORD 317
# define CLKEYWORD 318
# define FKEYWORD 319
# define FSKEYWORD 320
# define SKEYWORD 321
# define DKEYWORD 322
# define JKEYWORD 323
# define WINDOW_RING 324
# define WARP_CURSOR 325
# define ERRORTOKEN 326
# define NO_STACKMODE 327
# define STRING 328
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
YYSTYPE yylval, yyval;
typedef int yytabelem;
#include <stdio.h>
# define YYERRCODE 256
yytabelem yyexca[] ={
	-1, 1,
	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, 39,
	257, 69,
	-2, 71,
-1, 44,
	257, 156,
	-2, 155,
-1, 45,
	257, 159,
	-2, 158,
-1, 251,
	257, 143,
	-2, 142,
	};
# define YYNPROD 193
# define YYLAST 412
yytabelem yyact[]={

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

-10000000,-10000000,  -256,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -327,
  -327,  -276,  -124,  -126,-10000000,  -327,  -327,  -266,  -231,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  -327,  -327,-10000000,-10000000,-10000000,  -132,-10000000,  -308,  -308,-10000000,
-10000000,-10000000,  -327,  -276,-10000000,-10000000,  -276,-10000000,  -312,  -276,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -154,  -257,  -259,-10000000,
-10000000,-10000000,-10000000,  -327,-10000000,-10000000,-10000000,  -154,  -154,  -135,
  -154,  -154,  -154,  -154,  -154,  -154,  -154,  -154,  -160,-10000000,
  -137,  -141,  -141,-10000000,-10000000,  -141,-10000000,-10000000,  -154,  -154,
-10000000,-10000000,  -152,  -154,-10000000,  -313,-10000000,  -200,  -173,-10000000,
-10000000,  -308,  -308,-10000000,  -136,  -140,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -327,  -157,
  -155,-10000000,-10000000,-10000000,-10000000,-10000000,  -255,-10000000,-10000000,-10000000,
-10000000,-10000000,  -276,-10000000,-10000000,  -327,-10000000,-10000000,  -327,  -327,
  -327,  -327,  -327,  -327,  -327,  -327,  -327,  -327,  -327,  -215,
-10000000,-10000000,-10000000,-10000000,  -276,-10000000,-10000000,-10000000,-10000000,-10000000,
  -217,  -223,-10000000,-10000000,-10000000,-10000000,  -218,  -203,-10000000,-10000000,
-10000000,-10000000,  -219,  -276,-10000000,  -327,  -327,  -327,  -327,  -327,
  -327,  -327,  -327,  -327,  -327,  -327,-10000000,-10000000,-10000000,  -150,
-10000000,  -216,-10000000,-10000000,  -327,  -327,  -237,  -253,-10000000,-10000000,
  -327,-10000000,-10000000,  -327,  -327,-10000000,  -321,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -308,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
  -308,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,  -278,  -172,-10000000,-10000000,  -222,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,  -170,-10000000,-10000000,-10000000,  -276,-10000000,-10000000,
  -327,  -156,  -276,-10000000,  -276,  -276,-10000000,  -157,  -236,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,  -327,  -254,  -182,-10000000,-10000000,
  -327,  -308,-10000000,-10000000 };
yytabelem yypgo[]={

     0,    76,   129,   267,   130,   266,   265,   264,   251,   250,
   248,   247,   246,   245,   244,   242,   241,   240,   234,   239,
   238,   236,   235,   233,   230,   229,   228,   227,   214,   213,
   211,   210,    45,   209,   208,   205,   202,   201,   200,   121,
   199,   198,   197,   196,   194,   139,   193,   192,   191,   190,
   189,   188,   187,   186,   185,   184,   183,   182,   181,   179,
   178,   176,   175,   173,   172,   171,   170,   169,   166,   165,
   163,   162,   161,   159,   143,   142 };
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,    42,    10,    10,    10,    43,
    10,    10,    44,    10,    11,    12,    13,     6,     7,    45,
    45,    48,    48,    48,    48,    48,    48,    46,    46,    49,
    49,    49,    49,    49,    49,    49,    49,    49,    47,    47,
    50,    50,    50,    50,    50,    50,    50,    50,    50,    50,
    15,    51,    51,    52,    16,    53,    53,    54,    54,    54,
    54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
    54,    54,    54,    54,    54,    54,    54,    54,    54,    39,
    55,    55,    56,    57,    56,    56,    41,    59,    59,    60,
    60,    58,    61,    61,    62,    14,    63,    14,    14,    65,
    14,    64,    64,    22,    66,    66,    67,    67,    18,    68,
    68,    69,    37,    70,    70,    71,    35,    72,    72,    73,
    32,    74,    74,    75,    75,     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,     4,     1,     6,     5,     5,     1,
     6,     3,     1,     6,     3,     5,     5,    13,    13,     0,
     4,     3,     3,     3,     3,     5,     3,     0,     4,     3,
     3,     3,     3,     3,     3,     3,     3,     3,     0,     4,
     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,     3,
     3,     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,   290,
   281,   279,   270,   269,   285,   312,   313,    -3,    -1,   286,
   282,   280,   276,   305,   289,   327,   287,   283,   304,   288,
   262,   275,   271,   272,   284,   273,   274,   264,   278,   325,
   324,   315,   321,   316,   302,   303,   263,   328,    -1,    -1,
    -4,   314,   -15,   257,   -16,   257,   -17,    -1,    -1,    -1,
    -2,    -6,   319,   320,   301,    -7,   301,   -19,   -20,   -21,
   -23,   -24,   -25,   -26,   -27,   -28,   -29,   -30,    -1,    -1,
   -36,   -38,   -40,   -41,   257,   -42,    -2,    -2,   -43,   -44,
    -1,    -4,   -63,   -65,    -4,   322,    -4,   -51,   -53,   -18,
   257,   301,   301,    -1,   -45,   -45,   -18,   -18,   -22,   257,
   -18,   -18,   -18,   -18,   -18,   -18,   -18,   -18,   259,   -33,
   -34,   -37,   257,   -39,   257,   -39,   -59,   -39,   -18,   -18,
   257,   -18,   322,   258,   -52,   306,   258,   -54,   299,   296,
   297,   277,   263,   307,   308,   309,   262,   310,   311,   -68,
    -2,    -2,   300,   -48,   291,   292,   293,   294,   268,   300,
   -66,    -1,   -32,   257,   -35,   257,   -70,   -55,   258,   -60,
    -1,   318,   -64,    -4,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,   258,   -69,    -1,   -46,
    -4,   -47,   258,   -67,    -1,   300,   -74,   -72,   258,   -71,
    -1,   258,   -56,   318,   317,   258,    -1,    -4,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   300,
   -49,   295,   296,   297,   298,   299,   277,   291,   267,   268,
   300,   -50,   295,   296,   297,   298,   299,   277,   291,   267,
   268,    -1,    -1,    -1,   258,   -75,    -1,   258,   -73,    -2,
    -1,    -1,    -1,   323,    -2,    -2,    -4,    -1,   260,    -2,
   259,   -57,    -5,    -4,   265,   266,    -4,   -31,    -1,   -58,
   257,    -4,    -4,    -4,   -32,   300,   -61,    -1,   258,   -62,
    -1,   260,    -1,    -2 };
yytabelem yydef[]={

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

#if YYDEBUG

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 : GRAYSCALE",
      "stmt : GRAYSCALE color_list",
      "stmt : SAVECOLOR save_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",
      "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 : ALL",
      "context : OR",
      "contextkeys : /* empty */",
      "contextkeys : contextkeys contextkey",
      "contextkey : WINDOW",
      "contextkey : TITLE",
      "contextkey : ICON",
      "contextkey : ROOT",
      "contextkey : FRAME",
      "contextkey : ICONMGR",
      "contextkey : META",
      "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",
      "save_color_list : LB s_color_entries RB",
      "s_color_entries : /* empty */",
      "s_color_entries : s_color_entries s_color_entry",
      "s_color_entry : string",
      "s_color_entry : CLKEYWORD",
      "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",
};
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,
	"SAVECOLOR",	273,
	"MONOCHROME",	274,
	"FUNCTION",	275,
	"ICONMGR_SHOW",	276,
	"ICONMGR",	277,
	"WINDOW_FUNCTION",	278,
	"ZOOM",	279,
	"ICONMGRS",	280,
	"ICONMGR_GEOMETRY",	281,
	"ICONMGR_NOSHOW",	282,
	"MAKE_TITLE",	283,
	"GRAYSCALE",	284,
	"ICONIFY_BY_UNMAPPING",	285,
	"DONT_ICONIFY_BY_UNMAPPING",	286,
	"NO_TITLE",	287,
	"AUTO_RAISE",	288,
	"NO_HILITE",	289,
	"ICON_REGION",	290,
	"META",	291,
	"SHIFT",	292,
	"LOCK",	293,
	"CONTROL",	294,
	"WINDOW",	295,
	"TITLE",	296,
	"ICON",	297,
	"ROOT",	298,
	"FRAME",	299,
	"COLON",	300,
	"EQUALS",	301,
	"SQUEEZE_TITLE",	302,
	"DONT_SQUEEZE_TITLE",	303,
	"START_ICONIFIED",	304,
	"NO_TITLE_HILITE",	305,
	"TITLE_HILITE",	306,
	"MOVE",	307,
	"RESIZE",	308,
	"WAIT",	309,
	"SELECT",	310,
	"KILL",	311,
	"LEFT_TITLEBUTTON",	312,
	"RIGHT_TITLEBUTTON",	313,
	"NUMBER",	314,
	"KEYWORD",	315,
	"NKEYWORD",	316,
	"CKEYWORD",	317,
	"CLKEYWORD",	318,
	"FKEYWORD",	319,
	"FSKEYWORD",	320,
	"SKEYWORD",	321,
	"DKEYWORD",	322,
	"JKEYWORD",	323,
	"WINDOW_RING",	324,
	"WARP_CURSOR",	325,
	"ERRORTOKEN",	326,
	"NO_STACKMODE",	327,
	"STRING",	328,
	"-unknown-",	-1	/* ends search */
};
#endif /* YYDEBUG */

/* @(#)27       1.7.1.5  src/bos/usr/ccs/bin/yacc/yaccpar, cmdlang, bos720 6/18/07 05:28:20 */
/*
 * COMPONENT_NAME: (CMDLANG) Language Utilities
 *
 * FUNCTIONS: yyparse
 * ORIGINS: 3
 */
/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#ifdef YYSPLIT
#   define YYERROR      return(-2)
#else
#   define YYERROR      goto yyerrlab
#endif
#ifdef YACC_MSG
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif
#include <nl_types.h>
nl_catd yyusercatd;
#endif
#define YYACCEPT        return(0)
#define YYABORT         return(1)
#ifndef YACC_MSG
#define YYBACKUP( newtoken, newvalue )\
{\
        if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
        {\
                yyerror( "syntax error - cannot backup" );\
                YYERROR;\
        }\
        yychar = newtoken;\
        yystate = *yyps;\
        yylval = newvalue;\
        goto yynewstate;\
}
#else
#define YYBACKUP( newtoken, newvalue )\
{\
        if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
        {\
                yyusercatd=catopen("yacc_user.cat", NL_CAT_LOCALE);\
                yyerror(catgets(yyusercatd,1,1,"syntax error - cannot backup" ));\
                YYERROR;\
        }\
        yychar = newtoken;\
        yystate = *yyps;\
        yylval = newvalue;\
        goto yynewstate;\
}
#endif
#define YYRECOVERING()  (!!yyerrflag)
#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)

#ifdef YYSPLIT
#   define YYSCODE { \
                        extern int (*_yyf[])(); \
                        register int yyret; \
                        if (_yyf[yytmp]) \
                            if ((yyret=(*_yyf[yytmp])()) == -2) \
                                    goto yyerrlab; \
                                else if (yyret>=0) return(yyret); \
                   }
#endif

/*
** global variables used by the parser
*/
YYSTYPE yyv[ YYMAXDEPTH ];      /* value stack */
int yys[ YYMAXDEPTH ];          /* state stack */

YYSTYPE *yypv;                  /* top of value stack */
YYSTYPE *yypvt;                 /* top of value stack for $vars */
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 __cplusplus
 #ifdef _CPP_IOSTREAMS
  #include <iostream.h>
  extern void yyerror (char *); /* error message routine -- iostream version */
 #else
  #include <stdio.h>
  extern "C" void yyerror (char *); /* error message routine -- stdio version */
 #endif /* _CPP_IOSTREAMS */
 extern "C" int yylex(void);        /* return the next token */
#endif /* __cplusplus */


/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
#ifdef __cplusplus
extern "C"
#endif /* __cplusplus */
int
yyparse()
{
        /*
        ** 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;
#ifdef YACC_MSG
        yyusercatd=catopen("yacc_user.cat", NL_CAT_LOCALE);
#endif
        goto yystack;
        {
                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 */

                /*
                ** 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;

#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                        cout << "State " << yy_state << " token ";
                        if ( yychar == 0 )
                                cout << "end-of-file" << endl;
                        else if ( yychar < 0 )
                                cout << "-none-" << endl;
#else
                        printf( "State %d, token ", yy_state );
                        if ( yychar == 0 )
                                printf( "end-of-file\n" );
                        else if ( yychar < 0 )
                                printf( "-none-\n" );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                        else
                        {
                                for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
                                        yy_i++ )
                                {
                                        if ( yytoks[yy_i].t_val == yychar )
                                                break;
                                }
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                cout << yytoks[yy_i].t_name << endl;
#else
                                printf( "%s\n", yytoks[yy_i].t_name );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                        }
                }
#endif /* YYDEBUG */
                if ( ++yy_ps >= yys+YYMAXDEPTH )    /* room on stack? */
                {
#ifndef YACC_MSG
                        yyerror( "yacc stack overflow" );
#else
                        yyerror(catgets(yyusercatd,1,2,"yacc stack overflow" ));
#endif
                        YYABORT;
                }
                *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;

#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                        cout << "Received token " << endl;
                        if ( yychar == 0 )
                                cout << "end-of-file" << endl;
                        else if ( yychar < 0 )
                                cout << "-none-" << endl;
#else
                        printf( "Received token " );
                        if ( yychar == 0 )
                                printf( "end-of-file\n" );
                        else if ( yychar < 0 )
                                printf( "-none-\n" );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                        else
                        {
                                for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
                                        yy_i++ )
                                {
                                        if ( yytoks[yy_i].t_val == yychar )
                                                break;
                                }
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                cout << yytoks[yy_i].t_name << endl;
#else
                                printf( "%s\n", yytoks[yy_i].t_name );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                        }
                }
#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;

#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                cout << "Received token " << endl;
                                if ( yychar == 0 )
                                        cout << "end-of-file" << endl;
                                else if ( yychar < 0 )
                                        cout << "-none-" << endl;
#else
                                printf( "Received token " );
                                if ( yychar == 0 )
                                        printf( "end-of-file\n" );
                                else if ( yychar < 0 )
                                        printf( "-none-\n" );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                                else
                                {
                                        for ( yy_i = 0;
                                                yytoks[yy_i].t_val >= 0;
                                                yy_i++ )
                                        {
                                                if ( yytoks[yy_i].t_val
                                                        == yychar )
                                                {
                                                        break;
                                                }
                                        }
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                        cout << yytoks[yy_i].t_name << endl;
#else
                                        printf( "%s\n", yytoks[yy_i].t_name );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                                }
                        }
#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 */
#ifndef YACC_MSG
                                yyerror( "syntax error" );
#else
                                yyerror(catgets(yyusercatd,1,3,"syntax error" ));
#endif
                                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;
                                yynerrs++;
                        skip_init:
                        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
                                        if ( yydebug )
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                            cout << "Error recovery pops state "
                                                 << (*yy_ps)
                                                 << ", uncovers state "
                                                 << *(yy_ps-1) << endl;
#else
#       define _POP_ "Error recovery pops state %d, uncovers state %d\n"
                                                printf( _POP_, *yy_ps,
                                                        *(yy_ps-1) );
#       undef _POP_
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
#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;

#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                        cout << "Error recovery discards ";
                                        if ( yychar == 0 )
                                            cout << "token end-of-file" << endl;
                                        else if ( yychar < 0 )
                                            cout << "token -none-" << endl;
#else
                                        printf( "Error recovery discards " );
                                        if ( yychar == 0 )
                                                printf( "token end-of-file\n" );
                                        else if ( yychar < 0 )
                                                printf( "token -none-\n" );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                                        else
                                        {
                                                for ( yy_i = 0;
                                                        yytoks[yy_i].t_val >= 0;
                                                        yy_i++ )
                                                {
                                                        if ( yytoks[yy_i].t_val
                                                                == yychar )
                                                        {
                                                                break;
                                                        }
                                                }
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                                                cout << "token " <<
                                                    yytoks[yy_i].t_name <<
                                                    endl;
#else
                                                printf( "token %s\n",
                                                        yytoks[yy_i].t_name );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
                                        }
                                }
#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 )
#if defined(__cplusplus) && defined(_CPP_IOSTREAMS)
                        cout << "Reduce by (" << yy_n << ") \"" <<
                            yyreds[ yy_n ] << "\"\n";
#else
                        printf( "Reduce by (%d) \"%s\"\n",
                                yy_n, yyreds[ yy_n ] );
#endif /* defined(__cplusplus) && defined(_CPP_IOSTREAMS) */
#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 161 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ AddIconRegion(yypvt[-4].ptr, yypvt[-3].num, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num); } /*NOTREACHED*/ break;
case 10:
# line 162 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						  {
						    Scr->iconmgr.geometry=yypvt[-1].ptr;
						    Scr->iconmgr.columns=yypvt[-0].num;
						  }
						} /*NOTREACHED*/ break;
case 11:
# line 168 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						    Scr->iconmgr.geometry = yypvt[-0].ptr;
						} /*NOTREACHED*/ break;
case 12:
# line 171 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
					  {
						Scr->DoZoom = TRUE;
						Scr->ZoomCount = yypvt[-0].num;
					  }
					} /*NOTREACHED*/ break;
case 13:
# line 177 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime) 
						Scr->DoZoom = TRUE; } /*NOTREACHED*/ break;
case 14:
# line 179 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{} /*NOTREACHED*/ break;
case 15:
# line 180 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{} /*NOTREACHED*/ break;
case 16:
# line 181 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->IconifyByUn; } /*NOTREACHED*/ break;
case 18:
# line 183 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime) 
		    Scr->IconifyByUnmapping = TRUE; } /*NOTREACHED*/ break;
case 19:
# line 185 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, False);
					} /*NOTREACHED*/ break;
case 20:
# line 188 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ 
					  GotTitleButton (yypvt[-2].ptr, yypvt[-0].num, True);
					} /*NOTREACHED*/ break;
case 21:
# line 191 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					} /*NOTREACHED*/ break;
case 22:
# line 195 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					} /*NOTREACHED*/ break;
case 23:
# line 211 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ GotKey(yypvt[-1].ptr, yypvt[-0].num); } /*NOTREACHED*/ break;
case 24:
# line 212 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ GotButton(yypvt[-1].num, yypvt[-0].num); } /*NOTREACHED*/ break;
case 25:
# line 213 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->DontIconify; } /*NOTREACHED*/ break;
case 27:
# line 215 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->IconMgrNoShow; } /*NOTREACHED*/ break;
case 29:
# line 217 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ Scr->IconManagerDontShow = TRUE; } /*NOTREACHED*/ break;
case 30:
# line 218 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->IconMgrs; } /*NOTREACHED*/ break;
case 32:
# line 220 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->IconMgrShow; } /*NOTREACHED*/ break;
case 34:
# line 222 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->NoTitleHighlight; } /*NOTREACHED*/ break;
case 36:
# line 224 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						Scr->TitleHighlight = FALSE; } /*NOTREACHED*/ break;
case 37:
# line 226 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->NoHighlight; } /*NOTREACHED*/ break;
case 39:
# line 228 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						Scr->Highlight = FALSE; } /*NOTREACHED*/ break;
case 40:
# line 230 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->NoStackModeL; } /*NOTREACHED*/ break;
case 42:
# line 232 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						Scr->StackMode = FALSE; } /*NOTREACHED*/ break;
case 43:
# line 234 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->NoTitle; } /*NOTREACHED*/ break;
case 45:
# line 236 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
						Scr->NoTitlebar = TRUE; } /*NOTREACHED*/ break;
case 46:
# line 238 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->MakeTitle; } /*NOTREACHED*/ break;
case 48:
# line 240 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->StartIconified; } /*NOTREACHED*/ break;
case 50:
# line 242 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->AutoRaise; } /*NOTREACHED*/ break;
case 52:
# line 244 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
					root = GetRoot(yypvt[-5].ptr, yypvt[-3].ptr, yypvt[-1].ptr); } /*NOTREACHED*/ break;
case 53:
# line 246 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ root->real_menu = TRUE;} /*NOTREACHED*/ break;
case 54:
# line 247 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } /*NOTREACHED*/ break;
case 55:
# line 248 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ root->real_menu = TRUE; } /*NOTREACHED*/ break;
case 56:
# line 249 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ root = GetRoot(yypvt[-0].ptr, NULLSTR, NULLSTR); } /*NOTREACHED*/ break;
case 58:
# line 251 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->IconNames; } /*NOTREACHED*/ break;
case 60:
# line 253 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ color = COLOR; } /*NOTREACHED*/ break;
case 62:
# line 255 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ color = GRAYSCALE; } /*NOTREACHED*/ break;
case 65:
# line 259 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ color = MONOCHROME; } /*NOTREACHED*/ break;
case 67:
# line 261 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					} /*NOTREACHED*/ break;
case 68:
# line 277 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					} /*NOTREACHED*/ break;
case 69:
# line 285 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->WarpCursorL; } /*NOTREACHED*/ break;
case 71:
# line 287 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime) 
					    Scr->WarpCursor = TRUE; } /*NOTREACHED*/ break;
case 72:
# line 289 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->WindowRingL; } /*NOTREACHED*/ break;
case 74:
# line 294 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (!do_single_keyword (yypvt[-0].num)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
					"unknown singleton keyword %d\n",
						     yypvt[-0].num);
					    ParseError = 1;
					  }
					} /*NOTREACHED*/ break;
case 75:
# line 304 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					  }
					} /*NOTREACHED*/ break;
case 76:
# line 314 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					  }
					} /*NOTREACHED*/ break;
case 77:
# line 326 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
case 78:
# line 329 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
case 81:
# line 336 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ mods |= Mod1Mask; } /*NOTREACHED*/ break;
case 82:
# line 337 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ mods |= ShiftMask; } /*NOTREACHED*/ break;
case 83:
# line 338 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ mods |= LockMask; } /*NOTREACHED*/ break;
case 84:
# line 339 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ mods |= ControlMask; } /*NOTREACHED*/ break;
case 85:
# line 340 "../../../../../../../src/gos/2d/XTOP/programs/twm/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));
					  }
					} /*NOTREACHED*/ break;
case 86:
# line 350 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ } /*NOTREACHED*/ break;
case 89:
# line 357 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_WINDOW_BIT; } /*NOTREACHED*/ break;
case 90:
# line 358 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_TITLE_BIT; } /*NOTREACHED*/ break;
case 91:
# line 359 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICON_BIT; } /*NOTREACHED*/ break;
case 92:
# line 360 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ROOT_BIT; } /*NOTREACHED*/ break;
case 93:
# line 361 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_FRAME_BIT; } /*NOTREACHED*/ break;
case 94:
# line 362 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICONMGR_BIT; } /*NOTREACHED*/ break;
case 95:
# line 363 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICONMGR_BIT; } /*NOTREACHED*/ break;
case 96:
# line 364 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ALL_BITS; } /*NOTREACHED*/ break;
case 97:
# line 365 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{  } /*NOTREACHED*/ break;
case 100:
# line 372 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_WINDOW_BIT; } /*NOTREACHED*/ break;
case 101:
# line 373 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_TITLE_BIT; } /*NOTREACHED*/ break;
case 102:
# line 374 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICON_BIT; } /*NOTREACHED*/ break;
case 103:
# line 375 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ROOT_BIT; } /*NOTREACHED*/ break;
case 104:
# line 376 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_FRAME_BIT; } /*NOTREACHED*/ break;
case 105:
# line 377 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICONMGR_BIT; } /*NOTREACHED*/ break;
case 106:
# line 378 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ICONMGR_BIT; } /*NOTREACHED*/ break;
case 107:
# line 379 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ cont |= C_ALL_BITS; } /*NOTREACHED*/ break;
case 108:
# line 380 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ } /*NOTREACHED*/ break;
case 109:
# line 381 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ Name = yypvt[-0].ptr; cont |= C_NAME_BIT; } /*NOTREACHED*/ break;
case 113:
# line 392 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ SetHighlightPixmap (yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 117:
# line 403 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->FrameCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 118:
# line 405 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->FrameCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 119:
# line 407 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->TitleCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 120:
# line 409 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->TitleCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 121:
# line 411 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->IconCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 122:
# line 413 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->IconCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 123:
# line 415 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->IconMgrCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 124:
# line 417 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->IconMgrCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 125:
# line 419 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->ButtonCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 126:
# line 421 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->ButtonCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 127:
# line 423 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->MoveCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 128:
# line 425 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->MoveCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 129:
# line 427 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->ResizeCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 130:
# line 429 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->ResizeCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 131:
# line 431 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->WaitCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 132:
# line 433 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->WaitCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 133:
# line 435 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->MenuCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 134:
# line 437 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->MenuCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 135:
# line 439 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->SelectCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 136:
# line 441 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->SelectCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 137:
# line 443 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewBitmapCursor(&Scr->DestroyCursor, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 138:
# line 445 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
			NewFontCursor(&Scr->DestroyCursor, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 142:
# line 457 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					  }
					} /*NOTREACHED*/ break;
case 143:
# line 466 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					  }
					} /*NOTREACHED*/ break;
case 145:
# line 477 "../../../../../../../src/gos/2d/XTOP/programs/twm/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;
					  }
					} /*NOTREACHED*/ break;
case 149:
# line 495 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ do_string_savecolor(color, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 150:
# line 496 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ do_var_savecolor(yypvt[-0].num); } /*NOTREACHED*/ break;
case 154:
# line 506 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime &&
					      color == Scr->Monochrome)
					    AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 155:
# line 511 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ 
				    if (HasShape) Scr->SqueezeTitle = TRUE;
				} /*NOTREACHED*/ break;
case 156:
# line 514 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->SqueezeTitleL; 
				  if (HasShape && Scr->SqueezeTitle == -1)
				    Scr->SqueezeTitle = TRUE;
				} /*NOTREACHED*/ break;
case 158:
# line 519 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ Scr->SqueezeTitle = FALSE; } /*NOTREACHED*/ break;
case 159:
# line 520 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ list = &Scr->DontSqueezeTitleL; } /*NOTREACHED*/ break;
case 162:
# line 525 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
				if (Scr->FirstTime) {
				   do_squeeze_entry (list, yypvt[-3].ptr, yypvt[-2].num, yypvt[-1].num, yypvt[-0].num);
				}
			} /*NOTREACHED*/ break;
case 166:
# line 540 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-2].ptr, (char *)
						AllocateIconManager(yypvt[-2].ptr, NULLSTR,
							yypvt[-1].ptr,yypvt[-0].num));
					} /*NOTREACHED*/ break;
case 167:
# line 546 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-3].ptr, (char *)
						AllocateIconManager(yypvt[-3].ptr,yypvt[-2].ptr,
						yypvt[-1].ptr, yypvt[-0].num));
					} /*NOTREACHED*/ break;
case 171:
# line 560 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yypvt[-0].ptr, 0);
					} /*NOTREACHED*/ break;
case 175:
# line 572 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ if (Scr->FirstTime) AddToList(list, yypvt[-1].ptr, yypvt[-0].ptr); } /*NOTREACHED*/ break;
case 179:
# line 582 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ AddToMenu(root, "", Action, NULLSTR, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					} /*NOTREACHED*/ break;
case 183:
# line 595 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ AddToMenu(root, yypvt[-1].ptr, Action, pull, yypvt[-0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					  pull = NULL;
					} /*NOTREACHED*/ break;
case 184:
# line 600 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{
					  AddToMenu(root, yypvt[-6].ptr, Action, pull, yypvt[-0].num,
						yypvt[-4].ptr, yypvt[-2].ptr);
					  Action = "";
					  pull = NULL;
					} /*NOTREACHED*/ break;
case 185:
# line 608 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
case 186:
# line 609 "../../../../../../../src/gos/2d/XTOP/programs/twm/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 */
				   } /*NOTREACHED*/ break;
case 187:
# line 650 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
case 188:
# line 651 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
case 189:
# line 652 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = -(yypvt[-0].num); } /*NOTREACHED*/ break;
case 190:
# line 655 "../../../../../../../src/gos/2d/XTOP/programs/twm/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");
					  }
					} /*NOTREACHED*/ break;
case 191:
# line 667 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ ptr = (char *)malloc(strlen(yypvt[-0].ptr)+1);
					  strcpy(ptr, yypvt[-0].ptr);
					  RemoveDQuote(ptr);
					  yyval.ptr = ptr;
					} /*NOTREACHED*/ break;
case 192:
# line 672 "../../../../../../../src/gos/2d/XTOP/programs/twm/gram.y"
{ yyval.num = yypvt[-0].num; } /*NOTREACHED*/ break;
}


        goto yystack;           /* reset registers in driver code */
}

# line 675 "../../../../../../../src/gos/2d/XTOP/programs/twm/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++) ; /* SUPPRESS 530 */
    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);
}
