* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)prtree.c 5.1 (Berkeley) 6/6/85";
* Print a tree back out in Pascal form.
if (op
< O_NOP
|| op
> O_LASTOP
) {
panic("bad op %d in prtree", p
->op
);
if (isredirected() || isambiguous(s
)) {
printf(".%s", name(p
->right
->nameval
));
printf("%g", p
->fconval
);
printf("'%s'", p
->sconval
);
if (!isvarparam(p
->left
->nodetype
)) {
printf("%s", opinfo
[op
].opstring
);
printf("%s", opinfo
[op
].opstring
);
panic("bad op %d in prtree", op
);
* Print an error associated with a particular tree.
* The string is searched for a "%t" which is replaced by
* the printed representation of the tree.
trerror(s
, tree
, a
, b
, c
, d
, e
, f
, g
, h
, i
, j
)
for (p
= s
; *p
!= '\0'; p
++) {
if (p
[0] == '%' && p
[1] == 't') {
error(&p
[2], a
, b
, c
, d
, e
, f
, g
, h
, i
, j
);
panic("bad call to trerror");