home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / coherent / 6329 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.1 KB  |  69 lines

  1. Newsgroups: comp.os.coherent
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!uchinews!iitmax!pred
  3. From: pred@iitmax.iit.edu (Predrag S. Bundalo)
  4. Subject: Working lex for v4.0?
  5. Message-ID: <1992Dec20.120530.16635@iitmax.iit.edu>
  6. Organization: IIT--Institute of Increasing Tuition.
  7. Date: Sun, 20 Dec 92 12:05:30 GMT
  8. Lines: 59
  9.  
  10. Does anyone know if MWC has released a working lex for v4.0?  I get a
  11. core dump when I try to run the following code (after it's been
  12. lex'd and compiled).
  13.  
  14. Randy Wright's port of flex is even worse (flex is bad, not the port): it
  15. creates an ever-growing lex.yy.c file.  Sheesh.
  16.  
  17. Anyway, this code works with UMAX 4.3 (bsd) and NeXTSTEP 3.0 (also bsd)
  18. without a hitch, and it's logically correct--to me anyway.
  19.  
  20. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  21. %S REPLY FROM SUBJECT QUIT GET BINARY ASCII HELP CONNECT
  22. %%
  23. <FROM>[^\n]+    printf("FROM: %s\n",yytext);
  24. <FROM>\n    BEGIN 0;
  25. From:" "    BEGIN FROM;
  26.  
  27. <SUBJECT>[^\n]+    printf("SUBJECT: %s\n",yytext);
  28. <SUBJECT>\n    BEGIN 0;
  29. Subject:" "    BEGIN SUBJECT;
  30.  
  31. <REPLY>[^\n]+    printf("REPLY: %s\n",yytext);
  32. <REPLY>\n    BEGIN 0;
  33. [rR][eE][pP][lL][yY]" "    BEGIN REPLY;
  34.  
  35. <QUIT>[^\n]+    printf("QUIT\n");
  36. <QUIT>\n    BEGIN 0;
  37. [qQ][uU][iI][tT]    BEGIN QUIT;
  38.  
  39. <HELP>[^\n]+    printf("HELP\n");
  40. <HELP>\n    BEGIN 0;
  41. [hH][Ee][lL][pP]    BEGIN HELP;
  42.  
  43. <GET>[^\n]+    printf("GET: %s\n",yytext);
  44. <GET>\n    BEGIN 0;
  45. [gG][eE][tT]" "    BEGIN GET;
  46.  
  47. <BINARY>[^\n]+    printf("BINARY\n");
  48. <BINARY>\n    BEGIN 0;
  49. [bB][iI][nN][aA][rR][yY]    BEGIN BINARY;
  50.  
  51. <ASCII>[^\n]+    printf("ASCII\n");
  52. <ASCII>\n    BEGIN 0;
  53. [aA][sS][cC][iI][iI]    BEGIN ASCII;
  54.  
  55. <CONNECT>[^\n]+    printf("CONNECT: %s\n",yytext);
  56. <CONNECT>\n    BEGIN 0;
  57. [cC][oO][nN][nN][Ee][cC][tT]" "    BEGIN CONNECT;
  58. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  59.  
  60. Regards,
  61.  
  62. Pred Bundalo
  63. -- 
  64. :::  Predrag S. Bundalo                  Academic Computing Center
  65. :::  Illinois Institute of Technology    Chicago, Illinois
  66. .....................................................................
  67. :::  Internet:  pred@{iitmax, elof}.iit.edu, syspredrag@minna.iit.edu
  68. :::  BITNET  :  syspredrag@iitvax.BITNET
  69.