]> Pileus Git - ~andy/fetchmail/blob - rcfile_l.l
Implemented aka option.
[~andy/fetchmail] / rcfile_l.l
1 %{
2
3 /*
4  * rcfile_l.l -- lexer for the run control file
5  *
6  * For license terms, see the file COPYING in this directory.
7  */
8
9 #include <config.h>
10 #include "fetchmail.h"
11 #include "rcfile_y.h"
12
13 int prc_lineno = 1;
14 %}
15
16 /* this doesn't work with Linux lex, see the INSTALL file */
17 %o 5000
18 %a 2100
19
20 %%
21
22 set             { return SET; }
23 batchlimit      { return BATCHLIMIT; }
24 defaults        { return DEFAULTS; }
25 server          { return POLL; }
26 poll            { return POLL; }
27 skip            { return SKIP; }
28 aka             { return AKA; }
29 proto(col)?     { return PROTOCOL; }
30 port            { return PORT; }
31 auth(enticate)? { return AUTHENTICATE; }
32 kerberos        { return KERBEROS; }
33 timeout         { return TIMEOUT;}
34
35 user(name)?     { return USERNAME; }
36 pass(word)?     { return PASSWORD; }
37 remote(folder)? { return FOLDER; }
38 smtp(host)?     { return SMTPHOST; }
39 mda             { return MDA; }
40 is              { return IS; }
41 here            { return HERE; }
42 there           { return THERE; }
43 to              { return TO; }
44 =               { return MAP; }
45
46 keep            { yylval.flag = FLAG_TRUE;  return KEEP; }
47 flush           { yylval.flag = FLAG_TRUE;  return FLUSH; }
48 fetchall        { yylval.flag = FLAG_TRUE;  return FETCHALL; }
49 rewrite         { yylval.flag = FLAG_FALSE; return REWRITE; }
50 nokeep          { yylval.flag = FLAG_FALSE; return KEEP; }
51 noflush         { yylval.flag = FLAG_FALSE; return FLUSH; }
52 nofetchall      { yylval.flag = FLAG_FALSE; return FETCHALL; }
53 norewrite       { yylval.flag = FLAG_TRUE;  return REWRITE; }
54 limit           { return LIMIT; }
55
56 with            {/* EMPTY */}
57 and             {/* EMPTY */}
58 has             {/* EMPTY */}
59 wants           {/* EMPTY */}
60 options         {/* EMPTY */}
61 [;:,]           {/* EMPTY */}
62
63 (auto)|(AUTO)   { yylval.proto = P_AUTO;  return PROTO; }
64 (pop2)|(POP2)   { yylval.proto = P_POP2;  return PROTO; }
65 (pop3)|(POP3)   { yylval.proto = P_POP3;  return PROTO; }
66 (imap)|(IMAP)   { yylval.proto = P_IMAP;  return PROTO; }
67 (apop)|(APOP)   { yylval.proto = P_APOP;  return PROTO; }
68 (kpop)|(KPOP)   { return KPOP; }
69
70
71 (#.*)?\\?\n     { prc_lineno++; }   /* newline is ignored */
72
73 [0-9]+          { yylval.number = atoi(yytext); return NUMBER; }
74
75 \"[^\"]*\"      {
76                         char buf[POPBUFSIZE];
77
78                         yytext[strlen(yytext)-1] = '\0';
79                         escapes(yytext+1, buf);
80                         yylval.sval = (char *) xstrdup(buf);
81                         return STRING;
82                 }
83 [^;:, \t\r\n]+  {
84                         char buf[POPBUFSIZE];
85
86                         escapes(yytext, buf);
87                         yylval.sval = (char *) xstrdup(buf);
88                         return STRING;
89                 }
90
91 [ \t\r]+        ;       /* whitespace */
92