# define NEW 257
# define GRAPH 258
# define TITLE 259
# define SIZE 260
# define FONT 261
# define ANGLE 262
# define ALIGN 263
# define LEFT 264
# define RIGHT 265
# define CENTER 266
# define BAR 267
# define REGRESSION 268
# define STEP 269
# define XHISTOGRAM 270
# define YHISTOGRAM 271
# define SMOOTH 272
# define SPLINE 273
# define KEY 274
# define CURVE 275
# define POINTS 276
# define CONFIDENCE 277
# define LABEL 278
# define LABELS 279
# define TYPE 280
# define INTERPOLATION 281
# define GRAY 282
# define MAT 283
# define X 284
# define Y 285
# define MAXIMUM 286
# define MINIMUM 287
# define UNIT 288
# define INTERVAL 289
# define SCALE 290
# define LOGBASE 291
# define NUMBERSTYLE 292
# define TEXT 293
# define INPUT 294
# define LINE 295
# define SYMBOL 296
# define BOTH 297
# define NONE 298
# define SOLID 299
# define DASHES 300
# define STIPPLE 301
# define DOTS 302
# define PAT 303
# define FILL 304
# define BOLD 305
# define CROSS 306
# define TRIANGLE 307
# define TRIANGLEFILLED 308
# define DIAMOND 309
# define DIAMONDFILLED 310
# define SQUARE 311
# define BOX 312
# define SQUAREFILLED 313
# define SOLIDBOX 314
# define RECTANGLE 315
# define RECTANGLEFILLED 316
# define CIRCLE 317
# define CIRCLEFILLED 318
# define BULLET 319
# define PLUS 320
# define STAR 321
# define LINEAR 322
# define LOGS 323
# define UNKNOWNCMD 324
# define COMMENT 325
# define EXCLUDE 326
# define MINORTIC 327
# define MINORTICS 328
# define NUMBERS 329
# define FONTNAME 330
# define INTEGER 331
# define FLOATING 332
# define SCIENTIFIC 333
# define EXPONENT 334
# define MIRROR 335
# define ORIGIN 336
# define AXES 337
# define FUNCTION 338
# define DEF 339

# line 88 "plot.yacc"

#include <stdio.h>
#include <strings.h>
#include "plotio.h"
#include "defs.h"
#include "structs.h"
#include "plot.h"

static double currSSfreq=30.0, currSSang = 0.0; /* for setscreen */
static int currSSfnIndex = 0;

/* function related globals */
static char* curfn; /*ptr to function defs for a curce */
static float curfnstart, curfnend, curfndelta;/*start,end,incr for fn calcs */
static int FUNCTION_LEN = 10000;

char pstr[MAXLABEL];/*stores previous correct instring - for error reporting*/
char errorpos[MAXLABEL];/* stores prev correct text word */
double tmpfloat;
int tmpint;
pointType *ptPtr;/*temp pointer for current point in curve */
boolean intext = FALSE;
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#ifndef YYSTYPE
#define YYSTYPE int
#endif
YYSTYPE yylval, yyval;
typedef int yytabelem;
# define YYERRCODE 256

# line 941 "plot.yacc"
 

#include "lex.yy.c"


addPointsPair1()
{
	ptPtr = (pointType *)GetSp(sizeof(pointType));
	ptPtr->conf = NoConfInterval; /* initialized */
	if ((curves[curcur])->fstPtr == nil)
	{
		/*means first point in curve */
		(curves[curcur])->fstPtr = ptPtr;
		ptPtr->prvPtr = nil;
	}
	else 
	{
		ptPtr->prvPtr = (curves[curcur])->lstPtr;
		(curves[curcur])->lstPtr->nxtPtr = ptPtr;
	}
	(curves[curcur])->lstPtr = ptPtr;
	ptPtr->nxtPtr = nil;
	(curves[curcur])->lastpoint += 1;
	/* incr point count; after 1st pt is 0 */
	ptPtr->pt[xpt]= atof(yytext);
}

addPointsPair2()
{
	ptPtr->pt[ypt] = atof(yytext);
}

addPointsConf()
{
	ptPtr->conf = atof(yytext);
}

unknowncmderror()
{
	fprintf(stderr,	
		"***splot::Warning: unknown command near line %d\n", lineno);
	fprintf(stderr,"previous text: %s, ",errorpos);
	fprintf(stderr,"current text: %s\n",yytext);
}

newgraphproc()
{
	graph.includekey = FALSE;
	*graph.title = '\0';
	*graph.label = '\0';
	graph.font = defGraphFont;
	graph.keyfont = defGraphKeyFont;
	graph.key = kboth;
	graph.size[xpt] = defGraphXsize * 2.54;
	graph.size[ypt] = defGraphYsize * 2.54;
	setaxisdefs(xpt);
	setaxisdefs(ypt);
	currSSang = 0.0;
	currSSfnIndex = 0;
	currSSfreq = 30;
}

setaxisdefs(z)
int z;
{
	*axis[z].label = '\0';
	axis[z].scale.type = linear;
	axis[z].interval = 0.0;
	axis[z].axismax = BIG;
	axis[z].axismin = BIG;
	axis[z].numberstyle = floating;
	axis[z].signif = 0;
	axis[z].unit = 1.0;
	axis[z].font = defAxisFont;
}

newcurveproc()
{
	curcur++;/*go to first empty slot*/
	curves[curcur] = (curvetype *) 
		GetSp(sizeof(curvetype));  
	(curves[curcur])->validcurve = TRUE;
	*curves[curcur]->label = '\0';
	(curves[curcur])->symbol = nonesymbol;
	(curves[curcur])->symbolsize = defSymbolSize;
	(curves[curcur])->interp = linearinterp;
	(curves[curcur])->type = solid;
	(curves[curcur])->fstPtr = nil;
	(curves[curcur])->lstPtr = nil;
	(curves[curcur])->lastpoint = -1;
	(curves[curcur])->include = TRUE;
	(curves[curcur])->showConf = FALSE;
	(curves[curcur])->thick = defGraphThick;
	(curves[curcur])->gray = 0.0;
	(curves[curcur])->mat.grayset = FALSE;
	(curves[curcur])->mat.freq = 0.0;
	(curves[curcur])->mat.ang = 30.0;
	(curves[curcur])->mat.indx = 0;
	(curves[curcur])->mat.matset = FALSE;
	(curves[curcur])->mat.showline = TRUE;
	/* bounding curve appears by default */
}

handlefillproc()
{
	currSSang += 45.0; 
	/* rotate 45 degrees for each new curve */
	if (currSSang > 181.0) 
	{
		currSSang = 45.0;
		currSSfnIndex += 1;
		if (currSSfnIndex == MAXSSFNS)
		{
			currSSfnIndex = 0;
			currSSfreq += 15.0;
			if (currSSfreq > 61.0)
			{
				currSSfreq = 5.0;
			}
		}
	}
	(curves[curcur])->type = fill;
	/* bounding curve true by default */
	if ((!(curves[curcur])->mat.grayset))
		(curves[curcur])->gray = defFillGray;
	if ((!(curves[curcur])->mat.matset))
	{
	    (curves[curcur])->mat.freq = currSSfreq;
	    (curves[curcur])->mat.ang = currSSang;
	    (curves[curcur])->mat.indx= currSSfnIndex;
	}
}

nocurverr()
{
	fprintf(stderr,
		"splot error: no new curve command, near line %d\n", lineno);
}

notexterr()
{
	fprintf(stderr,
	"***splot warning: error on line %d, no text entered yet!\n", lineno);
}

newtextproc()
{
	curtext++;
	text[curtext] = (texttype *) GetSp(sizeof(texttype));
	(text[curtext])->font = defTextFont;
	(text[curtext])->angle = 0;
	(text[curtext])->include = TRUE;
	(text[curtext])->validtext = TRUE;
}


fnerror()
{
	fprintf(stderr,
	"***splot warning: error on line %d, incorrect function declaration!\n", 
		lineno);
}

char *prc[] = { "%f" };
char *comf[] = { "/usr/tmp/ZZcomf.c" };
char *inf[] = { "/usr/tmp/ZZinf" };
char *outf[] = { "/usr/tmp/ZZoutf" };
#define MAXSIZEOFNUM 100

computfn(curfnstart,curfnend,curfndelta,curfn)
char* curfn; 
float curfnstart, curfnend, curfndelta;
{
float x, y;
FILE *fp_comf, *fp_inf, *fp_outf, *fopen();
char ytxt[MAXSIZEOFNUM], xtxt[MAXSIZEOFNUM];

	if (curcur < 0) nocurverr();

	/* first write out function program */
	fp_comf = fopen(*comf,"w");
	fprintf(fp_comf,"#include <stdio.h>\n");
	fprintf(fp_comf,"#include <math.h>\n");
	fprintf(fp_comf,"main(){\n");
	fprintf(fp_comf,"float y,x;\n");
	fprintf(fp_comf,"while (scanf(\"%s\",&x) != EOF){\n",*prc);
	fprintf(fp_comf,"y = %s;\n",curfn);	
	fprintf(fp_comf,"printf(\"%s\\n\",y);}}\n",*prc);
	fclose(fp_comf);

	/* then compile the function program */
	system("cd /usr/tmp; cc -o /usr/tmp/ZZexef /usr/tmp/ZZcomf.c -lm");

	/* write out input to function */
	fp_inf = fopen(*inf,"w");
	x = curfnstart;
	while (x <= curfnend)
	{
		fprintf(fp_inf,"%f\n",x);
		x += curfndelta;
	}
	fclose(fp_inf);

	/* run the function program */
	system("/usr/tmp/ZZexef </usr/tmp/ZZinf > /usr/tmp/ZZoutf");

	/* read the function out file and put points into curve */
	fp_inf = fopen(*inf,"r");
	fp_outf = fopen(*outf,"r");
	while(fscanf(fp_inf, "%s", xtxt) != EOF)
	{
		strcpy(yytext, xtxt);
		addPointsPair1();
		if (fscanf(fp_outf,"%s", ytxt) != EOF) 
			strcpy(yytext, ytxt);
		else 
		{
			fnerror();
			strcpy(yytext, "0.0");
			addPointsPair2();
			return;
		}
		addPointsPair2();
	}
	fclose(fp_outf);

	/* delete all files generated by function computations */
/*	system("rm /usr/tmp/ZZcomf.c /usr/tmp/ZZinf /usr/tmp/ZZoutf /usr/tmp/ZZexef");*/
}
yytabelem yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
-1, 302,
	10, 105,
	-2, 103,
	};
# define YYNPROD 244
# define YYLAST 374
yytabelem yyact[]={

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

   -10,    -6,   187,   186, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000,  -176,  -174,  -111,  -112,  -213,   -74,  -158,  -180,
  -334, -1000,  -274,  -113, -1000,  -114,  -244,   185, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000,  -115,  -116,  -287,   -70,   -71,
 -1000, -1000, -1000, -1000, -1000,  -117, -1000, -1000, -1000,  -118,
  -211,  -119,  -120, -1000,  -288,  -121,  -289,  -122,  -123,  -124,
  -271,  -125,  -126,  -318,  -127,  -290,  -128,  -129,  -130,  -277,
  -131,  -132,  -326, -1000,  -133, -1000,  -240,  -285, -1000,  -257,
  -258, -1000, -1000, -1000,  -134, -1000,  -245, -1000, -1000, -1000,
  -135,   184,  -136, -1000,  -137, -1000, -1000,  -294,  -312,  -138,
  -139,  -313,  -140, -1000,  -208,  -286,  -195, -1000, -1000, -1000,
 -1000,   -80, -1000,  -141, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000,  -142,  -142,  -142,  -143,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000,  -144,  -144,  -144, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000,  -145, -1000, -1000, -1000, -1000,    56, -1000,
 -1000, -1000, -1000,  -146,  -147, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000,   -68, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000,  -148, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
 -1000, -1000, -1000, -1000, -1000, -1000, -1000,  -149,  -150,  -151,
  -152, -1000, -1000, -1000, -1000, -1000, -1000,  -153,  -154,  -155,
 -1000,  -156, -1000,  -157,  -159, -1000, -1000, -1000, -1000,  -168,
 -1000,  -238,  -169,  -170,   183, -1000,  -171,  -171,  -171,  -172,
  -173, -1000, -1000,    52, -1000,  -321, -1000, -1000, -1000, -1000,
  -189, -1000,  -178, -1000, -1000,  -179, -1000,  -189,    50, -1000,
 -1000, -1000,  -337, -1000, -1000, -1000,   126,  -192, -1000,  -206,
 -1000, -1000 };
yytabelem yypgo[]={

     0,   338,   198,   337,   336,   335,   334,   333,   331,   327,
   324,   323,   322,   321,   317,   313,   312,   311,   310,   307,
   306,   305,   304,   303,   302,   301,   300,   299,   298,   295,
   294,   293,   292,   291,   290,   289,   288,   286,   285,   284,
   282,   281,   280,   277,   276,   273,   272,   271,   270,   267,
   266,   263,   262,   261,   260,   259,   258,   257,   256,   255,
   253,   249,   245,   244,   243,   242,   241,   240,   239,   238,
    56,   237,   236,   235,   234,   233,    55,   232,   231,    47,
   230,   229,   228,   227,   226,   225,   224,   223,   222,   221,
   220,   219,   218,   217,   216,   215,   214,   213,   212,   211,
   210,    86,   209,   208,   207,   206,   205,   204,   203,   118,
   202,   201,   199,   114 };
yytabelem yyr1[]={

     0,     1,     1,     1,     1,     1,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,    57,    60,    60,    61,    61,    61,    61,
    58,    58,    62,    62,     3,     4,     4,    63,    63,     5,
     5,    64,    64,     6,    65,    66,    65,     7,     8,     9,
    67,    68,    10,    69,    69,    69,    69,    70,    70,    71,
    72,    73,    12,    75,    74,    74,    76,    76,    77,    78,
    78,    79,    56,    15,    80,    16,    81,    81,    81,    14,
    43,    45,    46,    82,    47,    49,    50,    51,    52,    53,
    54,    55,    11,    48,    23,    83,    13,    17,    17,    84,
    84,    85,    18,    86,    86,    86,    86,    86,    86,    86,
    86,    87,    19,    89,    89,    88,    88,    88,    88,    88,
    88,    88,    88,    88,    88,    88,    88,    88,    88,    88,
    88,    88,    90,    20,    91,    91,    91,    91,    91,    91,
    91,    21,    22,    92,    93,    24,    94,    95,    96,    97,
    44,    98,    98,    99,    59,   100,   100,   100,   102,   103,
   101,   105,   104,   104,    25,    25,   106,   106,    26,    27,
    28,    29,    30,   107,   107,    31,    32,    33,   108,   108,
   108,   108,   109,   109,    34,    34,   110,   110,    35,    36,
    37,    38,    39,   111,   111,    40,    41,    42,   112,   112,
   112,   112,   113,   113 };
yytabelem yyr2[]={

     0,     4,     6,     4,     5,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     3,     5,     4,     4,     2,     2,
     4,     2,     4,     2,     5,     6,     4,     5,     3,     6,
     4,     5,     3,     4,     1,     1,     9,     7,     9,     9,
     1,     1,    14,     7,     7,     7,     0,     5,     0,     1,
     1,     1,    18,     1,     7,     2,     4,     2,     5,     4,
     2,     3,     5,     7,     1,     8,     3,     3,     3,     7,
     5,     7,     7,     1,    11,     7,     5,     7,     7,     7,
     7,     5,     5,     5,     5,     1,     9,     7,     4,     5,
     3,     1,     8,     3,     3,     3,     3,     3,     3,     3,
     3,     1,    10,     5,     0,     3,     3,     3,     3,     3,
     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
     3,     3,     1,     8,     3,     3,     3,     3,     3,     3,
     3,     7,     7,     1,     1,    19,     1,     1,     1,     1,
    27,     5,     3,     1,    10,     4,     2,     2,     1,     1,
    12,     1,     8,     2,     6,     4,     5,     3,     7,     7,
     7,     7,     6,     3,     3,     7,     7,     6,     3,     5,
     5,     5,     3,     1,     6,     4,     5,     3,     7,     7,
     7,     7,     6,     3,     3,     7,     7,     6,     3,     5,
     5,     5,     3,     1 };
yytabelem yychk[]={

 -1000,    -1,    -2,   256,    10,    -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,   257,   258,   260,   274,   275,   293,   284,   285,
   335,   338,   326,   336,   -60,   325,   324,    -2,    10,    10,
    10,   258,   293,   275,   276,   259,   278,   261,   293,   275,
   -65,   294,   294,   277,   261,   278,   280,   296,   281,   282,
   326,   283,   262,   263,   261,   278,   261,   286,   287,   288,
   290,   291,   289,   292,   278,   261,   286,   287,   288,   290,
   291,   289,   292,   337,   -94,   293,   335,   327,   328,   284,
   285,   337,   275,   294,   -62,   294,   -61,   294,   324,    10,
   -71,   -99,   -63,   294,   -64,   294,   330,   261,   261,   -66,
   -67,   -83,   -84,   294,   -85,   -87,   -90,   294,   295,   294,
   294,   -80,   330,  -106,   294,   330,   294,   294,   294,  -107,
   322,   323,   294,   294,  -108,   331,   332,   333,   334,  -110,
   294,   330,   294,   294,   294,  -111,   322,   323,   294,   294,
  -112,   331,   332,   333,   334,   294,   329,   279,   329,   329,
   295,   329,   295,   -82,   294,   294,   324,   294,    10,   294,
   294,   330,   330,   294,   294,   330,   294,   -86,   298,   299,
   300,   301,   302,   303,   304,   305,   -88,   298,   306,   307,
   308,   309,   310,   311,   312,   313,   314,   315,   316,   317,
   318,   319,   320,   321,   -91,   322,   270,   268,   269,   272,
   273,   271,   -92,   -81,   264,   266,   265,   294,  -109,   294,
  -109,  -109,   294,  -113,   294,  -113,  -113,   -95,   294,   -72,
  -100,  -101,    10,   294,   294,   294,   -89,   260,   294,   294,
   294,   294,  -101,  -102,   -68,   294,   294,   294,   294,   294,
   -69,   294,   -93,   -96,   -73,   294,   295,   296,   297,   294,
   294,   -74,    10,  -103,   -70,   294,   -70,   -70,   294,   294,
   -75,  -104,   294,    10,   330,   -97,   -76,   -77,   -78,   -79,
   294,   294,   294,   -76,    10,   -79,  -105,   339,    10,   -98,
   294,   294 };
yytabelem yydef[]={

     0,    -2,     0,     0,     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,     0,     0,    84,     0,     0,     0,     0,     0,
     0,   186,     0,     0,    63,    71,    64,     0,     3,     1,
     4,    74,    99,   132,   193,    76,    80,     0,     0,     0,
    83,    85,    90,   134,   135,   138,   141,   151,   172,     0,
     0,     0,     0,   114,     0,   205,     0,     0,     0,     0,
     0,     0,     0,     0,   225,     0,     0,     0,     0,     0,
     0,     0,     0,   120,     0,   112,     0,     0,   126,     0,
     0,   131,   133,   123,    70,    73,    65,    68,    69,     2,
     0,     0,    75,    78,    79,    82,    87,     0,     0,     0,
     0,     0,   137,   140,     0,     0,     0,   181,   182,   183,
   113,     0,   119,   204,   207,   208,   209,   210,   211,   212,
   213,   214,   215,   216,   217,   218,   223,   223,   223,   224,
   227,   228,   229,   230,   231,   232,   233,   234,   235,   236,
   237,   238,   243,   243,   243,   187,   121,   122,   125,   127,
   129,   128,   130,     0,    72,    66,    67,   100,     0,    77,
    81,    88,    89,     0,     0,   136,   139,   142,   143,   144,
   145,   146,   147,   148,   149,   150,   154,   155,   156,   157,
   158,   159,   160,   161,   162,   163,   164,   165,   166,   167,
   168,   169,   170,   171,   173,   174,   175,   176,   177,   178,
   179,   180,     0,   115,   116,   117,   118,   206,   219,   222,
   220,   221,   226,   239,   242,   240,   241,     0,     0,     0,
   194,   196,   197,   198,    86,    91,   152,     0,     0,     0,
   124,     0,   195,     0,    96,   153,   184,   188,   101,     0,
    92,     0,     0,     0,     0,   199,    98,    98,    98,     0,
     0,   102,    -2,     0,    93,     0,    94,    95,   185,   189,
     0,   200,     0,   203,    97,     0,   104,   107,     0,   110,
   111,   201,     0,   106,   108,   109,     0,     0,   202,   190,
   192,   191 };
typedef struct { char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"NEW",	257,
	"GRAPH",	258,
	"TITLE",	259,
	"SIZE",	260,
	"FONT",	261,
	"ANGLE",	262,
	"ALIGN",	263,
	"LEFT",	264,
	"RIGHT",	265,
	"CENTER",	266,
	"BAR",	267,
	"REGRESSION",	268,
	"STEP",	269,
	"XHISTOGRAM",	270,
	"YHISTOGRAM",	271,
	"SMOOTH",	272,
	"SPLINE",	273,
	"KEY",	274,
	"CURVE",	275,
	"POINTS",	276,
	"CONFIDENCE",	277,
	"LABEL",	278,
	"LABELS",	279,
	"TYPE",	280,
	"INTERPOLATION",	281,
	"GRAY",	282,
	"MAT",	283,
	"X",	284,
	"Y",	285,
	"MAXIMUM",	286,
	"MINIMUM",	287,
	"UNIT",	288,
	"INTERVAL",	289,
	"SCALE",	290,
	"LOGBASE",	291,
	"NUMBERSTYLE",	292,
	"TEXT",	293,
	"INPUT",	294,
	"LINE",	295,
	"SYMBOL",	296,
	"BOTH",	297,
	"NONE",	298,
	"SOLID",	299,
	"DASHES",	300,
	"STIPPLE",	301,
	"DOTS",	302,
	"PAT",	303,
	"FILL",	304,
	"BOLD",	305,
	"CROSS",	306,
	"TRIANGLE",	307,
	"TRIANGLEFILLED",	308,
	"DIAMOND",	309,
	"DIAMONDFILLED",	310,
	"SQUARE",	311,
	"BOX",	312,
	"SQUAREFILLED",	313,
	"SOLIDBOX",	314,
	"RECTANGLE",	315,
	"RECTANGLEFILLED",	316,
	"CIRCLE",	317,
	"CIRCLEFILLED",	318,
	"BULLET",	319,
	"PLUS",	320,
	"STAR",	321,
	"LINEAR",	322,
	"LOGS",	323,
	"UNKNOWNCMD",	324,
	"COMMENT",	325,
	"EXCLUDE",	326,
	"MINORTIC",	327,
	"MINORTICS",	328,
	"NUMBERS",	329,
	"FONTNAME",	330,
	"INTEGER",	331,
	"FLOATING",	332,
	"SCIENTIFIC",	333,
	"EXPONENT",	334,
	"MIRROR",	335,
	"ORIGIN",	336,
	"AXES",	337,
	"FUNCTION",	338,
	"DEF",	339,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"CommandStream : Command '\n'",
	"CommandStream : CommandStream Command '\n'",
	"CommandStream : CommandStream '\n'",
	"CommandStream : error '\n'",
	"CommandStream : '\n'",
	"Command : NewGraphCommand",
	"Command : GraphTitleCommand",
	"Command : GraphLabelCommand",
	"Command : SizeCommand",
	"Command : GraphFontCommand",
	"Command : GraphTextFontCommand",
	"Command : GraphCurveFontCommand",
	"Command : KeyCommand",
	"Command : NewCurveCommand",
	"Command : NewTextCommand",
	"Command : CurveFontCommand",
	"Command : TextFontCommand",
	"Command : TextAngleCommand",
	"Command : TextAlignCommand",
	"Command : CurveLabelCommand",
	"Command : CurveTypeCommand",
	"Command : CurveSymbolCommand",
	"Command : CurveInterpolationCommand",
	"Command : CurveGrayCommand",
	"Command : CurveExcludeLine",
	"Command : CurveConfidence",
	"Command : CurveMatCommand",
	"Command : XLabelCommand",
	"Command : XFontCommand",
	"Command : XMaximumCommand",
	"Command : XMinimumCommand",
	"Command : XUnitCommand",
	"Command : XScaleCommand",
	"Command : XLogBaseCommand",
	"Command : XIntervalCommand",
	"Command : XNumberStyleCommand",
	"Command : YLabelCommand",
	"Command : YFontCommand",
	"Command : YMaximumCommand",
	"Command : YMinimumCommand",
	"Command : YUnitCommand",
	"Command : YScaleCommand",
	"Command : YLogBaseCommand",
	"Command : YIntervalCommand",
	"Command : YNumberStyleCommand",
	"Command : MirrorAxesCommand",
	"Command : FunctionCommand",
	"Command : ExcludeMirrorNumbersCommand",
	"Command : ExcludeMirrorLabelsCommand",
	"Command : OriginCommand",
	"Command : ExcludeCurve",
	"Command : ExcludeMinorticNumbers",
	"Command : ExcludeMinortics",
	"Command : ExcludeXNos",
	"Command : ExcludeYNos",
	"Command : ExcludeXLine",
	"Command : ExcludeYLine",
	"Command : ExcludeAxes",
	"Command : ExcludeText",
	"Command : BadCommand",
	"Command : CommentCommand",
	"Command : NewPointsCommand",
	"BadCommand : BadString",
	"BadString : UNKNOWNCMD",
	"BadString : UNKNOWNCMD usentence",
	"usentence : usentence INPUT",
	"usentence : usentence UNKNOWNCMD",
	"usentence : INPUT",
	"usentence : UNKNOWNCMD",
	"CommentCommand : COMMENT restofcomment",
	"CommentCommand : COMMENT",
	"restofcomment : restofcomment INPUT",
	"restofcomment : INPUT",
	"NewGraphCommand : NEW GRAPH",
	"GraphTitleCommand : GRAPH TITLE gsentence",
	"GraphTitleCommand : GRAPH TITLE",
	"gsentence : gsentence INPUT",
	"gsentence : INPUT",
	"GraphLabelCommand : GRAPH LABEL glsentence",
	"GraphLabelCommand : GRAPH LABEL",
	"glsentence : glsentence INPUT",
	"glsentence : INPUT",
	"SizeCommand : SIZE restofsize",
	"restofsize : /* empty */",
	"restofsize : INPUT",
	"restofsize : INPUT INPUT INPUT",
	"GraphFontCommand : GRAPH FONT FONTNAME",
	"GraphTextFontCommand : GRAPH TEXT FONT FONTNAME",
	"GraphCurveFontCommand : GRAPH CURVE FONT FONTNAME",
	"KeyCommand : KEY INPUT",
	"KeyCommand : KEY INPUT INPUT INPUT",
	"KeyCommand : KEY INPUT INPUT INPUT keytype",
	"keytype : INPUT LINE keyfntnm",
	"keytype : INPUT SYMBOL keyfntnm",
	"keytype : INPUT BOTH keyfntnm",
	"keytype : /* empty */",
	"keyfntnm : INPUT FONTNAME",
	"keyfntnm : /* empty */",
	"NewTextCommand : NEW TEXT",
	"NewTextCommand : NEW TEXT INPUT",
	"NewTextCommand : NEW TEXT INPUT INPUT INPUT",
	"NewTextCommand : NEW TEXT INPUT INPUT INPUT textinput",
	"textinput : '\n'",
	"textinput : '\n' tsentencebig",
	"textinput : '\n'",
	"tsentencebig : tsentenceret tsentencebig",
	"tsentencebig : tsentenceret",
	"tsentenceret : tsentence '\n'",
	"tsentence : tsentence tword",
	"tsentence : tword",
	"tword : INPUT",
	"ExcludeText : EXCLUDE TEXT",
	"TextAngleCommand : TEXT ANGLE INPUT",
	"TextAlignCommand : TEXT ALIGN",
	"TextAlignCommand : TEXT ALIGN aligntype",
	"aligntype : LEFT",
	"aligntype : CENTER",
	"aligntype : RIGHT",
	"TextFontCommand : TEXT FONT FONTNAME",
	"MirrorAxesCommand : MIRROR AXES",
	"ExcludeMirrorNumbersCommand : EXCLUDE MIRROR NUMBERS",
	"ExcludeMirrorLabelsCommand : EXCLUDE MIRROR LABELS",
	"OriginCommand : ORIGIN INPUT",
	"OriginCommand : ORIGIN INPUT INPUT INPUT",
	"ExcludeMinorticNumbers : EXCLUDE MINORTIC NUMBERS",
	"ExcludeMinortics : EXCLUDE MINORTICS",
	"ExcludeXNos : EXCLUDE X NUMBERS",
	"ExcludeYNos : EXCLUDE Y NUMBERS",
	"ExcludeXLine : EXCLUDE X LINE",
	"ExcludeYLine : EXCLUDE Y LINE",
	"ExcludeAxes : EXCLUDE AXES",
	"NewCurveCommand : NEW CURVE",
	"ExcludeCurve : EXCLUDE CURVE",
	"CurveConfidence : CURVE CONFIDENCE",
	"CurveFontCommand : CURVE FONT",
	"CurveFontCommand : CURVE FONT FONTNAME",
	"CurveLabelCommand : CURVE LABEL csentence",
	"CurveLabelCommand : CURVE LABEL",
	"csentence : csentence INPUT",
	"csentence : INPUT",
	"CurveTypeCommand : CURVE TYPE",
	"CurveTypeCommand : CURVE TYPE curvetype",
	"curvetype : NONE",
	"curvetype : SOLID",
	"curvetype : DASHES",
	"curvetype : STIPPLE",
	"curvetype : DOTS",
	"curvetype : PAT",
	"curvetype : FILL",
	"curvetype : BOLD",
	"CurveSymbolCommand : CURVE SYMBOL",
	"CurveSymbolCommand : CURVE SYMBOL symboltype symbolsize",
	"symbolsize : SIZE INPUT",
	"symbolsize : /* empty */",
	"symboltype : NONE",
	"symboltype : CROSS",
	"symboltype : TRIANGLE",
	"symboltype : TRIANGLEFILLED",
	"symboltype : DIAMOND",
	"symboltype : DIAMONDFILLED",
	"symboltype : SQUARE",
	"symboltype : BOX",
	"symboltype : SQUAREFILLED",
	"symboltype : SOLIDBOX",
	"symboltype : RECTANGLE",
	"symboltype : RECTANGLEFILLED",
	"symboltype : CIRCLE",
	"symboltype : CIRCLEFILLED",
	"symboltype : BULLET",
	"symboltype : PLUS",
	"symboltype : STAR",
	"CurveInterpolationCommand : CURVE INTERPOLATION",
	"CurveInterpolationCommand : CURVE INTERPOLATION interptype",
	"interptype : LINEAR",
	"interptype : XHISTOGRAM",
	"interptype : REGRESSION",
	"interptype : STEP",
	"interptype : SMOOTH",
	"interptype : SPLINE",
	"interptype : YHISTOGRAM",
	"CurveGrayCommand : CURVE GRAY INPUT",
	"CurveExcludeLine : CURVE EXCLUDE LINE",
	"CurveMatCommand : CURVE MAT INPUT",
	"CurveMatCommand : CURVE MAT INPUT INPUT INPUT",
	"CurveMatCommand : CURVE MAT INPUT INPUT INPUT INPUT INPUT",
	"FunctionCommand : FUNCTION",
	"FunctionCommand : FUNCTION INPUT",
	"FunctionCommand : FUNCTION INPUT INPUT INPUT",
	"FunctionCommand : FUNCTION INPUT INPUT INPUT INPUT INPUT",
	"FunctionCommand : FUNCTION INPUT INPUT INPUT INPUT INPUT INPUT DEF fnsentence",
	"fnsentence : fnsentence INPUT",
	"fnsentence : INPUT",
	"NewPointsCommand : NEW POINTS",
	"NewPointsCommand : NEW POINTS '\n' sequence",
	"sequence : sequence pair",
	"sequence : pair",
	"sequence : '\n'",
	"pair : INPUT",
	"pair : INPUT INPUT INPUT",
	"pair : INPUT INPUT INPUT confInterval",
	"confInterval : INPUT INPUT",
	"confInterval : INPUT INPUT '\n'",
	"confInterval : '\n'",
	"XLabelCommand : X LABEL Xsentence",
	"XLabelCommand : X LABEL",
	"Xsentence : Xsentence INPUT",
	"Xsentence : INPUT",
	"XFontCommand : X FONT FONTNAME",
	"XMaximumCommand : X MAXIMUM INPUT",
	"XMinimumCommand : X MINIMUM INPUT",
	"XUnitCommand : X UNIT INPUT",
	"XScaleCommand : X SCALE Xwhichscale",
	"Xwhichscale : LINEAR",
	"Xwhichscale : LOGS",
	"XLogBaseCommand : X LOGBASE INPUT",
	"XIntervalCommand : X INTERVAL INPUT",
	"XNumberStyleCommand : X NUMBERSTYLE nxstyle",
	"nxstyle : INTEGER",
	"nxstyle : FLOATING xsignif",
	"nxstyle : SCIENTIFIC xsignif",
	"nxstyle : EXPONENT xsignif",
	"xsignif : INPUT",
	"xsignif : /* empty */",
	"YLabelCommand : Y LABEL Ysentence",
	"YLabelCommand : Y LABEL",
	"Ysentence : Ysentence INPUT",
	"Ysentence : INPUT",
	"YFontCommand : Y FONT FONTNAME",
	"YMaximumCommand : Y MAXIMUM INPUT",
	"YMinimumCommand : Y MINIMUM INPUT",
	"YUnitCommand : Y UNIT INPUT",
	"YScaleCommand : Y SCALE Ywhichscale",
	"Ywhichscale : LINEAR",
	"Ywhichscale : LOGS",
	"YLogBaseCommand : Y LOGBASE INPUT",
	"YIntervalCommand : Y INTERVAL INPUT",
	"YNumberStyleCommand : Y NUMBERSTYLE nystyle",
	"nystyle : INTEGER",
	"nystyle : FLOATING ysignif",
	"nystyle : SCIENTIFIC ysignif",
	"nystyle : EXPONENT ysignif",
	"ysignif : INPUT",
	"ysignif : /* empty */",
};
#endif /* YYDEBUG */
/* @(#)yaccpar	1.3  com/cmd/lang/yacc,3.1,9021 9/7/89 18:46:37 */
/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#ifdef YYSPLIT
#   define YYERROR	return(-2)
#else
#   define YYERROR	goto yyerrlab
#endif

#define YYACCEPT	return(0)
#define YYABORT		return(1)
#define YYBACKUP( newtoken, newvalue )\
{\
	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
	{\
		yyerror( "syntax error - cannot backup" );\
		goto yyerrlab;\
	}\
	yychar = newtoken;\
	yystate = *yyps;\
	yylval = newvalue;\
	goto yynewstate;\
}
#define YYRECOVERING()	(!!yyerrflag)
#ifndef YYDEBUG
#	define YYDEBUG	1	/* make debugging available */
#endif

/*
** user known globals
*/
int yydebug;			/* set to 1 to get debugging */

/*
** driver internal defines
*/
#define YYFLAG		(-1000)

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

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

YYSTYPE *yypv;			/* top of value stack */
YYSTYPE *yypvt;			/* top of value stack for $vars */
int *yyps;			/* top of state stack */

int yystate;			/* current state */
int yytmp;			/* extra var (lasts between blocks) */

int yynerrs;			/* number of errors */
int yyerrflag;			/* error recovery flag */
int yychar;			/* current input token number */



/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
int
yyparse()
{
	/*
	** Initialize externals - yyparse may be called more than once
	*/
	yypv = &yyv[-1];
	yyps = &yys[-1];
	yystate = 0;
	yytmp = 0;
	yynerrs = 0;
	yyerrflag = 0;
	yychar = -1;

	goto yystack;
	{
		register YYSTYPE *yy_pv;	/* top of value stack */
		register int *yy_ps;		/* top of state stack */
		register int yy_state;		/* current state */
		register int  yy_n;		/* internal state number info */

		/*
		** get globals into registers.
		** branch to here only if YYBACKUP was called.
		*/
	yynewstate:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;
		goto yy_newstate;

		/*
		** get globals into registers.
		** either we just started, or we just finished a reduction
		*/
	yystack:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;

		/*
		** top of for (;;) loop while no reductions done
		*/
	yy_stack:
		/*
		** put a state and value onto the stacks
		*/
#if YYDEBUG
		/*
		** if debugging, look up token value in list of value vs.
		** name pairs.  0 and negative (-1) are special values.
		** Note: linear search is used since time is not a real
		** consideration while debugging.
		*/
		if ( yydebug )
		{
			register int yy_i;

			printf( "State %d, token ", yy_state );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ++yy_ps >= &yys[ YYMAXDEPTH ] )	/* room on stack? */
		{
			yyerror( "yacc stack overflow" );
			YYABORT;
		}
		*yy_ps = yy_state;
		*++yy_pv = yyval;

		/*
		** we have a new state - find out what to do
		*/
	yy_newstate:
		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
			goto yydefault;		/* simple state */
#if YYDEBUG
		/*
		** if debugging, need to mark whether new token grabbed
		*/
		yytmp = yychar < 0;
#endif
		if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
			yychar = 0;		/* reached EOF */
#if YYDEBUG
		if ( yydebug && yytmp )
		{
			register int yy_i;

			printf( "Received token " );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
			goto yydefault;
		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/
		{
			yychar = -1;
			yyval = yylval;
			yy_state = yy_n;
			if ( yyerrflag > 0 )
				yyerrflag--;
			goto yy_stack;
		}

	yydefault:
		if ( ( yy_n = yydef[ yy_state ] ) == -2 )
		{
#if YYDEBUG
			yytmp = yychar < 0;
#endif
			if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
				yychar = 0;		/* reached EOF */
#if YYDEBUG
			if ( yydebug && yytmp )
			{
				register int yy_i;

				printf( "Received token " );
				if ( yychar == 0 )
					printf( "end-of-file\n" );
				else if ( yychar < 0 )
					printf( "-none-\n" );
				else
				{
					for ( yy_i = 0;
						yytoks[yy_i].t_val >= 0;
						yy_i++ )
					{
						if ( yytoks[yy_i].t_val
							== yychar )
						{
							break;
						}
					}
					printf( "%s\n", yytoks[yy_i].t_name );
				}
			}
#endif /* YYDEBUG */
			/*
			** look through exception table
			*/
			{
				register int *yyxi = yyexca;

				while ( ( *yyxi != -1 ) ||
					( yyxi[1] != yy_state ) )
				{
					yyxi += 2;
				}
				while ( ( *(yyxi += 2) >= 0 ) &&
					( *yyxi != yychar ) )
					;
				if ( ( yy_n = yyxi[1] ) < 0 )
					YYACCEPT;
			}
		}

		/*
		** check for syntax error
		*/
		if ( yy_n == 0 )	/* have an error */
		{
			/* no worry about speed here! */
			switch ( yyerrflag )
			{
			case 0:		/* new error */
				yyerror( "syntax error" );
				goto skip_init;
			yyerrlab:
				/*
				** get globals into registers.
				** we have a user generated syntax type error
				*/
				yy_pv = yypv;
				yy_ps = yyps;
				yy_state = yystate;
				yynerrs++;
			skip_init:
			case 1:
			case 2:		/* incompletely recovered error */
					/* try again... */
				yyerrflag = 3;
				/*
				** find state where "error" is a legal
				** shift action
				*/
				while ( yy_ps >= yys )
				{
					yy_n = yypact[ *yy_ps ] + YYERRCODE;
					if ( yy_n >= 0 && yy_n < YYLAST &&
						yychk[yyact[yy_n]] == YYERRCODE)					{
						/*
						** simulate shift of "error"
						*/
						yy_state = yyact[ yy_n ];
						goto yy_stack;
					}
					/*
					** current state has no shift on
					** "error", pop stack
					*/
#if YYDEBUG
#	define _POP_ "Error recovery pops state %d, uncovers state %d\n"
					if ( yydebug )
						printf( _POP_, *yy_ps,
							yy_ps[-1] );
#	undef _POP_
#endif
					yy_ps--;
					yy_pv--;
				}
				/*
				** there is no state on stack with "error" as
				** a valid shift.  give up.
				*/
				YYABORT;
			case 3:		/* no shift yet; eat a token */
#if YYDEBUG
				/*
				** if debugging, look up token in list of
				** pairs.  0 and negative shouldn't occur,
				** but since timing doesn't matter when
				** debugging, it doesn't hurt to leave the
				** tests here.
				*/
				if ( yydebug )
				{
					register int yy_i;

					printf( "Error recovery discards " );
					if ( yychar == 0 )
						printf( "token end-of-file\n" );
					else if ( yychar < 0 )
						printf( "token -none-\n" );
					else
					{
						for ( yy_i = 0;
							yytoks[yy_i].t_val >= 0;
							yy_i++ )
						{
							if ( yytoks[yy_i].t_val
								== yychar )
							{
								break;
							}
						}
						printf( "token %s\n",
							yytoks[yy_i].t_name );
					}
				}
#endif /* YYDEBUG */
				if ( yychar == 0 )	/* reached EOF. quit */
					YYABORT;
				yychar = -1;
				goto yy_newstate;
			}
		}/* end if ( yy_n == 0 ) */
		/*
		** reduction by production yy_n
		** put stack tops, etc. so things right after switch
		*/
#if YYDEBUG
		/*
		** if debugging, print the string that is the user's
		** specification of the reduction which is just about
		** to be done.
		*/
		if ( yydebug )
			printf( "Reduce by (%d) \"%s\"\n",
				yy_n, yyreds[ yy_n ] );
#endif
		yytmp = yy_n;			/* value to switch over */
		yypvt = yy_pv;			/* $vars top of value stack */
		/*
		** Look in goto table for next state
		** Sorry about using yy_state here as temporary
		** register variable, but why not, if it works...
		** If yyr2[ yy_n ] doesn't have the low order bit
		** set, then there is no action to be done for
		** this reduction.  So, no saving & unsaving of
		** registers done.  The only difference between the
		** code just after the if and the body of the if is
		** the goto yy_stack in the body.  This way the test
		** can be made before the choice of what to do is needed.
		*/
		{
			/* length of production doubled with extra bit */
			register int yy_len = yyr2[ yy_n ];

			if ( !( yy_len & 01 ) )
			{
				yy_len >>= 1;
				yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
				yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
					*( yy_ps -= yy_len ) + 1;
				if ( yy_state >= YYLAST ||
					yychk[ yy_state =
					yyact[ yy_state ] ] != -yy_n )
				{
					yy_state = yyact[ yypgo[ yy_n ] ];
				}
				goto yy_stack;
			}
			yy_len >>= 1;
			yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
			yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
				*( yy_ps -= yy_len ) + 1;
			if ( yy_state >= YYLAST ||
				yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
			{
				yy_state = yyact[ yypgo[ yy_n ] ];
			}
		}
					/* save until reenter driver code */
		yystate = yy_state;
		yyps = yy_ps;
		yypv = yy_pv;
	}
	/*
	** code supplied by user is placed in this switch
	*/

		switch(yytmp){

case 4:
# line 118 "plot.yacc"
{
				fprintf(stderr,
				"***splot::error near line %d\n", lineno);
				fprintf(stderr,
				"previous text: %s, ",errorpos);
/*				fprintf(stderr,"prev: %s, ",pstr);*/
				fprintf(stderr,"current text: %s\n",yytext);
				yyerrok;
			} /*NOTREACHED*/ break;
case 64:
# line 194 "plot.yacc"
{
				unknowncmderror();
			} /*NOTREACHED*/ break;
case 65:
# line 198 "plot.yacc"
{
				unknowncmderror();
			} /*NOTREACHED*/ break;
case 74:
# line 218 "plot.yacc"
{
				newgraphproc();
			} /*NOTREACHED*/ break;
case 77:
# line 228 "plot.yacc"
{strcat(graph.title, yytext);} /*NOTREACHED*/ break;
case 78:
# line 230 "plot.yacc"
{strcat(graph.title, yytext);} /*NOTREACHED*/ break;
case 81:
# line 238 "plot.yacc"
{strcat(graph.label, yytext);} /*NOTREACHED*/ break;
case 82:
# line 240 "plot.yacc"
{strcat(graph.label, yytext);} /*NOTREACHED*/ break;
case 84:
# line 247 "plot.yacc"
{
				graph.size[xpt] = 6;
				graphsize[xpt] = graph.size[xpt]*2.54;
				graph.size[ypt] = 6;
				graphsize[ypt] = graph.size[ypt]*2.54;
			} /*NOTREACHED*/ break;
case 85:
# line 254 "plot.yacc"
{
				graph.size[xpt] = atof(yytext);
				graphsize[xpt] = graph.size[xpt]*2.54;
			} /*NOTREACHED*/ break;
case 86:
# line 260 "plot.yacc"
{
				graph.size[ypt] = atof(yytext);
				graphsize[ypt] = graph.size[ypt]*2.54;
			} /*NOTREACHED*/ break;
case 87:
# line 267 "plot.yacc"
{
				graph.font = yylval;
			} /*NOTREACHED*/ break;
case 88:
# line 273 "plot.yacc"
{
				defTextFont = yylval;
			} /*NOTREACHED*/ break;
case 89:
# line 279 "plot.yacc"
{
				defGraphThick = FFthick(yylval);
			} /*NOTREACHED*/ break;
case 90:
# line 285 "plot.yacc"
{
				graph.keypos[xpt] = atof(yytext);
			} /*NOTREACHED*/ break;
case 91:
# line 290 "plot.yacc"
{
				graph.keypos[ypt] = atof(yytext);
				graph.includekey = TRUE;
			} /*NOTREACHED*/ break;
case 93:
# line 298 "plot.yacc"
{
				graph.key = ktype;
			} /*NOTREACHED*/ break;
case 94:
# line 302 "plot.yacc"
{
				graph.key = ksymbol;
			} /*NOTREACHED*/ break;
case 95:
# line 306 "plot.yacc"
{
				graph.key = kboth;
			} /*NOTREACHED*/ break;
case 97:
# line 313 "plot.yacc"
{
				graph.keyfont = yylval;
			} /*NOTREACHED*/ break;
case 99:
# line 320 "plot.yacc"
{
				newtextproc();
			} /*NOTREACHED*/ break;
case 100:
# line 324 "plot.yacc"
{
				(text[curtext])->pos[xpt] = atof(yytext);
			} /*NOTREACHED*/ break;
case 101:
# line 329 "plot.yacc"
{
				(text[curtext])->pos[ypt] = atof(yytext);
			} /*NOTREACHED*/ break;
case 103:
# line 336 "plot.yacc"
{intext = TRUE;} /*NOTREACHED*/ break;
case 104:
# line 338 "plot.yacc"
{
				 intext = FALSE;
			} /*NOTREACHED*/ break;
case 108:
# line 349 "plot.yacc"
{
				strcat((text[curtext])->label,yytext);
			} /*NOTREACHED*/ break;
case 111:
# line 359 "plot.yacc"
{
				strcat((text[curtext])->label,yytext);
			} /*NOTREACHED*/ break;
case 112:
# line 365 "plot.yacc"
{
				if (curtext == -1) notexterr();
				else (text[curtext])->include = FALSE;
			} /*NOTREACHED*/ break;
case 113:
# line 374 "plot.yacc"
{
				if (curtext == -1) notexterr();
				else
				(text[curtext])->angle = atof(yytext);
			} /*NOTREACHED*/ break;
case 114:
# line 384 "plot.yacc"
{
				if (curtext == -1) notexterr();
			} /*NOTREACHED*/ break;
case 116:
# line 391 "plot.yacc"
{
				(text[curtext])->align = left;
			} /*NOTREACHED*/ break;
case 117:
# line 395 "plot.yacc"
{
				(text[curtext])->align = center;
			} /*NOTREACHED*/ break;
case 118:
# line 399 "plot.yacc"
{
				(text[curtext])->align = right;
			} /*NOTREACHED*/ break;
case 119:
# line 408 "plot.yacc"
{
				if (curtext == -1) notexterr();
				else (text[curtext])->font = yylval;
			} /*NOTREACHED*/ break;
case 120:
# line 415 "plot.yacc"
{
				MirrorAxes = TRUE;
				MirrorAxisNumbers = TRUE;
				MirrorAxisLabels = TRUE;
			} /*NOTREACHED*/ break;
case 121:
# line 423 "plot.yacc"
{
				MirrorAxes = TRUE;
				MirrorAxisNumbers = FALSE;
			} /*NOTREACHED*/ break;
case 122:
# line 430 "plot.yacc"
{
				MirrorAxes = TRUE;
				MirrorAxisLabels = FALSE;
			} /*NOTREACHED*/ break;
case 123:
# line 437 "plot.yacc"
{
				NewOrigin = TRUE;
				origin[xpt] = atof(yytext);
			} /*NOTREACHED*/ break;
case 124:
# line 442 "plot.yacc"
{
				origin[ypt] = atof(yytext);
			} /*NOTREACHED*/ break;
case 125:
# line 448 "plot.yacc"
{
				MinticNos = FALSE;
			} /*NOTREACHED*/ break;
case 126:
# line 454 "plot.yacc"
{
				ShowMinTics = FALSE;
			} /*NOTREACHED*/ break;
case 127:
# line 460 "plot.yacc"
{
				ShowXNos = FALSE;
			} /*NOTREACHED*/ break;
case 128:
# line 466 "plot.yacc"
{
				ShowYNos = FALSE;
			} /*NOTREACHED*/ break;
case 129:
# line 472 "plot.yacc"
{
/* relic of ancient times. Not present in man page */
				ShowXLine = FALSE;
			} /*NOTREACHED*/ break;
case 130:
# line 479 "plot.yacc"
{
/* relic of ancient times. Not present in man page */
				ShowYLine = FALSE;
			} /*NOTREACHED*/ break;
case 131:
# line 486 "plot.yacc"
{
				ShowAxes = FALSE;
			} /*NOTREACHED*/ break;
case 132:
# line 492 "plot.yacc"
{	
				newcurveproc();
			 } /*NOTREACHED*/ break;
case 133:
# line 498 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				(curves[curcur])->include = FALSE;
				/*may want to do curcur-1 here*/
			} /*NOTREACHED*/ break;
case 134:
# line 506 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				(curves[curcur])->showConf = TRUE;
			} /*NOTREACHED*/ break;
case 135:
# line 513 "plot.yacc"
{
				if (curcur < 0) nocurverr();
			} /*NOTREACHED*/ break;
case 136:
# line 517 "plot.yacc"
{
				(curves[curcur])->thick = FFthick(yylval);
			} /*NOTREACHED*/ break;
case 137:
# line 523 "plot.yacc"
{
/*				strcpy(pstr,yytext);*/
			} /*NOTREACHED*/ break;
case 139:
# line 530 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				strcat((curves[curcur])->label, yytext);
			} /*NOTREACHED*/ break;
case 140:
# line 535 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				strcat((curves[curcur])->label, yytext);
			} /*NOTREACHED*/ break;
case 141:
# line 542 "plot.yacc"
{
				if (curcur < 0) nocurverr();
			} /*NOTREACHED*/ break;
case 143:
# line 549 "plot.yacc"
{(curves[curcur])->type = none;} /*NOTREACHED*/ break;
case 144:
# line 551 "plot.yacc"
{(curves[curcur])->type = solid;} /*NOTREACHED*/ break;
case 145:
# line 553 "plot.yacc"
{(curves[curcur])->type = dashes;} /*NOTREACHED*/ break;
case 146:
# line 555 "plot.yacc"
{(curves[curcur])->type = stipple;} /*NOTREACHED*/ break;
case 147:
# line 557 "plot.yacc"
{(curves[curcur])->type = dots;} /*NOTREACHED*/ break;
case 148:
# line 559 "plot.yacc"
{(curves[curcur])->type = pat;} /*NOTREACHED*/ break;
case 149:
# line 561 "plot.yacc"
{
				handlefillproc();
			} /*NOTREACHED*/ break;
case 150:
# line 565 "plot.yacc"
{
			    (curves[curcur])->type = solid;
			    (curves[curcur])->thick = 
				(curves[curcur])->thick * boldthickmul;
			} /*NOTREACHED*/ break;
case 151:
# line 574 "plot.yacc"
{
				if (curcur < 0) nocurverr();
			} /*NOTREACHED*/ break;
case 153:
# line 581 "plot.yacc"
{(curves[curcur])->symbolsize = atoi(yytext);} /*NOTREACHED*/ break;
case 155:
# line 586 "plot.yacc"
{(curves[curcur])->symbol = nonesymbol;} /*NOTREACHED*/ break;
case 156:
# line 588 "plot.yacc"
{(curves[curcur])->symbol = cross;} /*NOTREACHED*/ break;
case 157:
# line 590 "plot.yacc"
{(curves[curcur])->symbol = triangle;} /*NOTREACHED*/ break;
case 158:
# line 592 "plot.yacc"
{(curves[curcur])->symbol = trianglefilled;} /*NOTREACHED*/ break;
case 159:
# line 594 "plot.yacc"
{(curves[curcur])->symbol = diamond;} /*NOTREACHED*/ break;
case 160:
# line 596 "plot.yacc"
{(curves[curcur])->symbol = diamondfilled;} /*NOTREACHED*/ break;
case 161:
# line 598 "plot.yacc"
{(curves[curcur])->symbol = square;} /*NOTREACHED*/ break;
case 162:
# line 600 "plot.yacc"
{(curves[curcur])->symbol = square;} /*NOTREACHED*/ break;
case 163:
# line 602 "plot.yacc"
{(curves[curcur])->symbol = squarefilled;} /*NOTREACHED*/ break;
case 164:
# line 604 "plot.yacc"
{(curves[curcur])->symbol = squarefilled;} /*NOTREACHED*/ break;
case 165:
# line 606 "plot.yacc"
{(curves[curcur])->symbol = rectangle;} /*NOTREACHED*/ break;
case 166:
# line 608 "plot.yacc"
{(curves[curcur])->symbol = rectanglefilled;} /*NOTREACHED*/ break;
case 167:
# line 610 "plot.yacc"
{(curves[curcur])->symbol = circle;} /*NOTREACHED*/ break;
case 168:
# line 612 "plot.yacc"
{(curves[curcur])->symbol = circlefilled;} /*NOTREACHED*/ break;
case 169:
# line 614 "plot.yacc"
{(curves[curcur])->symbol = bullet;} /*NOTREACHED*/ break;
case 170:
# line 616 "plot.yacc"
{(curves[curcur])->symbol = plus;} /*NOTREACHED*/ break;
case 171:
# line 618 "plot.yacc"
{(curves[curcur])->symbol = star;} /*NOTREACHED*/ break;
case 172:
# line 622 "plot.yacc"
{
				if (curcur < 0) nocurverr();
			} /*NOTREACHED*/ break;
case 174:
# line 629 "plot.yacc"
{
				(curves[curcur])->interp = linearinterp;
			} /*NOTREACHED*/ break;
case 175:
# line 633 "plot.yacc"
{
				(curves[curcur])->interp = xhistogram;
				keySpacingMul = keySpacingMul ;/*  * 1.5; */
			} /*NOTREACHED*/ break;
case 176:
# line 638 "plot.yacc"
{
				(curves[curcur])->interp = lregression;
			} /*NOTREACHED*/ break;
case 177:
# line 642 "plot.yacc"
{
				(curves[curcur])->interp = step;
			} /*NOTREACHED*/ break;
case 178:
# line 646 "plot.yacc"
{
				(curves[curcur])->interp = smooth;
			} /*NOTREACHED*/ break;
case 179:
# line 650 "plot.yacc"
{
				(curves[curcur])->interp = smooth;
			} /*NOTREACHED*/ break;
case 180:
# line 654 "plot.yacc"
{
				(curves[curcur])->interp = yhistogram;
				keySpacingMul = keySpacingMul;/* * 1.5; */
			} /*NOTREACHED*/ break;
case 181:
# line 662 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				(curves[curcur])->mat.grayset = TRUE;
				(curves[curcur])->gray = atof(yytext);
			} /*NOTREACHED*/ break;
case 182:
# line 670 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				(curves[curcur])->mat.showline = FALSE;
			} /*NOTREACHED*/ break;
case 183:
# line 677 "plot.yacc"
{
				if (curcur < 0) nocurverr();
				(curves[curcur])->mat.matset = TRUE;
				(curves[curcur])->mat.freq = atof(yytext);
			} /*NOTREACHED*/ break;
case 184:
# line 683 "plot.yacc"
{
				(curves[curcur])->mat.ang = atof(yytext);
			} /*NOTREACHED*/ break;
case 185:
# line 687 "plot.yacc"
{
				(curves[curcur])->mat.indx = atoi(yytext);
			} /*NOTREACHED*/ break;
case 186:
# line 693 "plot.yacc"
{
				curfn = GetSp(FUNCTION_LEN);
			} /*NOTREACHED*/ break;
case 187:
# line 697 "plot.yacc"
{
				curfnstart = atof(yytext);
			} /*NOTREACHED*/ break;
case 188:
# line 702 "plot.yacc"
{
				curfnend = atof(yytext);
			} /*NOTREACHED*/ break;
case 189:
# line 707 "plot.yacc"
{
				curfndelta = atof(yytext);
			} /*NOTREACHED*/ break;
case 190:
# line 711 "plot.yacc"
{
				computfn(curfnstart,curfnend,curfndelta,curfn);
			} /*NOTREACHED*/ break;
case 191:
# line 717 "plot.yacc"
{
				strcat(curfn, yytext);
			} /*NOTREACHED*/ break;
case 192:
# line 721 "plot.yacc"
{
				strcat(curfn, yytext);
			} /*NOTREACHED*/ break;
case 193:
# line 727 "plot.yacc"
{
				if (curcur < 0) nocurverr();
			} /*NOTREACHED*/ break;
case 198:
# line 740 "plot.yacc"
{
				addPointsPair1();
			} /*NOTREACHED*/ break;
case 199:
# line 745 "plot.yacc"
{
				addPointsPair2();
			} /*NOTREACHED*/ break;
case 201:
# line 752 "plot.yacc"
{
				addPointsConf();
			} /*NOTREACHED*/ break;
case 206:
# line 764 "plot.yacc"
{strcat(axis[xpt].label, yytext);} /*NOTREACHED*/ break;
case 207:
# line 766 "plot.yacc"
{strcat(axis[xpt].label, yytext);} /*NOTREACHED*/ break;
case 208:
# line 770 "plot.yacc"
{
				axis[xpt].font = yylval;
			} /*NOTREACHED*/ break;
case 209:
# line 776 "plot.yacc"
{
				axis[xpt].axismax = atof(yytext);
				limits[xpt][maxval] = axis[xpt].axismax;
			} /*NOTREACHED*/ break;
case 210:
# line 783 "plot.yacc"
{
				axis[xpt].axismin = atof(yytext);
				limits[xpt][minval] = axis[xpt].axismin;
			} /*NOTREACHED*/ break;
case 211:
# line 789 "plot.yacc"
{
				axis[xpt].unit = atof(yytext);
			} /*NOTREACHED*/ break;
case 213:
# line 798 "plot.yacc"
{axis[xpt].scale.type = linear;} /*NOTREACHED*/ break;
case 214:
# line 800 "plot.yacc"
{
				axis[xpt].scale.type = logstype;
				axis[xpt].scale.base = 10.0; /* def logbase */
			} /*NOTREACHED*/ break;
case 215:
# line 807 "plot.yacc"
{
				axis[xpt].scale.base = atof(yytext);
			} /*NOTREACHED*/ break;
case 216:
# line 814 "plot.yacc"
{
				axis[xpt].interval = atof(yytext);
			} /*NOTREACHED*/ break;
case 218:
# line 823 "plot.yacc"
{
				axis[xpt].numberstyle = integer;
			} /*NOTREACHED*/ break;
case 219:
# line 827 "plot.yacc"
{
				axis[xpt].numberstyle = floating;
			} /*NOTREACHED*/ break;
case 220:
# line 831 "plot.yacc"
{
				axis[xpt].numberstyle = scientific;
			} /*NOTREACHED*/ break;
case 221:
# line 835 "plot.yacc"
{
				axis[xpt].numberstyle = exponent;
			} /*NOTREACHED*/ break;
case 222:
# line 841 "plot.yacc"
{
				axis[xpt].signif = atof(yytext);
			} /*NOTREACHED*/ break;
case 223:
# line 845 "plot.yacc"
{
				axis[xpt].signif = 1;
			} /*NOTREACHED*/ break;
case 226:
# line 855 "plot.yacc"
{strcat(axis[ypt].label, yytext);} /*NOTREACHED*/ break;
case 227:
# line 857 "plot.yacc"
{strcat(axis[ypt].label, yytext);} /*NOTREACHED*/ break;
case 228:
# line 861 "plot.yacc"
{
				axis[ypt].font = yylval;
			} /*NOTREACHED*/ break;
case 229:
# line 867 "plot.yacc"
{
				axis[ypt].axismax = atof(yytext);
				limits[ypt][maxval] = axis[ypt].axismax;
			} /*NOTREACHED*/ break;
case 230:
# line 874 "plot.yacc"
{
				axis[ypt].axismin = atof(yytext);
				limits[ypt][minval] = axis[ypt].axismin;
			} /*NOTREACHED*/ break;
case 231:
# line 880 "plot.yacc"
{
				axis[ypt].unit = atof(yytext);
			} /*NOTREACHED*/ break;
case 233:
# line 889 "plot.yacc"
{axis[ypt].scale.type = linear;} /*NOTREACHED*/ break;
case 234:
# line 891 "plot.yacc"
{
				axis[ypt].scale.type = logstype;
				axis[ypt].scale.base = 10.0; /* def logbase */
			} /*NOTREACHED*/ break;
case 235:
# line 898 "plot.yacc"
{
				axis[ypt].scale.base = atof(yytext);
			} /*NOTREACHED*/ break;
case 236:
# line 904 "plot.yacc"
{
				axis[ypt].interval = atof(yytext);
			} /*NOTREACHED*/ break;
case 238:
# line 913 "plot.yacc"
{
				axis[ypt].numberstyle = integer;
			} /*NOTREACHED*/ break;
case 239:
# line 917 "plot.yacc"
{
				axis[ypt].numberstyle = floating;
			} /*NOTREACHED*/ break;
case 240:
# line 921 "plot.yacc"
{
				axis[ypt].numberstyle = scientific;
			} /*NOTREACHED*/ break;
case 241:
# line 925 "plot.yacc"
{
				axis[ypt].numberstyle = exponent;
			} /*NOTREACHED*/ break;
case 242:
# line 931 "plot.yacc"
{
				axis[ypt].signif = atof(yytext);
			} /*NOTREACHED*/ break;
case 243:
# line 935 "plot.yacc"
{
				axis[ypt].signif = 1;
			} /*NOTREACHED*/ break;
}


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