xref: /csrg-svn/usr.bin/pascal/pdx/sym.h (revision 33243)
122578Sdist /*
222578Sdist  * Copyright (c) 1980 Regents of the University of California.
322578Sdist  * All rights reserved.  The Berkeley software License Agreement
422578Sdist  * specifies the terms and conditions for redistribution.
522578Sdist  *
6*33243Sbostic  *	@(#)sym.h	5.3 (Berkeley) 01/03/88
722578Sdist  */
85458Slinton 
95458Slinton /*
105458Slinton  * This header file declares the variables and routines that
115458Slinton  * are defined within the "sym" subdirectory and that can be
125458Slinton  * accessed from outside.
135458Slinton  */
145458Slinton 
155458Slinton SYM *program;
165458Slinton 
175458Slinton /*
185458Slinton  * attributes
195458Slinton  */
205458Slinton 
215458Slinton char *name();			/* symbol string name */
225458Slinton char *classname();		/* class name of a symbol */
235458Slinton int toknum();			/* token number of reserved word */
245458Slinton int tokval();			/* associated token value */
255458Slinton int size();			/* size in bytes of a type */
265458Slinton SYM *rtype();			/* the reduced type, i.e. no type names */
275458Slinton SYM *container();		/* symbol (block) that contains given symbol */
285458Slinton ADDRESS codeloc();		/* address of the beginning of a function */
295458Slinton 
305458Slinton /*
315458Slinton  * predicates
325458Slinton  */
335458Slinton 
345458Slinton BOOLEAN isblock();		/* test if a symbol is a block name */
355458Slinton BOOLEAN isbuiltin();		/* test if a symbol is a builtin type */
365458Slinton BOOLEAN isparam();		/* test if a symbol is a parameter */
375458Slinton BOOLEAN isvarparam();		/* test if a symbol is a var parameter */
385883Slinton BOOLEAN isvariable();		/* test if a symbol is a variable */
395458Slinton BOOLEAN isambiguous();		/* test if a symbol name is not unique */
405458Slinton BOOLEAN compatible();		/* test to see if two types are compatible */
415458Slinton BOOLEAN should_print();		/* test if a symbol should be printed */
425458Slinton 
435458Slinton SYM *readsym();			/* read in a symbol from object file */
445458Slinton SYM *which();			/* find the appropriate symbol of given name */
455458Slinton SYM *findsym();			/* find a symbol for a given block */
465458Slinton SYM *findclass();		/* find symbol with given class */
475458Slinton NODE *dot();			/* construct a tree for the dot operator */
485458Slinton NODE *subscript();		/* construct a tree for subscripting */
495458Slinton SYM *treetype();		/* return the type of a tree, checking also */
5030842Smckusick long evalindex();		/* evaluate a subscript index */
51*33243Sbostic int unmkstring();		/* free a constant string type */
52*33243Sbostic int chkboolean();		/* check if a tree is boolean-valued */
53*33243Sbostic int printdecl();		/* print out a symbol's declaration */
54*33243Sbostic int printparams();		/* print out values of a fn's parameters */
55*33243Sbostic int printentry();		/* note entrance of a block */
56*33243Sbostic int printexit();		/* note exiting from a block */
57*33243Sbostic int printcall();		/* note call of a function */
58*33243Sbostic int printval();			/* print an eval result */
59*33243Sbostic int printv();			/* print the name and value of a variable */
60*33243Sbostic int printwhich();		/* print the full "path" of an identifier */
61*33243Sbostic int maketypes();		/* initialize basic types */
62*33243Sbostic int make_keyword();		/* create a keyword in a given symbol table */
63