3 /* Copyright 1993-95 by Carl Harris, Jr.
6 * Distribute freely, except: don't remove my name from the source or
7 * documentation (don't take credit for my work), mark your changes (don't
8 * get me blamed for your possible bugs), don't alter or remove this
9 * notice. May be sold if buildable source is provided to buyer. No
10 * warrantee of any kind, express or implied, is included with this
11 * software; use at your own risk, responsibility for damages (if any) to
12 * anyone resulting from the use of this software rests entirely with the
15 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
16 * I'll try to keep a version up to date. I can be reached as follows:
17 * Carl Harris <ceharris@mal.com>
21 /***********************************************************************
24 programmer: Carl Harris, ceharris@mal.com
25 description: .poprc lexer
28 Revision 1.1 1996/06/24 18:16:08 esr
31 Revision 1.4 1995/08/10 00:32:43 ceharris
32 Preparation for 3.0b3 beta release:
33 - added code for --kill/--keep, --limit, --protocol, --flush
34 options; --pop2 and --pop3 options now obsoleted by --protocol.
35 - added support for APOP authentication, including --with-APOP
36 argument for configure.
37 - provisional and broken support for RPOP
38 - added buffering to SockGets and SockRead functions.
39 - fixed problem of command-line options not being correctly
40 carried into the merged options record.
42 Revision 1.3 1995/08/09 01:33:01 ceharris
43 Version 3.0 beta 2 release.
45 - .poprc functionality
47 - multiple servers on the command line.
49 - Passwords showing up in ps output.
51 Revision 1.2 1995/08/08 01:01:34 ceharris
52 Added GNU-style long options processing.
53 Fixed password in 'ps' output problem.
54 Fixed various RCS tag blunders.
55 Integrated .poprc parser, lexer, etc into Makefile processing.
57 ***********************************************************************/
69 server { return KW_SERVER; }
70 proto(col)? { return KW_PROTOCOL; }
71 user(name)? { return KW_USERNAME; }
72 pass(word)? { return KW_PASSWORD; }
73 remote(folder)? { return KW_REMOTEFOLDER; }
74 local(folder)? { return KW_LOCALFOLDER; }
76 (pop2)|(POP2) { yylval.proto = P_POP2; return PROTO_POP2; }
77 (pop3)|(POP3) { yylval.proto = P_POP3; return PROTO_POP3; }
78 (imap)|(IMAP) { yylval.proto = P_IMAP; return PROTO_IMAP; }
79 (apop)|(APOP) { yylval.proto = P_APOP; return PROTO_APOP; }
80 (rpop)|(RPOP) { yylval.proto = P_RPOP; return PROTO_RPOP; }
82 (#.*)?\\\n { prc_lineno++; } /* escaped newline is ignored */
84 (#.*)?\n { prc_lineno++; return KW_EOL; }
86 [^ \t\r\n#]+ { yylval.sval = (char *) strdup(yytext); return PARAM_STRING; }
88 [ \t\r]+ ; /* whitespace */