aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorGalin Simeonov <gts@volconst.com>2021-06-04 13:04:36 +0300
committerGalin Simeonov <gts@volconst.com>2021-07-15 18:04:02 +0300
commitb845e4754be86d2216733d9bea75cb301f38739d (patch)
tree5ba6355d1cb36b1bfaadf82781796b1c42b9202b /src/main.c
parent76fc38b3cdfded2911b464baa7b182b5102318d1 (diff)
downloadMEGATRON-b845e4754be86d2216733d9bea75cb301f38739d.tar.gz
added expressions and the if statement
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c20
1 files changed, 10 insertions, 10 deletions
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