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.2 1996/06/26 19:09:01 esr
29 This is what I sent Harris.
31 Revision 1.1 1996/06/24 18:16:08 esr
34 Revision 1.4 1995/08/10 00:32:43 ceharris
35 Preparation for 3.0b3 beta release:
36 - added code for --kill/--keep, --limit, --protocol, --flush
37 options; --pop2 and --pop3 options now obsoleted by --protocol.
38 - added support for APOP authentication, including --with-APOP
39 argument for configure.
40 - provisional and broken support for RPOP
41 - added buffering to SockGets and SockRead functions.
42 - fixed problem of command-line options not being correctly
43 carried into the merged options record.
45 Revision 1.3 1995/08/09 01:33:01 ceharris
46 Version 3.0 beta 2 release.
48 - .poprc functionality
50 - multiple servers on the command line.
52 - Passwords showing up in ps output.
54 Revision 1.2 1995/08/08 01:01:34 ceharris
55 Added GNU-style long options processing.
56 Fixed password in 'ps' output problem.
57 Fixed various RCS tag blunders.
58 Integrated .poprc parser, lexer, etc into Makefile processing.
60 ***********************************************************************/
72 defaults { return KW_DEFAULTS; }
73 server { return KW_SERVER; }
74 proto(col)? { return KW_PROTOCOL; }
75 user(name)? { return KW_USERNAME; }
76 pass(word)? { return KW_PASSWORD; }
77 remote(folder)? { return KW_REMOTEFOLDER; }
78 local(folder)? { return KW_LOCALFOLDER; }
79 mda { return KW_MDA; }
80 keep { yylval.flag = 1; return KW_KEEP; }
81 flush { yylval.flag = 1; return KW_FLUSH; }
82 fetchall { yylval.flag = 1; return KW_FETCHALL; }
83 nokeep { yylval.flag = -1; return KW_KEEP; }
84 noflush { yylval.flag = -1; return KW_FLUSH; }
85 nofetchall { yylval.flag = -1; return KW_FETCHALL; }
87 (pop2)|(POP2) { yylval.proto = P_POP2; return PROTO_POP2; }
88 (pop3)|(POP3) { yylval.proto = P_POP3; return PROTO_POP3; }
89 (imap)|(IMAP) { yylval.proto = P_IMAP; return PROTO_IMAP; }
90 (apop)|(APOP) { yylval.proto = P_APOP; return PROTO_APOP; }
91 (rpop)|(RPOP) { yylval.proto = P_RPOP; return PROTO_RPOP; }
93 (#.*)?\\\n { prc_lineno++; } /* escaped newline is ignored */
95 (#.*)?\n { prc_lineno++; return KW_EOL; }
97 [^ \t\r\n#]+ { yylval.sval = (char *) strdup(yytext); return PARAM_STRING; }
99 yytext[strlen(yytext)-1] = '\0';
100 yylval.sval = (char *) strdup(yytext+1);
104 [ \t\r]+ ; /* whitespace */