148104Sbostic /*- 2*62131Sbostic * Copyright (c) 1980, 1993 3*62131Sbostic * The Regents of the University of California. All rights reserved. 422578Sdist * 548104Sbostic * %sccs.include.redist.c% 648104Sbostic * 7*62131Sbostic * @(#)sym.h 8.1 (Berkeley) 06/06/93 822578Sdist */ 95458Slinton 105458Slinton /* 115458Slinton * This header file declares the variables and routines that 125458Slinton * are defined within the "sym" subdirectory and that can be 135458Slinton * accessed from outside. 145458Slinton */ 155458Slinton 165458Slinton SYM *program; 175458Slinton 185458Slinton /* 195458Slinton * attributes 205458Slinton */ 215458Slinton 225458Slinton char *name(); /* symbol string name */ 235458Slinton char *classname(); /* class name of a symbol */ 245458Slinton int toknum(); /* token number of reserved word */ 255458Slinton int tokval(); /* associated token value */ 265458Slinton int size(); /* size in bytes of a type */ 275458Slinton SYM *rtype(); /* the reduced type, i.e. no type names */ 285458Slinton SYM *container(); /* symbol (block) that contains given symbol */ 295458Slinton ADDRESS codeloc(); /* address of the beginning of a function */ 305458Slinton 315458Slinton /* 325458Slinton * predicates 335458Slinton */ 345458Slinton 355458Slinton BOOLEAN isblock(); /* test if a symbol is a block name */ 365458Slinton BOOLEAN isbuiltin(); /* test if a symbol is a builtin type */ 375458Slinton BOOLEAN isparam(); /* test if a symbol is a parameter */ 385458Slinton BOOLEAN isvarparam(); /* test if a symbol is a var parameter */ 395883Slinton BOOLEAN isvariable(); /* test if a symbol is a variable */ 405458Slinton BOOLEAN isambiguous(); /* test if a symbol name is not unique */ 415458Slinton BOOLEAN compatible(); /* test to see if two types are compatible */ 425458Slinton BOOLEAN should_print(); /* test if a symbol should be printed */ 435458Slinton 445458Slinton SYM *readsym(); /* read in a symbol from object file */ 455458Slinton SYM *which(); /* find the appropriate symbol of given name */ 465458Slinton SYM *findsym(); /* find a symbol for a given block */ 475458Slinton SYM *findclass(); /* find symbol with given class */ 485458Slinton NODE *dot(); /* construct a tree for the dot operator */ 495458Slinton NODE *subscript(); /* construct a tree for subscripting */ 505458Slinton SYM *treetype(); /* return the type of a tree, checking also */ 5130842Smckusick long evalindex(); /* evaluate a subscript index */ 5233243Sbostic int unmkstring(); /* free a constant string type */ 5333243Sbostic int chkboolean(); /* check if a tree is boolean-valued */ 5433243Sbostic int printdecl(); /* print out a symbol's declaration */ 5533243Sbostic int printparams(); /* print out values of a fn's parameters */ 5633243Sbostic int printentry(); /* note entrance of a block */ 5733243Sbostic int printexit(); /* note exiting from a block */ 5833243Sbostic int printcall(); /* note call of a function */ 5933243Sbostic int printval(); /* print an eval result */ 6033243Sbostic int printv(); /* print the name and value of a variable */ 6133243Sbostic int printwhich(); /* print the full "path" of an identifier */ 6233243Sbostic int maketypes(); /* initialize basic types */ 6333243Sbostic int make_keyword(); /* create a keyword in a given symbol table */ 64