
/*  A Bison parser, made from gram.y  */

#define YYBISON 1  /* Identify Bison output.  */

#define	LB	258
#define	RB	259
#define	LP	260
#define	RP	261
#define	MENUS	262
#define	MENU	263
#define	BUTTON	264
#define	DEFAULT_FUNCTION	265
#define	PLUS	266
#define	MINUS	267
#define	ALL	268
#define	OR	269
#define	CURSORS	270
#define	PIXMAPS	271
#define	ICONS	272
#define	COLOR	273
#define	SAVECOLOR	274
#define	MONOCHROME	275
#define	FUNCTION	276
#define	ICONMGR_SHOW	277
#define	ICONMGR	278
#define	WINDOW_FUNCTION	279
#define	ZOOM	280
#define	ICONMGRS	281
#define	ICONMGR_GEOMETRY	282
#define	ICONMGR_NOSHOW	283
#define	MAKE_TITLE	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	VIRTUAL	300
#define	VIRTUAL_WIN	301
#define	COLON	302
#define	EQUALS	303
#define	SQUEEZE_TITLE	304
#define	DONT_SQUEEZE_TITLE	305
#define	START_ICONIFIED	306
#define	NO_TITLE_HILITE	307
#define	TITLE_HILITE	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

#line 41 "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(), do_string_savecolor();
extern int yylineno;

#line 76 "gram.y"
typedef union
{
    int num;
    char *ptr;
} YYSTYPE;

#ifndef YYLTYPE
typedef
  struct yyltype
    {
      int timestamp;
      int first_line;
      int first_column;
      int last_line;
      int last_column;
      char *text;
   }
  yyltype;

#define YYLTYPE yyltype
#endif

#include <stdio.h>

#ifndef __STDC__
#define const
#endif



#define	YYFINAL		306
#define	YYFLAG		-32768
#define	YYNTBASE	81

#define YYTRANSLATE(x) ((unsigned)(x) <= 335 ? yytranslate[x] : 160)

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

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     3,     6,     8,    10,    12,    14,    16,    18,
    25,    29,    32,    35,    37,    40,    43,    44,    48,    50,
    55,    60,    63,    66,    69,    72,    73,    77,    78,    82,
    84,    85,    89,    90,    94,    95,    99,   101,   102,   106,
   108,   109,   113,   115,   116,   120,   122,   123,   127,   128,
   132,   133,   137,   138,   148,   149,   154,   155,   160,   161,
   165,   166,   170,   173,   174,   178,   181,   184,   185,   189,
   191,   192,   196,   197,   201,   205,   206,   210,   212,   215,
   218,   225,   232,   233,   236,   238,   240,   242,   244,   247,
   249,   250,   253,   255,   257,   259,   261,   263,   265,   267,
   269,   271,   273,   275,   277,   278,   281,   283,   285,   287,
   289,   291,   293,   295,   297,   299,   301,   303,   305,   307,
   311,   312,   315,   318,   322,   323,   326,   330,   333,   337,
   340,   344,   347,   351,   354,   358,   361,   365,   368,   372,
   375,   379,   382,   386,   389,   393,   396,   400,   403,   407,
   408,   411,   414,   415,   420,   423,   427,   428,   431,   433,
   435,   439,   440,   443,   446,   448,   449,   455,   457,   458,
   462,   463,   469,   474,   475,   478,   482,   486,   487,   490,
   494,   499,   503,   504,   507,   509,   513,   514,   517,   520,
   524,   525,   528,   530,   534,   535,   538,   541,   549,   551,
   554,   556,   559,   562,   565,   567
};

#endif

static const short yyrhs[] = {    82,
     0,     0,    82,    83,     0,     1,     0,   106,     0,   107,
     0,   108,     0,   133,     0,   137,     0,    35,   158,    69,
    69,   159,   159,     0,    27,   158,   159,     0,    27,   158,
     0,    25,   159,     0,    25,     0,    16,   117,     0,    15,
   120,     0,     0,    30,    84,   143,     0,    30,     0,    59,
   158,    48,   155,     0,    60,   158,    48,   155,     0,   157,
   158,     0,   157,   155,     0,   158,   110,     0,   157,   109,
     0,     0,    31,    85,   143,     0,     0,    28,    86,   143,
     0,    28,     0,     0,    26,    87,   140,     0,     0,    22,
    88,   143,     0,     0,    52,    89,   143,     0,    52,     0,
     0,    34,    90,   143,     0,    34,     0,     0,    74,    91,
   143,     0,    74,     0,     0,    32,    92,   143,     0,    32,
     0,     0,    29,    93,   143,     0,     0,    51,    94,   143,
     0,     0,    33,    95,   143,     0,     0,     8,   158,     5,
   158,    47,   158,     6,    96,   152,     0,     0,     8,   158,
    97,   152,     0,     0,    21,   158,    98,   149,     0,     0,
    17,    99,   146,     0,     0,    18,   100,   123,     0,    19,
   127,     0,     0,    20,   101,   123,     0,    10,   155,     0,
    24,   155,     0,     0,    72,   102,   143,     0,    72,     0,
     0,    71,   103,   143,     0,     0,    75,   104,   143,     0,
    76,   158,   159,     0,     0,    77,   105,   143,     0,    62,
     0,    68,   158,     0,    63,   159,     0,    48,   111,    47,
   113,    47,   155,     0,    48,   111,    47,   115,    47,   155,
     0,     0,   111,   112,     0,    36,     0,    37,     0,    38,
     0,    39,     0,    36,   159,     0,    14,     0,     0,   113,
   114,     0,    40,     0,    41,     0,    42,     0,    43,     0,
    44,     0,    23,     0,    36,     0,    45,     0,    46,     0,
    79,     0,    13,     0,    14,     0,     0,   115,   116,     0,
    40,     0,    41,     0,    42,     0,    43,     0,    44,     0,
    23,     0,    36,     0,    45,     0,    46,     0,    79,     0,
    13,     0,    14,     0,   158,     0,     3,   118,     4,     0,
     0,   118,   119,     0,    53,   158,     0,     3,   121,     4,
     0,     0,   121,   122,     0,    44,   158,   158,     0,    44,
   158,     0,    41,   158,   158,     0,    41,   158,     0,    42,
   158,   158,     0,    42,   158,     0,    23,   158,   158,     0,
    23,   158,     0,     9,   158,   158,     0,     9,   158,     0,
    54,   158,   158,     0,    54,   158,     0,    55,   158,   158,
     0,    55,   158,     0,    56,   158,   158,     0,    56,   158,
     0,     8,   158,   158,     0,     8,   158,     0,    57,   158,
   158,     0,    57,   158,     0,    58,   158,   158,     0,    58,
   158,     0,     3,   124,     4,     0,     0,   124,   125,     0,
    65,   158,     0,     0,    65,   158,   126,   130,     0,    64,
   158,     0,     3,   128,     4,     0,     0,   128,   129,     0,
   158,     0,    65,     0,     3,   131,     4,     0,     0,   131,
   132,     0,   158,   158,     0,    49,     0,     0,    49,   134,
     3,   136,     4,     0,    50,     0,     0,    50,   135,   143,
     0,     0,   136,   158,    70,   156,   159,     0,    78,     3,
   138,     4,     0,     0,   138,   139,     0,   158,   158,   158,
     0,     3,   141,     4,     0,     0,   141,   142,     0,   158,
   158,   159,     0,   158,   158,   158,   159,     0,     3,   144,
     4,     0,     0,   144,   145,     0,   158,     0,     3,   147,
     4,     0,     0,   147,   148,     0,   158,   158,     0,     3,
   150,     4,     0,     0,   150,   151,     0,   155,     0,     3,
   153,     4,     0,     0,   153,   154,     0,   158,   155,     0,
   158,     5,   158,    47,   158,     6,   155,     0,    66,     0,
    67,   158,     0,   159,     0,    11,   159,     0,    12,   159,
     0,     9,   159,     0,    80,     0,    61,     0
};

#if YYDEBUG != 0
static const short yyrline[] = { 0,
   104,   107,   108,   111,   112,   113,   114,   115,   116,   117,
   119,   125,   128,   134,   136,   137,   138,   140,   140,   142,
   145,   148,   152,   168,   169,   170,   172,   172,   174,   174,
   175,   177,   177,   179,   179,   181,   181,   183,   185,   185,
   187,   189,   189,   191,   193,   193,   195,   197,   197,   199,
   199,   201,   201,   203,   204,   205,   206,   208,   208,   210,
   210,   212,   212,   214,   216,   216,   232,   240,   242,   242,
   244,   246,   246,   248,   248,   250,   252,   255,   265,   275,
   287,   290,   293,   294,   297,   298,   299,   300,   301,   311,
   314,   315,   318,   319,   320,   321,   322,   323,   324,   325,
   326,   327,   328,   329,   332,   333,   336,   337,   338,   339,
   340,   341,   342,   343,   344,   345,   346,   347,   348,   352,
   355,   356,   359,   363,   366,   367,   370,   372,   374,   376,
   378,   380,   382,   384,   386,   388,   390,   392,   394,   396,
   398,   400,   402,   404,   406,   408,   410,   412,   416,   420,
   421,   424,   433,   444,   444,   455,   458,   459,   462,   463,
   466,   469,   470,   473,   478,   481,   485,   486,   487,   489,
   491,   492,   499,   502,   503,   506,   512,   515,   516,   519,
   524,   532,   535,   536,   539,   544,   547,   548,   551,   554,
   557,   558,   561,   567,   570,   571,   574,   579,   587,   588,
   629,   630,   631,   634,   646,   651
};

static const char * const yytname[] = {   "$","error","$illegal.","LB","RB",
"LP","RP","MENUS","MENU","BUTTON","DEFAULT_FUNCTION","PLUS","MINUS","ALL","OR",
"CURSORS","PIXMAPS","ICONS","COLOR","SAVECOLOR","MONOCHROME","FUNCTION","ICONMGR_SHOW",
"ICONMGR","WINDOW_FUNCTION","ZOOM","ICONMGRS","ICONMGR_GEOMETRY","ICONMGR_NOSHOW",
"MAKE_TITLE","ICONIFY_BY_UNMAPPING","DONT_ICONIFY_BY_UNMAPPING","NO_TITLE","AUTO_RAISE",
"NO_HILITE","ICON_REGION","META","SHIFT","LOCK","CONTROL","WINDOW","TITLE","ICON",
"ROOT","FRAME","VIRTUAL","VIRTUAL_WIN","COLON","EQUALS","SQUEEZE_TITLE","DONT_SQUEEZE_TITLE",
"START_ICONIFIED","NO_TITLE_HILITE","TITLE_HILITE","MOVE","RESIZE","WAIT","SELECT",
"KILL","LEFT_TITLEBUTTON","RIGHT_TITLEBUTTON","NUMBER","KEYWORD","NKEYWORD",
"CKEYWORD","CLKEYWORD","FKEYWORD","FSKEYWORD","SKEYWORD","DKEYWORD","JKEYWORD",
"WINDOW_RING","WARP_CURSOR","ERRORTOKEN","NO_STACKMODE","NAILEDDOWN","VIRTUALDESKTOP",
"NO_SHOW_IN_DISPLAY","DOORS","DOOR","STRING","twmrc","stmts","stmt","@1","@2",
"@3","@4","@5","@6","@7","@8","@9","@10","@11","@12","@13","@14","@15","@16",
"@17","@18","@19","@20","@21","@22","noarg","sarg","narg","full","fullkey","keys",
"key","contexts","context","contextkeys","contextkey","pixmap_list","pixmap_entries",
"pixmap_entry","cursor_list","cursor_entries","cursor_entry","color_list","color_entries",
"color_entry","@23","save_color_list","s_color_entries","s_color_entry","win_color_list",
"win_color_entries","win_color_entry","squeeze","@24","@25","win_sqz_entries",
"doors","door_list","door_entry","iconm_list","iconm_entries","iconm_entry",
"win_list","win_entries","win_entry","icon_list","icon_entries","icon_entry",
"function","function_entries","function_entry","menu","menu_entries","menu_entry",
"action","signed_number","button","string","number",""
};
#endif

static const short yyr1[] = {     0,
    81,    82,    82,    83,    83,    83,    83,    83,    83,    83,
    83,    83,    83,    83,    83,    83,    84,    83,    83,    83,
    83,    83,    83,    83,    83,    85,    83,    86,    83,    83,
    87,    83,    88,    83,    89,    83,    83,    90,    83,    83,
    91,    83,    83,    92,    83,    83,    93,    83,    94,    83,
    95,    83,    96,    83,    97,    83,    98,    83,    99,    83,
   100,    83,    83,   101,    83,    83,    83,   102,    83,    83,
   103,    83,   104,    83,    83,   105,    83,   106,   107,   108,
   109,   110,   111,   111,   112,   112,   112,   112,   112,   112,
   113,   113,   114,   114,   114,   114,   114,   114,   114,   114,
   114,   114,   114,   114,   115,   115,   116,   116,   116,   116,
   116,   116,   116,   116,   116,   116,   116,   116,   116,   117,
   118,   118,   119,   120,   121,   121,   122,   122,   122,   122,
   122,   122,   122,   122,   122,   122,   122,   122,   122,   122,
   122,   122,   122,   122,   122,   122,   122,   122,   123,   124,
   124,   125,   126,   125,   125,   127,   128,   128,   129,   129,
   130,   131,   131,   132,   133,   134,   133,   133,   135,   133,
   136,   136,   137,   138,   138,   139,   140,   141,   141,   142,
   142,   143,   144,   144,   145,   146,   147,   147,   148,   149,
   150,   150,   151,   152,   153,   153,   154,   154,   155,   155,
   156,   156,   156,   157,   158,   159
};

static const 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,     9,     0,     4,     0,     4,     0,     3,
     0,     3,     2,     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,     1,     1,
     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
};

static const short yydefact[] = {     2,
     0,     4,     0,     0,     0,     0,     0,    59,    61,     0,
    64,     0,    33,     0,    14,    31,     0,    30,    47,    19,
    26,    46,    51,    40,     0,   165,   168,    49,    37,     0,
     0,    78,     0,     0,    71,    70,    43,    73,     0,    76,
     0,   205,     3,     5,     6,     7,     8,     9,     0,     0,
    55,   206,   204,   199,     0,    66,   125,    16,   121,    15,
     0,     0,   157,    63,     0,    57,     0,    67,    13,     0,
    12,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,    80,    79,     0,     0,     0,
     0,     0,     0,   174,    83,    25,    23,    22,    83,    24,
     0,     0,   200,     0,     0,   187,    60,   150,    62,     0,
    65,     0,   183,    34,   178,    32,    11,    29,    48,    18,
    27,    45,    52,    39,     0,   171,   170,    50,    36,     0,
     0,    72,    69,    42,    74,    75,    77,     0,     0,     0,
     0,   195,    56,   124,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,   126,   120,     0,   122,     0,
     0,   156,   160,   158,   159,   191,    58,     0,     0,     0,
     0,    20,    21,   173,   175,     0,    90,    85,    86,    87,
    88,    91,    84,   105,     0,     0,   144,   136,   134,   130,
   132,   128,   138,   140,   142,   146,   148,   123,   186,   188,
     0,   149,     0,     0,   151,     0,   182,   184,   185,   177,
   179,     0,     0,   167,     0,     0,    89,     0,     0,     0,
   194,   196,     0,   143,   135,   133,   129,   131,   127,   137,
   139,   141,   145,   147,   189,   155,   152,   190,   192,   193,
     0,    10,     0,   176,   103,   104,    98,    99,    93,    94,
    95,    96,    97,   100,   101,     0,   102,    92,   117,   118,
   112,   113,   107,   108,   109,   110,   111,   114,   115,     0,
   116,   106,   119,    53,     0,   197,     0,     0,   180,     0,
     0,     0,   201,    81,    82,     0,     0,   162,   154,   181,
   202,   203,   172,    54,     0,     0,     0,   161,   163,     0,
     0,   164,   198,     0,     0,     0
};

static const short yydefgoto[] = {   304,
     1,    43,    74,    75,    72,    70,    67,    83,    78,    90,
    76,    73,    82,    77,   286,   102,   112,    61,    62,    65,
    89,    88,    91,    93,    44,    45,    46,    96,   100,   139,
   183,   218,   258,   219,   272,    60,   105,   159,    58,   104,
   156,   109,   161,   205,   277,    64,   110,   164,   289,   296,
   299,    47,    80,    81,   171,    48,   138,   175,   116,   169,
   211,   114,   168,   208,   107,   160,   200,   167,   206,   239,
   143,   186,   222,    56,   282,    49,    50,    53
};

static const short yypact[] = {-32768,
   286,-32768,   -60,   -40,   -49,    20,    23,-32768,-32768,    27,
-32768,   -60,-32768,   -49,   -40,-32768,   -60,    34,-32768,    38,
-32768,    39,-32768,    40,   -60,    41,    42,-32768,    45,   -60,
   -60,-32768,   -40,   -60,-32768,    47,    50,-32768,   -60,-32768,
    51,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -33,    10,
    54,-32768,-32768,-32768,   -60,-32768,-32768,-32768,-32768,-32768,
    52,    53,-32768,-32768,    53,-32768,    57,-32768,-32768,    58,
   -40,    57,    57,    57,    57,    57,    57,    57,    -6,    61,
    57,    57,    57,    31,    37,-32768,-32768,    57,    57,    57,
    57,   -40,    57,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
   -60,    86,-32768,   198,    -2,-32768,-32768,-32768,-32768,     0,
-32768,    93,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,    43,-32768,-32768,-32768,-32768,   -49,
   -49,-32768,-32768,-32768,-32768,-32768,-32768,     1,    63,    94,
    56,-32768,-32768,-32768,   -60,   -60,   -60,   -60,   -60,   -60,
   -60,   -60,   -60,   -60,   -60,-32768,-32768,   -60,-32768,     2,
    28,-32768,-32768,-32768,-32768,-32768,-32768,     3,     4,   -40,
     6,-32768,-32768,-32768,-32768,   -60,-32768,   -40,-32768,-32768,
-32768,-32768,-32768,-32768,   -60,     7,   -60,   -60,   -60,   -60,
   -60,   -60,   -60,   -60,   -60,   -60,   -60,-32768,-32768,-32768,
   -60,-32768,   -60,   -60,-32768,     9,-32768,-32768,-32768,-32768,
-32768,   -60,   -40,-32768,    44,   -60,-32768,    81,    26,    91,
-32768,-32768,    24,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,   106,-32768,-32768,-32768,
   -45,-32768,    13,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,   -49,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -49,
-32768,-32768,-32768,-32768,   -60,-32768,   108,   -40,-32768,   -40,
   -40,   -40,-32768,-32768,-32768,    86,    66,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   -60,     8,   109,-32768,-32768,   -60,
   -49,-32768,-32768,   116,   118,-32768
};

static const short yypgoto[] = {-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    30,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,    69,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,   251,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -150,-32768,-32768,   -11,-32768,-32768,    -3,   -14
};


#define	YYLAST		366


static const short yytable[] = {    51,
    69,   157,    68,   162,   174,   199,   207,   210,    66,   214,
   221,   298,   238,    71,    95,    52,    54,    55,    86,    42,
    52,    79,    57,   280,   281,    59,    84,    85,   275,    63,
    87,   202,    54,    55,    42,    92,   -28,    97,   259,   260,
   -17,   -44,   -38,  -166,  -169,    98,    42,   -35,   261,   -68,
   158,   103,   -41,    94,   106,   108,   117,    99,   101,   113,
   115,   262,   125,   126,   163,   263,   264,   265,   266,   267,
   268,   269,   270,    52,    54,    55,   177,   136,   130,    42,
    42,    42,    42,    42,   131,    42,    42,    42,   142,    54,
    55,   203,   204,   245,   246,   166,   274,   141,   178,   179,
   180,   181,   185,   247,   271,    42,   165,   177,  -153,   182,
   288,   170,   295,   243,   301,   305,   248,   306,   172,   173,
   249,   250,   251,   252,   253,   254,   255,   256,   140,   178,
   179,   180,   181,   111,   176,   294,     0,     0,     0,     0,
   184,   187,   188,   189,   190,   191,   192,   193,   194,   195,
   196,   197,     0,     0,   198,   213,   201,     0,     0,   257,
     0,     0,     0,   217,   209,   212,     0,   215,     0,     0,
     0,     0,   216,     0,     0,     0,     0,     0,     0,     0,
     0,   220,   223,   224,   225,   226,   227,   228,   229,   230,
   231,   232,   233,   234,   240,     0,     0,   235,   242,   236,
   237,   144,     0,     0,     0,   145,   146,     0,   241,     0,
     0,   276,   244,     0,     0,   273,     0,     0,     0,     0,
   147,     0,     0,     0,     0,     0,   279,     0,   283,     0,
     0,     0,     0,     0,     0,     0,     0,   278,   148,   149,
     0,   150,     0,     0,   284,     0,     0,     0,     0,     0,
     0,   151,   152,   153,   154,   155,     0,     0,   285,     0,
     0,     0,     0,   290,     0,   291,   292,   293,     0,     0,
     0,   287,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,    -1,     2,     0,     0,   303,
     0,   297,   300,     3,     4,     5,   302,     0,     0,     0,
     6,     7,     8,     9,    10,    11,    12,    13,     0,    14,
    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    25,     0,   118,   119,   120,   121,   122,   123,   124,     0,
     0,   127,   128,   129,    26,    27,    28,    29,   132,   133,
   134,   135,     0,   137,    30,    31,     0,    32,    33,     0,
     0,     0,     0,    34,     0,     0,    35,    36,     0,    37,
    38,    39,    40,    41,     0,    42
};

static const short yycheck[] = {     3,
    15,     4,    14,     4,     4,     4,     4,     4,    12,     4,
     4,     4,     4,    17,    48,    61,    66,    67,    33,    80,
    61,    25,     3,    11,    12,     3,    30,    31,     5,     3,
    34,     4,    66,    67,    80,    39,     3,    49,    13,    14,
     3,     3,     3,     3,     3,    49,    80,     3,    23,     3,
    53,    55,     3,     3,     3,     3,    71,    48,     5,     3,
     3,    36,    69,     3,    65,    40,    41,    42,    43,    44,
    45,    46,    47,    61,    66,    67,    14,    92,    48,    80,
    80,    80,    80,    80,    48,    80,    80,    80,     3,    66,
    67,    64,    65,    13,    14,     3,     6,   101,    36,    37,
    38,    39,    47,    23,    79,    80,   110,    14,     3,    47,
     3,    69,    47,    70,     6,     0,    36,     0,   130,   131,
    40,    41,    42,    43,    44,    45,    46,    47,    99,    36,
    37,    38,    39,    65,   138,   286,    -1,    -1,    -1,    -1,
    47,   145,   146,   147,   148,   149,   150,   151,   152,   153,
   154,   155,    -1,    -1,   158,   170,   160,    -1,    -1,    79,
    -1,    -1,    -1,   178,   168,   169,    -1,   171,    -1,    -1,
    -1,    -1,   176,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,   185,   186,   187,   188,   189,   190,   191,   192,   193,
   194,   195,   196,   197,   206,    -1,    -1,   201,   213,   203,
   204,     4,    -1,    -1,    -1,     8,     9,    -1,   212,    -1,
    -1,   223,   216,    -1,    -1,   219,    -1,    -1,    -1,    -1,
    23,    -1,    -1,    -1,    -1,    -1,   241,    -1,   243,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,   241,    41,    42,
    -1,    44,    -1,    -1,   256,    -1,    -1,    -1,    -1,    -1,
    -1,    54,    55,    56,    57,    58,    -1,    -1,   270,    -1,
    -1,    -1,    -1,   278,    -1,   280,   281,   282,    -1,    -1,
    -1,   275,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,     0,     1,    -1,    -1,   301,
    -1,   295,   296,     8,     9,    10,   300,    -1,    -1,    -1,
    15,    16,    17,    18,    19,    20,    21,    22,    -1,    24,
    25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
    35,    -1,    72,    73,    74,    75,    76,    77,    78,    -1,
    -1,    81,    82,    83,    49,    50,    51,    52,    88,    89,
    90,    91,    -1,    93,    59,    60,    -1,    62,    63,    -1,
    -1,    -1,    -1,    68,    -1,    -1,    71,    72,    -1,    74,
    75,    76,    77,    78,    -1,    80
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/lib/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 1, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */


#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

/* This is the parser code that is written into each bison parser
  when the %semantic_parser declaration is not specified in the grammar.
  It was written by Richard Stallman by simplifying the hairy parser
  used when %semantic_parser is specified.  */

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	return(0)
#define YYABORT 	return(1)
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.
   This remains here temporarily to ease the
   transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(token, value) \
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    { yychar = (token), yylval = (value);			\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

#ifndef YYPURE
#define YYLEX		yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX		yylex(&yylval, &yylloc)
#else
#define YYLEX		yylex(&yylval)
#endif
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	yychar;			/*  the lookahead symbol		*/
YYSTYPE	yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __yy_bcopy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (char *from, char *to, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 169 "/usr/lib/bison.simple"
int
yyparse()
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YYSTYPE *yyvsp;
  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
  int yychar1;		/*  lookahead token as an internal (translated) token number */

  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/

  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YYLSP_NEEDED
  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yysp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yysp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YYPURE
  int yychar;
  YYSTYPE yylval;
  int yynerrs;
#ifdef YYLSP_NEEDED
  YYLTYPE yylloc;
#endif
#endif

  YYSTYPE yyval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int yylen;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Starting parse\n");
#endif

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YYLSP_NEEDED
  yylsp = yyls;
#endif

/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
yynewstate:

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Give user a chance to reallocate the stack */
      /* Use copies of these so that the &'s don't force the real ones into memory. */
      YYSTYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
#ifdef YYLSP_NEEDED
		 &yyls1, size * sizeof (*yylsp),
#endif
		 &yystacksize);

      yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  yyerror("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

 yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise meaning
	     of a token, for further debugging info.  */
#ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
#endif
	  fprintf (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* count tokens shifted since error; after three, turn off error status.  */
  if (yyerrstatus) yyerrstatus--;

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

      fprintf (stderr, "Reducing via rule %d (line %d), ",
	       yyn, yyrline[yyn]);

      /* Print the symboles being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 10:
#line 118 "gram.y"
{ AddIconRegion(yyvsp[-4].ptr, yyvsp[-3].num, yyvsp[-2].num, yyvsp[-1].num, yyvsp[0].num); ;
    break;}
case 11:
#line 119 "gram.y"
{ if (Scr->FirstTime)
						  {
						    Scr->iconmgr.geometry=yyvsp[-1].ptr;
						    Scr->iconmgr.columns=yyvsp[0].num;
						  }
						;
    break;}
case 12:
#line 125 "gram.y"
{ if (Scr->FirstTime)
						    Scr->iconmgr.geometry = yyvsp[0].ptr;
						;
    break;}
case 13:
#line 128 "gram.y"
{ if (Scr->FirstTime)
					  {
						Scr->DoZoom = TRUE;
						Scr->ZoomCount = yyvsp[0].num;
					  }
					;
    break;}
case 14:
#line 134 "gram.y"
{ if (Scr->FirstTime) 
						Scr->DoZoom = TRUE; ;
    break;}
case 15:
#line 136 "gram.y"
{;
    break;}
case 16:
#line 137 "gram.y"
{;
    break;}
case 17:
#line 138 "gram.y"
{ list = &Scr->IconifyByUn; ;
    break;}
case 19:
#line 140 "gram.y"
{ if (Scr->FirstTime) 
		    Scr->IconifyByUnmapping = TRUE; ;
    break;}
case 20:
#line 142 "gram.y"
{ 
					  GotTitleButton (yyvsp[-2].ptr, yyvsp[0].num, False);
					;
    break;}
case 21:
#line 145 "gram.y"
{ 
					  GotTitleButton (yyvsp[-2].ptr, yyvsp[0].num, True);
					;
    break;}
case 22:
#line 148 "gram.y"
{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR);
					  Scr->Mouse[yyvsp[-1].num][C_ROOT][0].func = F_MENU;
					  Scr->Mouse[yyvsp[-1].num][C_ROOT][0].menu = root;
					;
    break;}
case 23:
#line 152 "gram.y"
{ Scr->Mouse[yyvsp[-1].num][C_ROOT][0].func = yyvsp[0].num;
					  if (yyvsp[0].num == F_MENU)
					  {
					    pull->prev = NULL;
					    Scr->Mouse[yyvsp[-1].num][C_ROOT][0].menu = pull;
					  }
					  else
					  {
					    root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
					    Scr->Mouse[yyvsp[-1].num][C_ROOT][0].item = 
						AddToMenu(root,"x",Action,
							  NULLSTR,yyvsp[0].num,NULLSTR,NULLSTR);
					  }
					  Action = "";
					  pull = NULL;
					;
    break;}
case 24:
#line 168 "gram.y"
{ GotKey(yyvsp[-1].ptr, yyvsp[0].num); ;
    break;}
case 25:
#line 169 "gram.y"
{ GotButton(yyvsp[-1].num, yyvsp[0].num); ;
    break;}
case 26:
#line 170 "gram.y"
{ list = &Scr->DontIconify; ;
    break;}
case 28:
#line 172 "gram.y"
{ list = &Scr->IconMgrNoShow; ;
    break;}
case 30:
#line 174 "gram.y"
{ Scr->IconManagerDontShow = TRUE; ;
    break;}
case 31:
#line 175 "gram.y"
{ list = &Scr->IconMgrs; ;
    break;}
case 33:
#line 177 "gram.y"
{ list = &Scr->IconMgrShow; ;
    break;}
case 35:
#line 179 "gram.y"
{ list = &Scr->NoTitleHighlight; ;
    break;}
case 37:
#line 181 "gram.y"
{ if (Scr->FirstTime)
						Scr->TitleHighlight = FALSE; ;
    break;}
case 38:
#line 183 "gram.y"
{ list = &Scr->NoHighlight; ;
    break;}
case 40:
#line 185 "gram.y"
{ if (Scr->FirstTime)
						Scr->Highlight = FALSE; ;
    break;}
case 41:
#line 187 "gram.y"
{ list = &Scr->NoStackModeL; ;
    break;}
case 43:
#line 189 "gram.y"
{ if (Scr->FirstTime)
						Scr->StackMode = FALSE; ;
    break;}
case 44:
#line 191 "gram.y"
{ list = &Scr->NoTitle; ;
    break;}
case 46:
#line 193 "gram.y"
{ if (Scr->FirstTime)
						Scr->NoTitlebar = TRUE; ;
    break;}
case 47:
#line 195 "gram.y"
{ list = &Scr->MakeTitle; ;
    break;}
case 49:
#line 197 "gram.y"
{ list = &Scr->StartIconified; ;
    break;}
case 51:
#line 199 "gram.y"
{ list = &Scr->AutoRaise; ;
    break;}
case 53:
#line 201 "gram.y"
{
					root = GetRoot(yyvsp[-5].ptr, yyvsp[-3].ptr, yyvsp[-1].ptr); ;
    break;}
case 54:
#line 203 "gram.y"
{ root->real_menu = TRUE;;
    break;}
case 55:
#line 204 "gram.y"
{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR); ;
    break;}
case 56:
#line 205 "gram.y"
{ root->real_menu = TRUE; ;
    break;}
case 57:
#line 206 "gram.y"
{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR); ;
    break;}
case 59:
#line 208 "gram.y"
{ list = &Scr->IconNames; ;
    break;}
case 61:
#line 210 "gram.y"
{ color = COLOR; ;
    break;}
case 64:
#line 214 "gram.y"
{ color = MONOCHROME; ;
    break;}
case 66:
#line 216 "gram.y"
{ Scr->DefaultFunction.func = yyvsp[0].num;
					  if (yyvsp[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,yyvsp[0].num, NULLSTR, NULLSTR);
					  }
					  Action = "";
					  pull = NULL;
					;
    break;}
case 67:
#line 232 "gram.y"
{ Scr->WindowFunction.func = yyvsp[0].num;
					   root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
					   Scr->WindowFunction.item = 
						AddToMenu(root,"x",Action,
							  NULLSTR,yyvsp[0].num, NULLSTR, NULLSTR);
					   Action = "";
					   pull = NULL;
					;
    break;}
case 68:
#line 240 "gram.y"
{ list = &Scr->WarpCursorL; ;
    break;}
case 70:
#line 242 "gram.y"
{ if (Scr->FirstTime) 
					    Scr->WarpCursor = TRUE; ;
    break;}
case 71:
#line 244 "gram.y"
{ list = &Scr->WindowRingL; ;
    break;}
case 73:
#line 246 "gram.y"
{ list = &Scr->NailedDown; ;
    break;}
case 75:
#line 249 "gram.y"
{ SetVirtualDesktop(yyvsp[-1].ptr, yyvsp[0].num); ;
    break;}
case 76:
#line 250 "gram.y"
{ list = &Scr->DontShowInDisplay; ;
    break;}
case 78:
#line 255 "gram.y"
{ if (!do_single_keyword (yyvsp[0].num)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
					"unknown singleton keyword %d\n",
						     yyvsp[0].num);
					    ParseError = 1;
					  }
					;
    break;}
case 79:
#line 265 "gram.y"
{ if (!do_string_keyword (yyvsp[-1].num, yyvsp[0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
				"unknown string keyword %d (value \"%s\")\n",
						     yyvsp[-1].num, yyvsp[0].ptr);
					    ParseError = 1;
					  }
					;
    break;}
case 80:
#line 275 "gram.y"
{ if (!do_number_keyword (yyvsp[-1].num, yyvsp[0].num)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
				"unknown numeric keyword %d (value %d)\n",
						     yyvsp[-1].num, yyvsp[0].num);
					    ParseError = 1;
					  }
					;
    break;}
case 81:
#line 287 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
case 82:
#line 290 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
case 85:
#line 297 "gram.y"
{ mods |= Mod1Mask; ;
    break;}
case 86:
#line 298 "gram.y"
{ mods |= ShiftMask; ;
    break;}
case 87:
#line 299 "gram.y"
{ mods |= LockMask; ;
    break;}
case 88:
#line 300 "gram.y"
{ mods |= ControlMask; ;
    break;}
case 89:
#line 301 "gram.y"
{ if (yyvsp[0].num < 1 || yyvsp[0].num > 5) {
					     twmrc_error_prefix();
					     fprintf (stderr, 
				"bad modifier number (%d), must be 1-5\n",
						      yyvsp[0].num);
					     ParseError = 1;
					  } else {
					     mods |= (Mod1Mask << (yyvsp[0].num - 1));
					  }
					;
    break;}
case 90:
#line 311 "gram.y"
{ ;
    break;}
case 93:
#line 318 "gram.y"
{ cont |= C_WINDOW_BIT; ;
    break;}
case 94:
#line 319 "gram.y"
{ cont |= C_TITLE_BIT; ;
    break;}
case 95:
#line 320 "gram.y"
{ cont |= C_ICON_BIT; ;
    break;}
case 96:
#line 321 "gram.y"
{ cont |= C_ROOT_BIT; ;
    break;}
case 97:
#line 322 "gram.y"
{ cont |= C_FRAME_BIT; ;
    break;}
case 98:
#line 323 "gram.y"
{ cont |= C_ICONMGR_BIT; ;
    break;}
case 99:
#line 324 "gram.y"
{ cont |= C_ICONMGR_BIT; ;
    break;}
case 100:
#line 325 "gram.y"
{ cont |= C_VIRTUAL_BIT; ;
    break;}
case 101:
#line 326 "gram.y"
{ cont |= C_VIRTUAL_WIN_BIT; ;
    break;}
case 102:
#line 327 "gram.y"
{ cont |= C_DOOR_BIT; ;
    break;}
case 103:
#line 328 "gram.y"
{ cont |= C_ALL_BITS; ;
    break;}
case 104:
#line 329 "gram.y"
{  ;
    break;}
case 107:
#line 336 "gram.y"
{ cont |= C_WINDOW_BIT; ;
    break;}
case 108:
#line 337 "gram.y"
{ cont |= C_TITLE_BIT; ;
    break;}
case 109:
#line 338 "gram.y"
{ cont |= C_ICON_BIT; ;
    break;}
case 110:
#line 339 "gram.y"
{ cont |= C_ROOT_BIT; ;
    break;}
case 111:
#line 340 "gram.y"
{ cont |= C_FRAME_BIT; ;
    break;}
case 112:
#line 341 "gram.y"
{ cont |= C_ICONMGR_BIT; ;
    break;}
case 113:
#line 342 "gram.y"
{ cont |= C_ICONMGR_BIT; ;
    break;}
case 114:
#line 343 "gram.y"
{ cont |= C_VIRTUAL_BIT; ;
    break;}
case 115:
#line 344 "gram.y"
{ cont |= C_VIRTUAL_WIN_BIT; ;
    break;}
case 116:
#line 345 "gram.y"
{ cont |= C_DOOR_BIT; ;
    break;}
case 117:
#line 346 "gram.y"
{ cont |= C_ALL_BITS; ;
    break;}
case 118:
#line 347 "gram.y"
{ ;
    break;}
case 119:
#line 348 "gram.y"
{ Name = yyvsp[0].ptr; cont |= C_NAME_BIT; ;
    break;}
case 123:
#line 359 "gram.y"
{ SetHighlightPixmap (yyvsp[0].ptr); ;
    break;}
case 127:
#line 370 "gram.y"
{
			NewBitmapCursor(&Scr->FrameCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 128:
#line 372 "gram.y"
{
			NewFontCursor(&Scr->FrameCursor, yyvsp[0].ptr); ;
    break;}
case 129:
#line 374 "gram.y"
{
			NewBitmapCursor(&Scr->TitleCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 130:
#line 376 "gram.y"
{
			NewFontCursor(&Scr->TitleCursor, yyvsp[0].ptr); ;
    break;}
case 131:
#line 378 "gram.y"
{
			NewBitmapCursor(&Scr->IconCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 132:
#line 380 "gram.y"
{
			NewFontCursor(&Scr->IconCursor, yyvsp[0].ptr); ;
    break;}
case 133:
#line 382 "gram.y"
{
			NewBitmapCursor(&Scr->IconMgrCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 134:
#line 384 "gram.y"
{
			NewFontCursor(&Scr->IconMgrCursor, yyvsp[0].ptr); ;
    break;}
case 135:
#line 386 "gram.y"
{
			NewBitmapCursor(&Scr->ButtonCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 136:
#line 388 "gram.y"
{
			NewFontCursor(&Scr->ButtonCursor, yyvsp[0].ptr); ;
    break;}
case 137:
#line 390 "gram.y"
{
			NewBitmapCursor(&Scr->MoveCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 138:
#line 392 "gram.y"
{
			NewFontCursor(&Scr->MoveCursor, yyvsp[0].ptr); ;
    break;}
case 139:
#line 394 "gram.y"
{
			NewBitmapCursor(&Scr->ResizeCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 140:
#line 396 "gram.y"
{
			NewFontCursor(&Scr->ResizeCursor, yyvsp[0].ptr); ;
    break;}
case 141:
#line 398 "gram.y"
{
			NewBitmapCursor(&Scr->WaitCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 142:
#line 400 "gram.y"
{
			NewFontCursor(&Scr->WaitCursor, yyvsp[0].ptr); ;
    break;}
case 143:
#line 402 "gram.y"
{
			NewBitmapCursor(&Scr->MenuCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 144:
#line 404 "gram.y"
{
			NewFontCursor(&Scr->MenuCursor, yyvsp[0].ptr); ;
    break;}
case 145:
#line 406 "gram.y"
{
			NewBitmapCursor(&Scr->SelectCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 146:
#line 408 "gram.y"
{
			NewFontCursor(&Scr->SelectCursor, yyvsp[0].ptr); ;
    break;}
case 147:
#line 410 "gram.y"
{
			NewBitmapCursor(&Scr->DestroyCursor, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 148:
#line 412 "gram.y"
{
			NewFontCursor(&Scr->DestroyCursor, yyvsp[0].ptr); ;
    break;}
case 152:
#line 424 "gram.y"
{ if (!do_colorlist_keyword (yyvsp[-1].num, color,
								     yyvsp[0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled list color keyword %d (string \"%s\")\n",
						     yyvsp[-1].num, yyvsp[0].ptr);
					    ParseError = 1;
					  }
					;
    break;}
case 153:
#line 433 "gram.y"
{ list = do_colorlist_keyword(yyvsp[-1].num,color,
								      yyvsp[0].ptr);
					  if (!list) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled color list keyword %d (string \"%s\")\n",
						     yyvsp[-1].num, yyvsp[0].ptr);
					    ParseError = 1;
					  }
					;
    break;}
case 155:
#line 444 "gram.y"
{ if (!do_color_keyword (yyvsp[-1].num, color,
								 yyvsp[0].ptr)) {
					    twmrc_error_prefix();
					    fprintf (stderr,
			"unhandled color keyword %d (string \"%s\")\n",
						     yyvsp[-1].num, yyvsp[0].ptr);
					    ParseError = 1;
					  }
					;
    break;}
case 159:
#line 462 "gram.y"
{ do_string_savecolor(color, yyvsp[0].ptr); ;
    break;}
case 160:
#line 463 "gram.y"
{ do_var_savecolor(yyvsp[0].num); ;
    break;}
case 164:
#line 473 "gram.y"
{ if (Scr->FirstTime &&
					      color == Scr->Monochrome)
					    AddToList(list, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 165:
#line 478 "gram.y"
{ 
				    if (HasShape) Scr->SqueezeTitle = TRUE;
				;
    break;}
case 166:
#line 481 "gram.y"
{ list = &Scr->SqueezeTitleL; 
				  if (HasShape && Scr->SqueezeTitle == -1)
				    Scr->SqueezeTitle = TRUE;
				;
    break;}
case 168:
#line 486 "gram.y"
{ Scr->SqueezeTitle = FALSE; ;
    break;}
case 169:
#line 487 "gram.y"
{ list = &Scr->DontSqueezeTitleL; ;
    break;}
case 172:
#line 492 "gram.y"
{
				if (Scr->FirstTime) {
				   do_squeeze_entry (list, yyvsp[-3].ptr, yyvsp[-2].num, yyvsp[-1].num, yyvsp[0].num);
				}
			;
    break;}
case 176:
#line 507 "gram.y"
{
				(void) door_add(yyvsp[-2].ptr, yyvsp[-1].ptr, yyvsp[0].ptr);
			;
    break;}
case 180:
#line 519 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yyvsp[-2].ptr, (char *)
						AllocateIconManager(yyvsp[-2].ptr, NULLSTR,
							yyvsp[-1].ptr,yyvsp[0].num));
					;
    break;}
case 181:
#line 525 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yyvsp[-3].ptr, (char *)
						AllocateIconManager(yyvsp[-3].ptr,yyvsp[-2].ptr,
						yyvsp[-1].ptr, yyvsp[0].num));
					;
    break;}
case 185:
#line 539 "gram.y"
{ if (Scr->FirstTime)
					    AddToList(list, yyvsp[0].ptr, 0);
					;
    break;}
case 189:
#line 551 "gram.y"
{ if (Scr->FirstTime) AddToList(list, yyvsp[-1].ptr, yyvsp[0].ptr); ;
    break;}
case 193:
#line 561 "gram.y"
{ AddToMenu(root, "", Action, NULLSTR, yyvsp[0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					;
    break;}
case 197:
#line 574 "gram.y"
{ AddToMenu(root, yyvsp[-1].ptr, Action, pull, yyvsp[0].num,
						NULLSTR, NULLSTR);
					  Action = "";
					  pull = NULL;
					;
    break;}
case 198:
#line 579 "gram.y"
{
					  AddToMenu(root, yyvsp[-6].ptr, Action, pull, yyvsp[0].num,
						yyvsp[-4].ptr, yyvsp[-2].ptr);
					  Action = "";
					  pull = NULL;
					;
    break;}
case 199:
#line 587 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
case 200:
#line 588 "gram.y"
{
				yyval.num = yyvsp[-1].num;
				Action = yyvsp[0].ptr;
				switch (yyvsp[-1].num) {
				  case F_MENU:
				    pull = GetRoot (yyvsp[0].ptr, NULLSTR,NULLSTR);
				    pull->prev = root;
				    break;
				  case F_WARPRING:
				    if (!CheckWarpRingArg (Action)) {
					twmrc_error_prefix();
					fprintf (stderr,
			"ignoring invalid f.warptoring argument \"%s\"\n",
						 Action);
					yyval.num = F_NOP;
				    }
				  case F_WARPTOSCREEN:
				    if (!CheckWarpScreenArg (Action)) {
					twmrc_error_prefix();
					fprintf (stderr, 
			"ignoring invalid f.warptoscreen argument \"%s\"\n", 
					         Action);
					yyval.num = F_NOP;
				    }
				    break;
				  case F_COLORMAP:
				    if (CheckColormapArg (Action)) {
					yyval.num = F_COLORMAP;
				    } else {
					twmrc_error_prefix();
					fprintf (stderr,
			"ignoring invalid f.colormap argument \"%s\"\n", 
						 Action);
					yyval.num = F_NOP;
				    }
				    break;
				} /* end switch */
				   ;
    break;}
case 201:
#line 629 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
case 202:
#line 630 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
case 203:
#line 631 "gram.y"
{ yyval.num = -(yyvsp[0].num); ;
    break;}
case 204:
#line 634 "gram.y"
{ yyval.num = yyvsp[0].num;
					  if (yyvsp[0].num == 0)
						yyerror("bad button 0");

					  if (yyvsp[0].num > MAX_BUTTONS)
					  {
						yyval.num = 0;
						yyerror("button number too large");
					  }
					;
    break;}
case 205:
#line 646 "gram.y"
{ ptr = (char *)malloc(strlen(yyvsp[0].ptr)+1);
					  strcpy(ptr, yyvsp[0].ptr);
					  RemoveDQuote(ptr);
					  yyval.ptr = ptr;
					;
    break;}
case 206:
#line 651 "gram.y"
{ yyval.num = yyvsp[0].num; ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 440 "/usr/lib/bison.simple"

  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;

#ifdef YYLSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = yylloc.first_line;
      yylsp->first_column = yylloc.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#endif

  /* Now "shift" the result of the reduction.
     Determine what state that goes to,
     based on the state we popped back to
     and the rule number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;

yyerrlab:   /* here on detecting error */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) xmalloc(size + 15);
	  strcpy(msg, "parse error");

	  if (count < 5)
	    {
	      count = 0;
	      for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
		if (yycheck[x + yyn] == x)
		  {
		    strcat(msg, count == 0 ? ", expecting `" : " or `");
		    strcat(msg, yytname[x]);
		    strcat(msg, "'");
		    count++;
		  }
	    }
	  yyerror(msg);
	  free(msg);
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

yyerrlab1:   /* here on error raised explicitly by an action */

  if (yyerrstatus == 3)
    {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif

      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token
     after shifting the error token.  */

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;

yyerrdefault:  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG != 0
  if (yydebug)
    {
      short *ssp1 = yyss - 1;
      fprintf (stderr, "Error: state stack now");
      while (ssp1 != yyssp)
	fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

yyerrhandle:

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;
}
#line 654 "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);
}
