BSD 4_3 release
[unix-history] / usr / src / ucb / pascal / src / 0.h
index df1b56c..2d994c4 100644 (file)
@@ -1,6 +1,10 @@
-/* Copyright (c) 1979 Regents of the University of California */
-
-/* static char sccsid[] = "@(#)0.h 1.20 2/28/83"; */
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)0.h 5.2 (Berkeley) 6/20/85
+ */
 
 #define DEBUG
 #define CONSETS
 
 #define DEBUG
 #define CONSETS
@@ -10,6 +14,7 @@
 
 #include       <stdio.h>
 #include       <sys/types.h>
 
 #include       <stdio.h>
 #include       <sys/types.h>
+#undef roundup
 
 typedef enum {FALSE, TRUE} bool;
 
 
 typedef enum {FALSE, TRUE} bool;
 
@@ -62,7 +67,9 @@ bool  monflg;
      * profflag is set when we are generating a prof profile.
      * this is set by the -p command line option.
      */
      * profflag is set when we are generating a prof profile.
      * this is set by the -p command line option.
      */
+#ifdef PC
 bool   profflag;
 bool   profflag;
+#endif
 
 \f
 /*
 
 \f
 /*
@@ -77,7 +84,7 @@ bool  profflag;
  */
 
 #define        STRINC  1024            /* string space increment */
  */
 
 #define        STRINC  1024            /* string space increment */
-#define        TRINC   512             /* tree space increment */
+#define        TRINC   1024            /* tree space increment */
 #define        HASHINC 509             /* hash table size in words, each increment */
 #define        NLINC   56              /* namelist increment size in nl structs */
 
 #define        HASHINC 509             /* hash table size in words, each increment */
 #define        NLINC   56              /* namelist increment size in nl structs */
 
@@ -111,7 +118,7 @@ bool        profflag;
 #endif ADDR16
 #define        MAXHASH (4 * TABLE_MULTIPLIER)
 #define        MAXNL   (12 * TABLE_MULTIPLIER)
 #endif ADDR16
 #define        MAXHASH (4 * TABLE_MULTIPLIER)
 #define        MAXNL   (12 * TABLE_MULTIPLIER)
-#define        MAXTREE (30 * TABLE_MULTIPLIER)
+#define        MAXTREE (40 * TABLE_MULTIPLIER)
 /*
  * MAXDEPTH is the depth of the parse stack.
  * STACK_MULTIPLIER is for increasing its size.
 /*
  * MAXDEPTH is the depth of the parse stack.
  * STACK_MULTIPLIER is for increasing its size.
@@ -143,8 +150,8 @@ bool        profflag;
 
 bool   Recovery;
 
 
 bool   Recovery;
 
-#define        eholdnl()       Eholdnl = 1
-#define        nocascade()     Enocascade = 1
+#define        eholdnl()       Eholdnl = TRUE
+#define        nocascade()     Enocascade = TRUE
 
 bool   Eholdnl, Enocascade;
 
 
 bool   Eholdnl, Enocascade;
 
@@ -185,8 +192,12 @@ bool       syneflg;
  * "obj" where we write the interpreter code.
  */
 short  efil;
  * "obj" where we write the interpreter code.
  */
 short  efil;
+
+#ifdef OBJ
 short  ofil;
 short  ofil;
+
 short  obuf[518];
 short  obuf[518];
+#endif
 
 bool   Enoline;
 #define        elineoff()      Enoline = TRUE
 
 bool   Enoline;
 #define        elineoff()      Enoline = TRUE
@@ -238,10 +249,11 @@ struct    nl {
        struct  nl *type;
        struct  nl *chain, *nl_next;
        union {
        struct  nl *type;
        struct  nl *chain, *nl_next;
        union {
-               int     *un_ptr[5];
-               int     un_value[5];
-               long    un_range[2];
-               double  un_real;
+               struct nl *un_ptr[5];
+               int        un_value[5];
+               long       un_range[2];
+               double     un_real;
+               struct nl  *un_nptr[5]; /* Points to conformant array bounds */
        } nl_un;
 #      ifdef PTREE
            pPointer    inTree;
        } nl_un;
 #      ifdef PTREE
            pPointer    inTree;
@@ -258,6 +270,7 @@ struct      nl {
 #define value  nl_un.un_value
 #define ptr    nl_un.un_ptr
 #define real   nl_un.un_real
 #define value  nl_un.un_value
 #define ptr    nl_un.un_ptr
 #define real   nl_un.un_real
+#define nptr   nl_un.un_nptr   
 
 extern struct nl *nlp, *disptab[077+1], *Fp;
 extern struct nl nl[INL];
 
 extern struct nl *nlp, *disptab[077+1], *Fp;
 extern struct nl nl[INL];
@@ -391,6 +404,7 @@ extern struct nl nl[INL];
 #define        VARNT   22
 #define        FPROC   23
 #define        FFUNC   24
 #define        VARNT   22
 #define        FPROC   23
 #define        FFUNC   24
+#define CRANGE 25
 
 /*
  * Clnames points to an array of names for the
 
 /*
  * Clnames points to an array of names for the
@@ -483,7 +497,7 @@ struct {
        struct nl       *ctype;
        short           cival;
        double          crval;
        struct nl       *ctype;
        short           cival;
        double          crval;
-       int             *cpval;
+       char            *cpval; /* note used to be int * */
 } con;
 
 /*
 } con;
 
 /*
@@ -676,7 +690,9 @@ struct      udinfo {
  *
 short  codeline;
  */
  *
 short  codeline;
  */
+#ifdef OBJ
 char   *lc;
 char   *lc;
+#endif
 \f
 
 /*
 \f
 
 /*
@@ -693,48 +709,90 @@ long              roundup();
 struct nl      *tmpalloc();
 struct nl      *lookup();
 double         atof();
 struct nl      *tmpalloc();
 struct nl      *lookup();
 double         atof();
-int            *tree();
 int            *hash();
 char           *alloc();
 int            *hash();
 char           *alloc();
-int            *calloc();
+int            *pcalloc();
 char           *savestr();
 char           *savestr();
+char           *esavestr();
 char           *parnam();
 char           *parnam();
+char           *malloc();
+char           *getlab();
+char           *getnext();
+char           *skipbl();
+char           *nameof();
+char           *pstrcpy();
+char           *myctime();
+char           *putlab();
 bool           fcompat();
 bool           fcompat();
+bool           constval();
+bool           precset();
+bool           nilfnil();
+struct nl      *funccod();
+struct nl      *pcfunccod();
 struct nl      *lookup1();
 struct nl      *hdefnl();
 struct nl      *defnl();
 struct nl      *lookup1();
 struct nl      *hdefnl();
 struct nl      *defnl();
+struct nl      *flvalue();
+struct nl      *plist();
 struct nl      *enter();
 struct nl      *nlcopy();
 struct nl      *tyrec();
 struct nl      *tyary();
 struct nl      *enter();
 struct nl      *nlcopy();
 struct nl      *tyrec();
 struct nl      *tyary();
+struct nl      *tyrang();
+struct nl      *tyscal();
 struct nl      *deffld();
 struct nl      *deffld();
+struct nl      *stklval();
+struct nl      *scalar();
+struct nl      *gen();
+struct nl      *stkrval();
+struct nl      *funcext();
+struct nl      *funchdr();
+struct nl      *funcbody();
+struct nl      *yybaduse();
+struct nl      *stackRV();
 struct nl      *defvnt();
 struct nl      *tyrec1();
 struct nl      *reclook();
 struct nl      *asgnop1();
 struct nl      *defvnt();
 struct nl      *tyrec1();
 struct nl      *reclook();
 struct nl      *asgnop1();
+struct nl      *pcasgconf();
 struct nl      *gtype();
 struct nl      *call();
 struct nl      *lvalue();
 struct nl      *gtype();
 struct nl      *call();
 struct nl      *lvalue();
+struct nl      *pclvalue();
 struct nl      *rvalue();
 struct nl      *cset();
 struct nl      *rvalue();
 struct nl      *cset();
+struct nl      *tycrang();
+struct tnode   *newlist();
+struct tnode   *addlist();
+struct tnode   *fixlist();
+struct tnode   *setupvar();
+struct tnode   *setuptyrec();
+struct tnode   *setupfield();
+struct tnode   *tree();
+struct tnode   *tree1();
+struct tnode   *tree2();
+struct tnode   *tree3();
+struct tnode   *tree4();
+struct tnode   *tree5();
 
 /*
  * type cast NIL to keep lint happy (which is not so bad)
  */
 #define                NLNIL   ( (struct nl *) NIL )
 
 /*
  * type cast NIL to keep lint happy (which is not so bad)
  */
 #define                NLNIL   ( (struct nl *) NIL )
+#define                TR_NIL  ( (struct tnode *) NIL)
 
 /*
  * Funny structures to use
  * pointers in wild and wooly ways
  */
 
 /*
  * Funny structures to use
  * pointers in wild and wooly ways
  */
-struct {
+struct cstruct{
        char    pchar;
 };
 struct {
        short   pint;
        short   pint2;
 };
        char    pchar;
 };
 struct {
        short   pint;
        short   pint2;
 };
-struct {
+struct lstruct {
        long    plong;
 };
 struct {
        long    plong;
 };
 struct {