SCCS-vsn: old/lex/parser.y 4.2
-static char sccsid[] = "@(#)parser.y 4.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)parser.y 4.2 (Berkeley) %G%";
#endif
# include "ldefs.c"
#endif
# include "ldefs.c"
={ $$ = mn0($1); }
| STR
={
={ $$ = mn0($1); }
| STR
={
i = mn0(*p++);
while(*p)
i = mn2(RSTR,i,*p++);
i = mn0(*p++);
while(*p)
i = mn2(RSTR,i,*p++);
sectbegin = TRUE;
i = treesize*(sizeof(*name)+sizeof(*left)+
sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;
sectbegin = TRUE;
i = treesize*(sizeof(*name)+sizeof(*left)+
sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;
if(c == 0)
error("Too little core for parse tree");
if(c == 0)
error("Too little core for parse tree");
- name = myalloc(treesize,sizeof(*name));
- left = myalloc(treesize,sizeof(*left));
- right = myalloc(treesize,sizeof(*right));
- nullstr = myalloc(treesize,sizeof(*nullstr));
- parent = myalloc(treesize,sizeof(*parent));
+ name = (int *)myalloc(treesize,sizeof(*name));
+ left = (int *)myalloc(treesize,sizeof(*left));
+ right = (int *)myalloc(treesize,sizeof(*right));
+ nullstr = (char *)myalloc(treesize,sizeof(*nullstr));
+ parent = (int *)myalloc(treesize,sizeof(*parent));
if(name == 0 || left == 0 || right == 0 || parent == 0 || nullstr == 0)
error("Too little core for parse tree");
return(freturn(DELIM));
if(name == 0 || left == 0 || right == 0 || parent == 0 || nullstr == 0)
error("Too little core for parse tree");
return(freturn(DELIM));
prev = *p;
*p = 0;
bptr = p+1;
prev = *p;
*p = 0;
bptr = p+1;
if(digit(buf[0]))
warning("Substitution strings may not begin with digits");
return(freturn(STR));
if(digit(buf[0]))
warning("Substitution strings may not begin with digits");
return(freturn(STR));
if(*p == 0)
warning("No translation given - null string assumed");
scopy(p,token);
if(*p == 0)
warning("No translation given - null string assumed");
scopy(p,token);
prev = '\n';
return(freturn(STR));
}
prev = '\n';
return(freturn(STR));
}
}
if(slptr > slist+STARTSIZE) /* note not packed ! */
error("Too many start conditions used");
}
if(slptr > slist+STARTSIZE) /* note not packed ! */
error("Too many start conditions used");
x = SCON;
break;
case '"':
x = SCON;
break;
case '"':
while(p <ccptr && scomp(token,p) != 0)p++;
}
if(p < ccptr) /* found it */
while(p <ccptr && scomp(token,p) != 0)p++;
}
if(p < ccptr) /* found it */
scopy(token,ccptr);
ccptr += slength(token) + 1;
if(ccptr >= ccl+CCLSIZE)
scopy(token,ccptr);
ccptr += slength(token) + 1;
if(ccptr >= ccl+CCLSIZE)
}
if(alpha(peek)){
i = 0;
}
if(alpha(peek)){
i = 0;
token[i++] = c;
while(alpha(peek))
token[i++] = gch();
token[i++] = c;
while(alpha(peek))
token[i++] = gch();