static struct { ptr lb, ub; } dims[8];
static struct labelblock *labarray[MAXLABLIST];
static int lastwasbranch = NO;
static int thiswasbranch = NO;
struct addrblock *nextdata(), *mkbitcon();
struct constblock *mklogcon(), *mkaddcon(), *mkrealcon();
struct constblock *mkstrcon(), *mkcxcon();
struct listblock *mklist();
struct listblock *mklist();
struct impldoblock *mkiodo();
struct extsym *comblock();
/* Specify precedences and associativies. */
%nonassoc SLT SGT SLE SGE SEQ SNE
{ if($1 && ($1->labelno==dorange))
if(lastwasbranch && thislabel==NULL)
warn1("statement cannot be reached");
lastwasbranch = thiswasbranch;
| thislabel SINCLUDE filename
| thislabel SEND end_spec
{ lastwasbranch = NO; endproc(); }
{ execerr("unclassifiable statement", 0); flline(); };
{ flline(); needkwd = NO; inioctl = NO;
$$ = thislabel = mklabel(yystno);
puthead(NULL, procclass);
if(thislabel->labdefined)
execerr("label %s already defined",
convic(thislabel->stateno) );
if(thislabel->blklevel!=0 && thislabel->blklevel<blklevel
&& thislabel->labtype!=LABFORMAT)
warn1("there is a branch to label %s from outside block",
convic( (ftnint) (thislabel->stateno) ) );
thislabel->blklevel = blklevel;
thislabel->labdefined = YES;
if(thislabel->labtype != LABFORMAT)
putlabel(thislabel->labelno);
else $$ = thislabel = NULL;
entry: SPROGRAM new_proc progname
{ startproc($3, CLMAIN); }
| SBLOCK new_proc progname
{ startproc($3, CLBLOCK); }
| SSUBROUTINE new_proc entryname arglist
{ entrypt(CLPROC, TYSUBR, (ftnint) 0, $3, $4); }
| SFUNCTION new_proc entryname arglist
{ entrypt(CLPROC, TYUNKNOWN, (ftnint) 0, $3, $4); }
| type SFUNCTION new_proc entryname arglist
{ entrypt(CLPROC, $1, varleng, $4, $5); }
| SENTRY entryname arglist
{ if(parstate==OUTSIDE || procclass==CLMAIN
execerr("misplaced entry statement", 0);
entrypt(CLENTRY, 0, (ftnint) 0, $2, $3);
{ $$ = mkname(toklen, token); }
{ $$ = ($1 ? mkchain($1,0) : 0 ); }
{ if($3) $1 = $$ = hookup($1, mkchain($3,0)); }
{ $$ = 0; substars = YES; }
s = copyn(toklen+1, token);