1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)tree.h	5.1 (Berkeley) 6/6/85
   7:  */
   8: 
   9: /*
  10:  * This file contains the declarations of the variables and routines
  11:  * within the "tree" subdirectory that are accessible from outside.
  12:  */
  13: 
  14: #include "tree/opinfo.h"
  15: 
  16: /*
  17:  * Evaluation stack manipulation macros.  These are publically
  18:  * available because "eval" leaves it's result on the stack.
  19:  *
  20:  * These macros allow one to operate on stacks of arbitrary types
  21:  * (including a stack of different typed objects).
  22:  *
  23:  * Sadly, underflow and overflow are not checked for.
  24:  */
  25: 
  26: typedef char STACK;
  27: 
  28: #define WMASK           (sizeof(int) - 1)
  29: 
  30: #define push(type, value)   ((type *) (sp += sizeof(type)))[-1] = (value)
  31: #define pop(type)       (*((type *) (sp -= sizeof(type))))
  32: #define alignstack()        sp = (char *) (( ((int) sp) + WMASK)&~WMASK)
  33: 
  34: STACK stack[];
  35: STACK *sp;
  36: 
  37: NODE *build();      /* create a node in the parse tree */
  38: prtree();       /* print a tree in source form */
  39: eval();         /* evaluate a tree, leaving value on stack */
  40: long popsmall();    /* pop a small item from the stack given its type */
  41: tfree();        /* release storage for a tree */
  42: BOOLEAN tr_equal(); /* test if two trees are structurally equivalent */
  43: BOOLEAN cond();     /* evaluate a node for a conditional */
  44: ADDRESS lval();     /* return the object address of a node */
  45: BOOLEAN isredirected(); /* TRUE if output is being redirected */

Defined variables

sp defined in line 35; used 4 times
stack defined in line 34; never used

Defined typedef's

STACK defined in line 26; used 2 times

Defined macros

WMASK defined in line 28; used 2 times
  • in line 32(2)
alignstack defined in line 32; never used
pop defined in line 31; never used
push defined in line 30; never used
Last modified: 1985-06-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1768
Valid CSS Valid XHTML 1.0 Strict