
/*  A Bison parser, made from pic.y with Bison version GNU Bison version 1.22
  */

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

#define	LABEL	258
#define	VARIABLE	259
#define	NUMBER	260
#define	TEXT	261
#define	COMMAND_LINE	262
#define	DELIMITED	263
#define	ORDINAL	264
#define	TH	265
#define	LEFT_ARROW_HEAD	266
#define	RIGHT_ARROW_HEAD	267
#define	DOUBLE_ARROW_HEAD	268
#define	LAST	269
#define	UP	270
#define	DOWN	271
#define	LEFT	272
#define	RIGHT	273
#define	BOX	274
#define	CIRCLE	275
#define	ELLIPSE	276
#define	ARC	277
#define	LINE	278
#define	ARROW	279
#define	MOVE	280
#define	SPLINE	281
#define	HEIGHT	282
#define	RADIUS	283
#define	WIDTH	284
#define	DIAMETER	285
#define	FROM	286
#define	TO	287
#define	AT	288
#define	WITH	289
#define	BY	290
#define	THEN	291
#define	DOTTED	292
#define	DASHED	293
#define	CHOP	294
#define	SAME	295
#define	INVISIBLE	296
#define	LJUST	297
#define	RJUST	298
#define	ABOVE	299
#define	BELOW	300
#define	OF	301
#define	THE	302
#define	WAY	303
#define	BETWEEN	304
#define	AND	305
#define	HERE	306
#define	DOT_N	307
#define	DOT_E	308
#define	DOT_W	309
#define	DOT_S	310
#define	DOT_NE	311
#define	DOT_SE	312
#define	DOT_NW	313
#define	DOT_SW	314
#define	DOT_C	315
#define	DOT_START	316
#define	DOT_END	317
#define	DOT_X	318
#define	DOT_Y	319
#define	DOT_HT	320
#define	DOT_WID	321
#define	DOT_RAD	322
#define	SIN	323
#define	COS	324
#define	ATAN2	325
#define	LOG	326
#define	EXP	327
#define	SQRT	328
#define	K_MAX	329
#define	K_MIN	330
#define	INT	331
#define	RAND	332
#define	COPY	333
#define	THRU	334
#define	TOP	335
#define	BOTTOM	336
#define	UPPER	337
#define	LOWER	338
#define	SH	339
#define	PRINT	340
#define	CW	341
#define	CCW	342
#define	FOR	343
#define	DO	344
#define	IF	345
#define	ELSE	346
#define	ANDAND	347
#define	OROR	348
#define	NOTEQUAL	349
#define	EQUALEQUAL	350
#define	LESSEQUAL	351
#define	GREATEREQUAL	352
#define	LEFT_CORNER	353
#define	RIGHT_CORNER	354
#define	CENTER	355
#define	END	356
#define	START	357
#define	RESET	358
#define	UNTIL	359
#define	PLOT	360
#define	THICKNESS	361
#define	FILL	362
#define	ALIGNED	363
#define	SPRINTF	364
#define	COMMAND	365
#define	DEFINE	366
#define	UNDEF	367

#line 19 "pic.y"

#include "pic.h"
#include "ptable.h"
#include "object.h"

extern int delim_flag;
extern void do_copy(const char *);
extern void copy_rest_thru(const char *, const char *);
extern void copy_file_thru(const char *, const char *, const char *);
extern void push_body(const char *);
extern void do_for(char *var, double from, double to,
		   int by_is_multiplicative, double by, char *body);
extern void do_lookahead();

#undef fmod
#undef rand

extern "C" {
  double fmod(double, double);
  int rand();
}

/* Maximum number of characters produced by printf("%g") */
#define GDIGITS 14

int yylex();
void yyerror(const char *);

void reset(const char *nm);
void reset_all();

place *lookup_label(const char *);
void define_label(const char *label, const place *pl);

direction current_direction;
position current_position;

implement_ptable(place)

PTABLE(place) top_table;

PTABLE(place) *current_table = &top_table;
saved_state *current_saved_state = 0;

object_list olist;

const char *ordinal_postfix(int n);
const char *object_type_name(object_type type);
char *format_number(const char *form, double n);
char *do_sprintf(const char *form, const double *v, int nv);


#line 73 "pic.y"
typedef union {
	char *str;
	int n;
	double x;
	struct { double x, y; } pair;
	struct { double x; char *body; } if_data;
	struct { char *str; const char *filename; int lineno; } lstr;
	struct { double *v; int nv; int maxv; } dv;
	struct { double val; int is_multiplicative; } by;
	place pl;
	object *obj;
	corner crn;
	path *pth;
	object_spec *spec;
	saved_state *pstate;
	graphics_state state;
	object_type obtype;
} 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 __cplusplus
#ifndef __STDC__
#define const
#endif
#endif



#define	YYFINAL		404
#define	YYFLAG		-32768
#define	YYNTBASE	134

#define YYTRANSLATE(x) ((unsigned)(x) <= 367 ? yytranslate[x] : 179)

static const short 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,   123,     2,     2,     2,   122,     2,     2,   113,
   132,   120,   118,   115,   119,   133,   121,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,   127,   125,   116,
   126,   117,     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,
   130,     2,   131,   124,     2,   114,     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,   128,     2,   129,     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,    81,    82,    83,    84,    85,
    86,    87,    88,    89,    90,    91,    92,    93,    94,    95,
    96,    97,    98,    99,   100,   101,   102,   103,   104,   105,
   106,   107,   108,   109,   110,   111,   112
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     4,     8,    10,    14,    15,    17,    19,    22,
    26,    31,    33,    35,    37,    39,    41,    44,    47,    48,
    52,    55,    56,    57,    65,    66,    67,    74,    75,    86,
    88,    89,    94,    96,    98,   101,   104,   108,   110,   113,
   115,   117,   119,   120,   126,   127,   130,   132,   134,   138,
   142,   146,   150,   154,   158,   162,   166,   169,   170,   173,
   177,   179,   184,   189,   194,   195,   196,   203,   205,   206,
   208,   210,   212,   214,   216,   218,   220,   222,   224,   226,
   229,   233,   234,   239,   243,   247,   251,   255,   258,   261,
   265,   268,   272,   275,   279,   282,   286,   290,   294,   298,
   302,   306,   309,   312,   316,   319,   323,   326,   330,   333,
   337,   340,   343,   346,   349,   352,   355,   358,   361,   364,
   367,   370,   373,   377,   380,   382,   388,   389,   393,   395,
   397,   399,   403,   407,   413,   419,   426,   428,   433,   437,
   441,   443,   446,   449,   453,   455,   457,   459,   463,   465,
   469,   471,   474,   477,   480,   482,   484,   486,   488,   490,
   492,   494,   497,   499,   502,   506,   508,   510,   513,   515,
   520,   524,   528,   531,   533,   535,   537,   539,   541,   543,
   545,   547,   549,   551,   553,   555,   557,   559,   561,   564,
   567,   570,   573,   575,   577,   580,   583,   586,   589,   591,
   593,   595,   597,   599,   602,   605,   608,   611,   614,   618,
   622,   626,   630,   634,   638,   641,   645,   650,   655,   662,
   667,   672,   677,   684,   691,   696,   701,   705,   709,   713,
   717,   721,   725,   729,   733,   737
};

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

#endif

#if YYDEBUG != 0
static const short yyrline[] = { 0,
   269,   271,   279,   284,   287,   291,   293,   296,   298,   301,
   307,   319,   321,   323,   325,   327,   332,   337,   343,   346,
   351,   358,   361,   363,   371,   374,   376,   383,   386,   392,
   400,   403,   414,   415,   419,   422,   424,   428,   431,   449,
   457,   459,   467,   471,   474,   477,   481,   484,   488,   495,
   501,   503,   505,   507,   509,   511,   513,   518,   521,   523,
   527,   542,   544,   552,   558,   564,   571,   574,   582,   585,
   589,   594,   598,   602,   607,   614,   621,   628,   635,   640,
   645,   652,   667,   679,   685,   691,   697,   703,   722,   729,
   736,   743,   750,   757,   764,   771,   778,   785,   800,   812,
   818,   825,   837,   843,   849,   855,   861,   866,   872,   888,
   905,   910,   915,   920,   925,   930,   935,   940,   947,   956,
   965,   974,   983,   989,   996,  1001,  1011,  1018,  1039,  1042,
  1050,  1053,  1058,  1063,  1068,  1073,  1080,  1082,  1085,  1088,
  1092,  1095,  1101,  1107,  1113,  1121,  1132,  1136,  1144,  1147,
  1154,  1157,  1161,  1176,  1192,  1195,  1197,  1199,  1201,  1203,
  1205,  1207,  1209,  1213,  1218,  1225,  1233,  1237,  1244,  1250,
  1256,  1262,  1268,  1276,  1279,  1281,  1283,  1285,  1287,  1289,
  1291,  1293,  1295,  1297,  1299,  1301,  1303,  1305,  1307,  1309,
  1311,  1313,  1315,  1317,  1319,  1321,  1323,  1325,  1327,  1329,
  1331,  1335,  1344,  1346,  1353,  1360,  1367,  1374,  1381,  1383,
  1385,  1387,  1395,  1403,  1416,  1418,  1420,  1429,  1438,  1451,
  1460,  1469,  1478,  1480,  1482,  1484,  1486,  1492,  1494,  1496,
  1498,  1500,  1502,  1504,  1506,  1508
};

static const char * const yytname[] = {   "$","error","$illegal.","LABEL","VARIABLE",
"NUMBER","TEXT","COMMAND_LINE","DELIMITED","ORDINAL","TH","LEFT_ARROW_HEAD",
"RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX",
"CIRCLE","ELLIPSE","ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS","WIDTH",
"DIAMETER","FROM","TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP","SAME",
"INVISIBLE","LJUST","RJUST","ABOVE","BELOW","OF","THE","WAY","BETWEEN","AND",
"HERE","DOT_N","DOT_E","DOT_W","DOT_S","DOT_NE","DOT_SE","DOT_NW","DOT_SW","DOT_C",
"DOT_START","DOT_END","DOT_X","DOT_Y","DOT_HT","DOT_WID","DOT_RAD","SIN","COS",
"ATAN2","LOG","EXP","SQRT","K_MAX","K_MIN","INT","RAND","COPY","THRU","TOP",
"BOTTOM","UPPER","LOWER","SH","PRINT","CW","CCW","FOR","DO","IF","ELSE","ANDAND",
"OROR","NOTEQUAL","EQUALEQUAL","LESSEQUAL","GREATEREQUAL","LEFT_CORNER","RIGHT_CORNER",
"CENTER","END","START","RESET","UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF",
"COMMAND","DEFINE","UNDEF","'('","'`'","','","'<'","'>'","'+'","'-'","'*'","'/'",
"'%'","'!'","'^'","';'","'='","':'","'{'","'}'","'['","']'","')'","'.'","top",
"element_list","middle_element_list","optional_separator","separator","placeless_element",
"@1","@2","@3","@4","@5","@6","@7","reset_variables","print_args","print_arg",
"simple_if","@8","until","any_expr","text_expr","optional_by","element","@9",
"@10","optional_element","object_spec","@11","text","sprintf_args","position",
"position_not_place","between","expr_pair","place","label","ordinal","optional_ordinal_last",
"nth_primitive","object_type","label_path","relative_path","path","corner","expr",
""
};
#endif

static const short yyr1[] = {     0,
   134,   134,   135,   136,   136,   137,   137,   138,   138,   139,
   139,   139,   139,   139,   139,   139,   139,   139,   140,   139,
   139,   141,   142,   139,   143,   144,   139,   145,   139,   139,
   146,   139,   139,   139,   147,   147,   147,   148,   148,   149,
   149,   149,   151,   150,   152,   152,   153,   153,   154,   154,
   154,   154,   154,   154,   154,   154,   154,   155,   155,   155,
   156,   156,   156,   156,   157,   158,   156,   156,   159,   159,
   160,   160,   160,   160,   160,   160,   160,   160,   160,   160,
   160,   161,   160,   160,   160,   160,   160,   160,   160,   160,
   160,   160,   160,   160,   160,   160,   160,   160,   160,   160,
   160,   160,   160,   160,   160,   160,   160,   160,   160,   160,
   160,   160,   160,   160,   160,   160,   160,   160,   160,   160,
   160,   160,   160,   160,   162,   162,   163,   163,   164,   164,
   165,   165,   165,   165,   165,   165,   166,   166,   167,   167,
   168,   168,   168,   168,   168,   169,   169,   169,   170,   170,
   171,   171,   172,   172,   173,   173,   173,   173,   173,   173,
   173,   173,   173,   174,   174,   175,   175,   175,   176,   176,
   176,   176,   176,   177,   177,   177,   177,   177,   177,   177,
   177,   177,   177,   177,   177,   177,   177,   177,   177,   177,
   177,   177,   177,   177,   177,   177,   177,   177,   177,   177,
   177,   178,   178,   178,   178,   178,   178,   178,   178,   178,
   178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
   178,   178,   178,   178,   178,   178,   178,   178,   178,   178,
   178,   178,   178,   178,   178,   178
};

static const short yyr2[] = {     0,
     1,     1,     3,     1,     3,     0,     1,     1,     2,     3,
     4,     1,     1,     1,     1,     1,     2,     2,     0,     3,
     2,     0,     0,     7,     0,     0,     6,     0,    10,     1,
     0,     4,     1,     1,     2,     2,     3,     1,     2,     1,
     1,     1,     0,     5,     0,     2,     1,     1,     3,     3,
     3,     3,     3,     3,     3,     3,     2,     0,     2,     3,
     1,     4,     4,     4,     0,     0,     6,     1,     0,     1,
     1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
     3,     0,     4,     3,     3,     3,     3,     2,     2,     3,
     2,     3,     2,     3,     2,     3,     3,     3,     3,     3,
     3,     2,     2,     3,     2,     3,     2,     3,     2,     3,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     3,     2,     1,     5,     0,     3,     1,     1,
     1,     3,     3,     5,     5,     6,     1,     4,     3,     3,
     1,     2,     2,     3,     1,     1,     1,     3,     1,     3,
     1,     2,     2,     2,     1,     1,     1,     1,     1,     1,
     1,     2,     1,     2,     3,     1,     1,     2,     1,     4,
     3,     3,     2,     1,     1,     1,     1,     1,     1,     1,
     1,     1,     1,     1,     1,     1,     1,     1,     2,     2,
     2,     2,     1,     1,     2,     2,     2,     2,     1,     1,
     1,     1,     1,     2,     2,     2,     2,     2,     3,     3,
     3,     3,     3,     3,     2,     3,     4,     4,     6,     4,
     4,     4,     6,     6,     4,     4,     3,     3,     3,     3,
     3,     3,     3,     3,     3,     2
};

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

static const short yydefgoto[] = {   402,
     2,    32,   240,     4,    33,    45,   282,   373,   157,   349,
   400,   244,    34,    88,    89,    35,   323,   375,   177,   105,
   395,    36,   113,   368,   386,    37,   114,   106,   335,    91,
    92,   225,    93,   107,    95,    96,    97,    98,   204,   261,
   262,   263,    99,   108
};

static const short yypact[] = {  -118,
-32768,-32768,   640,  -113,  -100,   -59,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     5,-32768,   860,    28,   972,    30,  1406,   -61,   860,-32768,
-32768,  -118,-32768,    12,   -34,-32768,   748,-32768,-32768,  -118,
   972,   -67,   -24,-32768,    71,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   -51,    -2,    11,    31,    48,    51,
    55,    73,    91,    92,-32768,-32768,    68,   129,-32768,-32768,
-32768,-32768,-32768,  1084,   972,  1406,  1406,   860,-32768,-32768,
   -36,-32768,-32768,   192,  1995,    -1,   273,-32768,    67,  1987,
     2,   972,   972,   104,    -5,     4,   192,  2072,-32768,   592,
   174,   860,  -118,  -118,-32768,   612,-32768,   202,-32768,-32768,
-32768,-32768,  1855,  1855,  1693,  1774,  1406,  1406,  1406,  1406,
  1509,  1509,  1509,   251,  1612,-32768,  1855,  1855,  1855,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,  1406,  1855,-32768,
-32768,  2105,   494,-32768,   972,-32768,   201,-32768,   972,   972,
   972,   972,   972,   972,   972,   972,   972,   373,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,    78,   -46,    83,  2020,
   212,   100,   100,-32768,  1612,  1612,-32768,-32768,-32768,-32768,
-32768,   222,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,    95,-32768,-32768,    34,    96,   183,-32768,  1406,
  1406,  1406,  1406,  1406,  1406,  1406,  1509,  1406,  1406,  1406,
  1406,  1406,  1406,  1406,  1509,  1406,-32768,   100,-32768,   972,
   972,    27,    27,   972,   972,  1406,-32768,-32768,   108,   640,
   110,-32768,-32768,   236,  2105,  2105,  2105,  2105,  2105,  2105,
  2105,  2105,   -36,  1987,   -36,   -36,  1927,   264,   273,   242,
  1941,-32768,-32768,-32768,  1196,-32768,  2030,  2105,  2105,  2105,
  2105,  2105,  -100,   -59,    53,    54,-32768,   -36,     3,   153,
-32768,   240,-32768,   119,   135,   146,   143,   144,   150,   159,
   176,   157,-32768,   166,-32768,  1509,-32768,-32768,-32768,-32768,
-32768,-32768,    96,   252,   241,  2114,   289,   289,   114,   114,
  2105,   -41,   197,   114,   142,   142,   100,   100,   100,   100,
   -22,   556,   293,-32768,   241,   228,  2123,-32768,-32768,-32768,
   241,   228,  2123,   114,   -76,-32768,-32768,-32768,-32768,   273,
  1927,  1927,-32768,   311,-32768,    83,  2063,-32768,   218,-32768,
-32768,   972,-32768,-32768,-32768,   972,   972,-32768,-32768,   -72,
   274,  1509,  1509,  1406,-32768,  1406,-32768,   640,  1927,-32768,
-32768,-32768,   218,   318,-32768,   193,   194,   195,-32768,-32768,
    15,   -36,  1310,  2105,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,  1299,   239,  1406,  2105,-32768,  2105,   321,
-32768,   330,   344,-32768
};

static const short yypgoto[] = {-32768,
    61,-32768,    26,   313,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,   319,   -71,-32768,-32768,   -19,   -10,   -58,
-32768,  -115,-32768,-32768,-32768,-32768,-32768,     7,-32768,   -82,
   203,-32768,   -44,     6,   -75,-32768,-32768,-32768,   -88,-32768,
  -249,-32768,   -92,   -23
};


#define	YYLAST		2247


static const short yytable[] = {   100,
   242,   178,   193,   110,   194,   100,     1,   339,   205,    38,
    43,    39,   195,   152,   104,   117,   184,   196,   197,   198,
   199,   200,   201,   207,   202,     3,    40,   363,    94,    90,
   154,   101,     7,   109,    94,    90,    46,   277,   366,   179,
   184,   264,    49,   151,   227,   185,   186,    50,   253,   255,
   256,   111,   -14,   -15,   156,   367,   119,   115,   155,   379,
   180,   159,   182,   183,   100,   153,    41,    42,   296,    46,
   278,   185,   186,   362,   181,    49,   185,   186,   158,   228,
    50,   185,   186,    44,   169,   170,   230,   231,   100,    94,
   266,   370,   371,    94,    90,   185,   186,   232,   233,   245,
   246,   247,   248,   249,   250,   251,   252,   254,   254,   254,
   160,   267,   206,   268,   269,   270,   237,    94,    90,   387,
  -129,  -129,    38,   161,   271,   272,   118,   226,   203,   254,
   303,   393,   185,   186,   312,    28,    94,    94,    94,   229,
   299,   300,   321,   162,   281,   173,   174,    85,   284,   285,
   286,   287,   288,   289,   290,   291,   292,   294,   280,    38,
   163,   267,   267,   164,   264,   171,   172,   165,   345,   341,
   342,   324,   326,   239,   241,   330,   332,   -14,   -15,   238,
    85,   -14,   -15,   -14,   -15,   166,   305,   306,   307,   308,
   309,   310,   311,   313,   314,   315,   316,   317,   318,   319,
   320,   254,   322,   167,   168,   243,   325,   327,   283,   295,
   331,   333,   334,   360,   297,   187,   188,   189,   190,   191,
   346,   298,    94,   224,   301,   302,   175,   176,   192,   304,
    94,   219,   220,   221,   222,   223,   336,   224,   328,   329,
   337,   347,   208,   338,   343,   209,    38,   348,   264,   264,
   350,   369,   385,   257,   187,   188,   189,   190,   191,   258,
   352,   221,   222,   223,   259,   224,   351,    51,    52,   194,
  -130,  -130,   254,   356,   353,   354,   264,   340,   194,   381,
   382,   355,   196,   197,   198,   199,   200,   201,   358,   202,
   357,   196,   197,   198,   199,   200,   201,   359,   202,   361,
   365,    94,    54,    55,    56,    57,    58,    59,    60,    61,
    62,    63,    64,   372,   219,   220,   221,   222,   223,   230,
   224,   374,   380,   389,   390,   391,   392,   398,   401,   403,
    75,    76,    77,    78,   212,   213,   214,   215,   254,   254,
   383,   376,   384,   404,   116,   377,   378,   112,    79,    80,
    81,    82,    83,   388,     0,   279,   236,   218,   219,   220,
   221,   222,   223,     0,   224,     0,     0,    94,    94,     0,
   397,     0,   399,     0,    38,    46,    47,    48,     7,     0,
     0,    49,     0,   260,   214,   215,    50,     0,     0,    51,
    52,     0,     0,   203,     0,     0,     0,     0,     0,     0,
     0,     0,   203,     0,   236,   218,   219,   220,   221,   222,
   223,     0,   224,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,    53,    54,    55,    56,    57,    58,    59,
    60,    61,    62,    63,    64,     0,     0,     0,     0,     0,
    65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
     0,     0,    75,    76,    77,    78,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    79,    80,    81,    82,    83,     0,     0,     0,     0,     0,
     0,    28,     0,     0,     0,   102,    85,     0,     0,     0,
     0,    86,     0,     0,     0,   103,   273,   274,    48,     7,
     8,     0,    49,     0,   293,     0,     0,    50,     9,    10,
   275,   276,    13,    14,    15,    16,    17,    18,    19,    20,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    53,    54,    55,    56,    57,    58,
    59,    60,    61,    62,    63,    64,     0,     0,     0,     0,
     0,    65,    66,    67,    68,    69,    70,    71,    72,    73,
    74,    21,     0,    75,    76,    77,    78,    22,    23,     0,
     0,    24,     0,    25,     0,     0,     0,   364,     0,     0,
     0,    79,    80,    81,    82,    83,    26,     7,    27,     0,
     0,     0,    28,    29,     0,     0,    84,    85,     0,     0,
     0,     0,    86,     0,     5,     6,    87,     7,     8,     0,
     0,    30,     0,    31,     0,     0,     9,    10,    11,    12,
    13,    14,    15,    16,    17,    18,    19,    20,     0,     0,
     0,     0,     5,     6,     0,     7,     8,   210,   211,   212,
   213,   214,   215,     0,     9,    10,    11,    12,    13,    14,
    15,    16,    17,    18,    19,    20,     0,     0,     0,     0,
     0,   236,   218,   219,   220,   221,   222,   223,     0,   224,
     0,     0,     0,   210,   211,   212,   213,   214,   215,    21,
     0,     0,     0,     0,     0,    22,    23,     0,     0,    24,
    28,    25,     0,     0,     0,     0,     0,   236,   218,   219,
   220,   221,   222,   223,    26,   224,    27,    21,     0,     0,
    28,    29,     0,    22,    23,     0,     0,    24,     0,    25,
     0,     0,     0,     0,     0,     0,    39,     0,     0,    30,
     0,    31,    26,     0,    27,     0,     0,     0,    28,    29,
    46,    47,    48,     7,     0,     0,    49,     0,   120,   121,
   122,    50,   123,   124,   125,   126,     0,    30,     0,    31,
     0,     0,     0,     0,   127,   128,   129,   130,   131,   132,
   133,   134,   135,   136,   137,   138,   139,   140,   141,   142,
   143,   144,   145,     0,     0,     0,     0,     0,    53,    54,
    55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
     0,     0,     0,     0,     0,    65,    66,    67,    68,    69,
    70,    71,    72,    73,    74,     0,     0,    75,    76,    77,
    78,     0,     0,   146,   147,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,    79,    80,    81,    82,    83,
     0,     0,     0,   148,   149,   150,    28,     0,     0,     0,
   102,    85,    46,    47,    48,     7,    86,     0,    49,     0,
    87,     0,     0,    50,     0,     0,    51,    52,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
    63,    64,     0,     0,     0,     0,     0,    65,    66,    67,
    68,    69,    70,    71,    72,    73,    74,     0,     0,    75,
    76,    77,    78,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,    79,    80,    81,
    82,    83,     0,     0,     0,     0,     0,     0,    28,     0,
     0,     0,    84,    85,    46,    47,    48,     7,    86,     0,
    49,     0,    87,     0,     0,    50,     0,     0,    51,    52,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,    53,    54,    55,    56,    57,    58,    59,    60,
    61,    62,    63,    64,     0,     0,     0,     0,     0,    65,
    66,    67,    68,    69,    70,    71,    72,    73,    74,     0,
     0,    75,    76,    77,    78,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,    79,
    80,    81,    82,    83,     0,     0,     0,     0,     0,     0,
    28,     0,     0,     0,   102,    85,    46,    47,    48,     7,
    86,     0,    49,     0,   103,     0,     0,    50,     0,     0,
    51,    52,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,    53,    54,    55,    56,    57,    58,
    59,    60,    61,    62,    63,    64,     0,     0,     0,     0,
     0,    65,    66,    67,    68,    69,    70,    71,    72,    73,
    74,     0,     0,    75,    76,    77,    78,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,    79,    80,    81,    82,    83,     0,     0,     0,     0,
     0,     0,    28,     0,     0,     0,    84,    85,    46,    47,
    48,     7,    86,     0,    49,     0,   103,     0,     0,    50,
     0,     0,    51,    52,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    53,    54,    55,    56,
    57,    58,    59,    60,    61,    62,    63,    64,     0,     0,
     0,     0,     0,    65,    66,    67,    68,    69,    70,    71,
    72,    73,    74,     0,     0,    75,    76,    77,    78,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,    79,    80,    81,    82,    83,     0,     0,
     0,    46,    47,    48,    28,     0,     0,    49,   265,    85,
     0,     0,    50,     0,    86,    51,    52,     0,   103,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,   394,     0,     0,     0,     0,    53,
    54,    55,    56,    57,    58,    59,    60,    61,    62,    63,
    64,     0,     0,     0,     0,     0,    65,    66,    67,    68,
    69,    70,    71,    72,    73,    74,     0,     0,    75,    76,
    77,    78,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    79,    80,    81,    82,
    83,   210,   211,   212,   213,   214,   215,     0,    46,    47,
    48,   102,    85,     0,    49,     0,     0,    86,   396,    50,
     0,    87,    51,    52,     0,   236,   218,   219,   220,   221,
   222,   223,     0,   224,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    53,    54,    55,    56,
    57,    58,    59,    60,    61,    62,    63,    64,     0,     0,
     0,     0,     0,    65,    66,    67,    68,    69,    70,    71,
    72,    73,    74,     0,     0,    75,    76,    77,    78,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,    79,    80,    81,    82,    83,     0,     0,
     0,    46,    47,    48,     0,     0,     0,    49,   102,    85,
     0,     0,    50,     0,    86,    51,    52,     0,    87,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,    53,
    54,    55,    56,    57,    58,    59,    60,    61,    62,    63,
    64,     0,     0,     0,     0,     0,    65,    66,    67,    68,
    69,    70,    71,    72,    73,    74,     0,     0,    75,    76,
    77,    78,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    79,    80,    81,    82,
    83,     0,     0,     0,    46,    47,    48,     0,     0,     0,
    49,    84,    85,     0,     0,    50,     0,    86,    51,    52,
     0,    87,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,    53,    54,    55,    56,    57,    58,    59,    60,
    61,    62,    63,    64,     0,     0,     0,     0,     0,    65,
    66,    67,    68,    69,    70,    71,    72,    73,    74,     0,
     0,    75,    76,    77,    78,    46,    47,    48,     0,     0,
     0,    49,     0,     0,     0,     0,    50,     0,     0,    79,
    80,    81,    82,    83,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,   265,    85,     0,     0,     0,     0,
    86,     0,     0,     0,    87,     0,     0,     0,  -187,     0,
     0,     0,     0,    53,    54,    55,    56,    57,    58,    59,
    60,    61,    62,    63,    64,     0,     0,     0,     0,     0,
    65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
     0,     0,    75,    76,    77,    78,    46,    47,    48,     0,
     0,     0,    49,     0,     0,     0,     0,    50,     0,     0,
    79,    80,    81,    82,    83,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,   102,    85,     0,     0,     0,
     0,    86,     0,     0,     0,    87,     0,     0,     0,  -188,
     0,     0,     0,     0,    53,    54,    55,    56,    57,    58,
    59,    60,    61,    62,    63,    64,     0,     0,     0,     0,
     0,    65,    66,    67,    68,    69,    70,    71,    72,    73,
    74,     0,     0,    75,    76,    77,    78,    46,    47,    48,
     0,     0,     0,    49,     0,     0,     0,     0,    50,     0,
     0,    79,    80,    81,    82,    83,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,   102,    85,     0,     0,
     0,     0,    86,     0,     0,     0,    87,     0,     0,     0,
     0,     0,     0,     0,     0,    53,    54,    55,    56,    57,
    58,    59,    60,    61,    62,    63,    64,     0,     0,     0,
     0,     0,    65,    66,    67,    68,    69,    70,    71,    72,
    73,    74,     0,     0,    75,    76,    77,    78,     0,     0,
     0,     0,     0,    51,    52,     0,     0,     0,     0,     0,
     0,     0,    79,    80,    81,    82,    83,    51,    52,     0,
     0,     0,     0,     0,     0,     0,     0,   102,    85,     0,
     0,     0,     0,    86,     0,     0,     0,    87,    54,    55,
    56,    57,    58,    59,    60,    61,    62,    63,    64,     0,
     0,     0,    54,    55,    56,    57,    58,    59,    60,    61,
    62,    63,    64,     0,     0,     0,    75,    76,    77,    78,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    75,    76,    77,    78,    79,    80,    81,    82,    83,     0,
     0,     0,   208,     0,     0,   209,     0,     0,    79,    80,
    81,    82,    83,     0,     0,     0,    54,    55,    56,    57,
    58,    59,    60,    61,    62,    63,    64,     0,     0,   260,
     0,     0,     0,     0,     0,   208,     0,     0,   209,     0,
     0,     0,     0,   344,    75,    76,    77,    78,   210,   211,
   212,   213,   214,   215,     0,     0,     0,     0,     0,     0,
     0,     0,    79,    80,    81,    82,    83,     0,     0,     0,
     0,   216,   217,   218,   219,   220,   221,   222,   223,     0,
   224,   234,   235,   212,   213,   214,   215,     0,     0,     0,
     0,   210,   211,   212,   213,   214,   215,   192,     0,     0,
     0,     0,     0,     0,   216,   217,   218,   219,   220,   221,
   222,   223,     0,   224,   216,   236,   218,   219,   220,   221,
   222,   223,     0,   224,   234,   235,   212,   213,   214,   215,
     0,     0,     0,   234,   235,   212,   213,   214,   215,     0,
     0,     0,     0,     0,     0,     0,     0,   216,   236,   218,
   219,   220,   221,   222,   223,     0,   224,   236,   218,   219,
   220,   221,   222,   223,     0,   224,   210,   211,   212,   213,
   214,   215,     0,     0,     0,   210,     0,   212,   213,   214,
   215,     0,     0,     0,   234,     0,   212,   213,   214,   215,
   236,   218,   219,   220,   221,   222,   223,     0,   224,   236,
   218,   219,   220,   221,   222,   223,     0,   224,   236,   218,
   219,   220,   221,   222,   223,     0,   224
};

static const short yycheck[] = {    23,
   116,    84,    95,    27,     6,    29,   125,   257,    97,     3,
     6,   125,    14,    37,    25,     4,    88,    19,    20,    21,
    22,    23,    24,    99,    26,     0,   127,    50,    23,    23,
    41,     4,     6,     4,    29,    29,     3,   153,   115,    84,
   112,   134,     9,    37,   103,   118,   119,    14,   131,   132,
   133,   113,     0,     0,    79,   132,    91,    32,   126,   132,
    84,   113,    86,    87,    88,    40,   126,   127,   115,     3,
   153,   118,   119,   115,    85,     9,   118,   119,     8,   103,
    14,   118,   119,    79,    17,    18,    92,    93,   112,    84,
   135,   341,   342,    88,    88,   118,   119,    94,    95,   123,
   124,   125,   126,   127,   128,   129,   130,   131,   132,   133,
   113,   135,    46,   137,   138,   139,   110,   112,   112,   369,
   118,   119,   116,   113,   148,   149,   115,   126,   130,   153,
   206,   117,   118,   119,   217,   109,   131,   132,   133,    36,
   185,   186,   225,   113,   155,    17,    18,   114,   159,   160,
   161,   162,   163,   164,   165,   166,   167,   168,   153,   153,
   113,   185,   186,   113,   257,    98,    99,   113,   261,   258,
   259,   230,   231,   113,   114,   234,   235,   125,   125,     6,
   114,   129,   129,   131,   131,   113,   210,   211,   212,   213,
   214,   215,   216,   217,   218,   219,   220,   221,   222,   223,
   224,   225,   226,   113,   113,     4,   230,   231,     8,   132,
   234,   235,   236,   296,   132,    63,    64,    65,    66,    67,
   265,    10,   217,   124,     3,   131,    98,    99,   133,    47,
   225,   118,   119,   120,   121,   122,   129,   124,   232,   233,
   131,   265,    46,     8,     3,    49,   240,     8,   341,   342,
   132,   340,   368,     3,    63,    64,    65,    66,    67,     9,
   115,   120,   121,   122,    14,   124,   132,    17,    18,     6,
   118,   119,   296,   115,   132,   132,   369,    14,     6,   362,
   363,   132,    19,    20,    21,    22,    23,    24,   132,    26,
   115,    19,    20,    21,    22,    23,    24,   132,    26,    48,
     8,   296,    52,    53,    54,    55,    56,    57,    58,    59,
    60,    61,    62,     3,   118,   119,   120,   121,   122,    92,
   124,   104,    49,     6,   132,   132,   132,    89,     8,     0,
    80,    81,    82,    83,    94,    95,    96,    97,   362,   363,
   364,   352,   366,     0,    32,   356,   357,    29,    98,    99,
   100,   101,   102,   373,    -1,   153,   116,   117,   118,   119,
   120,   121,   122,    -1,   124,    -1,    -1,   362,   363,    -1,
   394,    -1,   396,    -1,   368,     3,     4,     5,     6,    -1,
    -1,     9,    -1,   133,    96,    97,    14,    -1,    -1,    17,
    18,    -1,    -1,   130,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,   130,    -1,   116,   117,   118,   119,   120,   121,
   122,    -1,   124,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    51,    52,    53,    54,    55,    56,    57,
    58,    59,    60,    61,    62,    -1,    -1,    -1,    -1,    -1,
    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
    -1,    -1,    80,    81,    82,    83,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
    -1,   109,    -1,    -1,    -1,   113,   114,    -1,    -1,    -1,
    -1,   119,    -1,    -1,    -1,   123,     3,     4,     5,     6,
     7,    -1,     9,    -1,   132,    -1,    -1,    14,    15,    16,
    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    51,    52,    53,    54,    55,    56,
    57,    58,    59,    60,    61,    62,    -1,    -1,    -1,    -1,
    -1,    68,    69,    70,    71,    72,    73,    74,    75,    76,
    77,    78,    -1,    80,    81,    82,    83,    84,    85,    -1,
    -1,    88,    -1,    90,    -1,    -1,    -1,    32,    -1,    -1,
    -1,    98,    99,   100,   101,   102,   103,     6,   105,    -1,
    -1,    -1,   109,   110,    -1,    -1,   113,   114,    -1,    -1,
    -1,    -1,   119,    -1,     3,     4,   123,     6,     7,    -1,
    -1,   128,    -1,   130,    -1,    -1,    15,    16,    17,    18,
    19,    20,    21,    22,    23,    24,    25,    26,    -1,    -1,
    -1,    -1,     3,     4,    -1,     6,     7,    92,    93,    94,
    95,    96,    97,    -1,    15,    16,    17,    18,    19,    20,
    21,    22,    23,    24,    25,    26,    -1,    -1,    -1,    -1,
    -1,   116,   117,   118,   119,   120,   121,   122,    -1,   124,
    -1,    -1,    -1,    92,    93,    94,    95,    96,    97,    78,
    -1,    -1,    -1,    -1,    -1,    84,    85,    -1,    -1,    88,
   109,    90,    -1,    -1,    -1,    -1,    -1,   116,   117,   118,
   119,   120,   121,   122,   103,   124,   105,    78,    -1,    -1,
   109,   110,    -1,    84,    85,    -1,    -1,    88,    -1,    90,
    -1,    -1,    -1,    -1,    -1,    -1,   125,    -1,    -1,   128,
    -1,   130,   103,    -1,   105,    -1,    -1,    -1,   109,   110,
     3,     4,     5,     6,    -1,    -1,     9,    -1,    11,    12,
    13,    14,    15,    16,    17,    18,    -1,   128,    -1,   130,
    -1,    -1,    -1,    -1,    27,    28,    29,    30,    31,    32,
    33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
    43,    44,    45,    -1,    -1,    -1,    -1,    -1,    51,    52,
    53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
    -1,    -1,    -1,    -1,    -1,    68,    69,    70,    71,    72,
    73,    74,    75,    76,    77,    -1,    -1,    80,    81,    82,
    83,    -1,    -1,    86,    87,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    98,    99,   100,   101,   102,
    -1,    -1,    -1,   106,   107,   108,   109,    -1,    -1,    -1,
   113,   114,     3,     4,     5,     6,   119,    -1,     9,    -1,
   123,    -1,    -1,    14,    -1,    -1,    17,    18,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
    61,    62,    -1,    -1,    -1,    -1,    -1,    68,    69,    70,
    71,    72,    73,    74,    75,    76,    77,    -1,    -1,    80,
    81,    82,    83,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    98,    99,   100,
   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,   109,    -1,
    -1,    -1,   113,   114,     3,     4,     5,     6,   119,    -1,
     9,    -1,   123,    -1,    -1,    14,    -1,    -1,    17,    18,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    51,    52,    53,    54,    55,    56,    57,    58,
    59,    60,    61,    62,    -1,    -1,    -1,    -1,    -1,    68,
    69,    70,    71,    72,    73,    74,    75,    76,    77,    -1,
    -1,    80,    81,    82,    83,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    98,
    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,
   109,    -1,    -1,    -1,   113,   114,     3,     4,     5,     6,
   119,    -1,     9,    -1,   123,    -1,    -1,    14,    -1,    -1,
    17,    18,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    51,    52,    53,    54,    55,    56,
    57,    58,    59,    60,    61,    62,    -1,    -1,    -1,    -1,
    -1,    68,    69,    70,    71,    72,    73,    74,    75,    76,
    77,    -1,    -1,    80,    81,    82,    83,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,
    -1,    -1,   109,    -1,    -1,    -1,   113,   114,     3,     4,
     5,     6,   119,    -1,     9,    -1,   123,    -1,    -1,    14,
    -1,    -1,    17,    18,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    51,    52,    53,    54,
    55,    56,    57,    58,    59,    60,    61,    62,    -1,    -1,
    -1,    -1,    -1,    68,    69,    70,    71,    72,    73,    74,
    75,    76,    77,    -1,    -1,    80,    81,    82,    83,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    98,    99,   100,   101,   102,    -1,    -1,
    -1,     3,     4,     5,   109,    -1,    -1,     9,   113,   114,
    -1,    -1,    14,    -1,   119,    17,    18,    -1,   123,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,    51,
    52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
    62,    -1,    -1,    -1,    -1,    -1,    68,    69,    70,    71,
    72,    73,    74,    75,    76,    77,    -1,    -1,    80,    81,
    82,    83,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    98,    99,   100,   101,
   102,    92,    93,    94,    95,    96,    97,    -1,     3,     4,
     5,   113,   114,    -1,     9,    -1,    -1,   119,   120,    14,
    -1,   123,    17,    18,    -1,   116,   117,   118,   119,   120,
   121,   122,    -1,   124,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    51,    52,    53,    54,
    55,    56,    57,    58,    59,    60,    61,    62,    -1,    -1,
    -1,    -1,    -1,    68,    69,    70,    71,    72,    73,    74,
    75,    76,    77,    -1,    -1,    80,    81,    82,    83,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    98,    99,   100,   101,   102,    -1,    -1,
    -1,     3,     4,     5,    -1,    -1,    -1,     9,   113,   114,
    -1,    -1,    14,    -1,   119,    17,    18,    -1,   123,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    51,
    52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
    62,    -1,    -1,    -1,    -1,    -1,    68,    69,    70,    71,
    72,    73,    74,    75,    76,    77,    -1,    -1,    80,    81,
    82,    83,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    98,    99,   100,   101,
   102,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,    -1,
     9,   113,   114,    -1,    -1,    14,    -1,   119,    17,    18,
    -1,   123,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    51,    52,    53,    54,    55,    56,    57,    58,
    59,    60,    61,    62,    -1,    -1,    -1,    -1,    -1,    68,
    69,    70,    71,    72,    73,    74,    75,    76,    77,    -1,
    -1,    80,    81,    82,    83,     3,     4,     5,    -1,    -1,
    -1,     9,    -1,    -1,    -1,    -1,    14,    -1,    -1,    98,
    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,   113,   114,    -1,    -1,    -1,    -1,
   119,    -1,    -1,    -1,   123,    -1,    -1,    -1,    46,    -1,
    -1,    -1,    -1,    51,    52,    53,    54,    55,    56,    57,
    58,    59,    60,    61,    62,    -1,    -1,    -1,    -1,    -1,
    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
    -1,    -1,    80,    81,    82,    83,     3,     4,     5,    -1,
    -1,    -1,     9,    -1,    -1,    -1,    -1,    14,    -1,    -1,
    98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,   113,   114,    -1,    -1,    -1,
    -1,   119,    -1,    -1,    -1,   123,    -1,    -1,    -1,    46,
    -1,    -1,    -1,    -1,    51,    52,    53,    54,    55,    56,
    57,    58,    59,    60,    61,    62,    -1,    -1,    -1,    -1,
    -1,    68,    69,    70,    71,    72,    73,    74,    75,    76,
    77,    -1,    -1,    80,    81,    82,    83,     3,     4,     5,
    -1,    -1,    -1,     9,    -1,    -1,    -1,    -1,    14,    -1,
    -1,    98,    99,   100,   101,   102,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,   113,   114,    -1,    -1,
    -1,    -1,   119,    -1,    -1,    -1,   123,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    51,    52,    53,    54,    55,
    56,    57,    58,    59,    60,    61,    62,    -1,    -1,    -1,
    -1,    -1,    68,    69,    70,    71,    72,    73,    74,    75,
    76,    77,    -1,    -1,    80,    81,    82,    83,    -1,    -1,
    -1,    -1,    -1,    17,    18,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    98,    99,   100,   101,   102,    17,    18,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,   113,   114,    -1,
    -1,    -1,    -1,   119,    -1,    -1,    -1,   123,    52,    53,
    54,    55,    56,    57,    58,    59,    60,    61,    62,    -1,
    -1,    -1,    52,    53,    54,    55,    56,    57,    58,    59,
    60,    61,    62,    -1,    -1,    -1,    80,    81,    82,    83,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    80,    81,    82,    83,    98,    99,   100,   101,   102,    -1,
    -1,    -1,    46,    -1,    -1,    49,    -1,    -1,    98,    99,
   100,   101,   102,    -1,    -1,    -1,    52,    53,    54,    55,
    56,    57,    58,    59,    60,    61,    62,    -1,    -1,   133,
    -1,    -1,    -1,    -1,    -1,    46,    -1,    -1,    49,    -1,
    -1,    -1,    -1,   133,    80,    81,    82,    83,    92,    93,
    94,    95,    96,    97,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    98,    99,   100,   101,   102,    -1,    -1,    -1,
    -1,   115,   116,   117,   118,   119,   120,   121,   122,    -1,
   124,    92,    93,    94,    95,    96,    97,    -1,    -1,    -1,
    -1,    92,    93,    94,    95,    96,    97,   133,    -1,    -1,
    -1,    -1,    -1,    -1,   115,   116,   117,   118,   119,   120,
   121,   122,    -1,   124,   115,   116,   117,   118,   119,   120,
   121,   122,    -1,   124,    92,    93,    94,    95,    96,    97,
    -1,    -1,    -1,    92,    93,    94,    95,    96,    97,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,   115,   116,   117,
   118,   119,   120,   121,   122,    -1,   124,   116,   117,   118,
   119,   120,   121,   122,    -1,   124,    92,    93,    94,    95,
    96,    97,    -1,    -1,    -1,    92,    -1,    94,    95,    96,
    97,    -1,    -1,    -1,    92,    -1,    94,    95,    96,    97,
   116,   117,   118,   119,   120,   121,   122,    -1,   124,   116,
   117,   118,   119,   120,   121,   122,    -1,   124,   116,   117,
   118,   119,   120,   121,   122,    -1,   124
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "dh1:Library/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__) || defined (__sparc) || defined (__sgi)
#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
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#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

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
int yyparse (void);
#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 184 "dh1:Library/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 = 0;		/*  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--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#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.
     The wasted elements are never initialized.  */

  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.  */
#ifdef YYLSP_NEEDED
      /* This used to be a conditional around just the two extra args,
	 but that might be undefined if yyoverflow is a macro.  */
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yyls1, size * sizeof (*yylsp),
		 &yystacksize);
#else
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yystacksize);
#endif

      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

  goto yybackup;
 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];
  if (yylen > 0)
    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 symbols 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 2:
#line 272 "pic.y"
{
		  if (olist.head)
		    print_picture(olist.head);
		;
    break;}
case 3:
#line 281 "pic.y"
{ yyval.pl = yyvsp[-1].pl; ;
    break;}
case 4:
#line 286 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
    break;}
case 5:
#line 288 "pic.y"
{ yyval.pl = yyvsp[-2].pl; ;
    break;}
case 10:
#line 303 "pic.y"
{
		  define_variable(yyvsp[-2].str, yyvsp[0].x);
		  a_delete yyvsp[-2].str;
		;
    break;}
case 11:
#line 308 "pic.y"
{
		  place *p = lookup_label(yyvsp[-3].str);
		  if (!p) {
		    lex_error("variable `%1' not defined", yyvsp[-3].str);
		    YYABORT;
		  }
		  p->obj = 0;
		  p->x = yyvsp[0].x;
		  p->y = 0.0;
		  a_delete yyvsp[-3].str;
		;
    break;}
case 12:
#line 320 "pic.y"
{ current_direction = UP_DIRECTION; ;
    break;}
case 13:
#line 322 "pic.y"
{ current_direction = DOWN_DIRECTION; ;
    break;}
case 14:
#line 324 "pic.y"
{ current_direction = LEFT_DIRECTION; ;
    break;}
case 15:
#line 326 "pic.y"
{ current_direction = RIGHT_DIRECTION; ;
    break;}
case 16:
#line 328 "pic.y"
{
		  olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
						   yyvsp[0].lstr.lineno));
		;
    break;}
case 17:
#line 333 "pic.y"
{
		  olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
						   yyvsp[0].lstr.lineno));
		;
    break;}
case 18:
#line 338 "pic.y"
{
		  fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
		  a_delete yyvsp[0].lstr.str;
	          fflush(stderr);
		;
    break;}
case 19:
#line 344 "pic.y"
{ delim_flag = 1; ;
    break;}
case 20:
#line 346 "pic.y"
{
		  delim_flag = 0;
		  system(yyvsp[0].str);
		  a_delete yyvsp[0].str;
		;
    break;}
case 21:
#line 352 "pic.y"
{
		  if (yychar < 0)
		    do_lookahead();
		  do_copy(yyvsp[0].lstr.str);
		  // do not delete the filename
		;
    break;}
case 22:
#line 359 "pic.y"
{ delim_flag = 2; ;
    break;}
case 23:
#line 361 "pic.y"
{ delim_flag = 0; ;
    break;}
case 24:
#line 363 "pic.y"
{
		  if (yychar < 0)
		    do_lookahead();
		  copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str);
		  // do not delete the filename
		  a_delete yyvsp[-2].str;
		  a_delete yyvsp[0].str;
		;
    break;}
case 25:
#line 372 "pic.y"
{ delim_flag = 2; ;
    break;}
case 26:
#line 374 "pic.y"
{ delim_flag = 0; ;
    break;}
case 27:
#line 376 "pic.y"
{
		  if (yychar < 0)
		    do_lookahead();
		  copy_rest_thru(yyvsp[-2].str, yyvsp[0].str);
		  a_delete yyvsp[-2].str;
		  a_delete yyvsp[0].str;
		;
    break;}
case 28:
#line 384 "pic.y"
{ delim_flag = 1; ;
    break;}
case 29:
#line 386 "pic.y"
{
		  delim_flag = 0;
		  if (yychar < 0)
		    do_lookahead();
		  do_for(yyvsp[-8].str, yyvsp[-6].x, yyvsp[-4].x, yyvsp[-3].by.is_multiplicative, yyvsp[-3].by.val, yyvsp[0].str); 
		;
    break;}
case 30:
#line 393 "pic.y"
{
		  if (yychar < 0)
		    do_lookahead();
		  if (yyvsp[0].if_data.x != 0.0)
		    push_body(yyvsp[0].if_data.body);
		  a_delete yyvsp[0].if_data.body;
		;
    break;}
case 31:
#line 401 "pic.y"
{ delim_flag = 1; ;
    break;}
case 32:
#line 403 "pic.y"
{
		  delim_flag = 0;
		  if (yychar < 0)
		    do_lookahead();
		  if (yyvsp[-3].if_data.x != 0.0)
		    push_body(yyvsp[-3].if_data.body);
		  else
		    push_body(yyvsp[0].str);
		  a_delete yyvsp[-3].if_data.body;
		  a_delete yyvsp[0].str;
		;
    break;}
case 34:
#line 416 "pic.y"
{ define_variable("scale", 1.0); ;
    break;}
case 35:
#line 421 "pic.y"
{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
    break;}
case 36:
#line 423 "pic.y"
{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
    break;}
case 37:
#line 425 "pic.y"
{ reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
    break;}
case 38:
#line 430 "pic.y"
{ yyval.lstr = yyvsp[0].lstr; ;
    break;}
case 39:
#line 432 "pic.y"
{
		  yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1];
		  strcpy(yyval.lstr.str, yyvsp[-1].lstr.str);
		  strcat(yyval.lstr.str, yyvsp[0].lstr.str);
		  a_delete yyvsp[-1].lstr.str;
		  a_delete yyvsp[0].lstr.str;
		  if (yyvsp[-1].lstr.filename) {
		    yyval.lstr.filename = yyvsp[-1].lstr.filename;
		    yyval.lstr.lineno = yyvsp[-1].lstr.lineno;
		  }
		  else if (yyvsp[0].lstr.filename) {
		    yyval.lstr.filename = yyvsp[0].lstr.filename;
		    yyval.lstr.lineno = yyvsp[0].lstr.lineno;
		  }
		;
    break;}
case 40:
#line 451 "pic.y"
{
		  yyval.lstr.str = new char[GDIGITS + 1];
		  sprintf(yyval.lstr.str, "%g", yyvsp[0].x);
		  yyval.lstr.filename = 0;
		  yyval.lstr.lineno = 0;
		;
    break;}
case 41:
#line 458 "pic.y"
{ yyval.lstr = yyvsp[0].lstr; ;
    break;}
case 42:
#line 460 "pic.y"
{
		  yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1];
		  sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y);
		  yyval.lstr.filename = 0;
		  yyval.lstr.lineno = 0;
		;
    break;}
case 43:
#line 469 "pic.y"
{ delim_flag = 1; ;
    break;}
case 44:
#line 471 "pic.y"
{ delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ;
    break;}
case 45:
#line 476 "pic.y"
{ yyval.str = 0; ;
    break;}
case 46:
#line 478 "pic.y"
{ yyval.str = yyvsp[0].lstr.str; ;
    break;}
case 47:
#line 483 "pic.y"
{ yyval.x = yyvsp[0].x; ;
    break;}
case 48:
#line 485 "pic.y"
{ yyval.x = yyvsp[0].x; ;
    break;}
case 49:
#line 490 "pic.y"
{
		  yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0;
		  a_delete yyvsp[-2].lstr.str;
		  a_delete yyvsp[0].lstr.str;
		;
    break;}
case 50:
#line 496 "pic.y"
{
		  yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0;
		  a_delete yyvsp[-2].lstr.str;
		  a_delete yyvsp[0].lstr.str;
		;
    break;}
case 51:
#line 502 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
    break;}
case 52:
#line 504 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
    break;}
case 53:
#line 506 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
    break;}
case 54:
#line 508 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
    break;}
case 55:
#line 510 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
    break;}
case 56:
#line 512 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
    break;}
case 57:
#line 514 "pic.y"
{ yyval.x = (yyvsp[0].x == 0.0); ;
    break;}
case 58:
#line 520 "pic.y"
{ yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ;
    break;}
case 59:
#line 522 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ;
    break;}
case 60:
#line 524 "pic.y"
{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ;
    break;}
case 61:
#line 529 "pic.y"
{
		  yyval.pl.obj = yyvsp[0].spec->make_object(&current_position,
					   &current_direction);
		  if (yyval.pl.obj == 0)
		    YYABORT;
		  delete yyvsp[0].spec;
		  if (yyval.pl.obj)
		    olist.append(yyval.pl.obj);
		  else {
		    yyval.pl.x = current_position.x;
		    yyval.pl.y = current_position.y;
		  }
		;
    break;}
case 62:
#line 543 "pic.y"
{ yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ;
    break;}
case 63:
#line 545 "pic.y"
{
		  yyval.pl.obj = 0;
		  yyval.pl.x = yyvsp[0].pair.x;
		  yyval.pl.y = yyvsp[0].pair.y;
		  define_label(yyvsp[-3].str, & yyval.pl);
		  a_delete yyvsp[-3].str;
		;
    break;}
case 64:
#line 553 "pic.y"
{
		  yyval.pl = yyvsp[0].pl;
		  define_label(yyvsp[-3].str, & yyval.pl);
		  a_delete yyvsp[-3].str;
		;
    break;}
case 65:
#line 559 "pic.y"
{
		  yyval.state.x = current_position.x;
		  yyval.state.y = current_position.y;
		  yyval.state.dir = current_direction;
		;
    break;}
case 66:
#line 565 "pic.y"
{
		  current_position.x = yyvsp[-2].state.x;
		  current_position.y = yyvsp[-2].state.y;
		  current_direction = yyvsp[-2].state.dir;
		;
    break;}
case 67:
#line 571 "pic.y"
{
		  yyval.pl = yyvsp[-3].pl;
		;
    break;}
case 68:
#line 575 "pic.y"
{
		  yyval.pl.obj = 0;
		  yyval.pl.x = current_position.x;
		  yyval.pl.y = current_position.y;
		;
    break;}
case 69:
#line 584 "pic.y"
{;
    break;}
case 70:
#line 586 "pic.y"
{;
    break;}
case 71:
#line 591 "pic.y"
{
		  yyval.spec = new object_spec(BOX_OBJECT);
		;
    break;}
case 72:
#line 595 "pic.y"
{
		  yyval.spec = new object_spec(CIRCLE_OBJECT);
		;
    break;}
case 73:
#line 599 "pic.y"
{
		  yyval.spec = new object_spec(ELLIPSE_OBJECT);
		;
    break;}
case 74:
#line 603 "pic.y"
{
		  yyval.spec = new object_spec(ARC_OBJECT);
		  yyval.spec->dir = current_direction;
		;
    break;}
case 75:
#line 608 "pic.y"
{
		  yyval.spec = new object_spec(LINE_OBJECT);
		  lookup_variable("lineht", & yyval.spec->segment_height);
		  lookup_variable("linewid", & yyval.spec->segment_width);
		  yyval.spec->dir = current_direction;
		;
    break;}
case 76:
#line 615 "pic.y"
{
		  yyval.spec = new object_spec(ARROW_OBJECT);
		  lookup_variable("lineht", & yyval.spec->segment_height);
		  lookup_variable("linewid", & yyval.spec->segment_width);
		  yyval.spec->dir = current_direction;
		;
    break;}
case 77:
#line 622 "pic.y"
{
		  yyval.spec = new object_spec(MOVE_OBJECT);
		  lookup_variable("moveht", & yyval.spec->segment_height);
		  lookup_variable("movewid", & yyval.spec->segment_width);
		  yyval.spec->dir = current_direction;
		;
    break;}
case 78:
#line 629 "pic.y"
{
		  yyval.spec = new object_spec(SPLINE_OBJECT);
		  lookup_variable("lineht", & yyval.spec->segment_height);
		  lookup_variable("linewid", & yyval.spec->segment_width);
		  yyval.spec->dir = current_direction;
		;
    break;}
case 79:
#line 636 "pic.y"
{
		  yyval.spec = new object_spec(TEXT_OBJECT);
		  yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
		;
    break;}
case 80:
#line 641 "pic.y"
{
		  yyval.spec = new object_spec(TEXT_OBJECT);
		  yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1);
		;
    break;}
case 81:
#line 646 "pic.y"
{
		  yyval.spec = new object_spec(TEXT_OBJECT);
		  yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x),
					   yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
		  a_delete yyvsp[0].lstr.str;
		;
    break;}
case 82:
#line 653 "pic.y"
{
		  saved_state *p = new saved_state;
		  yyval.pstate = p;
		  p->x = current_position.x;
		  p->y = current_position.y;
		  p->dir = current_direction;
		  p->tbl = current_table;
		  p->prev = current_saved_state;
		  current_position.x = 0.0;
		  current_position.y = 0.0;
		  current_table = new PTABLE(place);
		  current_saved_state = p;
		  olist.append(make_mark_object());
		;
    break;}
case 83:
#line 668 "pic.y"
{
		  current_position.x = yyvsp[-2].pstate->x;
		  current_position.y = yyvsp[-2].pstate->y;
		  current_direction = yyvsp[-2].pstate->dir;
		  yyval.spec = new object_spec(BLOCK_OBJECT);
		  olist.wrap_up_block(& yyval.spec->oblist);
		  yyval.spec->tbl = current_table;
		  current_table = yyvsp[-2].pstate->tbl;
		  current_saved_state = yyvsp[-2].pstate->prev;
		  delete yyvsp[-2].pstate;
		;
    break;}
case 84:
#line 680 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->height = yyvsp[0].x;
		  yyval.spec->flags |= HAS_HEIGHT;
		;
    break;}
case 85:
#line 686 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->radius = yyvsp[0].x;
		  yyval.spec->flags |= HAS_RADIUS;
		;
    break;}
case 86:
#line 692 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->width = yyvsp[0].x;
		  yyval.spec->flags |= HAS_WIDTH;
		;
    break;}
case 87:
#line 698 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->radius = yyvsp[0].x/2.0;
		  yyval.spec->flags |= HAS_RADIUS;
		;
    break;}
case 88:
#line 704 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= HAS_SEGMENT;
		  switch (yyval.spec->dir) {
		  case UP_DIRECTION:
		    yyval.spec->segment_pos.y += yyvsp[0].x;
		    break;
		  case DOWN_DIRECTION:
		    yyval.spec->segment_pos.y -= yyvsp[0].x;
		    break;
		  case RIGHT_DIRECTION:
		    yyval.spec->segment_pos.x += yyvsp[0].x;
		    break;
		  case LEFT_DIRECTION:
		    yyval.spec->segment_pos.x -= yyvsp[0].x;
		    break;
		  }
		;
    break;}
case 89:
#line 723 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->dir = UP_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.y += yyval.spec->segment_height;
		;
    break;}
case 90:
#line 730 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->dir = UP_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.y += yyvsp[0].x;
		;
    break;}
case 91:
#line 737 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->dir = DOWN_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.y -= yyval.spec->segment_height;
		;
    break;}
case 92:
#line 744 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->dir = DOWN_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.y -= yyvsp[0].x;
		;
    break;}
case 93:
#line 751 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->dir = RIGHT_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x += yyval.spec->segment_width;
		;
    break;}
case 94:
#line 758 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->dir = RIGHT_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x += yyvsp[0].x;
		;
    break;}
case 95:
#line 765 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->dir = LEFT_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x -= yyval.spec->segment_width;
		;
    break;}
case 96:
#line 772 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->dir = LEFT_DIRECTION;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x -= yyvsp[0].x;
		;
    break;}
case 97:
#line 779 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= HAS_FROM;
		  yyval.spec->from.x = yyvsp[0].pair.x;
		  yyval.spec->from.y = yyvsp[0].pair.y;
		;
    break;}
case 98:
#line 786 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  if (yyval.spec->flags & HAS_SEGMENT)
		    yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
						   yyval.spec->segment_is_absolute,
						   yyval.spec->segment_list);
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x = yyvsp[0].pair.x;
		  yyval.spec->segment_pos.y = yyvsp[0].pair.y;
		  yyval.spec->segment_is_absolute = 1;
		  yyval.spec->flags |= HAS_TO;
		  yyval.spec->to.x = yyvsp[0].pair.x;
		  yyval.spec->to.y = yyvsp[0].pair.y;
		;
    break;}
case 99:
#line 801 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= HAS_AT;
		  yyval.spec->at.x = yyvsp[0].pair.x;
		  yyval.spec->at.y = yyvsp[0].pair.y;
		  if (yyval.spec->type != ARC_OBJECT) {
		    yyval.spec->flags |= HAS_FROM;
		    yyval.spec->from.x = yyvsp[0].pair.x;
		    yyval.spec->from.y = yyvsp[0].pair.y;
		  }
		;
    break;}
case 100:
#line 813 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= HAS_WITH;
		  yyval.spec->with = yyvsp[0].pth;
		;
    break;}
case 101:
#line 819 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= HAS_SEGMENT;
		  yyval.spec->segment_pos.x += yyvsp[0].pair.x;
		  yyval.spec->segment_pos.y += yyvsp[0].pair.y;
		;
    break;}
case 102:
#line 826 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  if (yyval.spec->flags & HAS_SEGMENT) {
		    yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
						   yyval.spec->segment_is_absolute,
						   yyval.spec->segment_list);
		    yyval.spec->flags &= ~HAS_SEGMENT;
		    yyval.spec->segment_pos.x = yyval.spec->segment_pos.y = 0.0;
		    yyval.spec->segment_is_absolute = 0;
		  }
		;
    break;}
case 103:
#line 838 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_DOTTED;
		  lookup_variable("dashwid", & yyval.spec->dash_width);
		;
    break;}
case 104:
#line 844 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= IS_DOTTED;
		  yyval.spec->dash_width = yyvsp[0].x;
		;
    break;}
case 105:
#line 850 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_DASHED;
		  lookup_variable("dashwid", & yyval.spec->dash_width);
		;
    break;}
case 106:
#line 856 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= IS_DASHED;
		  yyval.spec->dash_width = yyvsp[0].x;
		;
    break;}
case 107:
#line 862 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_DEFAULT_FILLED;
		;
    break;}
case 108:
#line 867 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= IS_FILLED;
		  yyval.spec->fill = yyvsp[0].x;
		;
    break;}
case 109:
#line 873 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  // line chop chop means line chop 0 chop 0
		  if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
		    yyval.spec->flags |= IS_CHOPPED;
		    yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
		    yyval.spec->start_chop = yyval.spec->end_chop = 0.0;
		  }
		  else if (yyval.spec->flags & IS_CHOPPED) {
		    yyval.spec->end_chop = 0.0;
		  }
		  else {
		    yyval.spec->flags |= IS_DEFAULT_CHOPPED;
		  }
		;
    break;}
case 110:
#line 889 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
		    yyval.spec->flags |= IS_CHOPPED;
		    yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
		    yyval.spec->start_chop = 0.0;
		    yyval.spec->end_chop = yyvsp[0].x;
		  }
		  else if (yyval.spec->flags & IS_CHOPPED) {
		    yyval.spec->end_chop = yyvsp[0].x;
		  }
		  else {
		    yyval.spec->start_chop = yyval.spec->end_chop = yyvsp[0].x;
		    yyval.spec->flags |= IS_CHOPPED;
		  }
		;
    break;}
case 111:
#line 906 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_SAME;
		;
    break;}
case 112:
#line 911 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_INVISIBLE;
		;
    break;}
case 113:
#line 916 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= HAS_LEFT_ARROW_HEAD;
		;
    break;}
case 114:
#line 921 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD;
		;
    break;}
case 115:
#line 926 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
		;
    break;}
case 116:
#line 931 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_CLOCKWISE;
		;
    break;}
case 117:
#line 936 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags &= ~IS_CLOCKWISE;
		;
    break;}
case 118:
#line 941 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  for (text_item **p = & yyval.spec->text; *p; p = &(*p)->next)
		    ;
		  *p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
		;
    break;}
case 119:
#line 948 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  if (yyval.spec->text) {
		    for (text_item *p = yyval.spec->text; p->next; p = p->next)
		      ;
		    p->adj.h = LEFT_ADJUST;
		  }
		;
    break;}
case 120:
#line 957 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  if (yyval.spec->text) {
		    for (text_item *p = yyval.spec->text; p->next; p = p->next)
		      ;
		    p->adj.h = RIGHT_ADJUST;
		  }
		;
    break;}
case 121:
#line 966 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  if (yyval.spec->text) {
		    for (text_item *p = yyval.spec->text; p->next; p = p->next)
		      ;
		    p->adj.v = ABOVE_ADJUST;
		  }
		;
    break;}
case 122:
#line 975 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  if (yyval.spec->text) {
		    for (text_item *p = yyval.spec->text; p->next; p = p->next)
		      ;
		    p->adj.v = BELOW_ADJUST;
		  }
		;
    break;}
case 123:
#line 984 "pic.y"
{
		  yyval.spec = yyvsp[-2].spec;
		  yyval.spec->flags |= HAS_THICKNESS;
		  yyval.spec->thickness = yyvsp[0].x;
		;
    break;}
case 124:
#line 990 "pic.y"
{
		  yyval.spec = yyvsp[-1].spec;
		  yyval.spec->flags |= IS_ALIGNED;
		;
    break;}
case 125:
#line 998 "pic.y"
{
		  yyval.lstr = yyvsp[0].lstr;
		;
    break;}
case 126:
#line 1002 "pic.y"
{
		  yyval.lstr.filename = yyvsp[-2].lstr.filename;
		  yyval.lstr.lineno = yyvsp[-2].lstr.lineno;
		  yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv);
		  a_delete yyvsp[-1].dv.v;
		  a_delete yyvsp[-2].lstr.str;
		;
    break;}
case 127:
#line 1013 "pic.y"
{
		  yyval.dv.v = 0;
		  yyval.dv.nv = 0;
		  yyval.dv.maxv = 0;
		;
    break;}
case 128:
#line 1019 "pic.y"
{
		  yyval.dv = yyvsp[-2].dv;
		  if (yyval.dv.nv >= yyval.dv.maxv) {
		    if (yyval.dv.nv == 0) {
		      yyval.dv.v = new double[4];
		      yyval.dv.maxv = 4;
		    }
		    else {
		      double *oldv = yyval.dv.v;
		      yyval.dv.maxv *= 2;
		      yyval.dv.v = new double[yyval.dv.maxv];
		      memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double));
		      a_delete oldv;
		    }
		  }
		  yyval.dv.v[yyval.dv.nv] = yyvsp[0].x;
		  yyval.dv.nv += 1;
		;
    break;}
case 129:
#line 1041 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
    break;}
case 130:
#line 1043 "pic.y"
{
		  position pos = yyvsp[0].pl;
		  yyval.pair.x = pos.x;
		  yyval.pair.y = pos.y;
		;
    break;}
case 131:
#line 1052 "pic.y"
{ yyval.pair = yyvsp[0].pair; ;
    break;}
case 132:
#line 1054 "pic.y"
{
		  yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x;
		  yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y;
		;
    break;}
case 133:
#line 1059 "pic.y"
{
		  yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x;
		  yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y;
		;
    break;}
case 134:
#line 1064 "pic.y"
{
		  yyval.pair.x = yyvsp[-3].pair.x;
		  yyval.pair.y = yyvsp[-1].pair.y;
		;
    break;}
case 135:
#line 1069 "pic.y"
{
		  yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x;
		  yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y;
		;
    break;}
case 136:
#line 1074 "pic.y"
{
		  yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x;
		  yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y;
		;
    break;}
case 139:
#line 1087 "pic.y"
{ yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ;
    break;}
case 140:
#line 1089 "pic.y"
{ yyval.pair = yyvsp[-1].pair; ;
    break;}
case 141:
#line 1094 "pic.y"
{ yyval.pl = yyvsp[0].pl; ;
    break;}
case 142:
#line 1096 "pic.y"
{
		  path pth(yyvsp[0].crn);
		  if (!pth.follow(yyvsp[-1].pl, & yyval.pl))
		    YYABORT;
		;
    break;}
case 143:
#line 1102 "pic.y"
{
		  path pth(yyvsp[-1].crn);
		  if (!pth.follow(yyvsp[0].pl, & yyval.pl))
		    YYABORT;
		;
    break;}
case 144:
#line 1108 "pic.y"
{
		  path pth(yyvsp[-2].crn);
		  if (!pth.follow(yyvsp[0].pl, & yyval.pl))
		    YYABORT;
		;
    break;}
case 145:
#line 1114 "pic.y"
{
		  yyval.pl.x = current_position.x;
		  yyval.pl.y = current_position.y;
		  yyval.pl.obj = 0;
		;
    break;}
case 146:
#line 1123 "pic.y"
{
		  place *p = lookup_label(yyvsp[0].str);
		  if (!p) {
		    lex_error("there is no place `%1'", yyvsp[0].str);
		    YYABORT;
		  }
		  yyval.pl = *p;
		  a_delete yyvsp[0].str;
		;
    break;}
case 147:
#line 1133 "pic.y"
{
		  yyval.pl.obj = yyvsp[0].obj;
		;
    break;}
case 148:
#line 1137 "pic.y"
{
		  path pth(yyvsp[0].str);
		  if (!pth.follow(yyvsp[-2].pl, & yyval.pl))
		    YYABORT;
		;
    break;}
case 149:
#line 1146 "pic.y"
{ yyval.n = yyvsp[0].n; ;
    break;}
case 150:
#line 1148 "pic.y"
{
		  // XXX Check for overflow (and non-integers?).
		  yyval.n = (int)yyvsp[-1].x;
		;
    break;}
case 151:
#line 1156 "pic.y"
{ yyval.n = 1; ;
    break;}
case 152:
#line 1158 "pic.y"
{ yyval.n = yyvsp[-1].n; ;
    break;}
case 153:
#line 1163 "pic.y"
{
		  int count = 0;
		  for (object *p = olist.head; p != 0; p = p->next)
		    if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
		      yyval.obj = p;
		      break;
		    }
		  if (p == 0) {
		    lex_error("there is no %1%2 %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n),
			      object_type_name(yyvsp[0].obtype));
		    YYABORT;
		  }
		;
    break;}
case 154:
#line 1177 "pic.y"
{
		  int count = 0;
		  for (object *p = olist.tail; p != 0; p = p->prev)
		    if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
		      yyval.obj = p;
		      break;
		    }
		  if (p == 0) {
		    lex_error("there is no %1%2 last %3", yyvsp[-1].n,
			      ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype));
		    YYABORT;
		  }
		;
    break;}
case 155:
#line 1194 "pic.y"
{ yyval.obtype = BOX_OBJECT; ;
    break;}
case 156:
#line 1196 "pic.y"
{ yyval.obtype = CIRCLE_OBJECT; ;
    break;}
case 157:
#line 1198 "pic.y"
{ yyval.obtype = ELLIPSE_OBJECT; ;
    break;}
case 158:
#line 1200 "pic.y"
{ yyval.obtype = ARC_OBJECT; ;
    break;}
case 159:
#line 1202 "pic.y"
{ yyval.obtype = LINE_OBJECT; ;
    break;}
case 160:
#line 1204 "pic.y"
{ yyval.obtype = ARROW_OBJECT; ;
    break;}
case 161:
#line 1206 "pic.y"
{ yyval.obtype = SPLINE_OBJECT; ;
    break;}
case 162:
#line 1208 "pic.y"
{ yyval.obtype = BLOCK_OBJECT; ;
    break;}
case 163:
#line 1210 "pic.y"
{ yyval.obtype = TEXT_OBJECT; ;
    break;}
case 164:
#line 1215 "pic.y"
{
		  yyval.pth = new path(yyvsp[0].str);
		;
    break;}
case 165:
#line 1219 "pic.y"
{
		  yyval.pth = yyvsp[-2].pth;
		  yyval.pth->append(yyvsp[0].str);
		;
    break;}
case 166:
#line 1227 "pic.y"
{
		  yyval.pth = new path(yyvsp[0].crn);
		;
    break;}
case 167:
#line 1234 "pic.y"
{
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 168:
#line 1238 "pic.y"
{
		  yyval.pth = yyvsp[-1].pth;
		  yyval.pth->append(yyvsp[0].crn);
		;
    break;}
case 169:
#line 1246 "pic.y"
{
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 170:
#line 1251 "pic.y"
{
		  lex_warning("`%1%2 last %3' in `with' argument ignored",
			      yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype));
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 171:
#line 1257 "pic.y"
{
		  lex_warning("`last %1' in `with' argument ignored",
			      object_type_name(yyvsp[-1].obtype));
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 172:
#line 1263 "pic.y"
{
		  lex_warning("`%1%2 %3' in `with' argument ignored",
			      yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype));
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 173:
#line 1269 "pic.y"
{
		  lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str);
		  a_delete yyvsp[-1].str;
		  yyval.pth = yyvsp[0].pth;
		;
    break;}
case 174:
#line 1278 "pic.y"
{ yyval.crn = &object::north; ;
    break;}
case 175:
#line 1280 "pic.y"
{ yyval.crn = &object::east; ;
    break;}
case 176:
#line 1282 "pic.y"
{ yyval.crn = &object::west; ;
    break;}
case 177:
#line 1284 "pic.y"
{ yyval.crn = &object::south; ;
    break;}
case 178:
#line 1286 "pic.y"
{ yyval.crn = &object::north_east; ;
    break;}
case 179:
#line 1288 "pic.y"
{ yyval.crn = &object:: south_east; ;
    break;}
case 180:
#line 1290 "pic.y"
{ yyval.crn = &object::north_west; ;
    break;}
case 181:
#line 1292 "pic.y"
{ yyval.crn = &object::south_west; ;
    break;}
case 182:
#line 1294 "pic.y"
{ yyval.crn = &object::center; ;
    break;}
case 183:
#line 1296 "pic.y"
{ yyval.crn = &object::start; ;
    break;}
case 184:
#line 1298 "pic.y"
{ yyval.crn = &object::end; ;
    break;}
case 185:
#line 1300 "pic.y"
{ yyval.crn = &object::north; ;
    break;}
case 186:
#line 1302 "pic.y"
{ yyval.crn = &object::south; ;
    break;}
case 187:
#line 1304 "pic.y"
{ yyval.crn = &object::west; ;
    break;}
case 188:
#line 1306 "pic.y"
{ yyval.crn = &object::east; ;
    break;}
case 189:
#line 1308 "pic.y"
{ yyval.crn = &object::north_west; ;
    break;}
case 190:
#line 1310 "pic.y"
{ yyval.crn = &object::south_west; ;
    break;}
case 191:
#line 1312 "pic.y"
{ yyval.crn = &object::north_east; ;
    break;}
case 192:
#line 1314 "pic.y"
{ yyval.crn = &object::south_east; ;
    break;}
case 193:
#line 1316 "pic.y"
{ yyval.crn = &object::west; ;
    break;}
case 194:
#line 1318 "pic.y"
{ yyval.crn = &object::east; ;
    break;}
case 195:
#line 1320 "pic.y"
{ yyval.crn = &object::north_west; ;
    break;}
case 196:
#line 1322 "pic.y"
{ yyval.crn = &object::south_west; ;
    break;}
case 197:
#line 1324 "pic.y"
{ yyval.crn = &object::north_east; ;
    break;}
case 198:
#line 1326 "pic.y"
{ yyval.crn = &object::south_east; ;
    break;}
case 199:
#line 1328 "pic.y"
{ yyval.crn = &object::center; ;
    break;}
case 200:
#line 1330 "pic.y"
{ yyval.crn = &object::start; ;
    break;}
case 201:
#line 1332 "pic.y"
{ yyval.crn = &object::end; ;
    break;}
case 202:
#line 1337 "pic.y"
{
		  if (!lookup_variable(yyvsp[0].str, & yyval.x)) {
		    lex_error("there is no variable `%1'", yyvsp[0].str);
		    YYABORT;
		  }
		  a_delete yyvsp[0].str;
		;
    break;}
case 203:
#line 1345 "pic.y"
{ yyval.x = yyvsp[0].x; ;
    break;}
case 204:
#line 1347 "pic.y"
{
		  if (yyvsp[-1].pl.obj != 0)
		    yyval.x = yyvsp[-1].pl.obj->origin().x;
		  else
		    yyval.x = yyvsp[-1].pl.x;
		;
    break;}
case 205:
#line 1354 "pic.y"
{
		  if (yyvsp[-1].pl.obj != 0)
		    yyval.x = yyvsp[-1].pl.obj->origin().y;
		  else
		    yyval.x = yyvsp[-1].pl.y;
		;
    break;}
case 206:
#line 1361 "pic.y"
{
		  if (yyvsp[-1].pl.obj != 0)
		    yyval.x = yyvsp[-1].pl.obj->height();
		  else
		    yyval.x = 0.0;
		;
    break;}
case 207:
#line 1368 "pic.y"
{
		  if (yyvsp[-1].pl.obj != 0)
		    yyval.x = yyvsp[-1].pl.obj->width();
		  else
		    yyval.x = 0.0;
		;
    break;}
case 208:
#line 1375 "pic.y"
{
		  if (yyvsp[-1].pl.obj != 0)
		    yyval.x = yyvsp[-1].pl.obj->radius();
		  else
		    yyval.x = 0.0;
		;
    break;}
case 209:
#line 1382 "pic.y"
{ yyval.x = yyvsp[-2].x + yyvsp[0].x; ;
    break;}
case 210:
#line 1384 "pic.y"
{ yyval.x = yyvsp[-2].x - yyvsp[0].x; ;
    break;}
case 211:
#line 1386 "pic.y"
{ yyval.x = yyvsp[-2].x * yyvsp[0].x; ;
    break;}
case 212:
#line 1388 "pic.y"
{
		  if (yyvsp[0].x == 0.0) {
		    lex_error("division by zero");
		    YYABORT;
		  }
		  yyval.x = yyvsp[-2].x/yyvsp[0].x;
		;
    break;}
case 213:
#line 1396 "pic.y"
{
		  if (yyvsp[0].x == 0.0) {
		    lex_error("modulus by zero");
		    YYABORT;
		  }
		  yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x);
		;
    break;}
case 214:
#line 1404 "pic.y"
{
		  errno = 0;
		  yyval.x = pow(yyvsp[-2].x, yyvsp[0].x);
		  if (errno == EDOM) {
		    lex_error("arguments to `^' operator out of domain");
		    YYABORT;
		  }
		  if (errno == ERANGE) {
		    lex_error("result of `^' operator out of range");
		    YYABORT;
		  }
		;
    break;}
case 215:
#line 1417 "pic.y"
{ yyval.x = -yyvsp[0].x; ;
    break;}
case 216:
#line 1419 "pic.y"
{ yyval.x = yyvsp[-1].x; ;
    break;}
case 217:
#line 1421 "pic.y"
{
		  errno = 0;
		  yyval.x = sin(yyvsp[-1].x);
		  if (errno == ERANGE) {
		    lex_error("sin result out of range");
		    YYABORT;
		  }
		;
    break;}
case 218:
#line 1430 "pic.y"
{
		  errno = 0;
		  yyval.x = cos(yyvsp[-1].x);
		  if (errno == ERANGE) {
		    lex_error("cos result out of range");
		    YYABORT;
		  }
		;
    break;}
case 219:
#line 1439 "pic.y"
{
		  errno = 0;
		  yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x);
		  if (errno == EDOM) {
		    lex_error("atan2 argument out of domain");
		    YYABORT;
		  }
		  if (errno == ERANGE) {
		    lex_error("atan2 result out of range");
		    YYABORT;
		  }
		;
    break;}
case 220:
#line 1452 "pic.y"
{
		  errno = 0;
		  yyval.x = log10(yyvsp[-1].x);
		  if (errno == ERANGE) {
		    lex_error("log result out of range");
		    YYABORT;
		  }
		;
    break;}
case 221:
#line 1461 "pic.y"
{
		  errno = 0;
		  yyval.x = pow(10.0, yyvsp[-1].x);
		  if (errno == ERANGE) {
		    lex_error("exp result out of range");
		    YYABORT;
		  }
		;
    break;}
case 222:
#line 1470 "pic.y"
{
		  errno = 0;
		  yyval.x = sqrt(yyvsp[-1].x);
		  if (errno == EDOM) {
		    lex_error("sqrt argument out of domain");
		    YYABORT;
		  }
		;
    break;}
case 223:
#line 1479 "pic.y"
{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
    break;}
case 224:
#line 1481 "pic.y"
{ yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
    break;}
case 225:
#line 1483 "pic.y"
{ yyval.x = floor(yyvsp[-1].x); ;
    break;}
case 226:
#line 1485 "pic.y"
{ yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ;
    break;}
case 227:
#line 1487 "pic.y"
{
		  /* return a random number in the range [0,1) */
		  /* portable, but not very random */
		  yyval.x = (rand() & 0x7fff) / double(0x8000);
		;
    break;}
case 228:
#line 1493 "pic.y"
{ yyval.x = (yyvsp[-2].x < yyvsp[0].x); ;
    break;}
case 229:
#line 1495 "pic.y"
{ yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ;
    break;}
case 230:
#line 1497 "pic.y"
{ yyval.x = (yyvsp[-2].x > yyvsp[0].x); ;
    break;}
case 231:
#line 1499 "pic.y"
{ yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ;
    break;}
case 232:
#line 1501 "pic.y"
{ yyval.x = (yyvsp[-2].x == yyvsp[0].x); ;
    break;}
case 233:
#line 1503 "pic.y"
{ yyval.x = (yyvsp[-2].x != yyvsp[0].x); ;
    break;}
case 234:
#line 1505 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
    break;}
case 235:
#line 1507 "pic.y"
{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
    break;}
case 236:
#line 1509 "pic.y"
{ yyval.x = (yyvsp[0].x == 0.0); ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 465 "dh1:Library/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;
	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
	  for (x = (yyn < 0 ? -yyn : 0);
	       x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (yyn < 0 ? -yyn : 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
	    yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

  goto yyerrlab1;
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 1513 "pic.y"


/* bison defines const to be empty unless __STDC__ is defined, which it
isn't under cfront */

#ifdef const
#undef const
#endif

static struct {
  const char *name;
  double val;
  int scaled;		     // non-zero if val should be multiplied by scale
} defaults_table[] = {
  { "arcrad", .25, 1 },
  { "arrowht", .1, 1 },
  { "arrowwid", .05, 1 },
  { "circlerad", .25, 1 },
  { "boxht", .5, 1 },
  { "boxwid", .75, 1 },
  { "boxrad", 0.0, 1 },
  { "dashwid", .05, 1 },
  { "ellipseht", .5, 1 },
  { "ellipsewid", .75, 1 },
  { "moveht", .5, 1 },
  { "movewid", .5, 1 },
  { "lineht", .5, 1 },
  { "linewid", .5, 1 },
  { "textht", 0.0, 1 },
  { "textwid", 0.0, 1 },
  { "scale", 1.0, 0 },
  { "linethick", -1.0, 0 },		// in points
  { "fillval", .5, 0 },
  { "arrowhead", 1.0, 0 },
  { "maxpswid", 8.5, 0 },
  { "maxpsht", 11.0, 0 },
};

place *lookup_label(const char *label)
{
  saved_state *state = current_saved_state;
  PTABLE(place) *tbl = current_table;
  for (;;) {
    place *pl = tbl->lookup(label);
    if (pl)
      return pl;
    if (!state)
      return 0;
    tbl = state->tbl;
    state = state->prev;
  }
}

void define_label(const char *label, const place *pl)
{
  place *p = new place;
  *p = *pl;
  current_table->define(label, p);
}

int lookup_variable(const char *name, double *val)
{
  place *pl = lookup_label(name);
  if (pl) {
    *val = pl->x;
    return 1;
  }
  return 0;
}

void define_variable(const char *name, double val)
{
  place *p = new place;
  p->obj = 0;
  p->x = val;
  p->y = 0.0;
  current_table->define(name, p);
  if (strcmp(name, "scale") == 0) {
    // When the scale changes, reset all scaled pre-defined variables to
    // their default values.
    for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) 
      if (defaults_table[i].scaled)
	define_variable(defaults_table[i].name, val*defaults_table[i].val);
  }
}

// called once only (not once per parse)

void parse_init()
{
  current_direction = RIGHT_DIRECTION;
  current_position.x = 0.0;
  current_position.y = 0.0;
  // This resets everything to its default value.
  reset_all();
}

void reset(const char *nm)
{
  for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
    if (strcmp(nm, defaults_table[i].name) == 0) {
      double val = defaults_table[i].val;
      if (defaults_table[i].scaled) {
	double scale;
	lookup_variable("scale", &scale);
	val *= scale;
      }
      define_variable(defaults_table[i].name, val);
      return;
    }
  lex_error("`%1' is not a predefined variable", nm);
}

void reset_all()
{
  // We only have to explicitly reset the pre-defined variables that
  // aren't scaled because `scale' is not scaled, and changing the
  // value of `scale' will reset all the pre-defined variables that
  // are scaled.
  for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
    if (!defaults_table[i].scaled)
      define_variable(defaults_table[i].name, defaults_table[i].val);
}

// called after each parse

void parse_cleanup()
{
  while (current_saved_state != 0) {
    delete current_table;
    current_table = current_saved_state->tbl;
    saved_state *tem = current_saved_state;
    current_saved_state = current_saved_state->prev;
    delete tem;
  }
  assert(current_table == &top_table);
  PTABLE_ITERATOR(place) iter(current_table);
  const char *key;
  place *pl;
  while (iter.next(&key, &pl))
    if (pl->obj != 0) {
      position pos = pl->obj->origin();
      pl->obj = 0;
      pl->x = pos.x;
      pl->y = pos.y;
    }
  while (olist.head != 0) {
    object *tem = olist.head;
    olist.head = olist.head->next;
    delete tem;
  }
  olist.tail = 0;
  current_direction = RIGHT_DIRECTION;
  current_position.x = 0.0;
  current_position.y = 0.0;
}

const char *ordinal_postfix(int n)
{
  if (n < 10 || n > 20)
    switch (n % 10) {
    case 1:
      return "st";
    case 2:
      return "nd";
    case 3:
      return "rd";
    }
  return "th";
}

const char *object_type_name(object_type type)
{
  switch (type) {
  case BOX_OBJECT:
    return "box";
  case CIRCLE_OBJECT:
    return "circle";
  case ELLIPSE_OBJECT:
    return "ellipse";
  case ARC_OBJECT:
    return "arc";
  case SPLINE_OBJECT:
    return "spline";
  case LINE_OBJECT:
    return "line";
  case ARROW_OBJECT:
    return "arrow";
  case MOVE_OBJECT:
    return "move";
  case TEXT_OBJECT:
    return "\"\"";
  case BLOCK_OBJECT:
    return "[]";
  case OTHER_OBJECT:
  case MARK_OBJECT:
  default:
    break;
  }
  return "object";
}

static char sprintf_buf[1024];

char *format_number(const char *form, double n)
{
  if (form == 0)
    form = "%g";
  else {
    // this is a fairly feeble attempt at validation of the format
    int nspecs = 0;
    for (const char *p = form; *p != '\0'; p++)
      if (*p == '%') {
	if (p[1] == '%')
	  p++;
	else
	  nspecs++;
      }
    if (nspecs > 1) {
      lex_error("bad format `%1'", form);
      return strsave(form);
    }
  }
  sprintf(sprintf_buf, form, n);
  return strsave(sprintf_buf);
}

char *do_sprintf(const char *form, const double *v, int nv)
{
  string result;
  int i = 0;
  string one_format;
  while (*form) {
    if (*form == '%') {
      one_format += *form++;
      for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++)
	one_format += *form;
      if (*form == '\0' || strchr("eEfgG%", *form) == 0) {
	lex_error("bad sprintf format");
	result += one_format;
	result += form;
	break;
      }
      if (*form == '%') {
	one_format += *form++;
	one_format += '\0';
	sprintf(sprintf_buf, one_format.contents());
      }
      else {
	if (i >= nv) {
	  lex_error("too few arguments to sprintf");
	  result += one_format;
	  result += form;
	  break;
	}
	one_format += *form++;
	one_format += '\0';
	sprintf(sprintf_buf, one_format.contents(), v[i++]);
      }
      one_format.clear();
      result += sprintf_buf;
    }
    else
      result += *form++;
  }
  result += '\0';
  return strsave(result.contents());
}
