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