- Improved roledef printing by adding roledefPrintShort.

This commit is contained in:
ccremers 2004-10-28 12:56:13 +00:00
parent 61457b5f3d
commit 3673fc689d
3 changed files with 30 additions and 7 deletions

View File

@ -778,7 +778,7 @@ dotSemiState ()
eprintf ("shape=box,"); eprintf ("shape=box,");
} }
eprintf ("label=\""); eprintf ("label=\"");
roledefPrint (rd); roledefPrintShort (rd);
eprintf ("\"]"); eprintf ("\"]");
eprintf (";\n"); eprintf (";\n");
@ -827,7 +827,7 @@ dotSemiState ()
} }
// Draw the first box // Draw the first box
// This used to be drawn only if done && send_before_read, now we always draw it. // This used to be drawn only if done && send_before_read, now we always draw it.
eprintf ("\t\ts%i [label=\"Run %i ", run,run); eprintf ("\t\ts%i [label=\"Run %i\\n", run,run);
agentsOfRunPrint (sys, run); agentsOfRunPrint (sys, run);
eprintf ("\", shape=diamond];\n"); eprintf ("\", shape=diamond];\n");
eprintf ("\t\ts%i -> ", run); eprintf ("\t\ts%i -> ", run);

View File

@ -27,8 +27,11 @@ makeRoledef ()
} }
//! Print a role event. //! Print a role event.
/**
* If print_actor is true, the actor is included (OS version), otherwise it is left out (short stuff)
*/
void void
roledefPrint (Roledef rd) roledefPrintGeneric (Roledef rd, int print_actor)
{ {
if (rd == NULL) if (rd == NULL)
{ {
@ -79,12 +82,18 @@ roledefPrint (Roledef rd)
eprintf ("("); eprintf ("(");
if (!(rd->from == NULL && rd->to == NULL)) if (!(rd->from == NULL && rd->to == NULL))
{ {
termPrint (rd->from); if (print_actor || rd->type == READ)
eprintf (","); {
termPrint (rd->from);
eprintf (",");
}
if (rd->type == CLAIM) if (rd->type == CLAIM)
eprintf (" "); eprintf (" ");
termPrint (rd->to); if (print_actor || rd->type != READ)
eprintf (", "); {
termPrint (rd->to);
eprintf (", ");
}
} }
termPrint (rd->message); termPrint (rd->message);
eprintf (" )"); eprintf (" )");
@ -92,6 +101,19 @@ roledefPrint (Roledef rd)
eprintf ("$"); eprintf ("$");
} }
void
roledefPrint (Roledef rd)
{
roledefPrintGeneric (rd, 1);
}
void
roledefPrintShort (Roledef rd)
{
roledefPrintGeneric (rd, 0);
}
//! Duplicate a single role event node. //! Duplicate a single role event node.
/** /**
*\sa roledefDelete() *\sa roledefDelete()

View File

@ -126,6 +126,7 @@ struct role
typedef struct role *Role; typedef struct role *Role;
void roledefPrint (Roledef rd); void roledefPrint (Roledef rd);
void roledefPrintShort (Roledef rd);
Roledef roledefDuplicate1 (const Roledef rd); Roledef roledefDuplicate1 (const Roledef rd);
Roledef roledefDuplicate (Roledef rd); Roledef roledefDuplicate (Roledef rd);
void roledefDelete (Roledef rd); void roledefDelete (Roledef rd);