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