From 76fc38b3cdfded2911b464baa7b182b5102318d1 Mon Sep 17 00:00:00 2001 From: Galin Simeonov Date: Thu, 3 Jun 2021 12:38:37 +0300 Subject: work on generated C code --- src/backend/backend.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/backend/backend.h') diff --git a/src/backend/backend.h b/src/backend/backend.h index 1857cd0..8b865fd 100644 --- a/src/backend/backend.h +++ b/src/backend/backend.h @@ -2,6 +2,7 @@ #define BACKEND_H BACKEND_H #include #include +#include /* * describes a given state and the transitions coming out of it @@ -15,4 +16,16 @@ struct State_And_Transitions }; /*returns an array of state_and_transition structs*/ struct State_And_Transitions** extract_transition_table(struct AST_States *states,struct AST_Transitions *transitions); +/*extracts a state from the expression that belongs in the states structure*/ +struct AST_State* extract_state(struct AST *expression,struct AST_States *states); + +void anotate_unchecked_states(struct AST_Translation_Unit *unit,struct Translation_Data *translation_data); +void anotate_machine(struct AST_Machine *machine,struct AST_Translation_Unit *unit,struct Translation_Data *translation_data); +struct AST* anotate_expression(struct AST *expression,struct AST_Translation_Unit *unit,struct AST_Machine *current_machine,struct Translation_Data *translation_data); + +_Bool expression_is_binary(struct AST* expression); +_Bool expression_is_unary(struct AST* expression); +_Bool state_is_in_states(struct AST_State *state,struct AST_States *states); +_Bool check_expression(struct AST *state,struct AST_Translation_Unit *unit); +_Bool check_transition(struct AST *state,struct AST_Translation_Unit *unit); #endif -- cgit v1.2.3