|
|
1.1 root 1: exec: iffable
2: | SDO end_spec intonlyon label intonlyoff opt_comma dospec
3: {
4: if($4->labdefined)
5: execerr("no backward DO loops", CNULL);
6: $4->blklevel = blklevel+1;
7: exdo($4->labelno, $7);
8: }
9: | logif iffable
10: { exendif(); thiswasbranch = NO; }
11: | logif STHEN
12: | SELSEIF end_spec SLPAR expr SRPAR STHEN
13: { exelif($4); lastwasbranch = NO; }
14: | SELSE end_spec
15: { exelse(); lastwasbranch = NO; }
16: | SENDIF end_spec
17: { exendif(); lastwasbranch = NO; }
18: ;
19:
20: logif: SLOGIF end_spec SLPAR expr SRPAR
21: { exif($4); }
22: ;
23:
24: dospec: name SEQUALS exprlist
25: { $$ = mkchain($1, $3); }
26: ;
27:
28: iffable: let lhs SEQUALS expr
29: { exequals($2, $4); }
30: | SASSIGN end_spec assignlabel STO name
31: { exassign($5, $3); }
32: | SCONTINUE end_spec
33: | goto
34: | io
35: { inioctl = NO; }
36: | SARITHIF end_spec SLPAR expr SRPAR label SCOMMA label SCOMMA label
37: { exarif($4, $6, $8, $10); thiswasbranch = YES; }
38: | call
39: { excall($1, PNULL, 0, labarray); }
40: | call SLPAR SRPAR
41: { excall($1, PNULL, 0, labarray); }
42: | call SLPAR callarglist SRPAR
43: { if(nstars < MAXLABLIST)
44: excall($1, mklist($3), nstars, labarray);
45: else
46: err("too many alternate returns");
47: }
48: | SRETURN end_spec opt_expr
49: { exreturn($3); thiswasbranch = YES; }
50: | stop end_spec opt_expr
51: { exstop($1, $3); thiswasbranch = $1; }
52: ;
53:
54: assignlabel: SICON
55: { $$ = mklabel( convci(toklen, token) ); }
56: ;
57:
58: let: SLET
59: { if(parstate == OUTSIDE)
60: {
61: newproc();
62: startproc(PNULL, CLMAIN);
63: }
64: }
65: ;
66:
67: goto: SGOTO end_spec label
68: { exgoto($3); thiswasbranch = YES; }
69: | SASGOTO end_spec name
70: { exasgoto($3); thiswasbranch = YES; }
71: | SASGOTO end_spec name opt_comma SLPAR labellist SRPAR
72: { exasgoto($3); thiswasbranch = YES; }
73: | SCOMPGOTO end_spec SLPAR labellist SRPAR opt_comma expr
74: { if(nstars < MAXLABLIST)
75: if (optimflag)
76: optbuff (SKCMGOTO, fixtype($7), nstars, labarray);
77: else
78: putcmgo (fixtype($7), nstars, labarray);
79: else
80: err("computed GOTO list too long");
81: }
82: ;
83:
84: opt_comma:
85: | SCOMMA
86: ;
87:
88: call: SCALL end_spec name
89: { nstars = 0; $$ = $3; }
90: ;
91:
92: callarglist: callarg
93: { $$ = ($1 ? mkchain($1,CHNULL) : CHNULL); }
94: | callarglist SCOMMA callarg
95: { if($3)
96: if($1) $$ = hookup($1, mkchain($3,CHNULL));
97: else $$ = mkchain($3,CHNULL);
98: else
99: $$ = $1;
100: }
101: ;
102:
103: callarg: expr
104: | SSTAR label
105: { if(nstars<MAXLABLIST) labarray[nstars++] = $2; $$ = 0; }
106: ;
107:
108: stop: SPAUSE
109: { $$ = 0; }
110: | SSTOP
111: { $$ = 1; }
112: ;
113:
114: exprlist: expr
115: { $$ = mkchain($1, CHNULL); }
116: | exprlist SCOMMA expr
117: { $$ = hookup($1, mkchain($3,CHNULL) ); }
118: ;
119:
120: end_spec:
121: { if(parstate == OUTSIDE)
122: {
123: newproc();
124: startproc(PNULL, CLMAIN);
125: }
126: if(parstate < INDATA) enddcl();
127: }
128: ;
129:
130: intonlyon:
131: { intonly = YES; }
132: ;
133:
134: intonlyoff:
135: { intonly = NO; }
136: ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.