1: /*
   2:  * Copyright (c) 1982 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:  *	@(#)asscan.h	5.1 (Berkeley) 4/30/85
   7:  */
   8: 
   9: /*
  10:  *	The character scanner is called to fill up one token buffer
  11:  *
  12:  *	However, once the tokens are filled up by the
  13:  *	character scanner, they are used in both the first and the second
  14:  *	pass.  Holes created by .stab removal are replaced
  15:  *	with 'skip' tokens that direct the second pass to ignore the
  16:  *	following tokens.
  17:  */
  18: 
  19: #define TOKBUFLG        4096
  20: #define MAXVAX          32
  21: #define SAFETY          16
  22: 
  23: #define AVAILTOKS       TOKBUFLG -\
  24:         sizeof(int) -\
  25:         sizeof (struct tokbufdesc *) -\
  26:         MAXVAX - SAFETY
  27: 
  28: struct tokbufdesc{
  29:     int     tok_count;      /*absolute byte length*/
  30:     struct      tokbufdesc *tok_next;
  31:     char        toks[AVAILTOKS];
  32:     char        bufovf[MAXVAX + SAFETY];
  33: };
  34: /*
  35:  *	Definitions for handling tokens in the intermediate file
  36:  *	buffers.
  37:  *
  38:  *	We want to have the compiler produce the efficient auto increment
  39:  *	instruction for stepping through the buffer of tokens.  We must
  40:  *	fool the type checker into thinking that a pointer can point
  41:  *	to various size things.
  42:  */
  43: 
  44: typedef int inttoktype;
  45: typedef char bytetoktype;
  46: 
  47: typedef char *ptrall;           /*all uses will be type cast*/
  48: typedef u_short lgtype;         /*for storing length of strings or skiping*/
  49: /*
  50:  *	defintions for putting various typed values
  51:  *	into the intermediate buffers
  52:  *	ptr will ALWAYS be of type ptrall
  53:  */
  54: 
  55: #define pchar(ptr,val)      *ptr++  = val
  56: #define puchar(ptr,val)     *ptr++  = val
  57: 
  58: #define pshort(ptr,val)     *(short *)ptr=val,  ptr += sizeof(short)
  59: #define plgtype(ptr,val)    *(lgtype *)ptr=val, ptr += sizeof(lgtype)
  60: #define pushort(ptr,val)    *(u_short *)ptr=val,    ptr += sizeof(short)
  61: #define pint(ptr,val)       *(int *)ptr  = val, ptr += sizeof(int)
  62: #define puint(ptr,val)      *(u_int int *)ptr=val,  ptr += sizeof(int)
  63: #define plong(ptr,val)      *(long *)ptr  = val,    ptr += sizeof(long)
  64: #define pulong(ptr,val)     *(u_int long *)ptr=val, ptr += sizeof(long)
  65: #define pnumber(ptr,val)    *(Bignum*)ptr=val,  ptr += sizeof(Bignum)
  66: #define popcode(ptr,val)    *(struct Opcode*)ptr=val,   ptr += sizeof(struct Opcode)
  67: 
  68: #define pptr(ptr,val)       *(int *)ptr  = (val),   ptr += sizeof(ptrall)
  69: #define ptoken(ptr,val)     *ptr++  = val
  70: #define pskiplg(ptr,val)    *(lgtype *)ptr  = val,  ptr += sizeof(short)
  71: 
  72: #define gchar(val, ptr)     val = *ptr++
  73: #define guchar(val, ptr)    val = *ptr++
  74: 
  75: #define gshort(val, ptr)    val = *(short *)ptr , ptr += sizeof (short)
  76: #define glgtype(val, ptr)   val = *(lgtype *)ptr , ptr += sizeof (lgtype)
  77: #define gushort(val, ptr)   val = *(u_short *)ptr , ptr += sizeof (short)
  78: #define gint(val, ptr)      val = *(int *)ptr, ptr += sizeof (int)
  79: #define guint(val, ptr)     val = *(u_int *)ptr, ptr += sizeof (int)
  80: #define glong(val, ptr)     val = *(long *)ptr, ptr += sizeof (long)
  81: #define gulong(val, ptr)    val = *(u_int *)ptr, ptr += sizeof (long)
  82: #define gnumber(val, ptr)   val = *(Bignum *)ptr, ptr += sizeof(Bignum)
  83: #define gopcode(val, ptr)   val = *(struct Opcode *)ptr, ptr += sizeof(struct Opcode)
  84: 
  85: #define gptr(val, ptr)      val = *(int *)ptr, ptr += sizeof (ptrall)
  86: #define gtoken(val, ptr)    val = *ptr++
  87: #define gskiplg(val, ptr)   val = *(lgtype *)ptr, ptr += sizeof (short)
  88: 
  89: extern  ptrall tokptr;  /*the next token to consume, call by copy*/
  90: extern  ptrall tokub;   /*current upper bound in the current buffer*/

Defined struct's

tokbufdesc defined in line 28; used 24 times

Defined typedef's

bytetoktype defined in line 45; used 30 times
inttoktype defined in line 44; used 14 times
ptrall defined in line 47; used 13 times

Defined macros

AVAILTOKS defined in line 23; used 2 times
MAXVAX defined in line 20; used 2 times
SAFETY defined in line 21; used 2 times
TOKBUFLG defined in line 19; used 4 times
gchar defined in line 72; used 1 times
gint defined in line 78; used 1 times
glgtype defined in line 76; never used
glong defined in line 80; used 1 times
gnumber defined in line 82; used 1 times
gopcode defined in line 83; used 2 times
gptr defined in line 85; used 3 times
gshort defined in line 75; never used
gskiplg defined in line 87; never used
gtoken defined in line 86; used 1 times
guchar defined in line 73; never used
guint defined in line 79; never used
gulong defined in line 81; never used
gushort defined in line 77; never used
pchar defined in line 55; used 2 times
pint defined in line 61; used 4 times
plgtype defined in line 59; never used
plong defined in line 63; used 2 times
pnumber defined in line 65; used 1 times
popcode defined in line 66; used 2 times
pptr defined in line 68; used 5 times
pshort defined in line 58; never used
pskiplg defined in line 70; never used
ptoken defined in line 69; used 14 times
puchar defined in line 56; never used
puint defined in line 62; never used
pulong defined in line 64; never used
pushort defined in line 60; never used

Usage of this include

Last modified: 1985-04-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1518
Valid CSS Valid XHTML 1.0 Strict