47 lines
1,014 B
C
47 lines
1,014 B
C
|
|
/**
|
||
|
|
* @file push_counter.h
|
||
|
|
* @brief Push_Counter: a visitor that counts Push mnemonics.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#ifndef PUSH_COUNTER_H
|
||
|
|
#define PUSH_COUNTER_H
|
||
|
|
|
||
|
|
#include <stddef.h>
|
||
|
|
#include "visitor.h"
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Forward declaration of non-derivable class Push_Counter.
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
typedef struct _push_counter_t push_counter_t;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Push_Counter vtable is identical to Visitor vtable (no new methods).
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
typedef visitor_vtable_t push_counter_vtable_t;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Constructs a Push_Counter with count initialized to 0.
|
||
|
|
*
|
||
|
|
* @return A newly allocated Push_Counter.
|
||
|
|
*/
|
||
|
|
push_counter_t* push_counter_build_default(void);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Destroys a Push_Counter.
|
||
|
|
*
|
||
|
|
* @param self The Push_Counter (can be NULL).
|
||
|
|
*/
|
||
|
|
void push_counter_destroy(push_counter_t *self);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Returns the number of Push mnemonics visited.
|
||
|
|
*
|
||
|
|
* @param self The Push_Counter.
|
||
|
|
* @pre self != NULL.
|
||
|
|
* @return The count of Push mnemonics.
|
||
|
|
*/
|
||
|
|
size_t push_counter_count(const push_counter_t *const self);
|
||
|
|
|
||
|
|
#endif /* PUSH_COUNTER_H */
|