# include "stdio.h"
# define U(x) ((x)&0377)
# define NLSTATE yyprevious=YYNEWLINE
# define BEGIN yybgin = yysvec + 1 +
# define INITIAL 0
# define YYLERR yysvec
# define YYSTATE (yyestate-yysvec-1)
# define YYOPTIM 1
# define YYLMAX 200
# define output(c) putc(c,yyout)
# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
# define yymore() (yymorfg=1)
# define ECHO fprintf(yyout, "%s",yytext)
# define REJECT { nstr = yyreject(); goto yyfussy;}
int yyleng; extern char yytext[];
int yymorfg;
extern char *yysptr, yysbuf[];
int yytchar;
FILE *yyin ={stdin}, *yyout ={stdout};
extern int yylineno;
struct yysvf { 
	struct yywork *yystoff;
	struct yysvf *yyother;
	int *yystops;};
struct yysvf *yyestate;
extern struct yysvf yysvec[], *yybgin;
ptrToHashElementType hashTable[MAXARR];
int prevToken = -1;/* -1 implies new line */
int prevprevToken = -1;/* -1 implies new line */
int textStart = -1;/* -1 implies not in text*/
int da = 0;/* dummyattribute for tokens initing */
# define YYNEWLINE 10
yylex(){
int nstr; extern int yyprevious;
while((nstr = yylook()) >= 0)
yyfussy: switch(nstr){
case 0:
if(yywrap()) return(0); break;
case 1:
{
				strcpy(errorpos,yytext);
				/*records prev text word for error handling */
				return(getToken(yytext));
			}
break;
case 2:
{
				return(INPUT);
			}
break;
case 3:
	{
				prevprevToken = prevToken;
				prevToken = COMMENT;
				return(COMMENT);
			}
break;
case 4:
	{
				return(INPUT);
			}
break;
case 5:
		{	
				lineno++;
				if (textStart == -1)
					{prevToken = -1;prevprevToken = -1;}
				/* text not terminated by newline, still need 
				to prevent hashing of input until first text
				item has been read at least*/
				/* testStart reset in getToken when 1st read*/
				/*Spaces: are sent if prev token was title,
				label, or new text. Sending spaces is
				reset usually by \n, except in the case of new
				text, where entry into the text resets it*/
				textStart = -1;
				return('\n');
			}
break;
case 6:
		{
				if (isItInput(prevToken,prevprevToken))
				{
					return(INPUT);
				}
				/* do not send blanks that are not in 
				 labels or text */
			}
break;
case -1:
break;
default:
fprintf(yyout,"bad switch yylook %d",nstr);
} return(0); }
/* end of yylex */

inithash()
{
int i;
	for (i=0;i<MAXARR;i++) hashTable[i] = nil;

	hinsert("new",NEW,da);
	hinsert("graph",GRAPH,da);
	hinsert("title",TITLE,da);
	hinsert("size",SIZE,da);
	hinsert("font",FONT,da);
	hinsert("angle",ANGLE,da);
	hinsert("align",ALIGN,da);
	hinsert("left",LEFT,da);
	hinsert("center",CENTER,da);
	hinsert("right",RIGHT,da);
	hinsert("regression",REGRESSION,da);
	hinsert("step",STEP,da);
	hinsert("xhistogram",XHISTOGRAM,da);
	hinsert("yhistogram",YHISTOGRAM,da);
	hinsert("smooth",SMOOTH,da);
	hinsert("spline",SPLINE,da);
	hinsert("key",KEY,da);
	hinsert("curve",CURVE,da);
	hinsert("confidence",CONFIDENCE,da);
	hinsert("points",POINTS,da);
	hinsert("label",LABEL,da);
	hinsert("labels",LABELS,da);
	hinsert("type",TYPE,da);
	hinsert("symbol",SYMBOL,da);
	hinsert("interpolation",INTERPOLATION,da);
	hinsert("gray",GRAY,da);
	hinsert("mat",MAT,da);
	hinsert("x",X,da);
	hinsert("y",Y,da);
	hinsert("maximum",MAXIMUM,da);
	hinsert("minimum",MINIMUM,da);
	hinsert("unit",UNIT,da);
	hinsert("interval",INTERVAL,da);
	hinsert("scale",SCALE,da);
	hinsert("logbase",LOGBASE,da);
	hinsert("numberstyle",NUMBERSTYLE,da);
	hinsert("integer",INTEGER,da);
	hinsert("floating",FLOATING,da);
	hinsert("scientific",SCIENTIFIC,da);
	hinsert("exponent",EXPONENT,da);
	hinsert("text",TEXT,da);
	hinsert("line",LINE,da);
	hinsert("both",BOTH,da);
	hinsert("none",NONE,da);
	hinsert("solid",SOLID,da);
	hinsert("dashes",DASHES,da);
	hinsert("stipple",STIPPLE,da);
	hinsert("dots",DOTS,da);
	hinsert("pat",PAT,da);
	hinsert("fill",FILL,da);
	hinsert("bold",BOLD,da);
	hinsert("cross",CROSS,da);
	hinsert("triangle",TRIANGLE,da);
	hinsert("trianglefilled",TRIANGLEFILLED,da);
	hinsert("diamond",DIAMOND,da);
	hinsert("diamondfilled",DIAMONDFILLED,da);
	hinsert("square",SQUARE,da);
	hinsert("box",BOX,da);
	hinsert("squarefilled",SQUAREFILLED,da);
	hinsert("solidbox",SOLIDBOX,da);
	hinsert("rectangle",RECTANGLE,da);
	hinsert("rectanglefilled",RECTANGLEFILLED,da);
	hinsert("circle",CIRCLE,da);
	hinsert("circlefilled",CIRCLEFILLED,da);
	hinsert("bullet",BULLET,da);
	hinsert("plus",PLUS,da);
	hinsert("star",STAR,da);
	hinsert("linear",LINEAR,da);
	hinsert("log",LOGS,da);
	hinsert("exclude",EXCLUDE,da);
	hinsert("mirror",MIRROR,da);
	hinsert("origin",ORIGIN,da);
	hinsert("axes",AXES,da);
	hinsert("function",FUNCTION,da);
	hinsert("def",DEF,da);
	hinsert("minortic",MINORTIC,da);
	hinsert("minortics",MINORTICS,da);
	hinsert("numbers",NUMBERS,da);
	hinsert("helvetica3",FONTNAME,helvetica3);
	hinsert("helvetica4",FONTNAME,helvetica4);
	hinsert("helvetica5",FONTNAME,helvetica5);
	hinsert("helvetica6",FONTNAME,helvetica6);
	hinsert("helvetica7",FONTNAME,helvetica7);
	hinsert("helvetica8",FONTNAME,helvetica8);
	hinsert("helvetica9",FONTNAME,helvetica9);
	hinsert("helvetica10",FONTNAME,helvetica10);
	hinsert("helvetica11",FONTNAME,helvetica11);
	hinsert("helvetica12",FONTNAME,helvetica12);
	hinsert("helvetica13",FONTNAME,helvetica13);
	hinsert("helvetica14",FONTNAME,helvetica14);
	hinsert("helvetica15",FONTNAME,helvetica15);
	hinsert("helvetica16",FONTNAME,helvetica16);
	hinsert("helvetica17",FONTNAME,helvetica17);
	hinsert("helvetica18",FONTNAME,helvetica18);
	hinsert("helvetica19",FONTNAME,helvetica19);
	hinsert("helvetica20",FONTNAME,helvetica20);
	hinsert("helvetica21",FONTNAME,helvetica21);
	hinsert("helvetica22",FONTNAME,helvetica22);
	hinsert("helvetica23",FONTNAME,helvetica23);
	hinsert("helvetica24",FONTNAME,helvetica24);
	hinsert("helvetica25",FONTNAME,helvetica25);
	hinsert("helvetica26",FONTNAME,helvetica26);
	hinsert("helvetica27",FONTNAME,helvetica27);
	hinsert("helvetica28",FONTNAME,helvetica28);
	hinsert("helvetica29",FONTNAME,helvetica29);
	hinsert("helvetica30",FONTNAME,helvetica30);

	hinsert("helvetica3b",FONTNAME,helvetica3b);
	hinsert("helvetica4b",FONTNAME,helvetica4b);
	hinsert("helvetica5b",FONTNAME,helvetica5b);
	hinsert("helvetica6b",FONTNAME,helvetica6b);
	hinsert("helvetica7b",FONTNAME,helvetica7b);
	hinsert("helvetica8b",FONTNAME,helvetica8b);
	hinsert("helvetica9b",FONTNAME,helvetica9b);
	hinsert("helvetica10b",FONTNAME,helvetica10b);
	hinsert("helvetica11b",FONTNAME,helvetica11b);
	hinsert("helvetica12b",FONTNAME,helvetica12b);
	hinsert("helvetica13b",FONTNAME,helvetica13b);
	hinsert("helvetica14b",FONTNAME,helvetica14b);
	hinsert("helvetica15b",FONTNAME,helvetica15b);
	hinsert("helvetica16b",FONTNAME,helvetica16b);
	hinsert("helvetica17b",FONTNAME,helvetica17b);
	hinsert("helvetica18b",FONTNAME,helvetica18b);
	hinsert("helvetica19b",FONTNAME,helvetica19b);
	hinsert("helvetica20b",FONTNAME,helvetica20b);
	hinsert("helvetica21b",FONTNAME,helvetica21b);
	hinsert("helvetica22b",FONTNAME,helvetica22b);
	hinsert("helvetica23b",FONTNAME,helvetica23b);
	hinsert("helvetica24b",FONTNAME,helvetica24b);
	hinsert("helvetica25b",FONTNAME,helvetica25b);
	hinsert("helvetica26b",FONTNAME,helvetica26b);
	hinsert("helvetica27b",FONTNAME,helvetica27b);
	hinsert("helvetica28b",FONTNAME,helvetica28b);
	hinsert("helvetica29b",FONTNAME,helvetica29b);
	hinsert("helvetica30b",FONTNAME,helvetica30b);

	hinsert("helvetica3i",FONTNAME,helvetica3i);
	hinsert("helvetica4i",FONTNAME,helvetica4i);
	hinsert("helvetica5i",FONTNAME,helvetica5i);
	hinsert("helvetica6i",FONTNAME,helvetica6i);
	hinsert("helvetica7i",FONTNAME,helvetica7i);
	hinsert("helvetica8i",FONTNAME,helvetica8i);
	hinsert("helvetica9i",FONTNAME,helvetica9i);
	hinsert("helvetica10i",FONTNAME,helvetica10i);
	hinsert("helvetica11i",FONTNAME,helvetica11i);
	hinsert("helvetica12i",FONTNAME,helvetica12i);
	hinsert("helvetica13i",FONTNAME,helvetica13i);
	hinsert("helvetica14i",FONTNAME,helvetica14i);
	hinsert("helvetica15i",FONTNAME,helvetica15i);
	hinsert("helvetica16i",FONTNAME,helvetica16i);
	hinsert("helvetica17i",FONTNAME,helvetica17i);
	hinsert("helvetica18i",FONTNAME,helvetica18i);
	hinsert("helvetica19i",FONTNAME,helvetica19i);
	hinsert("helvetica20i",FONTNAME,helvetica20i);
	hinsert("helvetica21i",FONTNAME,helvetica21i);
	hinsert("helvetica22i",FONTNAME,helvetica22i);
	hinsert("helvetica23i",FONTNAME,helvetica23i);
	hinsert("helvetica24i",FONTNAME,helvetica24i);
	hinsert("helvetica25i",FONTNAME,helvetica25i);
	hinsert("helvetica26i",FONTNAME,helvetica26i);
	hinsert("helvetica27i",FONTNAME,helvetica27i);
	hinsert("helvetica28i",FONTNAME,helvetica28i);
	hinsert("helvetica29i",FONTNAME,helvetica29i);
	hinsert("helvetica30i",FONTNAME,helvetica30i);

	hinsert("helvetica3bi",FONTNAME,helvetica3bi);
	hinsert("helvetica4bi",FONTNAME,helvetica4bi);
	hinsert("helvetica5bi",FONTNAME,helvetica5bi);
	hinsert("helvetica6bi",FONTNAME,helvetica6bi);
	hinsert("helvetica7bi",FONTNAME,helvetica7bi);
	hinsert("helvetica8bi",FONTNAME,helvetica8bi);
	hinsert("helvetica9bi",FONTNAME,helvetica9bi);
	hinsert("helvetica10bi",FONTNAME,helvetica10bi);
	hinsert("helvetica11bi",FONTNAME,helvetica11bi);
	hinsert("helvetica12bi",FONTNAME,helvetica12bi);
	hinsert("helvetica13bi",FONTNAME,helvetica13bi);
	hinsert("helvetica14bi",FONTNAME,helvetica14bi);
	hinsert("helvetica15bi",FONTNAME,helvetica15bi);
	hinsert("helvetica16bi",FONTNAME,helvetica16bi);
	hinsert("helvetica17bi",FONTNAME,helvetica17bi);
	hinsert("helvetica18bi",FONTNAME,helvetica18bi);
	hinsert("helvetica19bi",FONTNAME,helvetica19bi);
	hinsert("helvetica20bi",FONTNAME,helvetica20bi);
	hinsert("helvetica21bi",FONTNAME,helvetica21bi);
	hinsert("helvetica22bi",FONTNAME,helvetica22bi);
	hinsert("helvetica23bi",FONTNAME,helvetica23bi);
	hinsert("helvetica24bi",FONTNAME,helvetica24bi);
	hinsert("helvetica25bi",FONTNAME,helvetica25bi);
	hinsert("helvetica26bi",FONTNAME,helvetica26bi);
	hinsert("helvetica27bi",FONTNAME,helvetica27bi);
	hinsert("helvetica28bi",FONTNAME,helvetica28bi);
	hinsert("helvetica29bi",FONTNAME,helvetica29bi);
	hinsert("helvetica30bi",FONTNAME,helvetica30bi);

	hinsert("timesroman3",FONTNAME,timesroman3);
	hinsert("timesroman4",FONTNAME,timesroman4);
	hinsert("timesroman5",FONTNAME,timesroman5);
	hinsert("timesroman6",FONTNAME,timesroman6);
	hinsert("timesroman7",FONTNAME,timesroman7);
	hinsert("timesroman8",FONTNAME,timesroman8);
	hinsert("timesroman9",FONTNAME,timesroman9);
	hinsert("timesroman10",FONTNAME,timesroman10);
	hinsert("timesroman11",FONTNAME,timesroman11);
	hinsert("timesroman12",FONTNAME,timesroman12);
	hinsert("timesroman13",FONTNAME,timesroman13);
	hinsert("timesroman14",FONTNAME,timesroman14);
	hinsert("timesroman15",FONTNAME,timesroman15);
	hinsert("timesroman16",FONTNAME,timesroman16);
	hinsert("timesroman17",FONTNAME,timesroman17);
	hinsert("timesroman18",FONTNAME,timesroman18);
	hinsert("timesroman19",FONTNAME,timesroman19);
	hinsert("timesroman20",FONTNAME,timesroman20);
	hinsert("timesroman21",FONTNAME,timesroman21);
	hinsert("timesroman22",FONTNAME,timesroman22);
	hinsert("timesroman23",FONTNAME,timesroman23);
	hinsert("timesroman24",FONTNAME,timesroman24);
	hinsert("timesroman25",FONTNAME,timesroman25);
	hinsert("timesroman26",FONTNAME,timesroman26);
	hinsert("timesroman27",FONTNAME,timesroman27);
	hinsert("timesroman28",FONTNAME,timesroman28);
	hinsert("timesroman29",FONTNAME,timesroman29);
	hinsert("timesroman30",FONTNAME,timesroman30);

	hinsert("timesroman3b",FONTNAME,timesroman3b);
	hinsert("timesroman4b",FONTNAME,timesroman4b);
	hinsert("timesroman5b",FONTNAME,timesroman5b);
	hinsert("timesroman6b",FONTNAME,timesroman6b);
	hinsert("timesroman7b",FONTNAME,timesroman7b);
	hinsert("timesroman8b",FONTNAME,timesroman8b);
	hinsert("timesroman9b",FONTNAME,timesroman9b);
	hinsert("timesroman10b",FONTNAME,timesroman10b);
	hinsert("timesroman11b",FONTNAME,timesroman11b);
	hinsert("timesroman12b",FONTNAME,timesroman12b);
	hinsert("timesroman13b",FONTNAME,timesroman13b);
	hinsert("timesroman14b",FONTNAME,timesroman14b);
	hinsert("timesroman15b",FONTNAME,timesroman15b);
	hinsert("timesroman16b",FONTNAME,timesroman16b);
	hinsert("timesroman17b",FONTNAME,timesroman17b);
	hinsert("timesroman18b",FONTNAME,timesroman18b);
	hinsert("timesroman19b",FONTNAME,timesroman19b);
	hinsert("timesroman20b",FONTNAME,timesroman20b);
	hinsert("timesroman21b",FONTNAME,timesroman21b);
	hinsert("timesroman22b",FONTNAME,timesroman22b);
	hinsert("timesroman23b",FONTNAME,timesroman23b);
	hinsert("timesroman24b",FONTNAME,timesroman24b);
	hinsert("timesroman25b",FONTNAME,timesroman25b);
	hinsert("timesroman26b",FONTNAME,timesroman26b);
	hinsert("timesroman27b",FONTNAME,timesroman27b);
	hinsert("timesroman28b",FONTNAME,timesroman28b);
	hinsert("timesroman29b",FONTNAME,timesroman29b);
	hinsert("timesroman30b",FONTNAME,timesroman30b);

	hinsert("timesroman3i",FONTNAME,timesroman3i);
	hinsert("timesroman4i",FONTNAME,timesroman4i);
	hinsert("timesroman5i",FONTNAME,timesroman5i);
	hinsert("timesroman6i",FONTNAME,timesroman6i);
	hinsert("timesroman7i",FONTNAME,timesroman7i);
	hinsert("timesroman8i",FONTNAME,timesroman8i);
	hinsert("timesroman9i",FONTNAME,timesroman9i);
	hinsert("timesroman10i",FONTNAME,timesroman10i);
	hinsert("timesroman11i",FONTNAME,timesroman11i);
	hinsert("timesroman12i",FONTNAME,timesroman12i);
	hinsert("timesroman13i",FONTNAME,timesroman13i);
	hinsert("timesroman14i",FONTNAME,timesroman14i);
	hinsert("timesroman15i",FONTNAME,timesroman15i);
	hinsert("timesroman16i",FONTNAME,timesroman16i);
	hinsert("timesroman17i",FONTNAME,timesroman17i);
	hinsert("timesroman18i",FONTNAME,timesroman18i);
	hinsert("timesroman19i",FONTNAME,timesroman19i);
	hinsert("timesroman20i",FONTNAME,timesroman20i);
	hinsert("timesroman21i",FONTNAME,timesroman21i);
	hinsert("timesroman22i",FONTNAME,timesroman22i);
	hinsert("timesroman23i",FONTNAME,timesroman23i);
	hinsert("timesroman24i",FONTNAME,timesroman24i);
	hinsert("timesroman25i",FONTNAME,timesroman25i);
	hinsert("timesroman26i",FONTNAME,timesroman26i);
	hinsert("timesroman27i",FONTNAME,timesroman27i);
	hinsert("timesroman28i",FONTNAME,timesroman28i);
	hinsert("timesroman29i",FONTNAME,timesroman29i);
	hinsert("timesroman30i",FONTNAME,timesroman30i);

	hinsert("timesroman3bi",FONTNAME,timesroman3bi);
	hinsert("timesroman4bi",FONTNAME,timesroman4bi);
	hinsert("timesroman5bi",FONTNAME,timesroman5bi);
	hinsert("timesroman6bi",FONTNAME,timesroman6bi);
	hinsert("timesroman7bi",FONTNAME,timesroman7bi);
	hinsert("timesroman8bi",FONTNAME,timesroman8bi);
	hinsert("timesroman9bi",FONTNAME,timesroman9bi);
	hinsert("timesroman10bi",FONTNAME,timesroman10bi);
	hinsert("timesroman11bi",FONTNAME,timesroman11bi);
	hinsert("timesroman12bi",FONTNAME,timesroman12bi);
	hinsert("timesroman13bi",FONTNAME,timesroman13bi);
	hinsert("timesroman14bi",FONTNAME,timesroman14bi);
	hinsert("timesroman15bi",FONTNAME,timesroman15bi);
	hinsert("timesroman16bi",FONTNAME,timesroman16bi);
	hinsert("timesroman17bi",FONTNAME,timesroman17bi);
	hinsert("timesroman18bi",FONTNAME,timesroman18bi);
	hinsert("timesroman19bi",FONTNAME,timesroman19bi);
	hinsert("timesroman20bi",FONTNAME,timesroman20bi);
	hinsert("timesroman21bi",FONTNAME,timesroman21bi);
	hinsert("timesroman22bi",FONTNAME,timesroman22bi);
	hinsert("timesroman23bi",FONTNAME,timesroman23bi);
	hinsert("timesroman24bi",FONTNAME,timesroman24bi);
	hinsert("timesroman25bi",FONTNAME,timesroman25bi);
	hinsert("timesroman26bi",FONTNAME,timesroman26bi);
	hinsert("timesroman27bi",FONTNAME,timesroman27bi);
	hinsert("timesroman28bi",FONTNAME,timesroman28bi);
	hinsert("timesroman29bi",FONTNAME,timesroman29bi);
	hinsert("timesroman30bi",FONTNAME,timesroman30bi);
}

getToken(instring)
char instring[];
{
int token;
	/* if prev token was label, or title then return input */
	if (isItInput(prevToken, prevprevToken))
	{
		textStart = -1;
		token = INPUT;/* note prevToken not made input, this
				allows all text upto newline to be sent */
	}
	else
	{
		chToLower(instring);
		token = hextract(instring);
		prevprevToken = prevToken;
		prevToken = token;
		if  ((prevprevToken == NEW)&&(prevToken == TEXT))
			 textStart = 1;
	}
	return(token);
}

chToLower(instring)
char instring[];
{
int i = 0;
	while (instring[i] != '\0')
	{
		switch (instring[i])
		{
			case 'A':instring[i] = 'a';break;
			case 'B':instring[i] = 'b';break;
			case 'C':instring[i] = 'c';break;
			case 'D':instring[i] = 'd';break;
			case 'E':instring[i] = 'e';break;
			case 'F':instring[i] = 'f';break;
			case 'G':instring[i] = 'g';break;
			case 'H':instring[i] = 'h';break;
			case 'I':instring[i] = 'i';break;
			case 'J':instring[i] = 'j';break;
			case 'K':instring[i] = 'k';break;
			case 'L':instring[i] = 'l';break;
			case 'M':instring[i] = 'm';break;
			case 'N':instring[i] = 'n';break;
			case 'O':instring[i] = 'o';break;
			case 'P':instring[i] = 'p';break;
			case 'Q':instring[i] = 'q';break;
			case 'R':instring[i] = 'r';break;
			case 'S':instring[i] = 's';break;
			case 'T':instring[i] = 't';break;
			case 'U':instring[i] = 'u';break;
			case 'V':instring[i] = 'v';break;
			case 'W':instring[i] = 'w';break;
			case 'X':instring[i] = 'x';break;
			case 'Y':instring[i] = 'y';break;
			case 'Z':instring[i] = 'z';break;
			default: break;
		}
		i++;
	}

}

hextract(instring)
char instring[];
{
int i = 0;
int hashval = 0;
int token;
ptrToHashElementType ptr;

	while (instring[i] != '\0')
	{
		hashval += instring[i];
		i++;
	}
	hashval = hashval % MAXARR;
	
	ptr = hashTable[hashval];

	while ((ptr != nil)&&(strcmp(instring,ptr->instring) != 0))
		ptr = ptr->link;

	if (ptr != nil)
	{
		token = ptr->token;
		yylval = ptr->attribute;
	}
	else 
	{
		token = UNKNOWNCMD;
		yylval = da;
	}

	return(token);
}


hinsert(instring,token,attribute)
char instring[];
int token;
int attribute;
{
int i = 0;
int hashval = 0;
ptrToHashElementType ptr, *startPtrPtr, tmpPtr;

	while (instring[i] != '\0')
	{
		hashval += instring[i];
		i++;
	}
	hashval = hashval % MAXARR;
	
	startPtrPtr = hashTable + hashval;
	ptr = *startPtrPtr;

	while ((ptr != nil)&&(strcmp(instring,ptr->instring) != 0))
		ptr = ptr->link;

	if (ptr == nil) 
	{	/* if (ptr != nil) already in *//* hinsert at head */
		ptr =(ptrToHashElementType)malloc(sizeof(hashElementType));
		ptr->token = token;
		ptr->attribute = attribute;
		strcpy(ptr->instring,instring);
		ptr->link = *startPtrPtr;
		*startPtrPtr = ptr;
	}
}

isItInput(prevToken,prevprevToken)
int prevToken;
int prevprevToken;
{
int sendInput;

	if ((prevToken == LABEL)||
		(prevToken == DEF)||
		((prevToken == TEXT)&&(prevprevToken ==NEW))||
		(prevToken == TITLE)||
		(prevToken==COMMENT)||
		(prevToken == SIZE)||
		(intext == TRUE)
	    )
	    {
		sendInput = 1;
	    }
	    else
	    {
		 sendInput = 0;
	    }
	    return(sendInput);
}

int yyvstop[] ={
0,

6,
0,

5,
0,

1,
0,

2,
0,

2,
0,

4,
0,

6,
0,

3,
4,
0,

2,
0,

2,
0,

2,
0,

2,
0,

2,
0,
0};
# define YYTYPE unsigned char
struct yywork { YYTYPE verify, advance; } yycrank[] ={
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	1,3,	1,4,	
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,	
0,0,	0,0,	0,0,	0,0,	
0,0,	1,3,	0,0,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,6,	1,7,	1,6,	1,6,	
1,5,	1,6,	1,6,	1,6,	
1,6,	1,6,	1,6,	1,6,	
1,6,	1,6,	1,6,	1,5,	
1,8,	1,5,	1,5,	1,5,	
7,7,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	0,0,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	1,5,	1,5,	1,5,	
1,5,	2,9,	1,5,	1,7,	
12,12,	15,15,	13,15,	13,0,	
0,0,	16,16,	0,0,	0,0,	
0,0,	3,3,	0,0,	9,9,	
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	7,7,	0,0,	
2,9,	0,0,	0,0,	12,12,	
15,15,	0,0,	0,0,	5,5,	
16,16,	0,0,	0,0,	6,11,	
3,3,	0,0,	9,9,	5,0,	
5,0,	13,0,	0,0,	6,12,	
6,0,	0,0,	0,0,	3,6,	
3,7,	3,6,	3,6,	2,10,	
3,6,	3,6,	3,6,	3,6,	
3,6,	3,6,	3,6,	3,6,	
3,6,	3,6,	5,0,	3,8,	
5,5,	9,10,	11,0,	11,0,	
6,11,	0,0,	14,16,	14,0,	
0,0,	5,5,	5,0,	8,8,	
5,5,	6,13,	6,0,	10,10,	
6,6,	0,0,	0,0,	8,8,	
8,0,	0,0,	0,0,	10,10,	
10,0,	11,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	5,5,	
0,0,	0,0,	0,0,	6,14,	
11,14,	11,0,	0,0,	11,11,	
14,14,	14,0,	0,0,	14,11,	
8,8,	0,0,	0,0,	0,0,	
10,10,	0,0,	0,0,	0,0,	
0,0,	8,8,	8,8,	0,0,	
8,8,	10,10,	10,10,	13,0,	
10,10,	0,0,	0,0,	0,0,	
0,0,	0,0,	3,7,	0,0,	
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	8,8,	
0,0,	0,0,	0,0,	10,10,	
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	0,0,	
5,0,	0,0,	0,0,	0,0,	
6,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,0,	0,0,	0,0,	0,0,	
0,0,	0,0,	0,0,	11,0,	
0,0,	0,0,	0,0,	14,0,	
0,0};
struct yysvf yysvec[] ={
0,	0,	0,
yycrank+1,	0,		0,	
yycrank+116,	yysvec+1,	0,	
yycrank+128,	0,		yyvstop+1,
yycrank+0,	0,		yyvstop+3,
yycrank+-154,	0,		yyvstop+5,
yycrank+-158,	0,		yyvstop+7,
yycrank+20,	0,		yyvstop+9,
yycrank+-198,	0,		yyvstop+11,
yycrank+130,	yysvec+3,	yyvstop+13,
yycrank+-202,	0,		yyvstop+15,
yycrank+-181,	yysvec+6,	0,	
yycrank+119,	0,		yyvstop+18,
yycrank+-121,	yysvec+6,	yyvstop+20,
yycrank+-185,	yysvec+6,	yyvstop+22,
yycrank+120,	0,		yyvstop+24,
yycrank+124,	0,		yyvstop+26,
0,	0,	0};
struct yywork *yytop = yycrank+311;
struct yysvf *yybgin = yysvec+1;
char yymatch[] ={
00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
011 ,01  ,'"' ,'"' ,'"' ,'"' ,'"' ,'"' ,
'"' ,'"' ,'"' ,'+' ,',' ,'+' ,'.' ,'"' ,
'+' ,'+' ,'+' ,'+' ,'+' ,'+' ,'+' ,'+' ,
'+' ,'+' ,'"' ,01  ,'"' ,'"' ,'"' ,01  ,
'"' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'"' ,'"' ,'"' ,'"' ,'"' ,
01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'"' ,01  ,'"' ,',' ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
0};
char yyextra[] ={
0,0,0,0,0,0,0,0,
0};
/*	ncform	4.1	83/08/11	*/

int yylineno =1;
# define YYU(x) x
# define NLSTATE yyprevious=YYNEWLINE
char yytext[YYLMAX];
struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
char yysbuf[YYLMAX];
char *yysptr = yysbuf;
int *yyfnd;
extern struct yysvf *yyestate;
int yyprevious = YYNEWLINE;
yylook(){
	register struct yysvf *yystate, **lsp;
	register struct yywork *yyt;
	struct yysvf *yyz;
	int yych;
	struct yywork *yyr;
# ifdef LEXDEBUG
	int debug;
# endif
	char *yylastch;
	/* start off machines */
# ifdef LEXDEBUG
	debug = 0;
# endif
	if (!yymorfg)
		yylastch = yytext;
	else {
		yymorfg=0;
		yylastch = yytext+yyleng;
		}
	for(;;){
		lsp = yylstate;
		yyestate = yystate = yybgin;
		if (yyprevious==YYNEWLINE) yystate++;
		for (;;){
# ifdef LEXDEBUG
			if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
# endif
			yyt = yystate->yystoff;
			if(yyt == yycrank){		/* may not be any transitions */
				yyz = yystate->yyother;
				if(yyz == 0)break;
				if(yyz->yystoff == yycrank)break;
				}
			*yylastch++ = yych = input();
		tryagain:
# ifdef LEXDEBUG
			if(debug){
				fprintf(yyout,"unsigned char ");
				allprint(yych);
				putchar('\n');
				}
# endif
			yyr = yyt;
			if ( (int)yyt > (int)yycrank){
				yyt = yyr + yych;
				if (yyt <= yytop && yyt->verify+yysvec == yystate){
					if(yyt->advance+yysvec == YYLERR)	/* error transitions */
						{unput(*--yylastch);break;}
					*lsp++ = yystate = yyt->advance+yysvec;
					goto contin;
					}
				}
# ifdef YYOPTIM
			else if((int)yyt < (int)yycrank) {		/* r < yycrank */
				yyt = yyr = yycrank+(yycrank-yyt);
# ifdef LEXDEBUG
				if(debug)fprintf(yyout,"compressed state\n");
# endif
				yyt = yyt + yych;
				if(yyt <= yytop && yyt->verify+yysvec == yystate){
					if(yyt->advance+yysvec == YYLERR)	/* error transitions */
						{unput(*--yylastch);break;}
					*lsp++ = yystate = yyt->advance+yysvec;
					goto contin;
					}
				yyt = yyr + YYU(yymatch[yych]);
# ifdef LEXDEBUG
				if(debug){
					fprintf(yyout,"try fall back character ");
					allprint(YYU(yymatch[yych]));
					putchar('\n');
					}
# endif
				if(yyt <= yytop && yyt->verify+yysvec == yystate){
					if(yyt->advance+yysvec == YYLERR)	/* error transition */
						{unput(*--yylastch);break;}
					*lsp++ = yystate = yyt->advance+yysvec;
					goto contin;
					}
				}
			if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
# ifdef LEXDEBUG
				if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
# endif
				goto tryagain;
				}
# endif
			else
				{unput(*--yylastch);break;}
		contin:
# ifdef LEXDEBUG
			if(debug){
				fprintf(yyout,"state %d char ",yystate-yysvec-1);
				allprint(yych);
				putchar('\n');
				}
# endif
			;
			}
# ifdef LEXDEBUG
		if(debug){
			fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
			allprint(yych);
			putchar('\n');
			}
# endif
		while (lsp-- > yylstate){
			*yylastch-- = 0;
			if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
				yyolsp = lsp;
				if(yyextra[*yyfnd]){		/* must backup */
					while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
						lsp--;
						unput(*yylastch--);
						}
					}
				yyprevious = YYU(*yylastch);
				yylsp = lsp;
				yyleng = yylastch-yytext+1;
				yytext[yyleng] = 0;
# ifdef LEXDEBUG
				if(debug){
					fprintf(yyout,"\nmatch ");
					sprint(yytext);
					fprintf(yyout," action %d\n",*yyfnd);
					}
# endif
				return(*yyfnd++);
				}
			unput(*yylastch);
			}
		if (yytext[0] == 0  /* && feof(yyin) */)
			{
			yysptr=yysbuf;
			return(0);
			}
		yyprevious = yytext[0] = input();
		if (yyprevious>0)
			output(yyprevious);
		yylastch=yytext;
# ifdef LEXDEBUG
		if(debug)putchar('\n');
# endif
		}
	}
yyback(p, m)
	int *p;
{
if (p==0) return(0);
while (*p)
	{
	if (*p++ == m)
		return(1);
	}
return(0);
}
	/* the following are only used in the lex library */
yyinput(){
	return(input());
	}
yyoutput(c)
  int c; {
	output(c);
	}
yyunput(c)
   int c; {
	unput(c);
	}
