home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.coherent
- Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!uchinews!iitmax!pred
- From: pred@iitmax.iit.edu (Predrag S. Bundalo)
- Subject: Working lex for v4.0?
- Message-ID: <1992Dec20.120530.16635@iitmax.iit.edu>
- Organization: IIT--Institute of Increasing Tuition.
- Date: Sun, 20 Dec 92 12:05:30 GMT
- Lines: 59
-
- Does anyone know if MWC has released a working lex for v4.0? I get a
- core dump when I try to run the following code (after it's been
- lex'd and compiled).
-
- Randy Wright's port of flex is even worse (flex is bad, not the port): it
- creates an ever-growing lex.yy.c file. Sheesh.
-
- Anyway, this code works with UMAX 4.3 (bsd) and NeXTSTEP 3.0 (also bsd)
- without a hitch, and it's logically correct--to me anyway.
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- %S REPLY FROM SUBJECT QUIT GET BINARY ASCII HELP CONNECT
- %%
- <FROM>[^\n]+ printf("FROM: %s\n",yytext);
- <FROM>\n BEGIN 0;
- From:" " BEGIN FROM;
-
- <SUBJECT>[^\n]+ printf("SUBJECT: %s\n",yytext);
- <SUBJECT>\n BEGIN 0;
- Subject:" " BEGIN SUBJECT;
-
- <REPLY>[^\n]+ printf("REPLY: %s\n",yytext);
- <REPLY>\n BEGIN 0;
- [rR][eE][pP][lL][yY]" " BEGIN REPLY;
-
- <QUIT>[^\n]+ printf("QUIT\n");
- <QUIT>\n BEGIN 0;
- [qQ][uU][iI][tT] BEGIN QUIT;
-
- <HELP>[^\n]+ printf("HELP\n");
- <HELP>\n BEGIN 0;
- [hH][Ee][lL][pP] BEGIN HELP;
-
- <GET>[^\n]+ printf("GET: %s\n",yytext);
- <GET>\n BEGIN 0;
- [gG][eE][tT]" " BEGIN GET;
-
- <BINARY>[^\n]+ printf("BINARY\n");
- <BINARY>\n BEGIN 0;
- [bB][iI][nN][aA][rR][yY] BEGIN BINARY;
-
- <ASCII>[^\n]+ printf("ASCII\n");
- <ASCII>\n BEGIN 0;
- [aA][sS][cC][iI][iI] BEGIN ASCII;
-
- <CONNECT>[^\n]+ printf("CONNECT: %s\n",yytext);
- <CONNECT>\n BEGIN 0;
- [cC][oO][nN][nN][Ee][cC][tT]" " BEGIN CONNECT;
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- Regards,
-
- Pred Bundalo
- --
- ::: Predrag S. Bundalo Academic Computing Center
- ::: Illinois Institute of Technology Chicago, Illinois
- .....................................................................
- ::: Internet: pred@{iitmax, elof}.iit.edu, syspredrag@minna.iit.edu
- ::: BITNET : syspredrag@iitvax.BITNET
-