diff options
author | Galin Simeonov <gts@volconst.com> | 2021-06-03 12:38:37 +0300 |
---|---|---|
committer | Galin Simeonov <gts@volconst.com> | 2021-07-15 18:04:02 +0300 |
commit | 76fc38b3cdfded2911b464baa7b182b5102318d1 (patch) | |
tree | 389223f76086bff07a3cd762683e5a16d34d12d2 /src/backend/targets/C/ast_to_c.h | |
parent | 85b23fbee717f047af5a89eac6f4dba8e7812524 (diff) | |
download | MEGATRON-76fc38b3cdfded2911b464baa7b182b5102318d1.tar.gz |
work on generated C code
Diffstat (limited to 'src/backend/targets/C/ast_to_c.h')
-rw-r--r-- | src/backend/targets/C/ast_to_c.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/backend/targets/C/ast_to_c.h b/src/backend/targets/C/ast_to_c.h index 8c86687..6e4006f 100644 --- a/src/backend/targets/C/ast_to_c.h +++ b/src/backend/targets/C/ast_to_c.h @@ -4,25 +4,53 @@ #include <parser.h> #include <backend.h> #include <ctype.h> +#include <stdio.h> +#include <string.h> struct State_And_Transitions; -void ast_to_c(FILE *out,struct AST *tree); +void ast_to_c(char *output_name,struct AST *tree); + +void ast_translation_unit_to_c_print_header_part(FILE *out,char *base_name,struct AST_Translation_Unit *translation_unit); +void ast_translation_unit_to_c_print_body_part(FILE *out,char *base_name,struct AST_Translation_Unit *translation_unit); +void ast_translation_unit_to_c_print_external_commands(FILE *out,char *base_name,struct AST_Translation_Unit *translation_unit); + +void ast_translation_unit_to_c_print_base_name(FILE *out, char *base_name); +void ast_translation_unit_to_c_print_header_string(FILE *out,char *base_name,char *file_suffix); +void ast_translation_unit_to_c_print_footer_string(FILE *out,char *base_name,char *file_suffix); + +void ast_translation_unit_to_c(FILE *out,struct AST_Translation_Unit *translation_unit); void ast_machine_to_c(FILE *out,struct AST_Machine *machine); void ast_machine_to_c_make_header_part(FILE *out,struct AST_Machine *machine); void ast_machine_to_c_make_body_part(FILE *out,struct AST_Machine *machine); + void ast_events_to_c(FILE *out,struct AST_Machine *machine); void ast_states_to_c(FILE *out,struct AST_Machine *machine); -void ast_pipeline_to_c(FILE *out,size_t indentation,struct AST_Pipeline *pipeline); void ast_command_to_c(FILE *out,struct AST_Command *command,char *hold_buffer); -void ast_command_to_c_signature(FILE *out,struct AST_Command *command); + +/*note the ordering*/ +void ast_command_to_c_extern_declaration(struct AST_Command *command,FILE *out); + +void ast_pipeline_to_c(FILE *out,size_t indentation,struct AST_Pipeline *pipeline); void ast_transitions_of_state_to_c(FILE *out,struct AST_Machine *machine,struct State_And_Transitions *vector); void ast_token_to_c(FILE *out,struct token *token); -void ast_event_name_to_c(FILE *out,struct AST_Machine *machine); +void ast_machine_enum_tag(FILE *out,struct AST_Machine *machine); void ast_state_to_c_signature(FILE *out,struct AST_Machine *machine,struct AST_State *state); +void ast_state_to_c_function_name(FILE *out,struct AST_Machine *machine,struct AST_State *state); +void ast_machines_to_c_array(FILE *out,struct AST_Translation_Unit *translation_unit); +void ast_machines_to_c_enum(FILE *out,struct AST_Translation_Unit *translation_unit); +void ast_event_to_c_enum(FILE *out,struct AST_Machine *machine,struct AST_Event *event); + + +void ast_to_c_print_internal_stuff_for_header(FILE *out,struct AST_Translation_Unit *translation_unit); +void ast_to_c_print_internal_stuff_for_body(FILE *out); +void ast_to_c_print_comment(FILE *out,char *comment); + + + /* :X */ void ast_to_c_print_tabs(FILE *out,size_t number_of_tabs); |