{ attvars($1,$2); $$ = $2; }
| attrs LBRACK dcls1 RBRACK
{ attvars($1,$3); $$ = $3; }
| IMPLICIT letton implist lettoff
init: lhs ASGNOP {ininit = YES; } expr
= { ininit = NO; mkinit($1,$4); frexpr($1); }
| implist COMMA impgroup;
{ setimpl(imptype, 'a', 'z'); }
| impspec LPAR impsets RPAR
{ imptype = $1->attype; cfree($1); }
{ setimpl(imptype, $1, $1); }
{ setimpl(imptype, $1, $3); }
| equivsets COMMA equivset
equivset: LPAR equivlist RPAR
{ $$ = mkchain($1, mkchain($3,CHNULL)); }
{ $$ = hookup($1, mkchain($3,CHNULL)); }
| attrs attr { attatt($1,$2); }
attr: spec dim { $1->atdim = $2; }
| array dim { $$ = ALLOC(atblock); $$->atdim = $2; }
dimbound: LPAR { inbound = 1; } bounds RPAR
{ inbound = 0; $$ = arrays = mkchain($3,arrays); }
| bounds COMMA bound { hookup($1,$3); }
| varlist COMMA var { hookup($1,$3); }
else if(!eqdim($2,$1->vdim))
dclerr("multiple dimension", $1->namep);
| varname dim ASGNOP { ininit = YES; } expr
dclerr("illegal initialization operator", $1->sthead->namep);
else if(!eqdim($2,$1->vdim))
dclerr("multiple dimension", $1->sthead->namep);
if($5!=0 && $1->vinit!=0)
dclerr("multiple initialization", $1->sthead->namep);
| specs specarray { attatt($1,$2); }
{ $$ = ALLOC(atblock); $$->atdim = $2; }
{ $$ = ALLOC(atblock); $$->attype = $1; }
| CHARACTER LPAR expr RPAR
{ $$ = ALLOC(atblock); $$->attype = TYCHAR; $$->attypep = $3; }
{ $$ = ALLOC(atblock); $$->attype = TYFIELD;
$$->attypep = mkfield($3); }
{ $$ = ALLOC(atblock); $$->attype = TYSTRUCT;
{ $$ = ALLOC(atblock); $$->atprec = $1; }
sclass: AUTOMATIC { $$ = CLAUTO;
fprintf(diagfile,"AUTOMATIC not yet implemented\n"); }
| STATIC { $$ = CLSTAT; }
| INTERNAL { $$ = CLSTAT; }
fprintf(diagfile, "VALUE not yet implemented\n"); }
| EXTERNAL { $$ = CLEXT; }
comclass: COMMON LPAR comneed comname RPAR
| COMMON MULTOP comneed comname MULTOP
comneed: { comneed = 1; }
comname: { $$ = mkcomm(""); }
stype: INTEGER { $$ = TYINT; }
| COMPLEX { $$ = TYCOMPLEX; }
| LOGICAL { $$ = TYLOG; }
{ $$ = TYLREAL; /* holdover from Fortran */ }
{ $$ = TYLREAL; /* holdover from Fortran */ }
| STRUCT structname contnu struct
{ $$ = mkstruct($2,$4); }
{ $$ = mkstruct(PNULL,$2); }
{ if($1->varp && $1->varp->blklevel<blklevel)
if($1->varp->blklevel<blklevel)
else dclerr("multiple declaration for type %s", $1->namep);
struct: LBRACK { ++instruct; } dcls { --instruct; } RBRACK EOS