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*30842Smckusick * @(#)sym.h 5.2 (Berkeley) 04/07/87 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 */ 50*30842Smckusick long evalindex(); /* evaluate a subscript index */ 515458Slinton unmkstring(); /* free a constant string type */ 525458Slinton chkboolean(); /* check if a tree is boolean-valued */ 535458Slinton printdecl(); /* print out a symbol's declaration */ 545458Slinton printparams(); /* print out values of a fn's parameters */ 555458Slinton printentry(); /* note entrance of a block */ 565458Slinton printexit(); /* note exiting from a block */ 575458Slinton printcall(); /* note call of a function */ 585458Slinton printval(); /* print an eval result */ 595458Slinton printv(); /* print the name and value of a variable */ 605458Slinton printwhich(); /* print the full "path" of an identifier */ 615458Slinton maketypes(); /* initialize basic types */ 625458Slinton make_keyword(); /* create a keyword in a given symbol table */ 63