home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume17 / pps / ps.l < prev    next >
Text File  |  1989-02-06  |  4KB  |  279 lines

  1. %{
  2. #ifndef lint
  3. static char rcsid[] = "$Header: ps.l,v 0.0 88/06/22 05:22:35 on Rel $";
  4. #endif
  5. #include "pps.h"
  6.  
  7. int nbrace;
  8. %}
  9. nonspecial    [^ \t\n\f()<>[\]/]
  10. %S STRING KEYWORD COMMENT
  11. %%
  12. <INITIAL>^\/{nonspecial}+/[ \t]*\{    {
  13.             funct(yytext + 1);
  14.             REJECT;
  15.         }
  16. <INITIAL>{nonspecial}+    {
  17.             int kw = iskw(yytext);
  18.             if (kw)
  19.                 begin(KEYWORD);
  20.             ECHO;
  21.             if (kw)
  22.                 begin(INITIAL);
  23.         }
  24. <INITIAL>\(    { begin(STRING); ECHO; }
  25. <STRING>\\.    { ECHO; }
  26. <STRING>\)    { ECHO; begin(INITIAL); }
  27. <INITIAL>%.*    { begin(COMMENT); ECHO; begin(INITIAL); }
  28. [\t\n\f]+    { space(yytext); }
  29. .        { ECHO; }
  30. %%
  31. char *keywords[] = {
  32.     "",
  33.     "=",
  34.     "==",
  35.     "VMerror",
  36.     "[",
  37.     "]",
  38.     "abs",
  39.     "add",
  40.     "aload",
  41.     "anchorsearch",
  42.     "and",
  43.     "arc",
  44.     "arcn",
  45.     "arcto",
  46.     "array",
  47.     "ashow",
  48.     "astore",
  49.     "atan",
  50.     "awidthshow",
  51.     "bitshift",
  52.     "bytesavailable",
  53.     "cachestatus",
  54.     "ceiling",
  55.     "charpath",
  56.     "clear",
  57.     "cleartomark",
  58.     "clip",
  59.     "clippath",
  60.     "closefile",
  61.     "closepath",
  62.     "concat",
  63.     "concatmatrix",
  64.     "copy",
  65.     "copypage",
  66.     "cos",
  67.     "count",
  68.     "countdictstack",
  69.     "countexecstack",
  70.     "counttomark",
  71.     "currentcacheparams",
  72.     "currentdash",
  73.     "currentfile",
  74.     "currentflat",
  75.     "currentfont",
  76.     "currentgray",
  77.     "currenthsbcolor",
  78.     "currentlinecap",
  79.     "currentlinejoin",
  80.     "currentlinewidth",
  81.     "currentmatrix",
  82.     "currentmiterlimit",
  83.     "currentpacking",
  84.     "currentpoint",
  85.     "currentrgbcolor",
  86.     "currentscreen",
  87.     "currenttransfer",
  88.     "curveto",
  89.     "cvi",
  90.     "cvlit",
  91.     "cvn",
  92.     "cvr",
  93.     "cvrs",
  94.     "cvs",
  95.     "cvx",
  96.     "def",
  97.     "defaultmatrix",
  98.     "definefont",
  99.     "dict",
  100.     "dictfull",
  101.     "dictstack",
  102.     "dictstackoverflow",
  103.     "dictstackunderflow",
  104.     "div",
  105.     "dtransform",
  106.     "dup",
  107.     "echo",
  108.     "eoclip",
  109.     "eofill",
  110.     "eq",
  111.     "erasepage",
  112.     "exch",
  113.     "exec",
  114.     "execstack",
  115.     "execstackoverflow",
  116.     "executeonly",
  117.     "exit",
  118.     "exp",
  119.     "false",
  120.     "file",
  121.     "fill",
  122.     "findfont",
  123.     "flattenpath",
  124.     "floor",
  125.     "flush",
  126.     "flushfile",
  127.     "for",
  128.     "forall",
  129.     "framedevice",
  130.     "ge",
  131.     "get",
  132.     "getinterval",
  133.     "grestore",
  134.     "grestoreall",
  135.     "gsave",
  136.     "gt",
  137.     "identmatrix",
  138.     "idiv",
  139.     "idtransform",
  140.     "if",
  141.     "ifelse",
  142.     "image",
  143.     "imagemask",
  144.     "index",
  145.     "initclip",
  146.     "initgraphics",
  147.     "initmatrix",
  148.     "interrupt",
  149.     "invalidaccess",
  150.     "invalidexit",
  151.     "invalidfileaccess",
  152.     "invalidfont",
  153.     "invalidrestore",
  154.     "invertmatrix",
  155.     "ioerror",
  156.     "itransform",
  157.     "known",
  158.     "kshow",
  159.     "le",
  160.     "limitcheck",
  161.     "lineto",
  162.     "ln",
  163.     "load",
  164.     "log",
  165.     "loop",
  166.     "lt",
  167.     "makefont",
  168.     "mark",
  169.     "matrix",
  170.     "maxlength",
  171.     "mod",
  172.     "moveto",
  173.     "mul",
  174.     "ne",
  175.     "neg",
  176.     "newpath",
  177.     "nocurrentpoint",
  178.     "not",
  179.     "null",
  180.     "nulldevice",
  181.     "or",
  182.     "packedarray",
  183.     "pathbbox",
  184.     "pathforall",
  185.     "pop",
  186.     "print",
  187.     "prompt",
  188.     "pstack",
  189.     "put",
  190.     "putinterval",
  191.     "quit",
  192.     "rand",
  193.     "rangecheck",
  194.     "rcheck",
  195.     "rcurveto",
  196.     "read",
  197.     "readhexstring",
  198.     "readline",
  199.     "readonly",
  200.     "readstring",
  201.     "repeat",
  202.     "restore",
  203.     "reversepath",
  204.     "rlineto",
  205.     "rmoveto",
  206.     "roll",
  207.     "rotate",
  208.     "round",
  209.     "rrand",
  210.     "run",
  211.     "save",
  212.     "scale",
  213.     "scalefont",
  214.     "search",
  215.     "setcachedevice",
  216.     "setcachelimit",
  217.     "setcacheparams",
  218.     "setcharwidth",
  219.     "setdash",
  220.     "setflat",
  221.     "setfont",
  222.     "setgray",
  223.     "sethsbcolor",
  224.     "setlinecap",
  225.     "setlinejoin",
  226.     "setlinewidth",
  227.     "setmatrix",
  228.     "setmitrlimit",
  229.     "setpacking",
  230.     "setrgbcolor",
  231.     "setscreen",
  232.     "settransfer",
  233.     "show",
  234.     "showpage",
  235.     "sin",
  236.     "sqrt",
  237.     "srand",
  238.     "stack",
  239.     "stackoverflow",
  240.     "stackunderflow",
  241.     "start",
  242.     "status",
  243.     "stop",
  244.     "stopped",
  245.     "store",
  246.     "string",
  247.     "stringwidth",
  248.     "stroke",
  249.     "strokepath",
  250.     "sub",
  251.     "syntaxerror",
  252.     "systemdict",
  253.     "token",
  254.     "transform",
  255.     "translate",
  256.     "true",
  257.     "truncate",
  258.     "type",
  259.     "typecheck",
  260.     "undefined",
  261.     "undefinedfilename",
  262.     "undefinedresult",
  263.     "unmatchedmark",
  264.     "unregistered",
  265.     "userdict",
  266.     "usertime",
  267.     "version",
  268.     "vmstatus",
  269.     "wcheck",
  270.     "where",
  271.     "widthshow",
  272.     "write",
  273.     "writehexstring",
  274.     "writestring",
  275.     "xcheck",
  276.     "xor",
  277.     NULL
  278. };
  279.