BSD 4_4 release
[unix-history] / usr / src / old / as.vax / asscan.h
index 8245381..59ef215 100644 (file)
@@ -1,7 +1,11 @@
 /*
 /*
- *     Copyright (c) 1982 Regents of the University of California
- *     @(#)asscan.h 4.4 %G%
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)asscan.h    5.1 (Berkeley) 4/30/85
  */
  */
+
 /*
  *     The character scanner is called to fill up one token buffer
  *
 /*
  *     The character scanner is called to fill up one token buffer
  *
@@ -12,7 +16,7 @@
  *     following tokens.
  */
 
  *     following tokens.
  */
 
-#define TOKBUFLG               BUFSIZ
+#define TOKBUFLG               4096
 #define MAXVAX                 32              
 #define SAFETY                 16
 
 #define MAXVAX                 32              
 #define SAFETY                 16
 
@@ -41,7 +45,7 @@ typedef int inttoktype;
 typedef char bytetoktype;
 
 typedef char *ptrall;                  /*all uses will be type cast*/
 typedef char bytetoktype;
 
 typedef char *ptrall;                  /*all uses will be type cast*/
-typedef short lgtype;                  /*for storing length of strings or skiping*/
+typedef u_short lgtype;                        /*for storing length of strings or skiping*/
 /*
  *     defintions for putting various typed values
  *     into the intermediate buffers
 /*
  *     defintions for putting various typed values
  *     into the intermediate buffers
@@ -52,6 +56,7 @@ typedef short lgtype;                 /*for storing length of strings or skiping*/
 #define        puchar(ptr,val)         *ptr++  = val
 
 #define        pshort(ptr,val)         *(short *)ptr=val,      ptr += sizeof(short)
 #define        puchar(ptr,val)         *ptr++  = val
 
 #define        pshort(ptr,val)         *(short *)ptr=val,      ptr += sizeof(short)
+#define        plgtype(ptr,val)        *(lgtype *)ptr=val,     ptr += sizeof(lgtype)
 #define        pushort(ptr,val)        *(u_short *)ptr=val,    ptr += sizeof(short)
 #define        pint(ptr,val)           *(int *)ptr  = val,     ptr += sizeof(int)
 #define        puint(ptr,val)          *(u_int int *)ptr=val,  ptr += sizeof(int)
 #define        pushort(ptr,val)        *(u_short *)ptr=val,    ptr += sizeof(short)
 #define        pint(ptr,val)           *(int *)ptr  = val,     ptr += sizeof(int)
 #define        puint(ptr,val)          *(u_int int *)ptr=val,  ptr += sizeof(int)
@@ -62,13 +67,13 @@ typedef short lgtype;                       /*for storing length of strings or skiping*/
 
 #define        pptr(ptr,val)           *(int *)ptr  = (val),   ptr += sizeof(ptrall)
 #define        ptoken(ptr,val)         *ptr++  = val
 
 #define        pptr(ptr,val)           *(int *)ptr  = (val),   ptr += sizeof(ptrall)
 #define        ptoken(ptr,val)         *ptr++  = val
-#define        pstrlg(ptr,val)         *(lgtype *)ptr  = val,  ptr += sizeof(short)
 #define        pskiplg(ptr,val)        *(lgtype *)ptr  = val,  ptr += sizeof(short)
 
 #define        gchar(val, ptr)         val = *ptr++
 #define        guchar(val, ptr)        val = *ptr++
 
 #define        gshort(val, ptr)        val = *(short *)ptr , ptr += sizeof (short)
 #define        pskiplg(ptr,val)        *(lgtype *)ptr  = val,  ptr += sizeof(short)
 
 #define        gchar(val, ptr)         val = *ptr++
 #define        guchar(val, ptr)        val = *ptr++
 
 #define        gshort(val, ptr)        val = *(short *)ptr , ptr += sizeof (short)
+#define        glgtype(val, ptr)       val = *(lgtype *)ptr , ptr += sizeof (lgtype)
 #define        gushort(val, ptr)       val = *(u_short *)ptr , ptr += sizeof (short)
 #define        gint(val, ptr)          val = *(int *)ptr, ptr += sizeof (int)
 #define        guint(val, ptr)         val = *(u_int *)ptr, ptr += sizeof (int)
 #define        gushort(val, ptr)       val = *(u_short *)ptr , ptr += sizeof (short)
 #define        gint(val, ptr)          val = *(int *)ptr, ptr += sizeof (int)
 #define        guint(val, ptr)         val = *(u_int *)ptr, ptr += sizeof (int)
@@ -79,33 +84,7 @@ typedef short lgtype;                        /*for storing length of strings or skiping*/
 
 #define        gptr(val, ptr)          val = *(int *)ptr, ptr += sizeof (ptrall)
 #define        gtoken(val, ptr)        val = *ptr++
 
 #define        gptr(val, ptr)          val = *(int *)ptr, ptr += sizeof (ptrall)
 #define        gtoken(val, ptr)        val = *ptr++
-#define        gstrlg(val, ptr)        val = *(lgtype *)ptr, ptr += sizeof (short)
 #define        gskiplg(val, ptr)       val = *(lgtype *)ptr, ptr += sizeof (short)
 
 #define        gskiplg(val, ptr)       val = *(lgtype *)ptr, ptr += sizeof (short)
 
-
 extern ptrall tokptr;  /*the next token to consume, call by copy*/
 extern ptrall tokub;   /*current upper bound in the current buffer*/
 extern ptrall tokptr;  /*the next token to consume, call by copy*/
 extern ptrall tokub;   /*current upper bound in the current buffer*/
-
-/*
- *     Strings are known for their characters and for their length.
- *     We cannot use a normal zero termination byte, because strings
- *     can contain anything.
- *
- *     We have two "strings", so that an input string that is too long can be
- *     split across two string buffers, and not confuse the yacc grammar.
- *     (This is probably superflous)
- *
- *     We have a third string of nulls so that the .skip can be 
- *     handled in the same way as strings.
- */
-#define MAXSTRLG       127
-
-struct strdesc{
-       char            str_lg;
-       char            str[MAXSTRLG];
-};
-
-extern struct  strdesc         strbuf[3];
-extern struct  strdesc         *strptr;        /*points to the current string*/
-extern int                     strno;          /*the current string being filled*/
-char   *savestr();