]> Pileus Git - ~andy/fetchmail/blob - rcfile_l.l
Added `logfile' keyword to rc syntax.
[~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 logfile         { return LOGFILE; }
25 defaults        { return DEFAULTS; }
26 server          { return POLL; }
27 poll            { return POLL; }
28 skip            { return SKIP; }
29 aka             { return AKA; }
30 proto(col)?     { return PROTOCOL; }
31 port            { return PORT; }
32 auth(enticate)? { return AUTHENTICATE; }
33 kerberos        { return KERBEROS; }
34 timeout         { return TIMEOUT;}
35
36 user(name)?     { return USERNAME; }
37 pass(word)?     { return PASSWORD; }
38 remote(folder)? { return FOLDER; }
39 smtp(host)?     { return SMTPHOST; }
40 mda             { return MDA; }
41 is              { return IS; }
42 here            { return HERE; }
43 there           { return THERE; }
44 to              { return TO; }
45 =               { return MAP; }
46
47 keep            { yylval.flag = FLAG_TRUE;  return KEEP; }
48 flush           { yylval.flag = FLAG_TRUE;  return FLUSH; }
49 fetchall        { yylval.flag = FLAG_TRUE;  return FETCHALL; }
50 rewrite         { yylval.flag = FLAG_FALSE; return REWRITE; }
51 nokeep          { yylval.flag = FLAG_FALSE; return KEEP; }
52 noflush         { yylval.flag = FLAG_FALSE; return FLUSH; }
53 nofetchall      { yylval.flag = FLAG_FALSE; return FETCHALL; }
54 norewrite       { yylval.flag = FLAG_TRUE;  return REWRITE; }
55 limit           { return LIMIT; }
56
57 with            {/* EMPTY */}
58 and             {/* EMPTY */}
59 has             {/* EMPTY */}
60 wants           {/* EMPTY */}
61 options         {/* EMPTY */}
62 [;:,]           {/* EMPTY */}
63
64 (auto)|(AUTO)   { yylval.proto = P_AUTO;  return PROTO; }
65 (pop2)|(POP2)   { yylval.proto = P_POP2;  return PROTO; }
66 (pop3)|(POP3)   { yylval.proto = P_POP3;  return PROTO; }
67 (imap)|(IMAP)   { yylval.proto = P_IMAP;  return PROTO; }
68 (apop)|(APOP)   { yylval.proto = P_APOP;  return PROTO; }
69 (kpop)|(KPOP)   { return KPOP; }
70
71
72 (#.*)?\\?\n     { prc_lineno++; }   /* newline is ignored */
73
74 [0-9]+          { yylval.number = atoi(yytext); return NUMBER; }
75
76 \"[^\"]*\"      {
77                         char buf[POPBUFSIZE];
78
79                         yytext[strlen(yytext)-1] = '\0';
80                         escapes(yytext+1, buf);
81                         yylval.sval = (char *) xstrdup(buf);
82                         return STRING;
83                 }
84 [^;:, \t\r\n]+  {
85                         char buf[POPBUFSIZE];
86
87                         escapes(yytext, buf);
88                         yylval.sval = (char *) xstrdup(buf);
89                         return STRING;
90                 }
91
92 [ \t\r]+        ;       /* whitespace */
93