/* Copyright (c) 1979 Regents of the University of California */
* pi - Pascal interpreter code translator
* Charles Haley, Bill Joy UCB
* Version 1.2 November 1978
* Funccod generates code for
* built in function calls and calls
* call to generate calls to user
* defined functions and procedures.
* Verify that the given name
* is defined and the name of
error("%s is not a function", p
->symbol
);
* Call handles user defined
* procedures and functions
return (call(p
, argv
, FUNC
, bn
));
for (al
= argv
; al
!= NIL
; al
= al
[2])
* Built-in functions have
* their interpreter opcode
op
= p
->value
[0] &~ NSTAND
;
if (opt('s') && (p
->value
[0] & NSTAND
)) {
error("%s is a nonstandard function", p
->symbol
);
* Parameterless functions
error("%s takes no arguments", p
->symbol
);
error("%s takes either zero or one argument", p
->symbol
);
* All other functions take
error("%s takes exactly one argument", p
->symbol
);
p1
= rvalue((int *) argv
[1], NLNIL
);
else if (isnta(p1
, "d")) {
error("%s's argument must be integer or real, not %s", p
->symbol
, nameof(p1
));
error("seed's argument must be an integer, not %s", nameof(p1
));
error("%s's argument must be a real, not %s", p
->symbol
, nameof(p1
));
put1(op
+ O_ABS8
-O_ABS2
);
put1(op
+ (width(p1
) >> 2));
error("%s's argument must be an integer or real, not %s", p
->symbol
, nameof(p1
));
if (isa(p1
, "bcis") || classify(p1
) == TPTR
)
error("ord's argument must be of scalar type or a pointer, not %s", nameof(p1
));
error("%s is forbidden for reals", p
->symbol
);
error("%s's argument must be of scalar type, not %s", p
->symbol
, nameof(p1
));
error("odd's argument must be an integer, not %s", nameof(p1
));
put1(op
+ (width(p1
) >> 2));
error("chr's argument must be an integer, not %s", nameof(p1
));
put1(op
+ (width(p1
) >> 2));
error("Argument to card must be a set, not %s", nameof(p1
));
error("Argument to eoln must be a text file, not %s", nameof(p1
));
if (p1
->class != FILET
) {
error("Argument to eof must be file, not %s", nameof(p1
));
error("%s is an unimplemented 6000-3.4 extension", p
->symbol
);