if (ffesymbol_where (s) == FFEINFO_whereINTRINSIC) { if (ffeexpr_context_outer_ (ffeexpr_stack_) == FFEEXPR_contextSUBROUTINEREF) *paren_type = FFEEXPR_parentypeSUBROUTINE_; else *paren_type = FFEEXPR_parentypeFUNCTION_; break; }
ffeexpr_declare_parenthesized_ (ffelexToken t, bool maybe_intrin,				ffeexprParenType_ *paren_type){  ffesymbol s;  ffesymbolState st;		/* Effective state. */  ffeinfoKind k;  bool bad;  if (maybe_intrin && ffesrc_check_symbol ())    {				/* Knock off some easy cases. */      switch (ffeexpr_stack_->context)	{	case FFEEXPR_contextSUBROUTINEREF:	case FFEEXPR_contextDATA:	case FFEEXPR_contextDATAIMPDOINDEX_:	case FFEEXPR_contextSFUNCDEF:	case FFEEXPR_contextSFUNCDEFINDEX_:	case FFEEXPR_contextSFUNCDEFACTUALARGEXPR_:	case FFEEXPR_contextSFUNCDEFINDEXORACTUALARGEXPR_:	case FFEEXPR_contextLET:	case FFEEXPR_contextPAREN_:	case FFEEXPR_contextACTUALARGEXPR_:	case FFEEXPR_contextINDEXORACTUALARGEXPR_:	case FFEEXPR_contextIOLIST:	case FFEEXPR_contextIOLISTDF:	case FFEEXPR_contextDO:	case FFEEXPR_contextDOWHILE:	case FFEEXPR_contextACTUALARG_:	case FFEEXPR_contextCGOTO:	case FFEEXPR_contextIF:	case FFEEXPR_contextARITHIF:	case FFEEXPR_contextFORMAT:	case FFEEXPR_contextSTOP:	case FFEEXPR_contextRETURN:	case FFEEXPR_contextSELECTCASE:	case FFEEXPR_contextCASE:	case FFEEXPR_contextFILEASSOC:	case FFEEXPR_contextFILEINT:	case FFEEXPR_contextFILEDFINT:	case FFEEXPR_contextFILELOG:	case FFEEXPR_contextFILENUM:	case FFEEXPR_contextFILENUMAMBIG:	case FFEEXPR_contextFILECHAR:	case FFEEXPR_contextFILENUMCHAR:	case FFEEXPR_contextFILEDFCHAR:	case FFEEXPR_contextFILEKEY:	case FFEEXPR_contextFILEUNIT:	case FFEEXPR_contextFILEUNIT_DF:	case FFEEXPR_contextFILEUNITAMBIG:	case FFEEXPR_contextFILEFORMAT:	case FFEEXPR_contextFILENAMELIST:	case FFEEXPR_contextFILEVXTCODE:	case FFEEXPR_contextINDEX_:	case FFEEXPR_contextIMPDOITEM_:	case FFEEXPR_contextIMPDOITEMDF_:	case FFEEXPR_contextIMPDOCTRL_:	case FFEEXPR_contextDATAIMPDOCTRL_:	case FFEEXPR_contextCHARACTERSIZE:	case FFEEXPR_contextPARAMETER:	case FFEEXPR_contextDIMLIST:	case FFEEXPR_contextDIMLISTCOMMON:	case FFEEXPR_contextKINDTYPE:	case FFEEXPR_contextINITVAL:	case FFEEXPR_contextEQVINDEX_:	  break;		/* These could be intrinsic invocations. */	case FFEEXPR_contextAGOTO:	case FFEEXPR_contextFILEFORMATNML:	case FFEEXPR_contextALLOCATE:	case FFEEXPR_contextDEALLOCATE:	case FFEEXPR_contextHEAPSTAT:	case FFEEXPR_contextNULLIFY:	case FFEEXPR_contextDATAIMPDOITEM_:	case FFEEXPR_contextLOC_:	case FFEEXPR_contextINDEXORACTUALARG_:	case FFEEXPR_contextSFUNCDEFACTUALARG_:	case FFEEXPR_contextSFUNCDEFINDEXORACTUALARG_:	case FFEEXPR_contextPARENFILENUM_:	case FFEEXPR_contextPARENFILEUNIT_:	  maybe_intrin = FALSE;	  break;		/* Can't be intrinsic invocation. */	default:	  assert ("blah! blah! waaauuggh!" == NULL);	  break;	}    }  s = ffesymbol_declare_local (t, maybe_intrin);  switch (ffeexpr_context_outer_ (ffeexpr_stack_))    /* Special-case these since they can involve a different concept       of "state" (in the stmtfunc name space).  */    {    case FFEEXPR_contextDATAIMPDOINDEX_:    case FFEEXPR_contextDATAIMPDOCTRL_:      if (ffeexpr_context_outer_ (ffeexpr_stack_)	  == FFEEXPR_contextDATAIMPDOINDEX_)	s = ffeexpr_sym_impdoitem_ (s, t);      else	if (ffeexpr_stack_->is_rhs)	  s = ffeexpr_sym_impdoitem_ (s, t);	else	  s = ffeexpr_sym_lhs_impdoctrl_ (s, t);      if (ffesymbol_kind (s) != FFEINFO_kindANY)	ffesymbol_error (s, t);      return s;    default:      break;    }  switch ((ffesymbol_sfdummyparent (s) == NULL)	  ? ffesymbol_state (s)	  : FFESYMBOL_stateUNDERSTOOD)    {    case FFESYMBOL_stateNONE:	/* Before first exec, not seen in expr				   context. */      if (!ffest_seen_first_exec ())	goto seen;		/* :::::::::::::::::::: */      /* Fall through. */    case FFESYMBOL_stateUNCERTAIN:	/* Unseen since first exec. */      switch (ffeexpr_context_outer_ (ffeexpr_stack_))	{	case FFEEXPR_contextSUBROUTINEREF:	  s = ffeexpr_sym_lhs_call_ (s, t);	/* "CALL FOO"=="CALL						   FOO(...)". */	  break;	case FFEEXPR_contextDATA:	  if (ffeexpr_stack_->is_rhs)	    s = ffeexpr_sym_rhs_let_ (s, t);	  else	    s = ffeexpr_sym_lhs_data_ (s, t);	  break;	case FFEEXPR_contextDATAIMPDOITEM_:	  s = ffeexpr_sym_lhs_data_ (s, t);	  break;	case FFEEXPR_contextSFUNCDEF:	case FFEEXPR_contextSFUNCDEFINDEX_:	case FFEEXPR_contextSFUNCDEFACTUALARGEXPR_:	case FFEEXPR_contextSFUNCDEFINDEXORACTUALARGEXPR_:	  s = ffecom_sym_exec_transition (s);	  if (ffesymbol_state (s) == FFESYMBOL_stateUNDERSTOOD)	    goto understood;	/* :::::::::::::::::::: */	  /* Fall through. */	case FFEEXPR_contextLET:	case FFEEXPR_contextPAREN_:	case FFEEXPR_contextACTUALARGEXPR_:	case FFEEXPR_contextINDEXORACTUALARGEXPR_:	case FFEEXPR_contextIOLIST:	case FFEEXPR_contextIOLISTDF:	case FFEEXPR_contextDO:	case FFEEXPR_contextDOWHILE:	case FFEEXPR_contextACTUALARG_:	case FFEEXPR_contextCGOTO:	case FFEEXPR_contextIF:	case FFEEXPR_contextARITHIF:	case FFEEXPR_contextFORMAT:	case FFEEXPR_contextSTOP:	case FFEEXPR_contextRETURN:	case FFEEXPR_contextSELECTCASE:	case FFEEXPR_contextCASE:	case FFEEXPR_contextFILEASSOC:	case FFEEXPR_contextFILEINT:	case FFEEXPR_contextFILEDFINT:	case FFEEXPR_contextFILELOG:	case FFEEXPR_contextFILENUM:	case FFEEXPR_contextFILENUMAMBIG:	case FFEEXPR_contextFILECHAR:	case FFEEXPR_contextFILENUMCHAR:	case FFEEXPR_contextFILEDFCHAR:	case FFEEXPR_contextFILEKEY:	case FFEEXPR_contextFILEUNIT:	case FFEEXPR_contextFILEUNIT_DF:	case FFEEXPR_contextFILEUNITAMBIG:	case FFEEXPR_contextFILEFORMAT:	case FFEEXPR_contextFILENAMELIST:	case FFEEXPR_contextFILEVXTCODE:	case FFEEXPR_contextINDEX_:	case FFEEXPR_contextIMPDOITEM_:	case FFEEXPR_contextIMPDOITEMDF_:	case FFEEXPR_contextIMPDOCTRL_:	case FFEEXPR_contextLOC_:	  if (ffeexpr_stack_->is_rhs)	    s = ffeexpr_paren_rhs_let_ (s, t);	  else	    s = ffeexpr_paren_lhs_let_ (s, t);	  break;	case FFEEXPR_contextASSIGN:	case FFEEXPR_contextAGOTO:	case FFEEXPR_contextCHARACTERSIZE:	case FFEEXPR_contextEQUIVALENCE:	case FFEEXPR_contextINCLUDE:	case FFEEXPR_contextPARAMETER:	case FFEEXPR_contextDIMLIST:	case FFEEXPR_contextDIMLISTCOMMON:	case FFEEXPR_contextKINDTYPE:	case FFEEXPR_contextINITVAL:	case FFEEXPR_contextEQVINDEX_:	  break;		/* Will turn into errors below. */	default:	  ffesymbol_error (s, t);	  break;	}      /* Fall through. */    case FFESYMBOL_stateUNDERSTOOD:	/* Nothing much more to learn. */    understood:		/* :::::::::::::::::::: */      /* State might have changed, update it.  */      st = ((ffesymbol_sfdummyparent (s) == NULL)	    ? ffesymbol_state (s)	    : FFESYMBOL_stateUNDERSTOOD);      k = ffesymbol_kind (s);      switch (ffeexpr_context_outer_ (ffeexpr_stack_))	{	case FFEEXPR_contextSUBROUTINEREF:	  bad = (k != FFEINFO_kindSUBROUTINE);	  break;	case FFEEXPR_contextDATA:	  if (ffeexpr_stack_->is_rhs)	    bad = (k != FFEINFO_kindENTITY)	      || (ffesymbol_where (s) != FFEINFO_whereCONSTANT);	  else	    bad = (k != FFEINFO_kindENTITY)	      || ((ffesymbol_where (s) != FFEINFO_whereNONE)		  && (ffesymbol_where (s) != FFEINFO_whereLOCAL)		  && (ffesymbol_where (s) != FFEINFO_whereCOMMON));	  break;	case FFEEXPR_contextDATAIMPDOITEM_:	  bad = (k != FFEINFO_kindENTITY) || (ffesymbol_rank (s) == 0)	    || ((ffesymbol_where (s) != FFEINFO_whereNONE)		&& (ffesymbol_where (s) != FFEINFO_whereLOCAL)		&& (ffesymbol_where (s) != FFEINFO_whereCOMMON));	  break;	case FFEEXPR_contextSFUNCDEF:	case FFEEXPR_contextSFUNCDEFINDEX_:	case FFEEXPR_contextSFUNCDEFACTUALARGEXPR_:	case FFEEXPR_contextSFUNCDEFINDEXORACTUALARGEXPR_:	case FFEEXPR_contextLET:	case FFEEXPR_contextPAREN_:	case FFEEXPR_contextACTUALARGEXPR_:	case FFEEXPR_contextINDEXORACTUALARGEXPR_:	case FFEEXPR_contextIOLIST:	case FFEEXPR_contextIOLISTDF:	case FFEEXPR_contextDO:	case FFEEXPR_contextDOWHILE:	case FFEEXPR_contextACTUALARG_:	case FFEEXPR_contextCGOTO:	case FFEEXPR_contextIF:	case FFEEXPR_contextARITHIF:	case FFEEXPR_contextFORMAT:	case FFEEXPR_contextSTOP:	case FFEEXPR_contextRETURN:	case FFEEXPR_contextSELECTCASE:	case FFEEXPR_contextCASE:	case FFEEXPR_contextFILEASSOC:	case FFEEXPR_contextFILEINT:	case FFEEXPR_contextFILEDFINT:	case FFEEXPR_contextFILELOG:	case FFEEXPR_contextFILENUM:	case FFEEXPR_contextFILENUMAMBIG:	case FFEEXPR_contextFILECHAR:	case FFEEXPR_contextFILENUMCHAR:	case FFEEXPR_contextFILEDFCHAR:	case FFEEXPR_contextFILEKEY:	case FFEEXPR_contextFILEUNIT:	case FFEEXPR_contextFILEUNIT_DF:	case FFEEXPR_contextFILEUNITAMBIG:	case FFEEXPR_contextFILEFORMAT:	case FFEEXPR_contextFILENAMELIST:	case FFEEXPR_contextFILEVXTCODE:	case FFEEXPR_contextINDEX_:	case FFEEXPR_contextIMPDOITEM_:	case FFEEXPR_contextIMPDOITEMDF_:	case FFEEXPR_contextIMPDOCTRL_:	case FFEEXPR_contextLOC_:	  bad = FALSE;		/* Let paren-switch handle the cases. */	  break;	case FFEEXPR_contextASSIGN:	case FFEEXPR_contextAGOTO:	case FFEEXPR_contextCHARACTERSIZE:	case FFEEXPR_contextEQUIVALENCE:	case FFEEXPR_contextPARAMETER:	case FFEEXPR_contextDIMLIST:	case FFEEXPR_contextDIMLISTCOMMON:	case FFEEXPR_contextKINDTYPE:	case FFEEXPR_contextINITVAL:	case FFEEXPR_contextEQVINDEX_:	  bad = (k != FFEINFO_kindENTITY)	    || (ffesymbol_where (s) != FFEINFO_whereCONSTANT);	  break;	case FFEEXPR_contextINCLUDE:	  bad = TRUE;	  break;	default:	  bad = TRUE;	  break;	}      switch (bad ? FFEINFO_kindANY : k)	{	case FFEINFO_kindNONE:	/* Case "CHARACTER X,Y; Y=X(?". */	  if (st == FFESYMBOL_stateUNDERSTOOD)	    {	      bad = TRUE;	      *paren_type = FFEEXPR_parentypeANY_;	    }	  else	    *paren_type = FFEEXPR_parentypeFUNSUBSTR_;	  break;	case FFEINFO_kindFUNCTION:	  *paren_type = FFEEXPR_parentypeFUNCTION_;	  switch (ffesymbol_where (s))	    {	    case FFEINFO_whereLOCAL:	      bad = TRUE;	/* Attempt to recurse! */	      break;	    case FFEINFO_whereCONSTANT:	      bad = ((ffesymbol_sfexpr (s) == NULL)		     || (ffebld_op (ffesymbol_sfexpr (s))			 == FFEBLD_opANY));	/* Attempt to recurse! */	      break;	    default:	      break;	    }	  break;	case FFEINFO_kindSUBROUTINE:	  if ((ffeexpr_stack_->context != FFEEXPR_contextSUBROUTINEREF)	      || (ffeexpr_stack_->previous != NULL))	    {	      bad = TRUE;	      *paren_type = FFEEXPR_parentypeANY_;	      break;	    }	  *paren_type = FFEEXPR_parentypeSUBROUTINE_;	  switch (ffesymbol_where (s))	    {	    case FFEINFO_whereLOCAL:	    case FFEINFO_whereCONSTANT:	      bad = TRUE;	/* Attempt to recurse! */	      break;	    default:	      break;	    }	  break;	case FFEINFO_kindENTITY:	  if (ffesymbol_rank (s) == 0)	    if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)	      *paren_type = FFEEXPR_parentypeSUBSTRING_;	    else	      {		bad = TRUE;		*paren_type = FFEEXPR_parentypeANY_;	      }	  else	    *paren_type = FFEEXPR_parentypeARRAY_;	  break;	default:	  bad = TRUE;	  /* Fall through. */	case FFEINFO_kindANY:	  *paren_type = FFEEXPR_parentypeANY_;	  break;	}      if (bad && (k != FFEINFO_kindANY))	ffesymbol_error (s, t);      return s;    case FFESYMBOL_stateSEEN:	/* Seen but not yet in exec portion. */    seen:			/* :::::::::::::::::::: */      bad = TRUE;      switch (ffeexpr_context_outer_ (ffeexpr_stack_))	{	case FFEEXPR_contextPARAMETER:	  if (ffeexpr_stack_->is_rhs)	    ffesymbol_error (s, t);	  else	    s = ffeexpr_sym_lhs_parameter_ (s, t);	  break;	case FFEEXPR_contextDATA:	  s = ffecom_sym_exec_transition (s);	  if (ffesymbol_state (s) == FFESYMBOL_stateUNDERSTOOD)	    goto understood;	/* :::::::::::::::::::: */	  if (ffeexpr_stack_->is_rhs)	    ffesymbol_error (s, t);	  else	    s = ffeexpr_sym_lhs_data_ (s, t);	  goto understood;	/* :::::::::::::::::::: */	case FFEEXPR_contextDATAIMPDOITEM_:	  s = ffecom_sym_exec_transition (s);	  if (ffesymbol_state (s) == FFESYMBOL_stateUNDERSTOOD)	    goto understood;	/* :::::::::::::::::::: */	  s = ffeexpr_sym_lhs_data_ (s, t);	  goto understood;	/* :::::::::::::::::::: */	case FFEEXPR_contextEQUIVALENCE:	  s = ffeexpr_sym_lhs_equivalence_ (s, t);	  bad = FALSE;	  break;	case FFEEXPR_contextDIMLIST:	  s = ffeexpr_sym_rhs_dimlist_ (s, t);	  break;	case FFEEXPR_contextCHARACTERSIZE:	case FFEEXPR_contextKINDTYPE:	case FFEEXPR_contextDIMLISTCOMMON:	case FFEEXPR_contextINITVAL:	case FFEEXPR_contextEQVINDEX_:	  break;	case FFEEXPR_contextINCLUDE:	  break;	case FFEEXPR_contextINDEX_:	case FFEEXPR_contextACTUALARGEXPR_:	case FFEEXPR_contextINDEXORACTUALARGEXPR_:	case FFEEXPR_contextSFUNCDEF:	case FFEEXPR_contextSFUNCDEFINDEX_:	case FFEEXPR_contextSFUNCDEFACTUALARGEXPR_:	case FFEEXPR_contextSFUNCDEFINDEXORACTUALARGEXPR_:	  assert (ffeexpr_stack_->is_rhs);	  s = ffecom_sym_exec_transition (s);	  if (ffesymbol_state (s) == FFESYMBOL_stateUNDERSTOOD)	    goto understood;	/* :::::::::::::::::::: */	  s = ffeexpr_paren_rhs_let_ (s, t);	  goto understood;	/* :::::::::::::::::::: */	default:	  break;	}      k = ffesymbol_kind (s);      switch (bad ? FFEINFO_kindANY : k)	{	case FFEINFO_kindNONE:	/* Case "CHARACTER X,Y; Y=X(?". */	  *paren_type = FFEEXPR_parentypeFUNSUBSTR_;	  break;	case FFEINFO_kindFUNCTION:	  *paren_type = FFEEXPR_parentypeFUNCTION_;	  switch (ffesymbol_where (s))	    {	    case FFEINFO_whereLOCAL:	      bad = TRUE;	/* Attempt to recurse! */	      break;	    case FFEINFO_whereCONSTANT:	      bad = ((ffesymbol_sfexpr (s) == NULL)		     || (ffebld_op (ffesymbol_sfexpr (s))			 == FFEBLD_opANY));	/* Attempt to recurse! */	      break;	    default:	      break;	    }	  break;	case FFEINFO_kindSUBROUTINE:	  *paren_type = FFEEXPR_parentypeANY_;	  bad = TRUE;		/* Cannot possibly be in				   contextSUBROUTINEREF. */	  break;	case FFEINFO_kindENTITY:	  if (ffesymbol_rank (s) == 0)	    if (ffeexpr_stack_->context == FFEEXPR_contextEQUIVALENCE)	      *paren_type = FFEEXPR_parentypeEQUIVALENCE_;	    else if (ffesymbol_basictype (s) == FFEINFO_basictypeCHARACTER)	      *paren_type = FFEEXPR_parentypeSUBSTRING_;	    else	      {		bad = TRUE;		*paren_type = FFEEXPR_parentypeANY_;	      }	  else	    *paren_type = FFEEXPR_parentypeARRAY_;	  break;	default:	  bad = TRUE;	  /* Fall through. */	case FFEINFO_kindANY:	  *paren_type = FFEEXPR_parentypeANY_;	  break;	}      if (bad && (k != FFEINFO_kindANY))	ffesymbol_error (s, t);      return s;    default:      assert ("bad symbol state" == NULL);      return NULL;    }}