diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-02-17 04:15:48 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-02-17 04:15:48 +0000 |
commit | 1bf8bb4b2751ef3d4007221cbe0e9bc39de34117 (patch) | |
tree | 454b81fb5ed405fc4dfab262ea9495f37dc04f49 | |
parent | 39a1e45b96f6dd43acf3692c12e9ed340a9431c1 (diff) | |
download | fetchmail-1bf8bb4b2751ef3d4007221cbe0e9bc39de34117.tar.gz fetchmail-1bf8bb4b2751ef3d4007221cbe0e9bc39de34117.tar.bz2 fetchmail-1bf8bb4b2751ef3d4007221cbe0e9bc39de34117.zip |
Pull negation into the grammar, simplifying the lexer.
svn path=/trunk/; revision=892
-rw-r--r-- | rcfile_l.l | 26 | ||||
-rw-r--r-- | rcfile_y.y | 26 |
2 files changed, 26 insertions, 26 deletions
@@ -17,8 +17,6 @@ int prc_lineno = 1; %o 5000 %a 4000 -WS [ \t]* - %% set { return SET; } @@ -55,21 +53,15 @@ to { return TO; } = { return MAP; } "*" { return WILDCARD; } -keep { yylval.flag = FLAG_TRUE; return KEEP; } -flush { yylval.flag = FLAG_TRUE; return FLUSH; } -fetchall { yylval.flag = FLAG_TRUE; return FETCHALL; } -rewrite { yylval.flag = FLAG_TRUE; return REWRITE; } -stripcr { yylval.flag = FLAG_TRUE; return STRIPCR; } -dns { yylval.flag = FLAG_TRUE; return DNS; } -received { yylval.flag = FLAG_TRUE; return RECEIVED; } - -no{WS}keep { yylval.flag = FLAG_FALSE; return KEEP; } -no{WS}flush { yylval.flag = FLAG_FALSE; return FLUSH; } -no{WS}fetchall { yylval.flag = FLAG_FALSE; return FETCHALL; } -no{WS}rewrite { yylval.flag = FLAG_FALSE; return REWRITE; } -no{WS}stripcr { yylval.flag = FLAG_FALSE; return REWRITE; } -no{WS}dns { yylval.flag = FLAG_FALSE; return DNS; } -no{WS}received { yylval.flag = FLAG_FALSE; return RECEIVED; } +no/.* { return NO;} + +keep { return KEEP; } +flush { return FLUSH; } +fetchall { return FETCHALL; } +rewrite { return REWRITE; } +stripcr { return STRIPCR; } +dns { return DNS; } +received { return RECEIVED; } limit { return LIMIT; } @@ -36,7 +36,6 @@ static void user_reset(); %union { int proto; - int flag; int number; char *sval; } @@ -49,7 +48,7 @@ static void user_reset(); %token <proto> PROTO %token <sval> STRING %token <number> NUMBER -%token <flag> KEEP FLUSH FETCHALL REWRITE STRIPCR DNS PORT RECEIVED +%token NO KEEP FLUSH FETCHALL REWRITE STRIPCR DNS PORT RECEIVED %% @@ -123,8 +122,10 @@ serv_option : AKA alias_list fprintf(stderr, "fetchmail: monitor option is only supported under Linux\n"); #endif /* linux */ } - | DNS {current.server.dns = $1;} - | RECEIVED {current.server.received = $1;} + | DNS {current.server.dns = FLAG_TRUE;} + | RECEIVED {current.server.received = FLAG_TRUE;} + | NO DNS {current.server.dns = FLAG_FALSE;} + | NO RECEIVED {current.server.received = FLAG_FALSE;} ; /* @@ -188,11 +189,18 @@ user_option : TO localnames HERE | MDA STRING {current.mda = xstrdup($2);} | PRECONNECT STRING {current.preconnect = xstrdup($2);} - | KEEP {current.keep = $1;} - | FLUSH {current.flush = $1;} - | FETCHALL {current.fetchall = $1;} - | REWRITE {current.rewrite = $1;} - | STRIPCR {current.stripcr = $1;} + | KEEP {current.keep = FLAG_TRUE;} + | FLUSH {current.flush = FLAG_TRUE;} + | FETCHALL {current.fetchall = FLAG_TRUE;} + | REWRITE {current.rewrite = FLAG_TRUE;} + | STRIPCR {current.stripcr = FLAG_TRUE;} + + | NO KEEP {current.keep = FLAG_FALSE;} + | NO FLUSH {current.flush = FLAG_FALSE;} + | NO FETCHALL {current.fetchall = FLAG_FALSE;} + | NO REWRITE {current.rewrite = FLAG_FALSE;} + | NO STRIPCR {current.stripcr = FLAG_FALSE;} + | LIMIT NUMBER {current.limit = $2;} | FETCHLIMIT NUMBER {current.fetchlimit = $2;} | BATCHLIMIT NUMBER {current.batchlimit = $2;} |