From 2bc1df613516a56c58f5233fa817534323d3bdc5 Mon Sep 17 00:00:00 2001 From: ccremers Date: Thu, 14 Oct 2004 13:19:36 +0000 Subject: [PATCH] - Improved readability of printed claims. - Fixed comment. --- src/main.c | 38 ++++++++++++++++++++++++++++---------- src/role.h | 3 ++- src/todo.txt | 3 +++ 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/main.c b/src/main.c index 6adc62a..34735b5 100644 --- a/src/main.c +++ b/src/main.c @@ -757,19 +757,37 @@ timersPrint (const System sys) anyclaims = 0; while (cl_scan != NULL) { - /** - * for now, we don't print the actual claim label. - *@todo When termPrint can also go to stderr, fix this. - */ anyclaims = 1; eprintf ("claim\t"); - termPrint (cl_scan->type); - eprintf ("\t"); - termPrint (cl_scan->rolename); - eprintf (" ("); - termPrint (cl_scan->label); - eprintf (")\tfound:\t"); + + /* claim label is tuple */ + if (realTermTuple (cl_scan->label)) + { + /* modern version: claim label is tuple (protocname, label) */ + /* first print protocol.role */ + termPrint (cl_scan->label->left.op1); + eprintf ("."); + termPrint (cl_scan->rolename); + eprintf ("\t"); + /* second print event_label */ + termPrint (cl_scan->type); + eprintf ("_"); + termPrint (cl_scan->label->right.op2); + eprintf ("\t"); + } + else + { + /* old-fashioned output */ + termPrint (cl_scan->type); + eprintf ("\t"); + termPrint (cl_scan->rolename); + eprintf (" ("); + termPrint (cl_scan->label); + eprintf (")\t"); + } + /* print counts etc. */ + eprintf ("found:\t"); statesFormat (cl_scan->count); if (cl_scan->count > 0) { diff --git a/src/role.h b/src/role.h index 777e14d..e418b23 100644 --- a/src/role.h +++ b/src/role.h @@ -18,7 +18,8 @@ struct claimlist Term type; //! The term element for this node. Term label; - //! The pointer to the protocol (not defined yet?) + //! The pointer to the protocol (not defined typically, because + //! at compile time of the claim the protocol structure is not known yet.) void *protocol; //! The name of the role in which it occurs. Term rolename; diff --git a/src/todo.txt b/src/todo.txt index b49d238..2c039a0 100644 --- a/src/todo.txt +++ b/src/todo.txt @@ -1,3 +1,6 @@ +- Make different error codes for compilation error/ other error. This can be + useful for scripts. However, it might shift some constants for the Elegast + scripts. - Consider where in Arachne dependency graph is used. If this is only for pruning states, we can construct it there only. However, the base 'role defs/bindings' graph might be re-used.