diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-08 07:04:50 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-08 07:04:50 +0000 |
commit | b48176ac1fc780e25f19222aa73417e956074bc7 (patch) | |
tree | 6337d857752ea15dc372806be2f9b082a8b65421 | |
parent | 5906e49aecf5b6957bae8cb438f42af5ca425967 (diff) | |
download | fetchmail-b48176ac1fc780e25f19222aa73417e956074bc7.tar.gz fetchmail-b48176ac1fc780e25f19222aa73417e956074bc7.tar.bz2 fetchmail-b48176ac1fc780e25f19222aa73417e956074bc7.zip |
More English-like token values.
svn path=/trunk/; revision=247
-rw-r--r-- | rcfile_l.l | 56 | ||||
-rw-r--r-- | rcfile_y.y | 43 |
2 files changed, 49 insertions, 50 deletions
@@ -23,42 +23,42 @@ int prc_lineno = 1; %% -defaults { return KW_DEFAULTS; } -server { return KW_SERVER; } -proto(col)? { return KW_PROTOCOL; } -is { return KW_LOCALNAME; } -user(name)? { return KW_USERNAME; } -pass(word)? { return KW_PASSWORD; } -remote(folder)? { return KW_FOLDER; } -smtp(host)? { return KW_SMTPHOST; } -mda { return KW_MDA; } -keep { yylval.flag = FLAG_TRUE; return KW_KEEP; } -flush { yylval.flag = FLAG_TRUE; return KW_FLUSH; } -fetchall { yylval.flag = FLAG_TRUE; return KW_FETCHALL; } -rewrite { yylval.flag = FLAG_FALSE; return KW_REWRITE; } -skip { yylval.flag = FLAG_TRUE; return KW_SKIP; } -nokeep { yylval.flag = FLAG_FALSE; return KW_KEEP; } -noflush { yylval.flag = FLAG_FALSE; return KW_FLUSH; } -nofetchall { yylval.flag = FLAG_FALSE; return KW_FETCHALL; } -norewrite { yylval.flag = FLAG_TRUE; return KW_REWRITE; } -noskip { yylval.flag = FLAG_FALSE; return KW_SKIP; } -port { return KW_PORT; } +defaults { return DEFAULTS; } +server { return SERVER; } +proto(col)? { return PROTOCOL; } +is { return LOCALNAME; } +user(name)? { return USERNAME; } +pass(word)? { return PASSWORD; } +remote(folder)? { return FOLDER; } +smtp(host)? { return SMTPHOST; } +mda { return MDA; } +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_FALSE; return REWRITE; } +skip { yylval.flag = FLAG_TRUE; return SKIP; } +nokeep { yylval.flag = FLAG_FALSE; return KEEP; } +noflush { yylval.flag = FLAG_FALSE; return FLUSH; } +nofetchall { yylval.flag = FLAG_FALSE; return FETCHALL; } +norewrite { yylval.flag = FLAG_TRUE; return REWRITE; } +noskip { yylval.flag = FLAG_FALSE; return SKIP; } +port { return PORT; } -(auto)|(AUTO) { yylval.proto = P_AUTO; return KW_PROTO; } -(pop2)|(POP2) { yylval.proto = P_POP2; return KW_PROTO; } -(pop3)|(POP3) { yylval.proto = P_POP3; return KW_PROTO; } -(imap)|(IMAP) { yylval.proto = P_IMAP; return KW_PROTO; } -(apop)|(APOP) { yylval.proto = P_APOP; return KW_PROTO; } -(rpop)|(RPOP) { yylval.proto = P_RPOP; return KW_PROTO; } +(auto)|(AUTO) { yylval.proto = P_AUTO; return PROTO; } +(pop2)|(POP2) { yylval.proto = P_POP2; return PROTO; } +(pop3)|(POP3) { yylval.proto = P_POP3; return PROTO; } +(imap)|(IMAP) { yylval.proto = P_IMAP; return PROTO; } +(apop)|(APOP) { yylval.proto = P_APOP; return PROTO; } +(rpop)|(RPOP) { yylval.proto = P_RPOP; return PROTO; } (#.*)?\\?\n { prc_lineno++; } /* newline is ignored */ \"[^\"]*\" { yytext[strlen(yytext)-1] = '\0'; yylval.sval = (char *) strdup(yytext+1); - return PARAM_STRING; + return STRING; } -[^ \t\r\n]+ { yylval.sval = (char *) strdup(yytext); return PARAM_STRING; } +[^ \t\r\n]+ { yylval.sval = (char *) strdup(yytext); return STRING; } [ \t\r]+ ; /* whitespace */ @@ -29,11 +29,10 @@ int yydebug; /* in case we didn't generate with -- debug */ char *sval; } -%token KW_SERVER KW_PROTOCOL KW_LOCALNAME KW_USERNAME KW_PASSWORD -%token KW_FOLDER KW_SMTPHOST KW_MDA KW_DEFAULTS -%token <proto> KW_PROTO -%token <sval> PARAM_STRING -%token <flag> KW_KEEP KW_FLUSH KW_FETCHALL KW_REWRITE KW_PORT KW_SKIP +%token SERVER PROTOCOL LOCALNAME USERNAME PASSWORD FOLDER SMTPHOST MDA DEFAULTS +%token <proto> PROTO +%token <sval> STRING +%token <flag> KEEP FLUSH FETCHALL REWRITE PORT SKIP /* these are actually used by the lexer */ %token FLAG_TRUE 2 @@ -52,19 +51,19 @@ statement_list : statement statement : define_server serverspecs userspecs ; -define_server : KW_SERVER PARAM_STRING {prc_setserver($2);} - | KW_DEFAULTS {prc_setserver("defaults");} +define_server : SERVER STRING {prc_setserver($2);} + | DEFAULTS {prc_setserver("defaults");} ; serverspecs : /* EMPTY */ | serverspecs serv_option ; -serv_option : KW_PROTOCOL KW_PROTO {prc_setproto($2);} - | KW_PORT PARAM_STRING {prc_setport($2);} +serv_option : PROTOCOL PROTO {prc_setproto($2);} + | PORT STRING {prc_setport($2);} ; -/* the first and only the first user spec may omit the KW_USERNAME part */ +/* the first and only the first user spec may omit the USERNAME part */ userspecs : user1opts {prc_register(); prc_reset();} | user1opts explicits {prc_register(); prc_reset();} | explicits @@ -74,7 +73,7 @@ explicits : userdef {prc_register(); prc_reset();} | explicits userdef {prc_register(); prc_reset();} ; -userdef : KW_USERNAME PARAM_STRING user0opts {prc_setremote($2);} +userdef : USERNAME STRING user0opts {prc_setremote($2);} ; user0opts : /* EMPTY */ @@ -85,17 +84,17 @@ user1opts : user_option | user1opts user_option ; -user_option : KW_LOCALNAME PARAM_STRING {prc_setlocal($2);} - | KW_PASSWORD PARAM_STRING {prc_setpassword($2);} - | KW_FOLDER PARAM_STRING {prc_setfolder($2);} - | KW_SMTPHOST PARAM_STRING {prc_setsmtphost($2);} - | KW_MDA PARAM_STRING {prc_setmda($2);} - - | KW_KEEP {prc_setkeep($1==FLAG_TRUE);} - | KW_FLUSH {prc_setflush($1==FLAG_TRUE);} - | KW_FETCHALL {prc_setfetchall($1==FLAG_TRUE);} - | KW_REWRITE {prc_setrewrite($1==FLAG_TRUE);} - | KW_SKIP {prc_setskip($1==FLAG_TRUE);} +user_option : LOCALNAME STRING {prc_setlocal($2);} + | PASSWORD STRING {prc_setpassword($2);} + | FOLDER STRING {prc_setfolder($2);} + | SMTPHOST STRING {prc_setsmtphost($2);} + | MDA STRING {prc_setmda($2);} + + | KEEP {prc_setkeep($1==FLAG_TRUE);} + | FLUSH {prc_setflush($1==FLAG_TRUE);} + | FETCHALL {prc_setfetchall($1==FLAG_TRUE);} + | REWRITE {prc_setrewrite($1==FLAG_TRUE);} + | SKIP {prc_setskip($1==FLAG_TRUE);} ; %% |