DEFUN (is_numbered, (child), Sym * child)
{
return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY;
-} /* is_numbered */
+}
/*
if (child->cg.top_order == DFN_NAN)
{
return FALSE;
- } /* if */
+ }
return TRUE;
-} /* is_busy */
+}
/*
if (child == head)
{
break;
- } /* if */
+ }
if (child->cg.cyc.head != child && child->cg.cyc.head == head)
{
break;
- } /* if */
- } /* for */
+ }
+ }
if (cycle_top <= 0)
{
fprintf (stderr, "[find_cycle] couldn't find head of cycle\n");
done (1);
- } /* if */
+ }
#ifdef DEBUG
if (debug_level & DFNDEBUG)
{
else
{
printf ("<unknown>");
- } /* if */
+ }
printf ("\n");
}
#endif
printf ("[find_cycle] tail ");
print_name (tail);
printf ("\n"));
- } /* for */
+ }
/*
* If what we think is the top of the cycle has a cyclehead
* field, then it's not really the head of the cycle, which is
DBG (DFNDEBUG, printf ("[find_cycle] new cyclehead ");
print_name (head);
printf ("\n"));
- } /* if */
+ }
for (index = cycle_top + 1; index <= dfn_depth; ++index)
{
child = dfn_stack[index].sym;
printf (" onto ");
print_name (head);
printf ("\n"));
- } /* for */
+ }
}
else if (child->cg.cyc.head != head /* firewall */ )
{
fprintf (stderr, "[find_cycle] glommed, but not to head\n");
done (1);
- } /* if */
- } /* for */
- } /* if */
-} /* find_cycle */
+ }
+ }
+ }
+}
/*
{
fprintf (stderr, "[pre_visit] dfn_stack overflow\n");
done (1);
- } /* if */
+ }
dfn_stack[dfn_depth].sym = parent;
dfn_stack[dfn_depth].cycle_top = dfn_depth;
parent->cg.top_order = DFN_BUSY;
DBG (DFNDEBUG, printf ("[pre_visit]\t\t%d:", dfn_depth);
print_name (parent);
printf ("\n"));
-} /* pre_visit */
+}
/*
DBG (DFNDEBUG, printf ("[post_visit]\t\tmember ");
print_name (member);
printf ("-> cg.top_order = %d\n", dfn_counter));
- } /* for */
+ }
}
else
{
DBG (DFNDEBUG, printf ("[post_visit]\t\tis part of a cycle\n"));
- } /* if */
+ }
--dfn_depth;
-} /* post_visit */
+}
/*
if (is_numbered (parent))
{
return;
- } /* if */
+ }
/*
* If we're already busy, must be a cycle:
*/
{
find_cycle (parent);
return;
- } /* if */
+ }
pre_visit (parent);
/*
* Recursively visit children:
for (arc = parent->cg.children; arc; arc = arc->next_child)
{
cg_dfn (arc->child);
- } /* for */
+ }
post_visit (parent);
-} /* cg_dfn */
-
-/*** end of cg_dfn.c ***/
+}