Spring forward into the late 1970's by following item 5 in the yacc
manual's Appendix D ("Old Features Supported but not Encouraged") in the Seventh Edition Unix Programmer's Manual (January, 1979) by retiring the " = {" method of of action specification in favor of a plain "{". It is no longer necessary for this bootstrap program to be compatible with 6th Edition systems. Some yaccs in the wild do not support this old syntax any more, and compatibility with those systems is more important these days (as there are easily 7 orders of magnitude more of them than real v6 systems today). Reviewed by: jhb@ and dds@ (the latter gave the reference).
This commit is contained in:
parent
3919ec2a10
commit
dd8f31f0c8
@ -95,6 +95,12 @@ int include(const char *, int);
|
||||
void yyerror(const char *s);
|
||||
int yywrap(void);
|
||||
|
||||
static void newdev(char *name);
|
||||
static void newfile(char *name);
|
||||
static void rmdev_schedule(struct device_head *dh, char *name);
|
||||
static void newopt(struct opt_head *list, char *name, char *value);
|
||||
static void rmopt_schedule(struct opt_head *list, char *name);
|
||||
|
||||
static char *
|
||||
devopt(char *dev)
|
||||
{
|
||||
@ -122,14 +128,12 @@ Spec:
|
||||
|
|
||||
Config_spec SEMICOLON
|
||||
|
|
||||
INCLUDE ID SEMICOLON
|
||||
= {
|
||||
INCLUDE ID SEMICOLON {
|
||||
if (incignore == 0)
|
||||
include($2, 0);
|
||||
};
|
||||
|
|
||||
FILES ID SEMICOLON
|
||||
= { newfile($2); };
|
||||
FILES ID SEMICOLON { newfile($2); };
|
||||
|
|
||||
SEMICOLON
|
||||
|
|
||||
@ -137,16 +141,14 @@ Spec:
|
||||
;
|
||||
|
||||
Config_spec:
|
||||
ARCH Save_id
|
||||
= {
|
||||
ARCH Save_id {
|
||||
if (machinename != NULL && !eq($2, machinename))
|
||||
errx(1, "%s:%d: only one machine directive is allowed",
|
||||
yyfile, yyline);
|
||||
machinename = $2;
|
||||
machinearch = $2;
|
||||
} |
|
||||
ARCH Save_id Save_id
|
||||
= {
|
||||
ARCH Save_id Save_id {
|
||||
if (machinename != NULL &&
|
||||
!(eq($2, machinename) && eq($3, machinearch)))
|
||||
errx(1, "%s:%d: only one machine directive is allowed",
|
||||
@ -154,15 +156,13 @@ Config_spec:
|
||||
machinename = $2;
|
||||
machinearch = $3;
|
||||
} |
|
||||
CPU Save_id
|
||||
= {
|
||||
CPU Save_id {
|
||||
struct cputype *cp =
|
||||
(struct cputype *)calloc(1, sizeof (struct cputype));
|
||||
cp->cpu_name = $2;
|
||||
SLIST_INSERT_HEAD(&cputype, cp, cpu_next);
|
||||
} |
|
||||
NOCPU Save_id
|
||||
= {
|
||||
NOCPU Save_id {
|
||||
struct cputype *cp, *cp2;
|
||||
SLIST_FOREACH_SAFE(cp, &cputype, cpu_next, cp2) {
|
||||
if (eq(cp->cpu_name, $2)) {
|
||||
@ -173,27 +173,20 @@ Config_spec:
|
||||
} |
|
||||
OPTIONS Opt_list
|
||||
|
|
||||
NOOPTION Save_id
|
||||
= { rmopt_schedule(&opt, $2); } |
|
||||
NOOPTION Save_id { rmopt_schedule(&opt, $2); } |
|
||||
MAKEOPTIONS Mkopt_list
|
||||
|
|
||||
NOMAKEOPTION Save_id
|
||||
= { rmopt_schedule(&mkopt, $2); } |
|
||||
IDENT ID
|
||||
= { ident = $2; } |
|
||||
NOMAKEOPTION Save_id { rmopt_schedule(&mkopt, $2); } |
|
||||
IDENT ID { ident = $2; } |
|
||||
System_spec
|
||||
|
|
||||
MAXUSERS NUMBER
|
||||
= { maxusers = $2; } |
|
||||
PROFILE NUMBER
|
||||
= { profiling = $2; } |
|
||||
ENV ID
|
||||
= {
|
||||
MAXUSERS NUMBER { maxusers = $2; } |
|
||||
PROFILE NUMBER { profiling = $2; } |
|
||||
ENV ID {
|
||||
env = $2;
|
||||
envmode = 1;
|
||||
} |
|
||||
HINTS ID
|
||||
= {
|
||||
HINTS ID {
|
||||
struct hint *hint;
|
||||
|
||||
hint = (struct hint *)calloc(1, sizeof (struct hint));
|
||||
@ -203,16 +196,16 @@ Config_spec:
|
||||
}
|
||||
|
||||
System_spec:
|
||||
CONFIG System_id System_parameter_list
|
||||
= { errx(1, "%s:%d: root/dump/swap specifications obsolete",
|
||||
yyfile, yyline);}
|
||||
CONFIG System_id System_parameter_list {
|
||||
errx(1, "%s:%d: root/dump/swap specifications obsolete",
|
||||
yyfile, yyline);
|
||||
}
|
||||
|
|
||||
CONFIG System_id
|
||||
;
|
||||
|
||||
System_id:
|
||||
Save_id
|
||||
= { newopt(&mkopt, ns("KERNEL"), $1); };
|
||||
Save_id { newopt(&mkopt, ns("KERNEL"), $1); };
|
||||
|
||||
System_parameter_list:
|
||||
System_parameter_list ID
|
||||
@ -226,23 +219,19 @@ Opt_list:
|
||||
;
|
||||
|
||||
Option:
|
||||
Save_id
|
||||
= {
|
||||
Save_id {
|
||||
newopt(&opt, $1, NULL);
|
||||
if (strchr($1, '=') != NULL)
|
||||
errx(1, "%s:%d: The `=' in options should not be "
|
||||
"quoted", yyfile, yyline);
|
||||
} |
|
||||
Save_id EQUALS Opt_value
|
||||
= {
|
||||
Save_id EQUALS Opt_value {
|
||||
newopt(&opt, $1, $3);
|
||||
} ;
|
||||
|
||||
Opt_value:
|
||||
ID
|
||||
= { $$ = $1; } |
|
||||
NUMBER
|
||||
= {
|
||||
ID { $$ = $1; } |
|
||||
NUMBER {
|
||||
char buf[80];
|
||||
|
||||
(void) snprintf(buf, sizeof(buf), "%d", $1);
|
||||
@ -250,8 +239,7 @@ Opt_value:
|
||||
} ;
|
||||
|
||||
Save_id:
|
||||
ID
|
||||
= { $$ = $1; }
|
||||
ID { $$ = $1; }
|
||||
;
|
||||
|
||||
Mkopt_list:
|
||||
@ -261,14 +249,11 @@ Mkopt_list:
|
||||
;
|
||||
|
||||
Mkoption:
|
||||
Save_id
|
||||
= { newopt(&mkopt, $1, ns("")); } |
|
||||
Save_id EQUALS Opt_value
|
||||
= { newopt(&mkopt, $1, $3); } ;
|
||||
Save_id { newopt(&mkopt, $1, ns("")); } |
|
||||
Save_id EQUALS Opt_value { newopt(&mkopt, $1, $3); } ;
|
||||
|
||||
Dev:
|
||||
ID
|
||||
= { $$ = $1; }
|
||||
ID { $$ = $1; }
|
||||
;
|
||||
|
||||
Device_spec:
|
||||
@ -290,16 +275,14 @@ NoDev_list:
|
||||
;
|
||||
|
||||
Device:
|
||||
Dev
|
||||
= {
|
||||
Dev {
|
||||
newopt(&opt, devopt($1), ns("1"));
|
||||
/* and the device part */
|
||||
newdev($1);
|
||||
}
|
||||
|
||||
NoDevice:
|
||||
Dev
|
||||
= {
|
||||
Dev {
|
||||
char *s = devopt($1);
|
||||
|
||||
rmopt_schedule(&opt, s);
|
||||
|
Loading…
Reference in New Issue
Block a user