From b845e4754be86d2216733d9bea75cb301f38739d Mon Sep 17 00:00:00 2001 From: Galin Simeonov Date: Fri, 4 Jun 2021 13:04:36 +0300 Subject: added expressions and the if statement --- src/main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index fe3a9f4..1ad3ae6 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ int main(int argc,char **argv) struct Source *source; struct Program *program; struct Translation_Data *translation_data; - struct AST* translation_unit; + struct AST_Translation_Unit* translation_unit; options=parse_command_line(argc,argv); if(options->src_name==NULL) @@ -38,23 +38,23 @@ int main(int argc,char **argv) print_tokens(translation_data->tokens); }else if(options->target==OPTION_TARGET_AST || options->target==OPTION_TARGET_C) { - //we check because we will probably add more options - - translation_unit=parse_source(translation_data); + translation_unit=(struct AST_Translation_Unit*)parse_source(translation_data); if(has_new_errors(translation_data)) - { - print_errors(translation_data); - return 1; - } + { print_errors(translation_data); return 1; } + + anotate_unchecked_states(translation_unit,translation_data); + + if(has_new_errors(translation_data)) + { print_errors(translation_data); return 1; } if(options->target==OPTION_TARGET_AST) { - print_ast(translation_unit); + print_ast((struct AST*)translation_unit); }else if(options->target==OPTION_TARGET_C) { ast_to_c(options->output_name,translation_unit); } - delete_ast(translation_unit); + delete_ast((struct AST*)translation_unit); } }else -- cgit v1.2.3