/* Copyright (c) 1979 Regents of the University of California */
* pi - Pascal interpreter code translator
* Charles Haley, Bill Joy UCB
* Version 1.2 November 1978
* This is the array of class
* names for the classes returned
* by classify. The order of the
* classes is the same as the base
* of the namelist, with special
* negative index entries for structures,
* scalars, pointers, sets and strings
char **clnames
= &clnxxxx
[-(TFIRST
)];
* Classify takes a pointer
* to a type and returns one
* of several interesting group
* classifications for easy use.
if (p
->type
== nl
+T1CHAR
)
return (p
!= NIL
&& p
->class == FILET
&& p
->type
== nl
+T1CHAR
);
* Scalar returns a pointer to
* the the base scalar type of
* its argument if its argument
return (p
->class == SCAL
? p
: NIL
);
* classes wanted are specified
* by the characters in s.
* (Note that s would more efficiently,
* if less clearly, be given by a mask.)
* the following character/class
if (i
>= 0 && i
<= TDOUBLE
+1) {
return (clnames
[classify(p
)]);
error("Oct/hex allowed only on writeln/write calls");
error("Width expressions allowed only in writeln/write calls");