- Added '--remove-claims' switch to cut off all existing claims.

This commit is contained in:
ccremers 2005-12-27 13:53:49 +00:00
parent ca4c5674ac
commit ccc4c34823
3 changed files with 179 additions and 156 deletions

View File

@ -463,6 +463,8 @@ commEvent (int event, Tac tc)
break;
case CLAIM:
if (!switches.removeclaims)
{
/* now parse tuple info */
if (trip == NULL || trip->next == NULL)
{
@ -489,7 +491,7 @@ commEvent (int event, Tac tc)
}
if (!inTermlist (claim->stype, TERM_Claim))
{
printf ("ERROR: unknown claim type ");
printf ("error: unknown claim type ");
termPrint (claim);
errorTac (trip->next->lineno);
}
@ -516,7 +518,8 @@ commEvent (int event, Tac tc)
if (label == NULL)
{
error ("Claim should have label on line %i.", trip->next->lineno);
error ("Claim should have label on line %i.",
trip->next->lineno);
}
// First check whether label is unique
cl = sys->claimlist;
@ -539,7 +542,8 @@ commEvent (int event, Tac tc)
cl->rolename = fromrole;
cl->role = thisRole;
if (!isTermEqual (fromrole, thisRole->nameterm))
error ("Claim role does not correspond to execution role at line %i.",
error
("Claim role does not correspond to execution role at line %i.",
tc->lineno);
cl->roledef = NULL;
cl->count = 0;
@ -615,10 +619,11 @@ commEvent (int event, Tac tc)
/* hmm, no handler yet */
printf ("ERROR: No know handler for this claim type: ");
printf ("error: No know handler for this claim type: ");
termPrint (claim);
printf (" ");
errorTac (trip->next->lineno);
}
break;
}
/* and make that event */
@ -670,7 +675,7 @@ roleCompile (Term nameterm, Tac tc)
}
if (thisRole == NULL)
{
printf ("ERROR: undeclared role name ");
printf ("error: undeclared role name ");
termPrint (nameterm);
printf (" in line ");
errorTac (tc->lineno);
@ -710,7 +715,7 @@ roleCompile (Term nameterm, Tac tc)
default:
if (!normalDeclaration (tc))
{
printf ("ERROR: illegal command %i in role ", tc->op);
printf ("error: illegal command %i in role ", tc->op);
termPrint (thisRole->nameterm);
printf (" ");
errorTac (tc->lineno);
@ -812,7 +817,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
if (levelFind (prots, level) != NULL)
{
printf ("ERROR: Double declaration of protocol ");
printf ("error: Double declaration of protocol ");
symbolPrint (prots);
printf (" ");
errorTac (tc->lineno);
@ -871,7 +876,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
}
else
{
printf ("ERROR: undeclared role ");
printf ("error: undeclared role ");
symbolPrint (tc->t1.sym);
printf (" in protocol ");
termPrint (pr->nameterm);
@ -881,7 +886,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
default:
if (!normalDeclaration (tc))
{
printf ("ERROR: illegal command %i in protocol ", tc->op);
printf ("error: illegal command %i in protocol ", tc->op);
termPrint (thisProtocol->nameterm);
errorTac (tc->lineno);
}
@ -915,7 +920,7 @@ tacProcess (Tac tc)
default:
if (!normalDeclaration (tc))
{
printf ("ERROR: illegal command %i at the global level.\n",
printf ("error: illegal command %i at the global level.\n",
tc->op);
errorTac (tc->lineno);
}

View File

@ -74,6 +74,7 @@ switchesInit (int argc, char **argv)
// Misc
switches.switchP = 0; // multi-purpose parameter
switches.experimental = 0; // experimental stuff defaults to 0, whatever that means.
switches.removeclaims = false; // default: leave claims from spdl file
// Output
switches.output = SUMMARY; // default is to show a summary
@ -378,6 +379,22 @@ switcher (const int process, int index)
}
}
if (detect (' ', "remove-claims", 0))
{
if (!process)
{
/* discourage:
*
* Causes all existing claims in the specification to be skipped.
*/
}
else
{
switches.removeclaims = true;
return index;
}
}
/* ==================
* Bounding options
*/

View File

@ -53,6 +53,7 @@ struct switchdata
// Misc
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.
int experimental; //!< Experimental stuff goes here until it moves into main stuff.
int removeclaims; //!< Remove any claims in the spdl file
// Output
int output; //!< From enum outputs: what should be produced. Default ATTACK.