* Copyright (c) 1980 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)attributes.c 5.2 (Berkeley) %G%";
* Functions to return the attributes of a symbol.
return s
->symvalue
.token
.toknum
;
return s
->symvalue
.token
.tokval
;
panic("codeloc: nil symbol");
panic("codeloc: %s is not a block", f
->symbol
);
return f
->symvalue
.funcv
.codeloc
;
* Rtype returns the "reduced type" given a variable.
* The idea is to remove type names so we can check the class.
while (t
->class == TYPE
) {
* Return the SYM that contains the given SYM.
* Return a pointer to the string for the name of the class that
* the given symbol belongs to.
"bad use", "constant", "type", "variable", "array", "fileptr",
"record", "field", "procedure", "function", "funcvar",
"ref", "pointer", "file", "set", "range", "label", "withptr",
"scalar", "string", "program", "improper", "variant",
"procparam", "funcparam",
* size finds the size in bytes of the given type
lower
= t
->symvalue
.rangev
.lower
;
upper
= t
->symvalue
.rangev
.upper
;
if (lower
>= MINCHAR
&& upper
<= MAXCHAR
) {
} else if (lower
>= MINSHORT
&& upper
<= MAXSHORT
) {
register int nel
, elsize
;
for (t
= t
->chain
; t
!= NIL
; t
= t
->chain
) {
lower
= s
->symvalue
.rangev
.lower
;
upper
= s
->symvalue
.rangev
.upper
;
return t
->symvalue
.offset
;
if (t
->symvalue
.iconval
> 255) {
return sizeof(ADDRESS
*);
if (t
->class < BADUSE
|| t
->class > FFUNC
) {
panic("size: bad class (%d)", t
->class);
error("improper operation on a %s", classname(t
));