/*
 *  MODULE:  blktab.h
 *  block table
{*  last modification:  21.08.91  13:54   }
 *  uli 04.03.89 : type optabptr added
 *  uli 16.07.91 : blkfset sets true.
 *  uli 16.07.91 : blkfclr added, sets false.
 *  uli 21.08.91 : flag linkdispl added.
*/
 
global blockptr  actblock;
global shortint  blocklevel;

enum {	IDNOLEVEL=0,
	IDPRELEVEL,
	IDUSELEVEL,
	IDMAINLEVEL,
	IDSUBLEVEL
      };

typedef struct {
		   unsigned int innerrout :1 ;
		   unsigned int innervar  :1 ;
		   unsigned int innertype :1 ; /* obsolete */
		   unsigned int iswith    :1 ;
		   unsigned int linkdispl :1 ;
	       } blkflags;

#define blk_is(blk,flag) (blkflag(blk,false)->flag)   /* Flags erfragen */
#define blkfset(blk,flag) (blkflag(blk,true)->flag) = true  /* Flags aendern  */
#define blkfclr(blk,flag) (blkflag(blk,true)->flag) = false /* Flags aendern  */

#ifdef LINT_ARGS
global blockptr  blkmake      (void);
global blockptr  blkfather    (blockptr);
global void      blkbegin     (idptr);
global void      blkend       (void);
global void      blkwith      (binptr,binptr);
						/* Access */
global idptr *     blkptrid     (blockptr);
global optabptr  * blkop        (blockptr);
global idptr       blkid        (blockptr);
						/* Modification */
global blkflags *blkflag      (blockptr,boolean);
global void      blksetcf     (blockptr, idptr);
global void      blksetfor    (blockptr, boolean);
 
#else

global blockptr  blkmake    ();
global void      blkbegin   (/*idptr*/);
global void      blkend     (/* */);
global blockptr  blkfather  (/* block */);
global optabptr  * blkop     (/* block */);
global blkflags *blkflag    ();
global void      blkwith    (/*t,sym*/);
global idptr *   blkptrid     ();
global idptr     blkid        (); 
global void      blksetcf     ();
global void      blksetfor    ();

#endif /*LINT_ARGS*/
 
 
 
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* The following declaration is necessary to satisfy forward declaration. */
/* Do not use the following names globally. */
 
typedef struct block {                                  /*  b l o c k  table */
	  /* status should be the first member!! */
		blkflags    status;
		int        forward; /* counts unsatisfied forward refs. */
		idptr           id; /* root of idtree */
		idptr       idfunc; /* if kind=IDFUNCTION */
		optabptr        op; /* Operator, if block is Operator declaration */
                struct block *pred; /* Pointer to father */
                struct block *succ; /* Pointer to sister*/
				    /* (block->succ->pred==block->pred) */
				    /* or son  (block->succ->pred==block) */
	} blockrec;
