head     56.1;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.1
date     91.11.05.09.27.30;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.05.07;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.14.31;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.15.13;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.00.21;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.15.59.17;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.12.42;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.01.25;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.07.06;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.42.44;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.31.45;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.38.44;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.21.56.25;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.13.46.18;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.31.49;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.14.17;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.37.16;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.22.35;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.12.45;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.25.50;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.04.48;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.15.10;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.15.50.57;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.26.52;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.32.07;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.17.53.06;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.31.12;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.15.31;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.45.46;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.09.18;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.12.23.35;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.02.40;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.05.50;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.09.43.14;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.10.22.13;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.10.57;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.10.20.46;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.07.40.09;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.14.32.33;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.09.48.19;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.06.45;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.08.29.40;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.14.18.55;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.17.57.05;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.12.42.14;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.08.41;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.10.12.34;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.13.32.02;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.11.02;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.12.56.32;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.16.52.39;  author paws;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.14.13.35;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.10.08.11.19.37;  author geli;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@/*      SCCS    REV(31.1);      DATE(85/08/13   14:32:14) */
/* KLEENIX_ID @@(#)manifest      31.1 85/07/23 */

/* NOCDB provides a hook for making a cdb-less compiler via
 *       cc -DNOCDB
 * The default is to turn on the CDB-compile-flag.
 */
# ifndef NOCDB
# define HPCDB
# endif

# include <stdio.h>
/*      manifest constant file for the lex/yacc interface */

#ifdef DEBUGGING
#       define LOCAL
#else
#       define LOCAL static
#endif

# define ERROR 1
# define NAME 2
# define STRING 3
# define ICON 4
# define FCON 5
# define PLUS 6
# define MINUS 8
# define MUL 11
# define AND 14
# define OR 17
# define ER 19
# define QUEST 21
# define COLON 22
# define ANDAND 23
# define OROR 24

/*      special interfaces for yacc alone */
/*      These serve as abbreviations of 2 or more ops:
	ASOP    =, = ops
	RELOP   LE,LT,GE,GT
	EQUOP   EQ,NE
	DIVOP   DIV,MOD
	SHIFTOP LS,RS
	ICOP    ICR,DECR
	UNOP    NOT,COMPL
	STROP   DOT,STREF

	*/
# define ASOP 25
# define RELOP 26
# define EQUOP 27
# define DIVOP 28
# define SHIFTOP 29
# define INCOP 30
# define UNOP 31
# define STROP 32

/*      reserved words, etc */
# define TYPE 33
# define CLASS 34
# define STRUCT 35
# define RETURN 36
# define GOTO 37
# define IF 38
# define ELSE 39
# define SWITCH 40
# define BREAK 41
# define CONTINUE 42
# define WHILE 43
# define DO 44
# define FOR 45
# define DEFAULT 46
# define CASE 47
# define SIZEOF 48
# define ENUM 49


/*      little symbols, etc. */
/*      namely,

	LP      (
	RP      )

	LC      {
	RC      }

	LB      [
	RB      ]

	CM      ,
	SM      ;

	*/

# define LP 50
# define RP 51
# define LC 52
# define RC 53
# define LB 54
# define RB 55
# define CM 56
# define SM 57
# define ASSIGN 58

/*      END OF YACC */

/*      left over tree building operators */
# define COMOP 59
# define DIV 60
# define MOD 62
# define LS 64
# define RS 66
# define DOT 68
# define STREF 69
# define CALL 70
# define FORTCALL 73
# define NOT 76
# define COMPL 77
# define INCR 78
# define DECR 79
# define EQ 80
# define NE 81
# define LE 82
# define LT 83
# define GE 84
# define GT 85
# define ULE 86
# define ULT 87
# define UGE 88
# define UGT 89
# define SETBIT 90
# define TESTBIT 91
# define RESETBIT 92
# define ARS 93
# define REG 94
# define OREG 95
# define CCODES 96
# define FREE 97
# define STASG 98
# define STARG 99
# define STCALL 100

/*      some conversion operators */
# define FLD 103
# define SCONV 104
# define PCONV 105
# define PMCONV 106
# define PVCONV 107

/*      special node operators, used for special contexts */
# define FORCE 108
# define CBRANCH 109
# define INIT 110
# define CAST 111
# define BICCODES 112   /* used only for DOUBLE/FLOAT compares in local2.c */

/* constant for lex/yacc interface for "asm" statements */
# define ASM 113

/*      node types */
# define LTYPE 02
# define UTYPE 04
# define BITYPE 010

	/* DSIZE is the size of the dope array */
# define DSIZE BICCODES+1

/*      type names, used in symbol table building */
# define TNULL PTR    /* pointer to UNDEF */
# define TVOID FTN      /* function returning UNDEF (for void) */
# define UNDEF 0
# define FARG 1
# define CHAR 2
# define SHORT 3
# define INT 4
# define LONG 5
# define FLOAT 6
# define DOUBLE 7
# define STRTY 8
# define UNIONTY 9
# define ENUMTY 10
# define MOETY 11
# define UCHAR 12
# define USHORT 13
# define UNSIGNED 14
# define ULONG 15

# define ASG 1+
# define UNARY 2+
# define NOASG (-1)+
# define NOUNARY (-2)+

/*      various flags */
# define NOLAB (-1)

/* type modifiers */

# define PTR  020
# define FTN  040
# define ARY  060

/* type packing constants */

# define TMASK 060
# define TMASK1 0300
# define TMASK2  0360
# define BTMASK 017
# define BTSHIFT 4
# define TSHIFT 2

/*      macros  */

# define MODTYPE(x,y) x = (x&(~BTMASK))|y  /* set basic type of x to y */
# define BTYPE(x)  (x&BTMASK)   /* basic type of x */
# define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR)
# define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR)
# define ENUNSIGN(x) ((x)+(UNSIGNED-INT))
# define DEUNSIGN(x) ((x)+(INT-UNSIGNED))
# define ISPTR(x) ((x&TMASK)==PTR)
# define ISFTN(x)  ((x&TMASK)==FTN)  /* is x a function type */
# define ISARY(x)   ((x&TMASK)==ARY)   /* is x an array type */
# define ISFTP(t)       ( ( (t)==DOUBLE ) || ( (t)==FLOAT ) )

# define LTMASK 0xc0000000
# define INCREF(x)  incref(x)   /* in common */



# define DECREF(x) (((x>>TSHIFT)&~BTMASK)|(x&BTMASK))
# define SETOFF(x,y)   if( x%y != 0 ) x = ( (x/y + 1) * y)
	/* SETOFF: an expression of value = first arg rounded up to a
	   multiple of the second arg.
	   Used for calculating byte or word offsets from bit offsets.
	*/

# define NOFIT(x,y,z)   ( (x%z + y) > z )
		/* can y bits be added to x without overflowing z */


/* pack and unpack field descriptors (size and offset) */
# define PKFIELD(s,o) (((o)<<6)|s)
# define UPKFSZ(v)  ((v)&077)
# define UPKFOFF(v) ((v) >> 6)
# define SETFFLD(p) ((p)->tn.onebit = 1)

# define INDEXREG(p) (p)->in.op==REG && (p)->tn.rval>=A0 &&(p)->tn.rval<=SP

/*      operator information */

# define TYFLG          016
# define ASGFLG         01
# define LOGFLG         020

# define SIMPFLG        040
# define COMMFLG        0100
# define DIVFLG         0200
# define FLOFLG         0400
# define LTYFLG         01000           /* bitwise logical ops */
# define CALLFLG        02000
# define MULFLG         04000
# define SHFFLG         010000
# define ASGOPFLG       020000
# define SPFLG          040000
# define FHWFLG         0100000         /* ops supported on flt pt. hardware */


#define optype(o)       (dope[o]&TYFLG)
#define asgop(o)        (dope[o]&ASGFLG)
#define logop(o)        (dope[o]&LOGFLG)
#define callop(o)       (dope[o]&CALLFLG)
#define bilogop(o)      (dope[o]&LTYFLG)
#define fhwop(o)        (dope[o]&FHWFLG)

/*      table sizes     */

# define BCSZ 100       /* size of the table to save break, continue labels */
# define SYMTSZ 1000    /* size of the symbol table */
# define DIMTABSZ 1000  /* size of the dimension/size table */
# define PARAMSZ 150    /* size of the parameter stack */
# define SWITSZ 250     /* size of switch table */
# define NCHNAM 255     /* max number of characters in a name */
# define AVENCHNAM 10   /* max avg length of symbol for full symbol table */
# define ASCIZSZ AVENCHNAM*SYMTSZ
# define HASHL 8        /* # chars significant to the hash in lookup */
# define MAXUSEFULERRS 30 /* more errors than this are just junk */

# ifndef FORT
#       define TREESZ 500               /* space for building parse tree */
# else
#       define TREESZ 1000
# endif

# define TASCIZSZ AVENCHNAM*TREESZ*4    /* size of treeasciz array */


/*      common defined variables */

typedef union ndu NODE;
typedef char flag;
typedef unsigned int TWORD;
typedef int *ptr;

# define TRUE 1
# define FALSE 0

extern maxsymtsz;
extern maxnodesz;

# ifndef FORT
	extern maxbcsz;
	extern maxdimtabsz;
	extern maxparamsz;
	extern maxswitsz;
# endif

extern short nerrors;   /* number of errors seen so far */
extern short dope[];    /* a vector containing operator characteristics */
extern char *opst[];    /* a vector containing names for ops */
extern NODE *fopseen;   /* pts to '?' node for fhw iff float simple op seen (+,-,*,/) */
extern flag singleflag;
extern flag oflag;      /* true for additional optimizations. */

extern NODE *bcon(), *block();  /* now in common */

/* global variables added by A. Hierath */
extern int comm_size;         /* to contain space needed for 'comm' variables */
extern int init_size;         /* space needed for other (local) variables     */
extern int str_size;          /* space needed for other (string) variables    */
extern int varid;             /* id into symtab of variable to be initialized */
extern FILE *outfile;         /* declared in code.c */

# define NIL (NODE *)0

/* used to mark a constant with no name field */
# define NONAME 040000

# ifdef ONEPASS
	/* in one-pass operation, define the tree nodes */

union ndu {

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;               /* su for flt pt registers. */
		flag fhwside;           /* true iff on side of tree for fhw */
		flag onebit;            /* true iff its a bit field of size 1 */
		char *name;
		int nameunused;         /* spacer added to prevent left-stsize overlap */
		NODE *left;
		NODE *right;
		}in; /* interior node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;           /* true iff on side of tree for fhw */
		flag onebit;            /* true iff its a bit field of size 1 */
		char *name;
		int nameunused;         /* spacer added to prevent left-stsize overlap */
		CONSZ lval;
		int rval;
		}tn; /* terminal node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;           /* true iff on side of tree for fhw */
		flag onebit;            /* true iff its a bit field of size 1 */
		int label;  /* for use with branching */
		}bn; /* branch node */

	struct {
		short op;
		int rall;
		TWORD type;
		short su;
		char fsu;
		flag fhwside;           /* true iff on side of tree for fhw */
		flag onebit;            /* true iff its a bit field of size 1 */
		int stsize;  /* sizes of structure objects */
		int stalign;  /* alignment of structure objects */
		}stn; /* structure node */

	struct {
		short op;
		int cdim;
		TWORD type;
		int csiz;
		}fn; /* front node */

	struct {
		/* this structure is used when a floating point constant
		   is being computed */
		short op;
		int cdim;               /* also used to store dimoff */
		TWORD type;
		int csiz;
		double dval;
		}fpn; /* floating point node */

	};
# endif

# ifdef BUG2
#        define BUG1
# endif
# ifdef BUG3
#        define BUG2
#        define BUG1
# endif
# ifdef BUG4
#        define BUG1
#        define BUG2
#        define BUG3
# endif

#ifdef DEBUGGING
#        define LOCAL
#else
#        define LOCAL static
#endif
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@@


1.1
log
@Initial revision
@
text
@@
