Esempio n. 1
0
ffename
ffename_find (ffenameSpace ns, ffelexToken t)
{
  ffename n;
  ffename newn;
  bool found;

  assert (ns != NULL);
  assert ((t != NULL) && ((ffelex_token_type (t) == FFELEX_typeNAME)
			  || (ffelex_token_type (t) == FFELEX_typeNAMES)));

  n = ffename_lookup_ (ns, t, &found);
  if (found)
    return n;

  newn = (ffename) malloc_new_ks (ns->pool, "FFENAME name", sizeof (*n));
  newn->next = n;
  newn->previous = n->previous;
  n->previous = newn;
  newn->previous->next = newn;
  newn->t = ffelex_token_use (t);
  newn->u.s = NULL;

  return newn;
}
Esempio n. 2
0
void
ffesymbol_check (ffesymbol s, ffelexToken t, bool maybe_intrin)
{
  char c;
  ffebad bad;
  ffeintrinGen gen;
  ffeintrinSpec spec;
  ffeintrinImp imp;

  if (!ffesrc_check_symbol ()
      || ((s->check_state != FFESYMBOL_checkstateNONE_)
	  && ((s->check_state != FFESYMBOL_checkstateINHIBITED_)
	      || ffebad_inhibit ())))
    return;

  bad = ffesymbol_check_token_ (t, &c);

  if (bad == FFEBAD)
    {
      s->check_state = FFESYMBOL_checkstateCHECKED_;
      return;
    }

  if (maybe_intrin
      && ffeintrin_is_intrinsic (ffelex_token_text (t), NULL, FALSE,
				 &gen, &spec, &imp))
    {
      s->check_state = FFESYMBOL_checkstatePENDING_;
      s->check_token = ffelex_token_use (t);
      return;
    }

  if (ffebad_inhibit ())
    {
      s->check_state = FFESYMBOL_checkstateINHIBITED_;
      return;			/* Don't complain now, do it later. */
    }

  s->check_state = FFESYMBOL_checkstateCHECKED_;

  ffesymbol_whine_state_ (bad, t, c);
}