|
|
1.1 ! root 1: exec: iffable ! 2: | SDO end_spec intonlyon label intonlyoff dospec ! 3: { ! 4: if($4->labdefined) ! 5: execerr("no backward DO loops", CNULL); ! 6: $4->blklevel = blklevel+1; ! 7: exdo($4->labelno, $6); ! 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: putcmgo(fixtype($7), nstars, labarray); ! 76: else ! 77: err("computed GOTO list too long"); ! 78: } ! 79: ; ! 80: ! 81: opt_comma: ! 82: | SCOMMA ! 83: ; ! 84: ! 85: call: SCALL end_spec name ! 86: { nstars = 0; $$ = $3; } ! 87: ; ! 88: ! 89: callarglist: callarg ! 90: { $$ = ($1 ? mkchain($1,CHNULL) : CHNULL); } ! 91: | callarglist SCOMMA callarg ! 92: { if($3) ! 93: if($1) $$ = hookup($1, mkchain($3,CHNULL)); ! 94: else $$ = mkchain($3,CHNULL); ! 95: else ! 96: $$ = $1; ! 97: } ! 98: ; ! 99: ! 100: callarg: expr ! 101: | SSTAR label ! 102: { if(nstars<MAXLABLIST) labarray[nstars++] = $2; $$ = 0; } ! 103: ; ! 104: ! 105: stop: SPAUSE ! 106: { $$ = 0; } ! 107: | SSTOP ! 108: { $$ = 1; } ! 109: ; ! 110: ! 111: exprlist: expr ! 112: { $$ = mkchain($1, CHNULL); } ! 113: | exprlist SCOMMA expr ! 114: { $$ = hookup($1, mkchain($3,CHNULL) ); } ! 115: ; ! 116: ! 117: end_spec: ! 118: { if(parstate == OUTSIDE) ! 119: { ! 120: newproc(); ! 121: startproc(PNULL, CLMAIN); ! 122: } ! 123: if(parstate < INDATA) enddcl(); ! 124: } ! 125: ; ! 126: ! 127: intonlyon: ! 128: { intonly = YES; } ! 129: ; ! 130: ! 131: intonlyoff: ! 132: { intonly = NO; } ! 133: ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.