#include <stdio.h>
#include "assertion.h"
#include "attr.h"
#include "defines.h"
#include "expr.h"
#include "fsm_arg.h"
#include "func_unit.h"
#include "profiler.h"
#include "util.h"
Functions | |
| attr_param * | attribute_create (const char *name, expression *expr) |
| Creates new attribute parameter based on specified values. | |
| void | attribute_parse (attr_param *ap, const func_unit *funit, bool exclude) |
| Parses and handles specified attribute parameter list. | |
| void | attribute_dealloc (attr_param *ap) |
| Deallocates entire attribute parameter list. | |
|
||||||||||||
|
Creates new attribute parameter based on specified values.
00060 { PROFILE(ATTRIBUTE_CREATE);
00061
00062 attr_param* ap; /* Pointer to newly allocated attribute parameter */
00063
00064 ap = (attr_param*)malloc_safe( sizeof( attr_param ) );
00065 ap->name = strdup_safe( name );
00066 ap->expr = expr;
00067 ap->index = 0;
00068 ap->next = NULL;
00069 ap->prev = NULL;
00070
00071 PROFILE_END;
00072
00073 return( ap );
00074
00075 }
|
|
|
Deallocates entire attribute parameter list. Deallocates all memory for the entire attribute parameter list.
00114 { PROFILE(ATTRIBUTE_DEALLOC);
00115
00116 if( ap != NULL ) {
00117
00118 /* Deallocate the next attribute */
00119 attribute_dealloc( ap->next );
00120
00121 /* Deallocate the name string */
00122 free_safe( ap->name, (strlen( ap->name ) + 1) );
00123
00124 /* Deallocate the expression tree */
00125 expression_dealloc( ap->expr, FALSE );
00126
00127 /* Finally, deallocate myself */
00128 free_safe( ap, sizeof( attr_param ) );
00129
00130 }
00131
00132 PROFILE_END;
00133
00134 }
|
|
||||||||||||||||
|
Parses and handles specified attribute parameter list.
00089 { PROFILE(ATTRIBUTE_PARSE);
00090
00091 if( ap != NULL ) {
00092
00093 if( ap->next != NULL ) {
00094 attribute_parse( ap->next, funit, exclude );
00095 } else {
00096 if( strcmp( ap->name, "covered_fsm" ) == 0 ) {
00097 fsm_arg_parse_attr( ap->prev, funit, exclude );
00098 } else if( strcmp( ap->name, "covered_assert" ) == 0 ) {
00099 assertion_parse_attr( ap->prev, funit, exclude );
00100 }
00101 }
00102
00103 }
00104
00105 PROFILE_END;
00106
00107 }
|
1.3.4