Target predicates may be used for test and set of node attributes or debugging generated code. E.g. the following rule tests whether a node is marked as deleted and removes it from some graphs:
GRS DeleteFromStatementLists(Proc:ProcGlobal)
{
RULES
Body(Proc,PBody),
{* /* This target code is printed after the code for */
/* the preceeding predicate Body */ *},
LinearBlocks(PBody,Block),
* /* and this here is a single line of target code */
Stmts(Block,Ass),
Ass ~ Assign,
{* /* target predicate to test, whether a node was really deleted */
/* is copied to the rule test after the pattern match on Assign */
if (!SimpleSTMT_Assign_get_deleted(Ass))
continue;
*}
==>
DELETE Ass FREE;, // really deallocate Ass
* printf("deleting copy statement %s",STMT_provide_label(Ass));
NOT Stmts(Block,Ass),
NOT list_of_definitions(Proc,Ass)
* /* This here is really the end of the rule */
;
}