xref: /csrg-svn/usr.bin/pascal/pdx/sym.h (revision 5883)
15458Slinton /* Copyright (c) 1982 Regents of the University of California */
25458Slinton 
3*5883Slinton /* static char sccsid[] = "@(#)sym.h 1.3 02/17/82"; */
45458Slinton 
55458Slinton /*
65458Slinton  * This header file declares the variables and routines that
75458Slinton  * are defined within the "sym" subdirectory and that can be
85458Slinton  * accessed from outside.
95458Slinton  */
105458Slinton 
115458Slinton SYM *program;
125458Slinton 
135458Slinton /*
145458Slinton  * attributes
155458Slinton  */
165458Slinton 
175458Slinton char *name();			/* symbol string name */
185458Slinton char *classname();		/* class name of a symbol */
195458Slinton int toknum();			/* token number of reserved word */
205458Slinton int tokval();			/* associated token value */
215458Slinton int size();			/* size in bytes of a type */
225458Slinton SYM *rtype();			/* the reduced type, i.e. no type names */
235458Slinton SYM *container();		/* symbol (block) that contains given symbol */
245458Slinton ADDRESS codeloc();		/* address of the beginning of a function */
255458Slinton 
265458Slinton /*
275458Slinton  * predicates
285458Slinton  */
295458Slinton 
305458Slinton BOOLEAN isblock();		/* test if a symbol is a block name */
315458Slinton BOOLEAN isbuiltin();		/* test if a symbol is a builtin type */
325458Slinton BOOLEAN isparam();		/* test if a symbol is a parameter */
335458Slinton BOOLEAN isvarparam();		/* test if a symbol is a var parameter */
34*5883Slinton BOOLEAN isvariable();		/* test if a symbol is a variable */
355458Slinton BOOLEAN isambiguous();		/* test if a symbol name is not unique */
365458Slinton BOOLEAN compatible();		/* test to see if two types are compatible */
375458Slinton BOOLEAN should_print();		/* test if a symbol should be printed */
385458Slinton 
395458Slinton SYM *readsym();			/* read in a symbol from object file */
405458Slinton SYM *which();			/* find the appropriate symbol of given name */
415458Slinton SYM *findsym();			/* find a symbol for a given block */
425458Slinton SYM *findclass();		/* find symbol with given class */
435458Slinton NODE *dot();			/* construct a tree for the dot operator */
445458Slinton NODE *subscript();		/* construct a tree for subscripting */
455458Slinton SYM *treetype();		/* return the type of a tree, checking also */
465458Slinton evalindex();			/* evaluate a subscript index */
475458Slinton unmkstring();			/* free a constant string type */
485458Slinton chkboolean();			/* check if a tree is boolean-valued */
495458Slinton printdecl();			/* print out a symbol's declaration */
505458Slinton printparams();			/* print out values of a fn's parameters */
515458Slinton printentry();			/* note entrance of a block */
525458Slinton printexit();			/* note exiting from a block */
535458Slinton printcall();			/* note call of a function */
545458Slinton printval();			/* print an eval result */
555458Slinton printv();			/* print the name and value of a variable */
565458Slinton printwhich();			/* print the full "path" of an identifier */
575458Slinton maketypes();			/* initialize basic types */
585458Slinton make_keyword();			/* create a keyword in a given symbol table */
59