Example #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;
}
Example #2
0
ffenameSpace
ffename_space_new (mallocPool pool)
{
  ffenameSpace ns;

  ns = (ffenameSpace) malloc_new_ks (pool, "FFENAME space",
				     sizeof (*ns));
  ns->first = (ffename) &ns->first;
  ns->last = (ffename) &ns->first;
  ns->pool = pool;

  return ns;
}
Example #3
0
ffelab
ffelab_new (ffelabValue v)
{
  ffelab l;

  ++ffelab_num_news_;
  l = malloc_new_ks (ffe_pool_any_unit (), "FFELAB label", sizeof (*l));
  l->next = ffelab_list_;
  l->hook = FFECOM_labelNULL;
  l->value = v;
  l->firstref_line = ffewhere_line_unknown ();
  l->firstref_col = ffewhere_column_unknown ();
  l->doref_line = ffewhere_line_unknown ();
  l->doref_col = ffewhere_column_unknown ();
  l->definition_line = ffewhere_line_unknown ();
  l->definition_col = ffewhere_column_unknown ();
  l->type = FFELAB_typeUNKNOWN;
  ffelab_list_ = l;
  return l;
}
Example #4
0
static ffesymbol
ffesymbol_new_ (ffename n)
{
  ffesymbol s;
  ffesymbolRetract_ r;

  assert (n != NULL);

  s = malloc_new_ks (FFESYMBOL_SPACE_POOL_, "FFESYMBOL", sizeof (*s));
  s->name = n;
  s->other_space_name = NULL;
#if FFEGLOBAL_ENABLED
  s->global = NULL;
#endif
  s->attrs = FFESYMBOL_attrsetNONE;
  s->state = FFESYMBOL_stateNONE;
  s->info = ffeinfo_new_null ();
  s->dims = NULL;
  s->extents = NULL;
  s->dim_syms = NULL;
  s->array_size = NULL;
  s->init = NULL;
  s->accretion = NULL;
  s->accretes = 0;
  s->dummy_args = NULL;
  s->namelist = NULL;
  s->common_list = NULL;
  s->sfunc_expr = NULL;
  s->list_bottom = NULL;
  s->common = NULL;
  s->equiv = NULL;
  s->storage = NULL;
  s->hook = FFECOM_symbolNULL;
  s->sfa_dummy_parent = NULL;
  s->func_result = NULL;
  s->value = 0;
  s->check_state = FFESYMBOL_checkstateNONE_;
  s->check_token = NULL;
  s->max_entry_num = 0;
  s->num_entries = 0;
  s->generic = FFEINTRIN_genNONE;
  s->specific = FFEINTRIN_specNONE;
  s->implementation = FFEINTRIN_impNONE;
  s->is_save = FALSE;
  s->is_init = FALSE;
  s->do_iter = FALSE;
  s->reported = FALSE;
  s->explicit_where = FALSE;
  s->namelisted = FALSE;
  s->assigned = FALSE;

  ffename_set_symbol (n, s);

  if (!ffesymbol_retractable_)
    {
      s->have_old = FALSE;
      return s;
    }

  r = malloc_new_kp (ffesymbol_retract_pool_, "FFESYMBOL retract",
		     sizeof (*r));
  r->next = NULL;
  r->command = FFESYMBOL_retractcommandDELETE_;
  r->live = s;
  r->symbol = NULL;		/* No backup copy. */

  *ffesymbol_retract_list_ = r;
  ffesymbol_retract_list_ = &r->next;

  s->have_old = TRUE;
  return s;
}