new template
[unix-history] / usr / src / usr.bin / pascal / pdx / sym.h
CommitLineData
f9e58c14
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
35bf0218 6 * @(#)sym.h 5.2 (Berkeley) %G%
f9e58c14 7 */
94a490d6
ML
8
9/*
10 * This header file declares the variables and routines that
11 * are defined within the "sym" subdirectory and that can be
12 * accessed from outside.
13 */
14
15SYM *program;
16
17/*
18 * attributes
19 */
20
21char *name(); /* symbol string name */
22char *classname(); /* class name of a symbol */
23int toknum(); /* token number of reserved word */
24int tokval(); /* associated token value */
25int size(); /* size in bytes of a type */
26SYM *rtype(); /* the reduced type, i.e. no type names */
27SYM *container(); /* symbol (block) that contains given symbol */
28ADDRESS codeloc(); /* address of the beginning of a function */
29
30/*
31 * predicates
32 */
33
34BOOLEAN isblock(); /* test if a symbol is a block name */
35BOOLEAN isbuiltin(); /* test if a symbol is a builtin type */
36BOOLEAN isparam(); /* test if a symbol is a parameter */
37BOOLEAN isvarparam(); /* test if a symbol is a var parameter */
6d3dd70b 38BOOLEAN isvariable(); /* test if a symbol is a variable */
94a490d6
ML
39BOOLEAN isambiguous(); /* test if a symbol name is not unique */
40BOOLEAN compatible(); /* test to see if two types are compatible */
41BOOLEAN should_print(); /* test if a symbol should be printed */
42
43SYM *readsym(); /* read in a symbol from object file */
44SYM *which(); /* find the appropriate symbol of given name */
45SYM *findsym(); /* find a symbol for a given block */
46SYM *findclass(); /* find symbol with given class */
47NODE *dot(); /* construct a tree for the dot operator */
48NODE *subscript(); /* construct a tree for subscripting */
49SYM *treetype(); /* return the type of a tree, checking also */
35bf0218 50long evalindex(); /* evaluate a subscript index */
94a490d6
ML
51unmkstring(); /* free a constant string type */
52chkboolean(); /* check if a tree is boolean-valued */
53printdecl(); /* print out a symbol's declaration */
54printparams(); /* print out values of a fn's parameters */
55printentry(); /* note entrance of a block */
56printexit(); /* note exiting from a block */
57printcall(); /* note call of a function */
58printval(); /* print an eval result */
59printv(); /* print the name and value of a variable */
60printwhich(); /* print the full "path" of an identifier */
61maketypes(); /* initialize basic types */
62make_keyword(); /* create a keyword in a given symbol table */