[alt.sources.amiga] sc Part 2 of 9

sie@fulcrum.bt.co.uk (Simon Raybould) (03/20/91)

#!/bin/sh
# this is scshr.02 (part 2 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file gram.c continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 2; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping gram.c'
else
echo 'x - continuing file gram.c'
sed 's/^X//' << 'SHAR_EOF' >> 'gram.c' &&
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,     0,   198,   396,   199,   200,   201,
X   202,   203,   204,   205,   206,   207,   208,   209,   210,   211,
X     0,     0,   198,   397,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,     0,   198,
X   398,   199,   200,   201,   202,   203,   204,   205,   206,   207,
X   208,   209,   210,   211,     0,     0,   198,   399,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,     0,   198,   400,   199,   200,   201,   202,   203,
X   204,   205,   206,   207,   208,   209,   210,   211,     0,     0,
X   198,   401,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,     0,   198,   402,   199,
X   200,   201,   202,   203,   204,   205,   206,   207,   208,   209,
X   210,   211,     0,     0,   198,   435,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X     0,   198,   436,   199,   200,   201,   202,   203,   204,   205,
X   206,   207,   208,   209,   210,   211,     0,     0,   198,   437,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,     0,   198,   438,   199,   200,   201,
X   202,   203,   204,   205,   206,   207,   208,   209,   210,   211,
X     0,     0,   198,   439,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,     0,   198,
X   440,   199,   200,   201,   202,   203,   204,   205,   206,   207,
X   208,   209,   210,   211,     0,     0,   198,   442,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   271,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   353,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   354,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   355,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   356,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   358,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   359,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   360,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   361,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   362,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   364,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   365,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   367,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   368,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   369,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   370,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   371,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   376,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   382,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   383,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   384,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   385,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   386,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   387,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   388,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   393,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   428,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   429,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   430,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   434,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   441,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   443,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   444,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   445,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   446,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   462,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   463,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   464,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X   198,   465,   199,   200,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211,     0,   198,   466,   199,   200,
X   201,   202,   203,   204,   205,   206,   207,   208,   209,   210,
X   211,     0,   198,   467,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,     0,   198,   468,
X   199,   200,   201,   202,   203,   204,   205,   206,   207,   208,
X   209,   210,   211,     0,   198,   469,   199,   200,   201,   202,
X   203,   204,   205,   206,   207,   208,   209,   210,   211,     0,
X     0,   470,   198,   344,   199,   200,   201,   202,   203,   204,
X   205,   206,   207,   208,   209,   210,   211,   198,     0,   199,
X   200,   201,   202,   203,   204,   205,   206,   207,   208,   209,
X   210,   211,   200,   201,   202,   203,   204,   205,   206,   207,
X   208,   209,   210,   211,   201,   202,   203,   204,   205,   206,
X   207,   208,   209,   210,   211
};
X
static CONST short yycheck[] = {     3,
X     4,     5,     6,     7,     8,     9,    10,    11,    12,     4,
X    14,    15,    16,    17,    18,    19,    20,     4,     5,     4,
X     5,     3,     4,     5,     9,     7,     4,     9,     9,    14,
X    15,    16,    36,    18,    19,    39,    40,    41,     9,     3,
X     4,     5,   103,     7,     3,     9,   103,     4,     7,    31,
X     9,    55,   107,     3,     4,     5,    41,     7,     7,     9,
X     9,     4,   119,    67,    87,    88,     9,    31,    50,     3,
X     4,     5,     6,     7,   107,     9,     6,     7,   107,     9,
X   107,    31,   103,     4,   103,    16,    50,     3,     4,     5,
X     6,     7,   108,     9,   110,   111,   112,    31,     4,   115,
X    50,     4,     5,     6,     7,     9,     9,     4,   103,     4,
X    68,    69,    70,     9,    72,   107,    50,    48,    49,    50,
X    51,     4,     4,   110,   111,   107,     9,   109,   110,   111,
X   113,   114,   115,   116,   107,   117,   118,     4,     4,   121,
X   122,     4,    12,   107,   122,   109,   110,   111,   118,    80,
X   119,   120,   118,   117,   118,   118,   114,   121,   122,   109,
X   110,   111,   118,   122,   118,   122,    36,   117,   118,    39,
X    40,   121,   122,   122,   118,   109,   110,   111,    99,   100,
X   101,   119,   120,   117,   118,    55,   118,   121,   122,   118,
X   118,   118,   122,   118,   110,   111,   118,   107,   118,     7,
X     8,   118,    10,    11,   118,   118,   122,   110,   111,    17,
X   118,   118,    20,   118,   218,   219,   220,   221,   222,   122,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,   218,   219,   220,   221,   222,   242,   243,
X   198,   199,   200,   201,   202,   203,   118,   205,   206,   207,
X   208,   209,   210,   211,    87,    88,   118,   242,   243,   118,
X    93,    94,    95,    96,    97,   223,   224,   225,   226,   227,
X   228,   229,   230,   231,   232,   233,   234,   235,   236,   237,
X   238,   239,   240,   241,   242,   243,   244,   245,   246,   247,
X   248,   249,   250,   251,   252,   253,   254,   255,   256,   257,
X   258,   259,   260,   261,   262,   263,   264,   265,   266,   267,
X   268,   269,   270,   118,   118,   118,   118,   275,   118,   118,
X   278,   118,   280,    32,    33,    34,    35,    36,    37,    38,
X    39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
X    49,   118,    51,    52,    53,    54,    55,    56,    57,    58,
X    59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
X    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
X    79,    80,    81,    82,    83,    84,    85,    86,   110,   111,
X   112,   113,   114,   115,   116,   118,   344,   118,   118,   118,
X   118,   118,   118,   118,   398,   399,   400,   401,   402,   357,
X   118,   118,   118,   118,   118,   363,   118,   118,   366,   119,
X   118,   118,   118,   398,   399,   400,   401,   402,   118,   377,
X   378,   379,   380,   381,   118,   118,   118,   118,   116,   119,
X   119,   389,   390,   391,   392,   119,   394,   395,   396,   397,
X   119,    87,    88,    89,    90,    91,    92,    93,    94,    95,
X    96,    97,    98,   119,   119,   119,     0,   120,   120,   119,
X   119,     0,   374,   109,    -1,    -1,    -1,    -1,    -1,    -1,
X    -1,    -1,    -1,    -1,   432,   121,    -1,   435,   436,   437,
X   438,   439,   440,    -1,   442,     0,     1,    -1,    -1,    -1,
X   448,   449,    -1,    -1,    -1,    10,    11,    12,    13,    14,
X    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
X    25,    26,    27,    28,    29,    30,   102,    -1,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,    -1,   102,   120,   104,   105,   106,   107,   108,
X   109,   110,   111,   112,   113,   114,   115,   116,    -1,    -1,
X   102,   120,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,    -1,   102,   120,   104,
X   105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
X   115,   116,    -1,    -1,   102,   120,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X    -1,   102,   120,   104,   105,   106,   107,   108,   109,   110,
X   111,   112,   113,   114,   115,   116,    -1,    -1,   102,   120,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,    -1,   102,   120,   104,   105,   106,
X   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
X    -1,    -1,   102,   120,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,    -1,   102,
X   120,   104,   105,   106,   107,   108,   109,   110,   111,   112,
X   113,   114,   115,   116,    -1,    -1,   102,   120,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,    -1,   102,   120,   104,   105,   106,   107,   108,
X   109,   110,   111,   112,   113,   114,   115,   116,    -1,    -1,
X   102,   120,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,    -1,   102,   120,   104,
X   105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
X   115,   116,    -1,    -1,   102,   120,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X    -1,   102,   120,   104,   105,   106,   107,   108,   109,   110,
X   111,   112,   113,   114,   115,   116,    -1,    -1,   102,   120,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,    -1,   102,   120,   104,   105,   106,
X   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
X    -1,    -1,   102,   120,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,    -1,   102,
X   120,   104,   105,   106,   107,   108,   109,   110,   111,   112,
X   113,   114,   115,   116,    -1,    -1,   102,   120,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,    -1,   102,   120,   104,   105,   106,   107,   108,
X   109,   110,   111,   112,   113,   114,   115,   116,    -1,    -1,
X   102,   120,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,    -1,   102,   120,   104,
X   105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
X   115,   116,    -1,    -1,   102,   120,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X    -1,   102,   120,   104,   105,   106,   107,   108,   109,   110,
X   111,   112,   113,   114,   115,   116,    -1,    -1,   102,   120,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,    -1,   102,   120,   104,   105,   106,
X   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
X    -1,    -1,   102,   120,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,    -1,   102,
X   120,   104,   105,   106,   107,   108,   109,   110,   111,   112,
X   113,   114,   115,   116,    -1,    -1,   102,   120,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X   102,   119,   104,   105,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116,    -1,   102,   119,   104,   105,
X   106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
X   116,    -1,   102,   119,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,    -1,   102,   119,
X   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
X   114,   115,   116,    -1,   102,   119,   104,   105,   106,   107,
X   108,   109,   110,   111,   112,   113,   114,   115,   116,    -1,
X    -1,   119,   102,   103,   104,   105,   106,   107,   108,   109,
X   110,   111,   112,   113,   114,   115,   116,   102,    -1,   104,
X   105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
X   115,   116,   105,   106,   107,   108,   109,   110,   111,   112,
X   113,   114,   115,   116,   106,   107,   108,   109,   110,   111,
X   112,   113,   114,   115,   116
};
#define YYPURE 1
X
#line 2 "bison.simple"
X
/* Skeleton output parser for bison,
X   copyright (C) 1984 Bob Corbett and Richard Stallman
X
X                       NO WARRANTY
X
X  BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT
WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
CORRECTION.
X
X IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
X
X                GENERAL PUBLIC LICENSE TO COPY
X
X  1. You may copy and distribute verbatim copies of this source file
as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy a valid copyright notice "Copyright
(C) 1985 Free Software Foundation, Inc."; and include following the
copyright notice a verbatim copy of the above disclaimer of warranty
and of this License.  You may charge a distribution fee for the
physical act of transferring a copy.
X
X  2. You may modify your copy or copies of this source file or
any portion of it, and copy and distribute such modifications under
the terms of Paragraph 1 above, provided that you also do the following:
X
X    a) cause the modified files to carry prominent notices stating
X    that you changed the files and the date of any change; and
X
X    b) cause the whole of any work that you distribute or publish,
X    that in whole or in part contains or is a derivative of this
X    program or any part thereof, to be licensed at no charge to all
X    third parties on terms identical to those contained in this
X    License Agreement (except that you may choose to grant more extensive
X    warranty protection to some or all third parties, at your option).
X
X    c) You may charge a distribution fee for the physical act of
X    transferring a copy, and you may at your option offer warranty
X    protection in exchange for a fee.
X
Mere aggregation of another unrelated program with this program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other program under the scope of these terms.
X
X  3. You may copy and distribute this program (or a portion or derivative
of it, under Paragraph 2) in object code or executable form under the terms
of Paragraphs 1 and 2 above provided that you also do one of the following:
X
X    a) accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of
X    Paragraphs 1 and 2 above; or,
X
X    b) accompany it with a written offer, valid for at least three
X    years, to give any third party free (except for a nominal
X    shipping charge) a complete machine-readable copy of the
X    corresponding source code, to be distributed under the terms of
X    Paragraphs 1 and 2 above; or,
X
X    c) accompany it with the information you received as to where the
X    corresponding source code may be obtained.  (This alternative is
X    allowed only for noncommercial distribution and only if you
X    received the program in object code or executable form alone.)
X
For an executable file, complete source code means all the source code for
all modules it contains; but, as a special exception, it need not include
source code for modules which are standard libraries that accompany the
operating system on which the executable file runs.
X
X  4. You may not copy, sublicense, distribute or transfer this program
except as expressly provided under this License Agreement.  Any attempt
otherwise to copy, sublicense, distribute or transfer this program is void and
your rights to use the program under this License agreement shall be
automatically terminated.  However, parties who have received computer
software programs from you with this License Agreement will not have
their licenses terminated so long as such parties remain in full compliance.
X
X  5. If you wish to incorporate parts of this program into other free
programs whose distribution conditions are different, write to the Free
Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not yet
worked out a simple rule that can be stated here, but we will often permit
this.  We will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing and reuse of
software.
X
X
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them.   Help stamp out software-hoarding!  */
X
/* This is the parser code that is written into each bison parser
X  when the %semantic_parser declaration is not specified in the grammar.
X  It was written by Richard Stallman by simplifying the hairy parser
X  used when %semantic_parser is specified.  */
X
/* Note: there must be only one dollar sign in this file.
X   It is replaced by the list of actions, each action
X   as one case of the switch.  */
X
#ifdef AMIGA
X
#define bzero(b, length) memset((b),'\0',(length))
#define bcopy(b1, b2, length) memcpy((b1),(b2),(length))
#define bcmp(b1, b2, length)  memcmp((b1),(b2),(length))
X
void
memory_full ()
{
X  printf ("Memory exhausted.\n");
X  exit(1);
}
X
X
char *
bison_xmalloc (size)
X     int size;
{
X  extern char *malloc ();
X  register char *ptr = malloc (size);
X  if (ptr != 0) return (ptr);
X  memory_full ();
X  /*NOTREACHED*/
}
X
char *
xrealloc (old, size)
X     char *old;
X     int size;
{
X  extern char *realloc ();
X  register char *ptr = realloc (old, size);
X  if (ptr != 0) return (ptr);
X  memory_full ();
X  /*NOTREACHED*/
}
X
char *
xcalloc (number, size)
X     int number, size;
{
X  extern char *malloc ();
X  register int total = number * size;
X  register char *ptr = malloc (total);
X  if (ptr != 0)
X    {
X      if (total > 100)
X        bzero (ptr, total);
X      else {
X        /* It's not too long, so loop, zeroing by longs.
X           It must be safe because malloc values are always well aligned.  */
X        register long *zp = (long *) ptr;
X        register long *zl = (long *) (ptr + total - 4);
X        register int i = total - 4;
X        while (zp < zl)
X          *zp++ = 0;
X        if (i < 0)
X          i = 0;
X        while (i < total)
X          ptr[i++] = 0;
X      }
X      return ptr;
X    }
X  memory_full ();
X  /*NOTREACHED*/
}
X
/*
X        alloca -- (mostly) portable public-domain implementation -- D A Gwyn
X
X        last edit:      86/05/30        rms
X           include config.h, since on VMS it renames some symbols.
X           Use bison_xmalloc instead of malloc.
X
X        This implementation of the PWB library alloca() function,
X        which is used to allocate space off the run-time stack so
X        that it is automatically reclaimed upon procedure exit,
X        was inspired by discussions with J. Q. Johnson of Cornell.
X
X        It should work under any C implementation that uses an
X        actual procedure stack (as opposed to a linked list of
X        frames).  There are some preprocessor constants that can
X        be defined when compiling for your specific system, for
X        improved efficiency; however, the defaults should be okay.
X
X        The general concept of this implementation is to keep
X        track of all alloca()-allocated blocks, and reclaim any
X        that are found to be deeper in the stack than the current
X        invocation.  This heuristic does not reclaim storage as
X        soon as it becomes invalid, but it will do so eventually.
X
X        As a special case, alloca(0) reclaims storage without
X        allocating any.  It is a good idea to use alloca(0) in
X        your main control loop, etc. to force garbage collection.
*/
X
typedef char    *pointer;               /* generic pointer type */
X
extern void     free();
extern pointer  bison_xmalloc();
X
/*
X        Define STACK_DIRECTION if you know the direction of stack
X        growth for your system; otherwise it will be automatically
X        deduced at run-time.
X
X        STACK_DIRECTION > 0 => grows toward higher addresses
X        STACK_DIRECTION < 0 => grows toward lower addresses
X        STACK_DIRECTION = 0 => direction of growth unknown
*/
X
#define STACK_DIRECTION -1
X
#define STACK_DIR       STACK_DIRECTION /* known at compile-time */
X
/*
X        An "alloca header" is used to:
X        (a) chain together all alloca()ed blocks;
X        (b) keep track of stack depth.
X
X        It is very important that sizeof(header) agree with malloc()
X        alignment chunk size.  The following default should work okay.
*/
X
#ifndef ALIGN_SIZE
#define ALIGN_SIZE      sizeof(double)
#endif
X
typedef union hdr
{
X  char  align[ALIGN_SIZE];      /* to force sizeof(header) */
X  struct
X    {
X      union hdr *next;          /* for chaining headers */
X      char *deep;               /* for stack depth measure */
X    } h;
} header;
X
/*
X        alloca( size ) returns a pointer to at least `size' bytes of
X        storage which will be automatically reclaimed upon exit from
X        the procedure that called alloca().  Originally, this space
X        was supposed to be taken from the current stack frame of the
X        caller, but that method cannot be made to work for some
X        implementations of C, for example under Gould's UTX/32.
*/
X
static header *last_alloca_header = NULL; /* -> last alloca header */
X
pointer
alloca (size)                   /* returns pointer to storage */
X     unsigned   size;           /* # bytes to allocate */
{
X  auto char     probe;          /* probes stack depth: */
X  register char *depth = &probe;
X
X                                /* Reclaim garbage, defined as all alloca()ed storage that
X                                   was allocated from deeper in the stack than currently. */
X
X  {
X    register header     *hp;    /* traverses linked list */
X
X    for (hp = last_alloca_header; hp != NULL;)
X      if (STACK_DIR > 0 && hp->h.deep > depth
X          || STACK_DIR < 0 && hp->h.deep < depth)
X        {
X          register header       *np = hp->h.next;
X
X          free ((pointer) hp);  /* collect garbage */
X
X          hp = np;              /* -> next header */
X        }
X      else
X        break;                  /* rest are not deeper */
X
X    last_alloca_header = hp;    /* -> last valid storage */
X  }
X
X  if (size == 0)
X    return NULL;                /* no allocation required */
X
X  /* Allocate combined header + user data storage. */
X
X  {
X    register pointer    new = bison_xmalloc (sizeof (header) + size);
X    /* address of header */
X
X    ((header *)new)->h.next = last_alloca_header;
X    ((header *)new)->h.deep = depth;
X
X    last_alloca_header = (header *)new;
X
X    /* User storage begins just after header. */
X
X    return (pointer)((char *)new + sizeof(header));
X  }
}
#endif
X
X
X
#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (yychar = YYEMPTY)
#define YYEMPTY         -2
#define YYEOF           0
#define YYFAIL          goto yyerrlab;
X
#define YYTERROR        1
X
#ifndef YYIMPURE
#define YYLEX           yylex()
#endif
X
#ifndef YYPURE
#define YYLEX           yylex(&yylval, &yylloc)
#endif
X
/* If nonreentrant, generate the variables here */
X
#ifndef YYIMPURE
X
int     yychar;                 /*  the lookahead symbol                */
YYSTYPE yylval;                 /*  the semantic value of the           */
X                                /*  lookahead symbol                    */
X
YYLTYPE yylloc;                 /*  location data for the lookahead     */
X                                /*  symbol                              */
X
int yynerr;                     /*  number of parse errors so far       */
X
#ifdef YYDEBUG
int yydebug = 0;                /*  nonzero means print parse trace     */
#endif
X
#endif  /* YYIMPURE */
X
X
/*  YYMAXDEPTH indicates the initial size of the parser's stacks        */
X
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 200
#endif
X
/*  YYMAXLIMIT is the maximum size the stacks can grow to
X    (effective only if the built-in stack extension method is used).  */
X
#ifndef YYMAXLIMIT
#define YYMAXLIMIT 10000
#endif
X
X
#line 165 "bison.simple"
int
yyparse()
{
X  register int yystate;
X  register int yyn;
X  register short *yyssp;
X  register YYSTYPE *yyvsp;
X  YYLTYPE *yylsp;
X  int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
X  int yychar1;          /*  lookahead token as an internal (translated) token number */
X
X  short yyssa[YYMAXDEPTH];      /*  the state stack                     */
X  YYSTYPE yyvsa[YYMAXDEPTH];    /*  the semantic value stack            */
X  YYLTYPE yylsa[YYMAXDEPTH];    /*  the location stack                  */
X
X  short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
X  YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
X  YYLTYPE *yyls = yylsa;
X
X  int yymaxdepth = YYMAXDEPTH;
X
#ifndef YYPURE
X  int yychar;
X  YYSTYPE yylval;
X  YYLTYPE yylloc;
#endif
X
#ifdef YYDEBUG
X  extern int yydebug;
#endif
X
X
X  YYSTYPE yyval;                /*  the variable used to return         */
X                                /*  semantic values from the action     */
X                                /*  routines                            */
X
X  int yylen;
X
#ifdef YYDEBUG
X  if (yydebug)
X    fprintf(stderr, "Starting parse\n");
#endif
X
X  yystate = 0;
X  yyerrstatus = 0;
X  yynerr = 0;
X  yychar = YYEMPTY;             /* Cause a token to be read.  */
X
X  /* Initialize stack pointers.
X     Waste one element of value and location stack
X     so that they stay on the same level as the state stack.  */
X
X  yyssp = yyss - 1;
X  yyvsp = yyvs;
X  yylsp = yyls;
X
/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
X   have just been pushed. so pushing a state here evens the stacks.  */
yynewstate:
X
X  *++yyssp = yystate;
X
X  if (yyssp >= yyss + yymaxdepth - 1)
X    {
X      /* Give user a chance to reallocate the stack */
X      /* Use copies of these so that the &'s don't force the real ones into memory. */
X      YYSTYPE *yyvs1 = yyvs;
X      YYLTYPE *yyls1 = yyls;
X      short *yyss1 = yyss;
X
X      /* Get the current used size of the three stacks, in elements.  */
X      int size = yyssp - yyss + 1;
X
#ifdef yyoverflow
X      /* Each stack pointer address is followed by the size of
X         the data in use in that stack, in bytes.  */
X      yyoverflow("parser stack overflow",
X                 &yyss1, size * sizeof (*yyssp),
X                 &yyvs1, size * sizeof (*yyvsp),
X                 &yyls1, size * sizeof (*yylsp),
X                 &yymaxdepth);
X
X      yyss = yyss1; yyvs = yyvs1; yyls = yyls1;
#else /* no yyoverflow */
X      /* Extend the stack our own way.  */
X      if (yymaxdepth >= YYMAXLIMIT)
X        yyerror("parser stack overflow");
X      yymaxdepth *= 2;
X      if (yymaxdepth > YYMAXLIMIT)
X        yymaxdepth = YYMAXLIMIT;
X      yyss = (short *) alloca (yymaxdepth * sizeof (*yyssp));
X      bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
X      yyvs = (YYSTYPE *) alloca (yymaxdepth * sizeof (*yyvsp));
X      bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
X      yyls = (YYLTYPE *) alloca (yymaxdepth * sizeof (*yylsp));
X      bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
X
X      yyssp = yyss + size - 1;
X      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
X      yylsp = yyls + size - 1;
#endif
X
#ifdef YYDEBUG
X      if (yydebug)
X        fprintf(stderr, "Stack size increased to %d\n", yymaxdepth);
#endif
X
X      if (yyssp >= yyss + yymaxdepth - 1)
X        YYERROR;
X    }
X
#ifdef YYDEBUG
X  if (yydebug)
X    fprintf(stderr, "Entering state %d\n", yystate);
#endif
X
/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
yyresume:
X
X  /* First try to decide what to do without reference to lookahead token.  */
X
X  yyn = yypact[yystate];
X  if (yyn == YYFLAG)
X    goto yydefault;
X
X  /* Not known => get a lookahead token if don't already have one.  */
X
X  /* yychar is either YYEMPTY or YYEOF
X     or a valid token in external form.  */
X
X  if (yychar == YYEMPTY)
X    {
#ifdef YYDEBUG
X      if (yydebug)
X        fprintf(stderr, "Reading a token: ");
#endif
X      yychar = YYLEX;
X    }
X
X  /* Convert token to internal form (in yychar1) for indexing tables with */
X
X  if (yychar <= 0)              /* This means end of input. */
X    {
X      yychar1 = 0;
X      yychar = YYEOF;           /* Don't call YYLEX any more */
X
#ifdef YYDEBUG
X      if (yydebug)
X        fprintf(stderr, "Now at end of input.\n");
#endif
X    }
X  else
X    {
X      yychar1 = YYTRANSLATE(yychar);
X
#ifdef YYDEBUG
X      if (yydebug)
X        fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
#endif
X    }
X
X  yyn += yychar1;
X  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
X    goto yydefault;
X
X  yyn = yytable[yyn];
X
X  /* yyn is what to do for this token type in this state.
X     Negative => reduce, -yyn is rule number.
X     Positive => shift, yyn is new state.
X       New state is final state => don't bother to shift,
X       just return success.
X     0, or most negative number => error.  */
X
X  if (yyn < 0)
X    {
X      if (yyn == YYFLAG)
X        goto yyerrlab;
X      yyn = -yyn;
X      goto yyreduce;
X    }
X  else if (yyn == 0)
X    goto yyerrlab;
X
X  if (yyn == YYFINAL)
X    YYACCEPT;
X
X  /* Shift the lookahead token.  */
X
#ifdef YYDEBUG
X  if (yydebug)
X    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif
X
X  /* Discard the token being shifted unless it is eof.  */
X  if (yychar != YYEOF)
X    yychar = YYEMPTY;
X
X  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
X  *++yylsp = yylloc;
#endif
X
X  /* count tokens shifted since error; after three, turn off error status.  */
X  if (yyerrstatus) yyerrstatus--;
X
X  yystate = yyn;
X  goto yynewstate;
X
/* Do the default action for the current state.  */
yydefault:
X
X  yyn = yydefact[yystate];
X  if (yyn == 0)
X    goto yyerrlab;
X
/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
X  yylen = yyr2[yyn];
X  yyval = yyvsp[1-yylen]; /* implement default value of the action */
X
#ifdef YYDEBUG
X  if (yydebug)
X    {
X      if (yylen == 1)
X        fprintf (stderr, "Reducing 1 value via line %d, ",
X                 yyrline[yyn]);
X      else
X        fprintf (stderr, "Reducing %d values via line %d, ",
X                 yylen, yyrline[yyn]);
X    }
#endif
X
X
X  switch (yyn) {
X
case 1:
#line 154 "gram.y"
{ let(yyvsp[-2].rval.left.vp, yyvsp[0].enode); ;
X    break;}
case 2:
#line 156 "gram.y"
{ slet(yyvsp[-2].rval.left.vp, yyvsp[0].enode, 0); ;
X    break;}
case 3:
#line 158 "gram.y"
{ slet(yyvsp[-2].rval.left.vp, yyvsp[0].enode, -1); ;
X    break;}
case 4:
#line 160 "gram.y"
{ slet(yyvsp[-2].rval.left.vp, yyvsp[0].enode, 1); ;
X    break;}
case 5:
#line 162 "gram.y"
{ doformat(yyvsp[-4].ival,yyvsp[-2].ival,yyvsp[-1].ival,yyvsp[0].ival); ;
X    break;}
case 6:
#line 164 "gram.y"
{ doformat(yyvsp[-2].ival,yyvsp[-2].ival,yyvsp[-1].ival,yyvsp[0].ival); ;
X    break;}
case 7:
#line 165 "gram.y"
{  /* This tmp hack is because readfile
X				    * recurses back through yyparse. */
X				  char *tmp;
X				  tmp = yyvsp[0].sval;
X				  readfile (tmp, 1);
X				  xfree(tmp);
X				;
X    break;}
case 8:
#line 172 "gram.y"
{
X				  char *tmp;
X				  tmp = yyvsp[0].sval;
X				  readfile (tmp, 0);
X				  xfree(tmp);
X				;
X    break;}
case 9:
#line 179 "gram.y"
{ if (mdir) xfree(mdir); mdir = yyvsp[0].sval; ;
X    break;}
case 10:
#line 181 "gram.y"
{ (void) writefile(yyvsp[-1].sval, (yyvsp[0].rval.left.vp)->row, 
X			 	(yyvsp[0].rval.left.vp)->col, (yyvsp[0].rval.right.vp)->row,
X			 	(yyvsp[0].rval.right.vp)->col);
X			 	xfree(yyvsp[-1].sval); ;
X    break;}
case 11:
#line 186 "gram.y"
{ (void) writefile (yyvsp[0].sval, 0, 0, maxrow, maxcol);
X			 	xfree(yyvsp[0].sval); ;
X    break;}
case 12:
#line 188 "gram.y"
{ (void) printfile(yyvsp[-1].sval, (yyvsp[0].rval.left.vp)->row, 
X			 (yyvsp[0].rval.left.vp)->col, (yyvsp[0].rval.right.vp)->row,
X			 (yyvsp[0].rval.right.vp)->col);
X			 xfree(yyvsp[-1].sval); ;
X    break;}
case 13:
#line 192 "gram.y"
{ (void) printfile (yyvsp[0].sval, 0, 0, maxrow, maxcol);
X			 xfree(yyvsp[0].sval); ;
X    break;}
case 14:
#line 194 "gram.y"
{ (void) tblprintfile(yyvsp[-1].sval, (yyvsp[0].rval.left.vp)->row, 
X			 (yyvsp[0].rval.left.vp)->col, (yyvsp[0].rval.right.vp)->row,
X			 (yyvsp[0].rval.right.vp)->col);
X			 xfree(yyvsp[-1].sval); ;
X    break;}
case 15:
#line 198 "gram.y"
{ (void)tblprintfile (yyvsp[0].sval, 0, 0, maxrow, maxcol);
X			 xfree(yyvsp[0].sval); ;
X    break;}
case 16:
#line 201 "gram.y"
{ showcol( yyvsp[-2].ival, yyvsp[0].ival); ;
X    break;}
case 17:
#line 203 "gram.y"
{ showrow( yyvsp[-2].ival, yyvsp[0].ival); ;
X    break;}
case 18:
#line 205 "gram.y"
{ hide_col( yyvsp[0].ival ); ;
X    break;}
case 19:
#line 207 "gram.y"
{ hide_row( yyvsp[0].ival ); ;
X    break;}
case 20:
#line 209 "gram.y"
{ copy(yyvsp[-1].rval.left.vp,yyvsp[-1].rval.right.vp,
X					yyvsp[0].rval.left.vp,yyvsp[0].rval.right.vp); ;
X    break;}
case 21:
#line 212 "gram.y"
{ eraser(lookat(showsr, showsc),
X				        lookat(currow, curcol)); ;
X    break;}
case 22:
#line 215 "gram.y"
{ eraser(yyvsp[0].rval.left.vp, yyvsp[0].rval.right.vp); ;
X    break;}
case 23:
#line 216 "gram.y"
{ valueize_area(showsr, showsc, currow, curcol);
X				 modflg++; ;
X    break;}
case 24:
#line 218 "gram.y"
{ valueize_area((yyvsp[0].rval.left.vp)->row,
X				(yyvsp[0].rval.left.vp)->col,
X				(yyvsp[0].rval.right.vp)->row,
X				(yyvsp[0].rval.right.vp)->col); modflg++; ;
X    break;}
case 25:
#line 222 "gram.y"
{ fill(lookat(showsr, showsc),
X				      lookat(currow, curcol), yyvsp[-1].fval, yyvsp[0].fval); ;
X    break;}
case 26:
#line 225 "gram.y"
{ fill(yyvsp[-2].rval.left.vp, yyvsp[-2].rval.right.vp, yyvsp[-1].fval, yyvsp[0].fval); ;
X    break;}
case 27:
#line 226 "gram.y"
{moveto(yyvsp[0].rval.left.vp->row, yyvsp[0].rval.left.vp->col);;
X    break;}
case 28:
#line 227 "gram.y"
{num_search(yyvsp[0].fval);;
X    break;}
case 29:
#line 228 "gram.y"
{str_search(yyvsp[0].sval);;
X    break;}
case 30:
#line 229 "gram.y"
{go_last();;
X    break;}
case 31:
#line 230 "gram.y"
{ struct ent_ptr arg1, arg2;
X					arg1.vp = lookat(showsr, showsc);
X					arg1.vf = 0;
X					arg2.vp = lookat(currow, curcol);
X					arg2.vf = 0;
X					add_range(yyvsp[0].sval, arg1, arg2, 1); ;
X    break;}
case 32:
#line 237 "gram.y"
{ add_range(yyvsp[-1].sval, yyvsp[0].rval.left, yyvsp[0].rval.right, 1); ;
X    break;}
case 33:
#line 238 "gram.y"
{ add_range(yyvsp[-1].sval, yyvsp[0].ent, yyvsp[0].ent, 0); ;
X    break;}
case 34:
#line 239 "gram.y"
{ del_range(yyvsp[0].rval.left.vp, yyvsp[0].rval.right.vp); ;
X    break;}
case 38:
#line 244 "gram.y"
{ yyval.enode = new_var('v', yyvsp[0].ent); ;
X    break;}
case 39:
#line 245 "gram.y"
{ yyval.enode = new ('f', ENULL, yyvsp[0].enode); ;
X    break;}
case 40:
#line 247 "gram.y"
{ yyval.enode = new_range(REDUCE | '+', yyvsp[-1].rval); ;
X    break;}
case 41:
#line 249 "gram.y"
{ yyval.enode = new_range (REDUCE | '*', yyvsp[-1].rval); ;
X    break;}
case 42:
#line 251 "gram.y"
{ yyval.enode = new_range (REDUCE | 'a', yyvsp[-1].rval); ;
X    break;}
case 43:
#line 253 "gram.y"
{ yyval.enode = new_range (REDUCE | 's', yyvsp[-1].rval); ;
X    break;}
case 44:
#line 255 "gram.y"
{ yyval.enode = new_range (REDUCE | 'c', yyvsp[-1].rval); ;
X    break;}
case 45:
#line 257 "gram.y"
{ yyval.enode = new_range (REDUCE | MAX, yyvsp[-1].rval); ;
X    break;}
case 46:
#line 259 "gram.y"
{ yyval.enode = new(LMAX, yyvsp[-1].enode, yyvsp[-3].enode); ;
X    break;}
case 47:
#line 261 "gram.y"
{ yyval.enode = new_range (REDUCE | MIN, yyvsp[-1].rval); ;
X    break;}
case 48:
#line 263 "gram.y"
{ yyval.enode = new(LMIN, yyvsp[-1].enode, yyvsp[-3].enode); ;
X    break;}
case 49:
#line 264 "gram.y"
{ yyval.enode = new(ABS, ENULL, yyvsp[-1].enode); ;
X    break;}
case 50:
#line 265 "gram.y"
{ yyval.enode = new(ACOS, ENULL, yyvsp[-1].enode); ;
X    break;}
case 51:
#line 266 "gram.y"
{ yyval.enode = new(ASIN, ENULL, yyvsp[-1].enode); ;
X    break;}
case 52:
#line 267 "gram.y"
{ yyval.enode = new(ATAN, ENULL, yyvsp[-1].enode); ;
X    break;}
case 53:
#line 268 "gram.y"
{ yyval.enode = new(ATAN2, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 54:
#line 269 "gram.y"
{ yyval.enode = new(CEIL, ENULL, yyvsp[-1].enode); ;
X    break;}
case 55:
#line 270 "gram.y"
{ yyval.enode = new(COS, ENULL, yyvsp[-1].enode); ;
X    break;}
case 56:
#line 271 "gram.y"
{ yyval.enode = new(EXP, ENULL, yyvsp[-1].enode); ;
X    break;}
case 57:
#line 272 "gram.y"
{ yyval.enode = new(FABS, ENULL, yyvsp[-1].enode); ;
X    break;}
case 58:
#line 273 "gram.y"
{ yyval.enode = new(FLOOR, ENULL, yyvsp[-1].enode); ;
X    break;}
case 59:
#line 274 "gram.y"
{ yyval.enode = new(HYPOT, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 60:
#line 275 "gram.y"
{ yyval.enode = new(LOG, ENULL, yyvsp[-1].enode); ;
X    break;}
case 61:
#line 276 "gram.y"
{ yyval.enode = new(LOG10, ENULL, yyvsp[-1].enode); ;
X    break;}
case 62:
#line 277 "gram.y"
{ yyval.enode = new(POW, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 63:
#line 278 "gram.y"
{ yyval.enode = new(SIN, ENULL, yyvsp[-1].enode); ;
X    break;}
case 64:
#line 279 "gram.y"
{ yyval.enode = new(SQRT, ENULL, yyvsp[-1].enode); ;
X    break;}
case 65:
#line 280 "gram.y"
{ yyval.enode = new(TAN, ENULL, yyvsp[-1].enode); ;
X    break;}
case 66:
#line 281 "gram.y"
{ yyval.enode = new(DTR, ENULL, yyvsp[-1].enode); ;
X    break;}
case 67:
#line 282 "gram.y"
{ yyval.enode = new(RTD, ENULL, yyvsp[-1].enode); ;
X    break;}
case 68:
#line 283 "gram.y"
{ yyval.enode = new(RND, ENULL, yyvsp[-1].enode); ;
X    break;}
case 69:
#line 284 "gram.y"
{ yyval.enode = new(ROUND, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 70:
#line 285 "gram.y"
{ yyval.enode = new(IF,  yyvsp[-5].enode,new(',',yyvsp[-3].enode,yyvsp[-1].enode)); ;
X    break;}
case 71:
#line 287 "gram.y"
{ yyval.enode = new(PV,  yyvsp[-5].enode,new(':',yyvsp[-3].enode,yyvsp[-1].enode)); ;
X    break;}
case 72:
#line 288 "gram.y"
{ yyval.enode = new(FV,  yyvsp[-5].enode,new(':',yyvsp[-3].enode,yyvsp[-1].enode)); ;
X    break;}
case 73:
#line 289 "gram.y"
{ yyval.enode = new(PMT, yyvsp[-5].enode,new(':',yyvsp[-3].enode,yyvsp[-1].enode)); ;
X    break;}
case 74:
#line 291 "gram.y"
{ yyval.enode = new(HOUR,ENULL, yyvsp[-1].enode); ;
X    break;}
case 75:
#line 292 "gram.y"
{ yyval.enode = new(MINUTE,ENULL, yyvsp[-1].enode); ;
X    break;}
case 76:
#line 293 "gram.y"
{ yyval.enode = new(SECOND,ENULL, yyvsp[-1].enode); ;
X    break;}
case 77:
#line 294 "gram.y"
{ yyval.enode = new(MONTH,ENULL,yyvsp[-1].enode); ;
X    break;}
case 78:
#line 295 "gram.y"
{ yyval.enode = new(DAY, ENULL, yyvsp[-1].enode); ;
X    break;}
case 79:
#line 296 "gram.y"
{ yyval.enode = new(YEAR, ENULL, yyvsp[-1].enode); ;
X    break;}
case 80:
#line 297 "gram.y"
{ yyval.enode = new(NOW, ENULL, ENULL);;
X    break;}
case 81:
#line 299 "gram.y"
{ yyval.enode = new(DTS, yyvsp[-5].enode, new(',', yyvsp[-3].enode, yyvsp[-1].enode));;
X    break;}
case 82:
#line 301 "gram.y"
{ yyval.enode = new(TTS, yyvsp[-5].enode, new(',', yyvsp[-3].enode, yyvsp[-1].enode));;
X    break;}
case 83:
#line 302 "gram.y"
{ yyval.enode = new(STON, ENULL, yyvsp[-1].enode); ;
X    break;}
case 84:
#line 303 "gram.y"
{ yyval.enode = new (EQS, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 85:
#line 304 "gram.y"
{ yyval.enode = new(DATE, ENULL, yyvsp[-1].enode); ;
X    break;}
case 86:
#line 305 "gram.y"
{ yyval.enode = new(FMT, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 87:
#line 307 "gram.y"
{ yyval.enode = new(INDEX, yyvsp[-3].enode, new_range(REDUCE | INDEX, yyvsp[-1].rval)); ;
X    break;}
case 88:
#line 309 "gram.y"
{ yyval.enode = new(LOOKUP, yyvsp[-3].enode, new_range(REDUCE | LOOKUP, yyvsp[-1].rval)); ;
X    break;}
case 89:
#line 311 "gram.y"
{ yyval.enode = new(HLOOKUP, new(',', yyvsp[-5].enode, yyvsp[-1].enode),
X		    new_range(REDUCE | HLOOKUP, yyvsp[-3].rval)); ;
X    break;}
case 90:
#line 314 "gram.y"
{ yyval.enode = new(VLOOKUP, new(',', yyvsp[-5].enode, yyvsp[-1].enode),
X		    new_range(REDUCE | VLOOKUP, yyvsp[-3].rval)); ;
X    break;}
case 91:
#line 317 "gram.y"
{ yyval.enode = new(STINDEX, yyvsp[-3].enode, new_range(REDUCE | STINDEX, yyvsp[-1].rval)); ;
X    break;}
case 92:
#line 318 "gram.y"
{ yyval.enode = new(EXT, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 93:
#line 319 "gram.y"
{ yyval.enode = new(NVAL, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 94:
#line 320 "gram.y"
{ yyval.enode = new(SVAL, yyvsp[-3].enode, yyvsp[-1].enode); ;
X    break;}
case 95:
#line 322 "gram.y"
{ yyval.enode = new(SUBSTR, yyvsp[-5].enode, new(',', yyvsp[-3].enode, yyvsp[-1].enode)); ;
X    break;}
case 96:
#line 323 "gram.y"
{ yyval.enode = yyvsp[-1].enode; ;
X    break;}
case 97:
#line 324 "gram.y"
{ yyval.enode = yyvsp[0].enode; ;
X    break;}
case 98:
#line 325 "gram.y"
{ yyval.enode = new ('m', ENULL, yyvsp[0].enode); ;
X    break;}
case 99:
#line 326 "gram.y"
{ yyval.enode = new_const('k', (double) yyvsp[0].ival); ;
X    break;}
case 100:
#line 327 "gram.y"
{ yyval.enode = new_const('k', yyvsp[0].fval); ;
X    break;}
case 101:
#line 328 "gram.y"
{ yyval.enode = new_const('k', (double)3.14159265358979323846); ;
X    break;}
case 102:
#line 329 "gram.y"
{ yyval.enode = new_str(yyvsp[0].sval); ;
X    break;}
case 103:
#line 330 "gram.y"
{ yyval.enode = new ('~', ENULL, yyvsp[0].enode); ;
X    break;}
case 104:
#line 331 "gram.y"
{ yyval.enode = new ('~', ENULL, yyvsp[0].enode); ;
X    break;}
case 105:
#line 334 "gram.y"
{ yyval.enode = new ('+', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 106:
#line 335 "gram.y"
{ yyval.enode = new ('-', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 107:
#line 336 "gram.y"
{ yyval.enode = new ('*', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 108:
#line 337 "gram.y"
{ yyval.enode = new ('/', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 109:
#line 338 "gram.y"
{ yyval.enode = new ('%', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 110:
#line 339 "gram.y"
{ yyval.enode = new ('^', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 112:
#line 341 "gram.y"
{ yyval.enode = new ('?', yyvsp[-4].enode, new(':', yyvsp[-2].enode, yyvsp[0].enode)); ;
X    break;}
case 113:
#line 342 "gram.y"
{ yyval.enode = new ('<', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 114:
#line 343 "gram.y"
{ yyval.enode = new ('=', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 115:
#line 344 "gram.y"
{ yyval.enode = new ('>', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 116:
#line 345 "gram.y"
{ yyval.enode = new ('&', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 117:
#line 346 "gram.y"
{ yyval.enode = new ('|', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 118:
#line 347 "gram.y"
{ yyval.enode = new ('~', ENULL, new ('>', yyvsp[-3].enode, yyvsp[0].enode)); ;
X    break;}
case 119:
#line 348 "gram.y"
{ yyval.enode = new ('~', ENULL, new ('=', yyvsp[-3].enode, yyvsp[0].enode)); ;
X    break;}
case 120:
#line 349 "gram.y"
{ yyval.enode = new ('~', ENULL, new ('<', yyvsp[-3].enode, yyvsp[0].enode)); ;
X    break;}
case 121:
#line 350 "gram.y"
{ yyval.enode = new ('#', yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 122:
#line 353 "gram.y"
{ yyval.enode = new(ELIST, ENULL, yyvsp[0].enode); ;
X    break;}
case 123:
#line 354 "gram.y"
{ yyval.enode = new(ELIST, yyvsp[-2].enode, yyvsp[0].enode); ;
X    break;}
case 124:
#line 357 "gram.y"
{ yyval.rval.left = yyvsp[-2].ent; yyval.rval.right = yyvsp[0].ent; ;
X    break;}
case 125:
#line 358 "gram.y"
{ yyval.rval = yyvsp[0].rval; ;
X    break;}
case 126:
#line 361 "gram.y"
{ yyval.ent.vp = lookat(yyvsp[0].ival , yyvsp[-1].ival); yyval.ent.vf = 0;;
X    break;}
case 127:
#line 362 "gram.y"
{ yyval.ent.vp = lookat(yyvsp[0].ival , yyvsp[-1].ival);
X					yyval.ent.vf = FIX_COL;;
X    break;}
case 128:
#line 364 "gram.y"
{ yyval.ent.vp = lookat(yyvsp[0].ival , yyvsp[-2].ival);
X					yyval.ent.vf = FIX_ROW;;
X    break;}
case 129:
#line 366 "gram.y"
{ yyval.ent.vp = lookat(yyvsp[0].ival , yyvsp[-2].ival);
X					yyval.ent.vf = FIX_ROW | FIX_COL;;
X    break;}
case 130:
#line 368 "gram.y"
{ yyval.ent = yyvsp[0].rval.left; ;
X    break;}
case 131:
#line 371 "gram.y"
{ yyval.rval = yyvsp[0].rval; ;
X    break;}
case 132:
#line 372 "gram.y"
{ yyval.rval.left = yyvsp[0].ent; yyval.rval.right = yyvsp[0].ent; ;
X    break;}
case 133:
#line 375 "gram.y"
{ yyval.fval = (double) yyvsp[0].ival; ;
X    break;}
case 134:
#line 376 "gram.y"
{ yyval.fval = yyvsp[0].fval; ;
X    break;}
case 135:
#line 377 "gram.y"
{ yyval.fval = -yyvsp[0].fval; ;
X    break;}
case 136:
#line 378 "gram.y"
{ yyval.fval = yyvsp[0].fval; ;
X    break;}
case 137:
#line 381 "gram.y"
{ yyval.sval = yyvsp[0].sval; ;
X    break;}
case 138:
#line 382 "gram.y"
{
X				    char *s, *s1;
X				    s1 = yyvsp[0].ent.vp->label;
X				    if (!s1)
X					s1 = "NULL_STRING";
X				    s = xmalloc((unsigned)strlen(s1)+1);
X				    (void) strcpy(s, s1);
X				    yyval.sval = s;
X				;
X    break;}
case 141:
#line 397 "gram.y"
{ setauto(1); ;
X    break;}
case 142:
#line 398 "gram.y"
{ setauto(1); ;
X    break;}
case 143:
#line 399 "gram.y"
{ setauto(0); ;
X    break;}
case 144:
#line 400 "gram.y"
{ setauto(0); ;
X    break;}
case 145:
#line 401 "gram.y"
{ setauto(0); ;
X    break;}
case 146:
#line 402 "gram.y"
{ setauto(0); ;
X    break;}
case 147:
#line 403 "gram.y"
{ setorder(BYCOLS); ;
X    break;}
case 148:
#line 404 "gram.y"
{ setorder(BYROWS); ;
X    break;}
case 149:
#line 405 "gram.y"
{ setorder(BYGRAPH); ;
X    break;}
case 150:
#line 406 "gram.y"
{ numeric = 1; ;
X    break;}
case 151:
#line 407 "gram.y"
{ numeric = 0; ;
X    break;}
case 152:
#line 408 "gram.y"
{ prescale = 0.01; ;
X    break;}
case 153:
#line 409 "gram.y"
{ prescale = 1.0; ;
X    break;}
case 154:
#line 410 "gram.y"
{ extfunc = 1; ;
X    break;}
case 155:
#line 411 "gram.y"
{ extfunc = 0; ;
X    break;}
case 156:
#line 412 "gram.y"
{ showcell = 1; ;
X    break;}
case 157:
#line 413 "gram.y"
{ showcell = 0; ;
X    break;}
case 158:
#line 414 "gram.y"
{ showtop = 1; ;
X    break;}
case 159:
#line 415 "gram.y"
{ showtop = 0; ;
X    break;}
case 160:
#line 416 "gram.y"
{ setiterations(yyvsp[0].ival); ;
X    break;}
case 161:
#line 417 "gram.y"
{ tbl_style = yyvsp[0].ival; ;
X    break;}
case 162:
#line 418 "gram.y"
{ tbl_style = TBL; ;
X    break;}
case 163:
#line 419 "gram.y"
{ tbl_style = LATEX; ;
X    break;}
case 164:
#line 420 "gram.y"
{ tbl_style = TEX; ;
X    break;}
}
X   /* the action file gets copied in in place of this dollarsign */
#line 303 "bison.simple"
X
X  yyvsp -= yylen;
X  yyssp -= yylen;
#ifdef YYLSP_NEEDED
X  yylsp -= yylen;
#endif
X
#ifdef YYDEBUG
X  if (yydebug)
X    {
X      short *ssp1 = yyss - 1;
X      fprintf (stderr, "state stack now");
X      while (ssp1 != yyssp)
X        fprintf (stderr, " %d", *++ssp1);
X      fprintf (stderr, "\n");
X    }
#endif
X
X  *++yyvsp = yyval;
X
#ifdef YYLSP_NEEDED
X  yylsp++;
X  if (yylen == 0)
X    {
X      yylsp->first_line = yylloc.first_line;
X      yylsp->first_column = yylloc.first_column;
X      yylsp->last_line = (yylsp-1)->last_line;
X      yylsp->last_column = (yylsp-1)->last_column;
X      yylsp->text = 0;
X    }
X  else
X    {
X      yylsp->last_line = (yylsp+yylen-1)->last_line;
X      yylsp->last_column = (yylsp+yylen-1)->last_column;
X    }
#endif
X
X  /* Now "shift" the result of the reduction.
X     Determine what state that goes to,
X     based on the state we popped back to
X     and the rule number reduced by.  */
X
X  yyn = yyr1[yyn];
X
X  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
X  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
X    yystate = yytable[yystate];
X  else
X    yystate = yydefgoto[yyn - YYNTBASE];
X
X  goto yynewstate;
X
yyerrlab:   /* here on detecting error */
X
X  if (! yyerrstatus)
X    /* If not already recovering from an error, report this error.  */
X    {
X      ++yynerr;
X      yyerror("parse error");
X    }
X
X  if (yyerrstatus == 3)
X    {
X      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
X
X      /* return failure if at end of input */
X      if (yychar == YYEOF)
X        YYERROR;
X
#ifdef YYDEBUG
X      if (yydebug)
X        fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif
X
X      yychar = YYEMPTY;
X    }
X
X  /* Else will try to reuse lookahead token
X     after shifting the error token.  */
X
X  yyerrstatus = 3;              /* Each real token shifted decrements this */
X
X  goto yyerrhandle;
X
yyerrdefault:  /* current state does not do anything special for the error token. */
X
#if 0
X  /* This is wrong; only states that explicitly want error tokens
X     should shift them.  */
X  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
X  if (yyn) goto yydefault;
#endif
X
yyerrpop:   /* pop the current state because it cannot handle the error token */
X
X  if (yyssp == yyss) YYERROR;
X  yyvsp--;
X  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
X  yylsp--;
#endif
X
#ifdef YYDEBUG
X  if (yydebug)
X    {
X      short *ssp1 = yyss - 1;
X      fprintf (stderr, "Error: state stack now");
X      while (ssp1 != yyssp)
X        fprintf (stderr, " %d", *++ssp1);
X      fprintf (stderr, "\n");
X    }
#endif
X
yyerrhandle:
X
X  yyn = yypact[yystate];
X  if (yyn == YYFLAG)
X    goto yyerrdefault;
X
X  yyn += YYTERROR;
X  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
X    goto yyerrdefault;
X
X  yyn = yytable[yyn];
X  if (yyn < 0)
X    {
X      if (yyn == YYFLAG)
X        goto yyerrpop;
X      yyn = -yyn;
X      goto yyreduce;
X    }
X  else if (yyn == 0)
X    goto yyerrpop;
X
X  if (yyn == YYFINAL)
X    YYACCEPT;
X
#ifdef YYDEBUG
X  if (yydebug)
X    fprintf(stderr, "Shifting error token, ");
#endif
X
X  *++yyvsp = yylval;
#ifdef YYLSP_NEEDED
X  *++yylsp = yylloc;
#endif
X
X  yystate = yyn;
X  goto yynewstate;
}
#line 422 "gram.y"
SHAR_EOF
echo 'File gram.c is complete' &&
chmod 0666 gram.c ||
echo 'restore of gram.c failed'
Wc_c="`wc -c < 'gram.c'`"
test 81234 -eq "$Wc_c" ||
	echo 'gram.c: original size 81234, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= gram.y ==============
if test -f 'gram.y' -a X"$1" != X"-c"; then
	echo 'x - skipping gram.y (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting gram.y (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gram.y' &&
/*	SC	A Spreadsheet Calculator
X *		Command and expression parser
X *
X *		original by James Gosling, September 1982
X *		modified by Mark Weiser and Bruce Israel,
X *			University of Maryland
X *
X * 		more mods Robert Bond 12/86
X *
X *		More mods by Alan Silverstein, 3/88, see list of changes.
X *
X *		$Revision: 6.8 $
X */
X
X
X
%{
#include <curses.h>
#include "sc.h"
X
#define ENULL (struct enode *)0
X
char *strcpy();
%}
X
%union {
X    int ival;
X    double fval;
X    struct ent_ptr ent;
X    struct enode *enode;
X    char *sval;
X    struct range_s rval;
}
X
%type <ent> var
%type <fval> num
%type <rval> range
%type <rval> var_or_range
%type <sval> strarg
%type <enode> e term expr_list
%token <sval> STRING
%token <ival> NUMBER
%token <fval> FNUMBER
%token <rval> RANGE
%token <rval> VAR
%token <sval> WORD
%token <ival> COL
%token S_FORMAT
%token S_LABEL
%token S_LEFTSTRING
%token S_RIGHTSTRING
%token S_GET
%token S_PUT
%token S_MERGE
%token S_LET
%token S_WRITE
%token S_TBL
%token S_COPY
%token S_SHOW
%token S_ERASE
%token S_FILL
%token S_GOTO
%token S_DEFINE
%token S_UNDEFINE
%token S_VALUE
%token S_MDIR
%token S_HIDE
%token S_SET
X
%token K_FIXED
%token K_SUM
%token K_PROD
%token K_AVG
%token K_STDDEV
%token K_COUNT
%token K_ABS
%token K_ACOS
%token K_ASIN
%token K_ATAN
%token K_ATAN2
%token K_CEIL
%token K_COS
%token K_EXP
%token K_FABS
%token K_FLOOR
%token K_HYPOT
%token K_LN
%token K_LOG
%token K_PI
%token K_POW
%token K_SIN
%token K_SQRT
%token K_TAN
%token K_DTR
%token K_RTD
%token K_MAX
%token K_MIN
%token K_RND
%token K_ROUND
%token K_IF
X
%token K_PV
%token K_FV
%token K_PMT
X
%token K_HOUR
%token K_MINUTE
%token K_SECOND
%token K_MONTH
%token K_DAY
%token K_YEAR
%token K_NOW
%token K_DATE
%token K_DTS
%token K_TTS
%token K_FMT
%token K_SUBSTR
%token K_STON
%token K_EQS
%token K_EXT
%token K_NVAL
%token K_SVAL
%token K_LOOKUP
%token K_HLOOKUP
%token K_VLOOKUP
%token K_INDEX
%token K_STINDEX
%token K_AUTO
%token K_AUTOCALC
%token K_BYROWS
%token K_BYCOLS
%token K_BYGRAPH
%token K_ITERATIONS
%token K_NUMERIC
%token K_PRESCALE
%token K_EXTFUN
%token K_CELLCUR
%token K_TOPROW
%token K_TBLSTYLE
%token K_TBL
%token K_LATEX
%token K_TEX
X
%left '?' ':'
%left '|'
%left '&'
%nonassoc '<' '=' '>' '!'
%left '+' '-' '#'
%left '*' '/' '%'
%left '^'
X
%%
command:	S_LET var_or_range '=' e
X				{ let($2.left.vp, $4); }
X	|	S_LABEL var_or_range '=' e
X				{ slet($2.left.vp, $4, 0); }
X	|	S_LEFTSTRING var_or_range '=' e
X				{ slet($2.left.vp, $4, -1); }
X	|	S_RIGHTSTRING var_or_range '=' e
X				{ slet($2.left.vp, $4, 1); }
X	|	S_FORMAT COL ':' COL NUMBER NUMBER
X				{ doformat($2,$4,$5,$6); }
X	|	S_FORMAT COL NUMBER NUMBER
X				{ doformat($2,$2,$3,$4); }
X	|	S_GET strarg	{  /* This tmp hack is because readfile
X				    * recurses back through yyparse. */
X				  char *tmp;
X				  tmp = $2;
X				  readfile (tmp, 1);
X				  xfree(tmp);
X				}
X	|	S_MERGE strarg	{
X				  char *tmp;
X				  tmp = $2;
X				  readfile (tmp, 0);
X				  xfree(tmp);
X				}
X	|	S_MDIR strarg	
X				{ if (mdir) xfree(mdir); mdir = $2; }
X	|       S_PUT strarg range
X				{ (void) writefile($2, ($3.left.vp)->row, 
X			 	($3.left.vp)->col, ($3.right.vp)->row,
X			 	($3.right.vp)->col);
X			 	xfree($2); }
X	|	S_PUT strarg	
X				{ (void) writefile ($2, 0, 0, maxrow, maxcol);
X			 	xfree($2); }
X	|       S_WRITE strarg range { (void) printfile($2, ($3.left.vp)->row, 
X			 ($3.left.vp)->col, ($3.right.vp)->row,
X			 ($3.right.vp)->col);
X			 xfree($2); }
X	|	S_WRITE strarg	{ (void) printfile ($2, 0, 0, maxrow, maxcol);
X			 xfree($2); }
X	|       S_TBL strarg range { (void) tblprintfile($2, ($3.left.vp)->row, 
X			 ($3.left.vp)->col, ($3.right.vp)->row,
X			 ($3.right.vp)->col);
X			 xfree($2); }
X	|	S_TBL strarg	{ (void)tblprintfile ($2, 0, 0, maxrow, maxcol);
X			 xfree($2); }
X	|       S_SHOW COL ':' COL
X					{ showcol( $2, $4); }
X	|       S_SHOW NUMBER ':' NUMBER
X					{ showrow( $2, $4); }
X 	|	S_HIDE COL
X 					{ hide_col( $2 ); }
X 	|	S_HIDE NUMBER
X 					{ hide_row( $2 ); }
X	|	S_COPY range var_or_range 
X					{ copy($2.left.vp,$2.right.vp,
X					$3.left.vp,$3.right.vp); }
X	|	S_ERASE       
X					{ eraser(lookat(showsr, showsc),
X				        lookat(currow, curcol)); }
X	|	S_ERASE var_or_range 
X					{ eraser($2.left.vp, $2.right.vp); }
X	|	S_VALUE       { valueize_area(showsr, showsc, currow, curcol);
X				 modflg++; }
X	|	S_VALUE var_or_range { valueize_area(($2.left.vp)->row,
X				($2.left.vp)->col,
X				($2.right.vp)->row,
X				($2.right.vp)->col); modflg++; }
X	|	S_FILL num num  { fill(lookat(showsr, showsc),
X				      lookat(currow, curcol), $2, $3); }
X	|	S_FILL var_or_range num num
X				 { fill($2.left.vp, $2.right.vp, $3, $4); }
X	|	S_GOTO var_or_range {moveto($2.left.vp->row, $2.left.vp->col);}
X	|       S_GOTO num          {num_search($2);}
X	|       S_GOTO STRING       {str_search($2);}
X	|	S_GOTO              {go_last();}
X	|	S_DEFINE strarg       { struct ent_ptr arg1, arg2;
X					arg1.vp = lookat(showsr, showsc);
X					arg1.vf = 0;
X					arg2.vp = lookat(currow, curcol);
X					arg2.vf = 0;
X					add_range($2, arg1, arg2, 1); }
X
X	|	S_DEFINE strarg range { add_range($2, $3.left, $3.right, 1); }
X	|	S_DEFINE strarg var   { add_range($2, $3, $3, 0); }
X	|	S_UNDEFINE var_or_range { del_range($2.left.vp, $2.right.vp); }
X 	|	S_SET setlist
X	|	/* nothing */
X	|	error;
X
term: 		var		{ $$ = new_var('v', $1); }
X	|	K_FIXED term	{ $$ = new ('f', ENULL, $2); }
X	|       '@' K_SUM '(' var_or_range ')' 
X				{ $$ = new_range(REDUCE | '+', $4); }
X	|       '@' K_PROD '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | '*', $4); }
X	|       '@' K_AVG '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | 'a', $4); }
X	|       '@' K_STDDEV '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | 's', $4); }
X	|       '@' K_COUNT '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | 'c', $4); }
X	|       '@' K_MAX '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | MAX, $4); }
X	|	'@' K_MAX '(' e ',' expr_list ')'
X				{ $$ = new(LMAX, $6, $4); }
X	|       '@' K_MIN '(' var_or_range ')' 
X				{ $$ = new_range (REDUCE | MIN, $4); }
X	|	'@' K_MIN '(' e ',' expr_list ')'
X				{ $$ = new(LMIN, $6, $4); }
X	| '@' K_ABS '(' e ')'	 { $$ = new(ABS, ENULL, $4); }
X	| '@' K_ACOS '(' e ')'	 { $$ = new(ACOS, ENULL, $4); }
X	| '@' K_ASIN '(' e ')'	 { $$ = new(ASIN, ENULL, $4); }
X	| '@' K_ATAN '(' e ')'	 { $$ = new(ATAN, ENULL, $4); }
X	| '@' K_ATAN2 '(' e ',' e ')' { $$ = new(ATAN2, $4, $6); }
X	| '@' K_CEIL '(' e ')'	 { $$ = new(CEIL, ENULL, $4); }
X	| '@' K_COS '(' e ')'	 { $$ = new(COS, ENULL, $4); }
X	| '@' K_EXP '(' e ')'	 { $$ = new(EXP, ENULL, $4); }
X	| '@' K_FABS '(' e ')'	 { $$ = new(FABS, ENULL, $4); }
X	| '@' K_FLOOR '(' e ')'	 { $$ = new(FLOOR, ENULL, $4); }
X	| '@' K_HYPOT '(' e ',' e ')'	{ $$ = new(HYPOT, $4, $6); }
X	| '@' K_LN '(' e ')'	 { $$ = new(LOG, ENULL, $4); }
X	| '@' K_LOG '(' e ')'	 { $$ = new(LOG10, ENULL, $4); }
X	| '@' K_POW '(' e ',' e ')'	{ $$ = new(POW, $4, $6); }
X	| '@' K_SIN '(' e ')'	 { $$ = new(SIN, ENULL, $4); }
X	| '@' K_SQRT '(' e ')'	 { $$ = new(SQRT, ENULL, $4); }
X	| '@' K_TAN '(' e ')'	 { $$ = new(TAN, ENULL, $4); }
X	| '@' K_DTR '(' e ')'	 { $$ = new(DTR, ENULL, $4); }
X	| '@' K_RTD '(' e ')'	 { $$ = new(RTD, ENULL, $4); }
X	| '@' K_RND '(' e ')'	 { $$ = new(RND, ENULL, $4); }
X	| '@' K_ROUND '(' e ',' e ')'	 { $$ = new(ROUND, $4, $6); }
X	| '@' K_IF  '(' e ',' e ',' e ')' { $$ = new(IF,  $4,new(',',$6,$8)); }
X
X	| '@' K_PV  '(' e ',' e ',' e ')' { $$ = new(PV,  $4,new(':',$6,$8)); }
X 	| '@' K_FV  '(' e ',' e ',' e ')' { $$ = new(FV,  $4,new(':',$6,$8)); }
X 	| '@' K_PMT '(' e ',' e ',' e ')' { $$ = new(PMT, $4,new(':',$6,$8)); }
X 
X	| '@' K_HOUR '(' e ')' 	 { $$ = new(HOUR,ENULL, $4); }
X	| '@' K_MINUTE '(' e ')' { $$ = new(MINUTE,ENULL, $4); }
X	| '@' K_SECOND '(' e ')' { $$ = new(SECOND,ENULL, $4); }
X	| '@' K_MONTH '(' e ')'	 { $$ = new(MONTH,ENULL,$4); }
X	| '@' K_DAY '(' e ')'    { $$ = new(DAY, ENULL, $4); }
X	| '@' K_YEAR '(' e ')'   { $$ = new(YEAR, ENULL, $4); }
X	| '@' K_NOW              { $$ = new(NOW, ENULL, ENULL);}
X	| '@' K_DTS '(' e ',' e ',' e ')'
X		  		 { $$ = new(DTS, $4, new(',', $6, $8));}
X	| '@' K_TTS '(' e ',' e ',' e ')'
X		  		 { $$ = new(TTS, $4, new(',', $6, $8));}
X	| '@' K_STON '(' e ')'   { $$ = new(STON, ENULL, $4); }
X	| '@' K_EQS '(' e ',' e ')' { $$ = new (EQS, $4, $6); }
X	| '@' K_DATE '(' e ')'	 { $$ = new(DATE, ENULL, $4); }
X	| '@' K_FMT  '(' e ',' e ')' { $$ = new(FMT, $4, $6); }
X	| '@' K_INDEX  '(' e ',' var_or_range ')'
X		 { $$ = new(INDEX, $4, new_range(REDUCE | INDEX, $6)); }
X	| '@' K_LOOKUP  '(' e ',' var_or_range ')'
X		 { $$ = new(LOOKUP, $4, new_range(REDUCE | LOOKUP, $6)); }
X	| '@' K_HLOOKUP  '(' e ',' var_or_range ',' e ')'
X		 { $$ = new(HLOOKUP, new(',', $4, $8),
X		    new_range(REDUCE | HLOOKUP, $6)); }
X	| '@' K_VLOOKUP  '(' e ',' var_or_range ',' e ')'
X		 { $$ = new(VLOOKUP, new(',', $4, $8),
X		    new_range(REDUCE | VLOOKUP, $6)); }
X	| '@' K_STINDEX  '(' e ',' var_or_range ')'
X		 { $$ = new(STINDEX, $4, new_range(REDUCE | STINDEX, $6)); }
X	| '@' K_EXT  '(' e ',' e ')' { $$ = new(EXT, $4, $6); }
X	| '@' K_NVAL '(' e ',' e ')' { $$ = new(NVAL, $4, $6); }
X	| '@' K_SVAL '(' e ',' e ')' { $$ = new(SVAL, $4, $6); }
X	| '@' K_SUBSTR '(' e ',' e ',' e ')'
X				 { $$ = new(SUBSTR, $4, new(',', $6, $8)); }
X	|	'(' e ')'	 { $$ = $2; }
X	|	'+' term	 { $$ = $2; }
X	|	'-' term	 { $$ = new ('m', ENULL, $2); }
X	|	NUMBER		 { $$ = new_const('k', (double) $1); }
X	|	FNUMBER		 { $$ = new_const('k', $1); }
X	|	K_PI	{ $$ = new_const('k', (double)3.14159265358979323846); }
X	|	STRING	         { $$ = new_str($1); }
X	|	'~' term	 { $$ = new ('~', ENULL, $2); }
X	|	'!' term	 { $$ = new ('~', ENULL, $2); }
X	;
X
e:		e '+' e		{ $$ = new ('+', $1, $3); }
X	|	e '-' e		{ $$ = new ('-', $1, $3); }
X	|	e '*' e		{ $$ = new ('*', $1, $3); }
X	|	e '/' e		{ $$ = new ('/', $1, $3); }
X	|	e '%' e		{ $$ = new ('%', $1, $3); }
X	|	e '^' e		{ $$ = new ('^', $1, $3); }
X	|	term
X	|	e '?' e ':' e	{ $$ = new ('?', $1, new(':', $3, $5)); }
X	|	e '<' e		{ $$ = new ('<', $1, $3); }
X	|	e '=' e		{ $$ = new ('=', $1, $3); }
X	|	e '>' e		{ $$ = new ('>', $1, $3); }
X	|	e '&' e		{ $$ = new ('&', $1, $3); }
X	|	e '|' e		{ $$ = new ('|', $1, $3); }
X	|	e '<' '=' e	{ $$ = new ('~', ENULL, new ('>', $1, $4)); }
X	|	e '!' '=' e	{ $$ = new ('~', ENULL, new ('=', $1, $4)); }
X	|	e '>' '=' e	{ $$ = new ('~', ENULL, new ('<', $1, $4)); }
SHAR_EOF
true || echo 'restore of gram.y failed'
fi
echo 'End of  part 2'
echo 'File gram.y is continued in part 3'
echo 3 > _shar_seq_.tmp
exit 0
--
Simon J Raybould    (sie@fulcrum.bt.co.uk)            //              {o.o}
                                                    \X/AMIGA           \-/
===========================================================================
British Telecom Fulcrum, Fordrough Lane, Birmingham, B9 5LD, ENGLAND.