BSD 1 development
[unix-history] / pcs / globals.i
CommitLineData
fc2b415a
BJ
1label 99;
2const nkw = 27; (*no. of key words*)
3 TAB = tab;
4 alng = 10; (*no. of significant chars in identifiers*)
5 llng = 120; (*input line length*)
6 emax = 322; (*max exponent of real numbers*)
7 emin =-292; (*min exponent*)
8 kmax = 15; (*max no. of significant digits*)
9 tmax = 100; (*size of table*)
10 bmax = 20; (*size of block-table*)
11 amax = 30; (*size of array-table*)
12 c2max = 20; (*size of real constant table*)
13 csmax = 30; (*max no. of cases*)
14 cmax = 500; (*size of code*)
15 lmax = 7; (*maximum level*)
16 smax = 400; (*size of string-table*)
17 ermax = 58; (*max error no.*)
18 omax = 66; (*highest order code*)
19 xmax = 131071; (*2**17 - 1*)
20{ shit, look at this number!!!!!
21 nmax = 281474976710655; (*2**48-1*)
22}
23 nmax = maxint;
24 lineleng = 136; (*output line length*)
25 linelimit = 200;
26 stacksize = 200;
27
28type symbol = (intcon,realcon,charcon,string,
29 notsy,plus,minus,times,idiv,rdiv,imod,andsy,orsy,
30 eql,neq,gtr,geq,lss,leq,
31 lparent,rparent,lbrack,rbrack,comma,semicolon,period,
32 colon,becomes,constsy,typesy,varsy,functionsy,
33 proceduresy,arraysy,recordsy,programsy,ident,
34 beginsy,ifsy,casesy,repeatsy,whilesy,forsy,
35 endsy,elsesy,untilsy,ofsy,dosy,tosy,downtosy,thensy);
36
37 index = -xmax .. +xmax;
38 alfa = packed array [1..alng] of char;
39 object = (konstant,variable,type1,prozedure,funktion);
40 types = (notyp,ints,reals,bools,chars,arrays,records);
41 symset = set of symbol;
42 typset = set of types;
43 item = record
44 typ: types; ref: index;
45 end ;
46 order = packed record
47 f: -omax..+omax;
48 x: -lmax..+lmax;
49 y: -nmax..+nmax;
50 end ;
51
52var sy: symbol; (*last symbol read by insymbol*)
53 id: alfa; (*identifier from insymbol*)
54 inum: integer; (*integer from insymbol*)
55 rnum: real; (*real number from insymbol*)
56 sleng: integer; (*string length*)
57 ch: char; (*last character read from source program*)
58 line: array [1..llng] of char;
59 cc: integer; (*character counter*)
60 lc: integer; (*program location counter*)
61 ll: integer; (*length of current line*)
62 errs: set of 0..ermax;
63 errpos: integer;
64 progname: alfa;
65 iflag, oflag: boolean;
66 constbegsys,typebegsys,blockbegsys,facbegsys,statbegsys: symset;
67 key: array [1..nkw] of alfa;
68 ksy: array [1..nkw] of symbol;
69 sps: array [char] of symbol; (*special symbols*)
70
71 t,a,b,sx,c1,c2: integer; (*indices to tables*)
72 stantyps: typset;
73 display: array [0 .. lmax] of integer;
74
75 tab: array [0 .. tmax] of (*identifier table*)
76 packed record
77 name: alfa; link: index;
78 obj: object; typ: types;
79 ref: index; normal: boolean;
80 lev: 0 .. lmax; adr: integer;
81 end ;
82 atab: array [1 .. amax] of (*array-table*)
83 packed record
84 inxtyp, eltyp: types;
85 elref, low, high, elsize, size: index;
86 end ;
87 btab: array [1 .. bmax] of (*block-table*)
88 packed record
89 last, lastpar, psize, vsize: index
90 end ;
91 stab: packed array [0..smax] of char; (*string table*)
92 rconst: array [1 .. c2max] of real;
93 code: array [0 .. cmax] of order;