]> Pileus Git - ~andy/fetchmail/blob - rcfile_l.l
Increase %a for Solaris.
[~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 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 "*"             { return WILDCARD; }
47
48 keep            { yylval.flag = FLAG_TRUE;  return KEEP; }
49 flush           { yylval.flag = FLAG_TRUE;  return FLUSH; }
50 fetchall        { yylval.flag = FLAG_TRUE;  return FETCHALL; }
51 rewrite         { yylval.flag = FLAG_FALSE; return REWRITE; }
52 nokeep          { yylval.flag = FLAG_FALSE; return KEEP; }
53 noflush         { yylval.flag = FLAG_FALSE; return FLUSH; }
54 nofetchall      { yylval.flag = FLAG_FALSE; return FETCHALL; }
55 norewrite       { yylval.flag = FLAG_TRUE;  return REWRITE; }
56 limit           { return LIMIT; }
57
58 with            {/* EMPTY */}
59 and             {/* EMPTY */}
60 has             {/* EMPTY */}
61 wants           {/* EMPTY */}
62 options         {/* EMPTY */}
63 [;:,]           {/* EMPTY */}
64
65 (auto)|(AUTO)   { yylval.proto = P_AUTO;  return PROTO; }
66 (pop2)|(POP2)   { yylval.proto = P_POP2;  return PROTO; }
67 (pop3)|(POP3)   { yylval.proto = P_POP3;  return PROTO; }
68 (imap)|(IMAP)   { yylval.proto = P_IMAP;  return PROTO; }
69 (apop)|(APOP)   { yylval.proto = P_APOP;  return PROTO; }
70 (kpop)|(KPOP)   { return KPOP; }
71
72
73 (#.*)?\\?\n     { prc_lineno++; }   /* newline is ignored */
74
75 [0-9]+          { yylval.number = atoi(yytext); return NUMBER; }
76
77 \"[^\"]*\"      {
78                         char buf[POPBUFSIZE];
79
80                         yytext[strlen(yytext)-1] = '\0';
81                         escapes(yytext+1, buf);
82                         yylval.sval = (char *) xstrdup(buf);
83                         return STRING;
84                 }
85 [^;:, \t\r\n]+  {
86                         char buf[POPBUFSIZE];
87
88                         escapes(yytext, buf);
89                         yylval.sval = (char *) xstrdup(buf);
90                         return STRING;
91                 }
92
93 [ \t\r]+        ;       /* whitespace */
94