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