%{
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "defs.h"
void yyerror(char *s);
%}
%union {
int intval;
char *string;
}
%%
;
}
}
}
}
}
| error
;
$$ = makenl($1);
}
$$ = $2;
}
;
}
else {
$$ = $1;
}
}
;
}
$$ = last_sc = $2;
else {
last_sc = $2;
$$ = $1;
}
}
;
if ($3 != NULL) {
yyerror("only one name allowed\n");
if (nl)
}
$$ = $1;
}
if ($2 != NULL)
$$ = $1;
}
if ($2 != NULL)
$$ = $1;
}
/*
* We dup the namelist in $2 because expand()
* destroys the list referred to in its first
* argument.
*/
$$ = $1;
}
if ($2 != NULL)
$$ = $1;
}
;
$$ = 0;
}
$$ |= $2;
}
;
$$ = NULL;
}
| namelist = {
$$ = $1;
}
;
%%
int yylineno = 1;
int
yylex()
{
register int c;
static char quotechars[] = "[]{}*?$";
case EOF: /* end of file */
return(0);
case '#': /* start of comment */
;
if (c == EOF)
return(0);
case '\n':
yylineno++;
case ' ':
case '\t': /* skip blanks */
goto again;
case '=': /* EQUAL */
return(EQUAL);
case '(': /* LP */
return(LP);
case ')': /* RP */
return(RP);
case ';': /* SM */
return(SM);
case '-': /* -> */
return(ARROW);
c = '-';
break;
case '"': /* STRING */
for (;;) {
yyerror("command string too long\n");
break;
}
if (c == EOF || c == '"')
break;
if (c == '\\') {
*cp1++ = '\\';
break;
}
}
if (c == '\n') {
yylineno++;
c = ' '; /* can't send '\n' */
}
*cp1++ = c;
}
if (c != '"')
yyerror("missing closing '\"'\n");
*cp1 = '\0';
return(STRING);
case ':': /* : or :: */
return(DCOLON);
return(COLON);
}
for (;;) {
yyerror("input line too long\n");
break;
}
if (c == '\\') {
if (any(c, quotechars))
c |= QUOTE;
} else {
*cp1++ = '\\';
break;
}
}
*cp1++ = c;
break;
}
}
*cp1 = '\0';
switch (yytext[1]) {
case 'b':
return(OPTION);
case 'R':
return(OPTION);
case 'v':
return(OPTION);
case 'w':
return(OPTION);
case 'y':
return(OPTION);
case 'h':
return(OPTION);
case 'i':
return(OPTION);
}
}
c = INSTALL;
c = NOTIFY;
c = EXCEPT;
c = PATTERN;
c = SPECIAL;
else {
return(NAME);
}
return(c);
}
int
register int c;
register char *str;
{
while (*str)
if (c == *str++)
return(1);
return(0);
}
/*
* Insert or append ARROW command to list of hosts to be updated.
*/
void
char *label;
{
if (debug) {
printf("insert: files = ");
printf("insert: hosts = ");
if (cmds)
else
printf("insert: cmds NULL\n");
}
/*
* Search command list for an update to the same host.
*/
do {
prev = c;
c = c->c_next;
} while (c != NULL &&
break;
}
}
/*
* Insert new command to update host.
*/
fatal("ran out of memory\n");
else
/* update last_cmd if appending nc to cmds */
if (c == NULL)
}
}
/*
* Append DCOLON command to the end of the command list since these are always
* executed in the order they appear in the distfile.
*/
static void
char *label;
char *stamp;
{
register struct cmd *c;
if (c == NULL)
fatal("ran out of memory\n");
else {
last_cmd = c;
}
}
/*
* Error printing routine in parser.
*/
void
yyerror(s)
char *s;
{
extern int yychar;
nerrs++;
}
/*
* Return a copy of the string.
*/
char *
char *str;
{
register char *cp, *s;
fatal("ran out of memory\n");
while (*cp++ = *s++)
;
return(str);
}
/*
* Allocate a namelist structure.
*/
struct namelist *
char *name;
{
fatal("ran out of memory\n");
return(nl);
}
/*
* Duplicate an existing namelist structure. Only used by the PATTERN
* code, and then only because expand() is destructive.
*/
struct namelist *
{
struct namelist *n;
fatal("ran out of memory\n");
if (n->n_name) {
fatal("ran out of memory\n");
} else
if (prev)
}
if (prev)
return (newhead);
}
/*
* Make a sub command for lists of variables, commands, etc.
*/
struct subcmd *
int type;
register char *name;
{
register char *cp;
fatal("ran out of memory\n");
return(sc);
}