void save_type_attr(const iterator_t str, const iterator_t end)
{
	string mod_type(str, end);
	if(mod_type.compare("inh") == 0)
	{
		new_attrs->d_mod_type = k_inherit;
	}
}
Example #2
0
int
main (int argc, char *argv[])
{
  const struct discrete_t *dtype;
  size_t index;

  if (argc < 2) {
    (void) fprintf (stderr, "usage: type\n");
    exit (EXIT_FAILURE);
  }

  for (index = 0; index < type_table_size; ++index) {
    dtype = &type_table [index];
    if (strcmp (argv[1], dtype->name_ada) == 0) {
      switch (dtype->kind) {
        case DISCRETE_RANGED:
          int_type
           (dtype->name_ada,
            dtype->bound_low,
            dtype->bound_high,
            dtype->bound_base,
            dtype->size);
          exit (EXIT_SUCCESS);
        case DISCRETE_MOD:
          mod_type (dtype->name_ada, dtype->size);
          exit (EXIT_SUCCESS);
        default:
          (void) fprintf (stderr, "fatal: unknown discrete type kind\n");
          exit (EXIT_FAILURE); 
      }
    }
  }

  (void) fprintf (stderr, "fatal: unknown type %s\n", argv[1]);
  exit (EXIT_FAILURE); 

  /*@notreached@*/
  return 0;
}