From c76f66c96872eee147fa58c4abc9d0f058468319 Mon Sep 17 00:00:00 2001 From: Valk Richard Li <48872266+ValKmjolnir@users.noreply.github.com> Date: Tue, 24 Sep 2019 09:41:00 -0500 Subject: [PATCH] Finished loop while and if-else --- version1.0/nasal_parser.h | 1168 +++++++++++++++---------------------- 1 file changed, 473 insertions(+), 695 deletions(-) diff --git a/version1.0/nasal_parser.h b/version1.0/nasal_parser.h index fa6a5a8..cd88af1 100644 --- a/version1.0/nasal_parser.h +++ b/version1.0/nasal_parser.h @@ -109,255 +109,287 @@ class nasal_parser return; } void parse_main_work(); - void definition_expr(); - void assignment_expr(); - void while_loop_expr(); - void for_loop_expr();// - void foreach_index_loop_expr();// - void loop_expr(); - void if_else_expr();// - void function_expr(); - - void list_init_generator(); - void hash_init_generator(); - void list_search_expr(); - void hash_search_expr(); - void call_function_expr(); - void identifier_begin_expr(); void number_begin_expr(); void string_begin_expr(); - void link_expr(); - void add_sub_expr(); - void mul_div_expr(); + void identifier_begin_expr(); + void call_list_expr(); + void call_function_expr(); + void call_hash_expr(); + void list_generate_expr(); + void hash_generate_expr(); + void definition_expr(); + void assignment_expr(); + void loop_expr(); + void if_else_expr(); + void add_sub_operator_expr(); + void mul_div_operator_expr(); + void link_operator_expr(); void compare_operator_expr(); + void check_semi_at_end(); + void statements_block(); + void function_generate_expr(); void return_expr(); }; +void nasal_parser::check_semi_at_end() +{ + get_token(); + if(this_token.type!=__semi) + { + ++error; + std::cout<<">>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<>[Error] line "<