%{
#ifndef lint
static char rcsid[] = "$Header: ps.l,v 0.0 88/06/22 05:22:35 on Rel $";
#endif
#include "pps.h"

int nbrace;
%}
nonspecial	[^ \t\n\f()<>[\]/]
%S STRING KEYWORD COMMENT
%%
<INITIAL>^\/{nonspecial}+/[ \t]*\{	{
			funct(yytext + 1);
			REJECT;
		}
<INITIAL>{nonspecial}+	{
			int kw = iskw(yytext);
			if (kw)
				begin(KEYWORD);
			ECHO;
			if (kw)
				begin(INITIAL);
		}
<INITIAL>\(	{ begin(STRING); ECHO; }
<STRING>\\.	{ ECHO; }
<STRING>\)	{ ECHO; begin(INITIAL); }
<INITIAL>%.*	{ begin(COMMENT); ECHO; begin(INITIAL); }
[\t\n\f]+	{ space(yytext); }
.		{ ECHO; }
%%
char *keywords[] = {
	"",
	"=",
	"==",
	"VMerror",
	"[",
	"]",
	"abs",
	"add",
	"aload",
	"anchorsearch",
	"and",
	"arc",
	"arcn",
	"arcto",
	"array",
	"ashow",
	"astore",
	"atan",
	"awidthshow",
	"bitshift",
	"bytesavailable",
	"cachestatus",
	"ceiling",
	"charpath",
	"clear",
	"cleartomark",
	"clip",
	"clippath",
	"closefile",
	"closepath",
	"concat",
	"concatmatrix",
	"copy",
	"copypage",
	"cos",
	"count",
	"countdictstack",
	"countexecstack",
	"counttomark",
	"currentcacheparams",
	"currentdash",
	"currentfile",
	"currentflat",
	"currentfont",
	"currentgray",
	"currenthsbcolor",
	"currentlinecap",
	"currentlinejoin",
	"currentlinewidth",
	"currentmatrix",
	"currentmiterlimit",
	"currentpacking",
	"currentpoint",
	"currentrgbcolor",
	"currentscreen",
	"currenttransfer",
	"curveto",
	"cvi",
	"cvlit",
	"cvn",
	"cvr",
	"cvrs",
	"cvs",
	"cvx",
	"def",
	"defaultmatrix",
	"definefont",
	"dict",
	"dictfull",
	"dictstack",
	"dictstackoverflow",
	"dictstackunderflow",
	"div",
	"dtransform",
	"dup",
	"echo",
	"eoclip",
	"eofill",
	"eq",
	"erasepage",
	"exch",
	"exec",
	"execstack",
	"execstackoverflow",
	"executeonly",
	"exit",
	"exp",
	"false",
	"file",
	"fill",
	"findfont",
	"flattenpath",
	"floor",
	"flush",
	"flushfile",
	"for",
	"forall",
	"framedevice",
	"ge",
	"get",
	"getinterval",
	"grestore",
	"grestoreall",
	"gsave",
	"gt",
	"identmatrix",
	"idiv",
	"idtransform",
	"if",
	"ifelse",
	"image",
	"imagemask",
	"index",
	"initclip",
	"initgraphics",
	"initmatrix",
	"interrupt",
	"invalidaccess",
	"invalidexit",
	"invalidfileaccess",
	"invalidfont",
	"invalidrestore",
	"invertmatrix",
	"ioerror",
	"itransform",
	"known",
	"kshow",
	"le",
	"limitcheck",
	"lineto",
	"ln",
	"load",
	"log",
	"loop",
	"lt",
	"makefont",
	"mark",
	"matrix",
	"maxlength",
	"mod",
	"moveto",
	"mul",
	"ne",
	"neg",
	"newpath",
	"nocurrentpoint",
	"not",
	"null",
	"nulldevice",
	"or",
	"packedarray",
	"pathbbox",
	"pathforall",
	"pop",
	"print",
	"prompt",
	"pstack",
	"put",
	"putinterval",
	"quit",
	"rand",
	"rangecheck",
	"rcheck",
	"rcurveto",
	"read",
	"readhexstring",
	"readline",
	"readonly",
	"readstring",
	"repeat",
	"restore",
	"reversepath",
	"rlineto",
	"rmoveto",
	"roll",
	"rotate",
	"round",
	"rrand",
	"run",
	"save",
	"scale",
	"scalefont",
	"search",
	"setcachedevice",
	"setcachelimit",
	"setcacheparams",
	"setcharwidth",
	"setdash",
	"setflat",
	"setfont",
	"setgray",
	"sethsbcolor",
	"setlinecap",
	"setlinejoin",
	"setlinewidth",
	"setmatrix",
	"setmitrlimit",
	"setpacking",
	"setrgbcolor",
	"setscreen",
	"settransfer",
	"show",
	"showpage",
	"sin",
	"sqrt",
	"srand",
	"stack",
	"stackoverflow",
	"stackunderflow",
	"start",
	"status",
	"stop",
	"stopped",
	"store",
	"string",
	"stringwidth",
	"stroke",
	"strokepath",
	"sub",
	"syntaxerror",
	"systemdict",
	"token",
	"transform",
	"translate",
	"true",
	"truncate",
	"type",
	"typecheck",
	"undefined",
	"undefinedfilename",
	"undefinedresult",
	"unmatchedmark",
	"unregistered",
	"userdict",
	"usertime",
	"version",
	"vmstatus",
	"wcheck",
	"where",
	"widthshow",
	"write",
	"writehexstring",
	"writestring",
	"xcheck",
	"xor",
	NULL
};
