* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid[] = "@(#)parse.y 5.3 (Berkeley) %G%";
%token <number> NUMBER KEYWORD
%type <namelist> Names Cputype Opsys Protos Proto
%type <addrlist> Addresses Address
Entry : KEYWORD ':' Addresses ':' Names ':' END
do_entry($1, $3, $5, NONAME, NONAME, NONAME);
| KEYWORD ':' Addresses ':' Names ':' Cputype ':' END
do_entry($1, $3, $5, $7, NONAME, NONAME);
| KEYWORD ':' Addresses ':' Names ':' Cputype ':' Opsys ':' END
do_entry($1, $3, $5, $7, $9, NONAME);
| KEYWORD ':' Addresses ':' Names ':' Cputype ':' Opsys ':' ':' END
do_entry($1, $3, $5, $7, $9, NONAME);
| KEYWORD ':' Addresses ':' Names ':' Cputype ':' Opsys ':' Protos ':' END
do_entry($1, $3, $5, $7, $9, $11);
Address : NUMBER '.' NUMBER '.' NUMBER '.' NUMBER
$$ = (struct addr *)malloc(sizeof (struct addr));
a = (char *)&($$->addr_val);
a[0] = $1; a[1] = $3; a[2] = $5; a[3] = $7;
fprintf(stderr, "\"%s\", line %d: %s\n", infile, yylineno, msg);