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