24 #ifndef FSM_GENERATION_DEFS
25 #define FSM_GENERATION_DEFS
27 #define STATE_VARIABLE_NAME "FSM%d_STATE"
28 #define STATE_VARIABLE_NAME_NO_REF "FSM_STATE"
29 #define FSM_BEGIN_COMMENT "! BEGIN FSM, %s\n"
30 #define FSM_TRANSITION_COMMENT "! Transition %s=%d\n"
38 string intrinsic_name);
59 int assignement_value);
const char * module_name(const char *s)
Return the module part of an entity name.
statement fsmize_statement(statement stat, entity state_variable, const char *module_name)
This function is recursively called during FSMization.
statement make_fsm_transitions_statement(statement stat, entity state_variable, const char *module_name)
This function build and return a statement representing the transitions computation in the FSM,...
statement make_state_variable_assignement_statement(statement stat, entity state_variable, int assignement_value)
This function build and return a statement representing the initial assigment of the state_variable,...
statement make_transition_statement(control current_node, statement root_statement, entity state_variable, const char *module_name)
This function build a transition statement (a TEST statement) corresponding to the current control cu...
entity create_state_variable(const char *module_name, int name_identifier)
This function creates (and add declaration) state variable.
statement make_fsm_from_statement(statement stat, entity state_variable, const char *module_name)
This function build and return a statement representing the FSM code equivalent to the given unstruct...
int exit_state_variable_value_for_unstructured(statement stat)
Return the state variable value corresponding to the exit in a unstructured statement NB: always retu...
statement make_reset_state_variable_statement(statement stat, entity state_variable)
This function build and return a statement representing the initial assigment of the state_variable,...
int entry_state_variable_value_for_unstructured(statement stat)
Return the state variable value corresponding to the entry in a unstructured statement.
expression make_expression_with_state_variable(entity state_variable, int value, string intrinsic_name)
Build and return an expression (eg.