aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
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