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