id->next = id_list;
id_list = id;
-} /* sym_id_add */
+}
/*
if (!sym->file)
{
sym->file = &non_existent_file;
- } /* if */
- } /* if */
+ }
+ }
spec = colon + 1;
if (strlen (spec))
{
else
{
sym->name = spec;
- } /* if */
- } /* if */
+ }
+ }
}
else if (strlen (spec))
{
if (!sym->file)
{
sym->file = &non_existent_file;
- } /* if */
+ }
}
else if (isdigit (*spec))
{
else if (strlen (spec))
{
sym->name = spec;
- } /* if */
- } /* if */
-} /* parse_spec */
+ }
+ }
+}
/*
parse_spec (slash + 1, &id->right.sym);
*slash = '\0';
id->has_right = TRUE;
- } /* if */
+ }
parse_spec (id->spec, &id->left.sym);
#ifdef DEBUG
else
{
printf ("*");
- } /* if */
+ }
if (id->has_right)
{
printf ("/%s:",
else
{
printf ("*");
- } /* if */
- } /* if */
+ }
+ }
printf ("\n");
}
#endif
-} /* parse_id */
+}
/*
return (pattern->file ? pattern->file == sym->file : TRUE)
&& (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
&& (pattern->name ? strcmp (pattern->name, sym->name) == 0 : TRUE);
-} /* match */
+}
static void
/* link match into match's chain: */
tab->base[tab->len].next = m->first_match;
m->first_match = &tab->base[tab->len];
- } /* if */
+ }
++tab->len;
- } /* if */
+ }
/* extend match to include this symbol: */
if (second_pass)
{
tab->base[m->prev_index].end_addr = sym->end_addr;
- } /* if */
+ }
m->prev_match = sym;
-} /* extend_match */
+}
/*
for (id = id_list; id; id = id->next)
{
parse_id (id);
- } /* for */
+ }
/* first determine size of each table: */
if (match (&id->left.sym, sym))
{
extend_match (&id->left, sym, &syms[id->which_table], FALSE);
- } /* if */
+ }
if (id->has_right && match (&id->right.sym, sym))
{
extend_match (&id->right, sym, &right_ids, FALSE);
- } /* if */
- } /* for */
- } /* for */
+ }
+ }
+ }
/* create tables of appropriate size and reset lengths: */
tab->base = (Sym *) xmalloc (tab->len * sizeof (Sym));
tab->limit = tab->base + tab->len;
tab->len = 0;
- } /* if */
- } /* for */
+ }
+ }
if (right_ids.len)
{
right_ids.base = (Sym *) xmalloc (right_ids.len * sizeof (Sym));
right_ids.limit = right_ids.base + right_ids.len;
right_ids.len = 0;
- } /* if */
+ }
/* make a second pass through symtab, creating syms as necessary: */
if (match (&id->left.sym, sym))
{
extend_match (&id->left, sym, &syms[id->which_table], TRUE);
- } /* if */
+ }
if (id->has_right && match (&id->right.sym, sym))
{
extend_match (&id->right, sym, &right_ids, TRUE);
- } /* if */
- } /* for */
- } /* for */
+ }
+ }
+ }
/* go through ids creating arcs as needed: */
right->end_addr,
table_name[id->which_table]));
arc_add (left, right, 0);
- } /* for */
- } /* for */
- } /* if */
- } /* for */
+ }
+ }
+ }
+ }
/* finally, we can sort the tables and we're done: */
DBG (IDDEBUG, printf ("[sym_id_parse] syms[%s]:\n",
table_name[tab - &syms[0]]));
symtab_finalize (tab);
- } /* for */
-} /* sym_id_parse */
+ }
+}
/*
&& arc_lookup (sym, to))
{
return TRUE;
- } /* if */
- } /* for */
+ }
+ }
return FALSE;
-} /* sym_id_arc_is_present */
-
-/*** end of sym_ids.h ***/
+}