static char *sccsid = "@(#)gram.y 4.5 (Berkeley) 83/10/20";
%type <blk> NAME, INSTALL, NOTIFY, EXCEPT
%type <blk> namelist, names, opt_name, cmdlist, cmd
%type <intval> OPTION, options
command: NAME EQUAL namelist = {
(void) lookup($1->b_name, $1, 1);
| namelist ARROW namelist cmdlist = {
| namelist DCOLON namelist cmdlist = {
cmd: INSTALL options opt_name SM = {
register struct block *b;
$1->b_options = $2 | options;
fatal("exactly one name allowed\n");
$1->b_args = expand($2, 1);
$1->b_args = expand($2, 0);
static char yytext[INMAX];
register char *cp1, *cp2;
static char quotechars[] = "[]{}*?$";
case EOF: /* end of file */
case '#': /* start of comment */
while ((c = getc(fin)) != EOF && c != '\n')
case '\t': /* skip blanks */
if ((c = getc(fin)) == '>')
if ((c = getc(fin)) == ':')
cp2 = &yytext[INMAX - 1];
fatal("input line too long\n");
if ((c = getc(fin)) != EOF) {
if (c == EOF || any(c, " \t()=;\n")) {
if (yytext[0] == '-' && yytext[2] == '\0') {
if (!strcmp(yytext, "install"))
else if (!strcmp(yytext, "notify"))
else if (!strcmp(yytext, "except"))
yylval.blk = makeblock(c, yytext);
* Error printing routine in parser.
fprintf(stderr, "rdist: line %d: %s\n", yylineno, s);