5 #include <ail/types.hpp>
6 #include <fridh/symbol.hpp>
7 #include <fridh/lexer.hpp>
11 namespace statement_processing
20 struct sorted_binary_operator_entry
30 bool process_module(std::string
const & path
, std::string
const & name
, module
& output
, std::string
& error_message
);
39 uword indentation_level
;
45 uword nested_class_level
;
49 symbol_tree_node
* current_node
;
51 bool name_is_used(std::string
const & name
);
52 std::string
const & get_declaration_name();
53 void name_collision_check();
54 symbol_tree_node
& add_name(symbol::type symbol_type
);
56 void process_body(executable_units
* output
= 0, bool increment
= true);
58 void process_atomic_statement(lexeme_container
& lexemes
, std::size_t & offset
, parse_tree_nodes
& output
, bool allow_multi_statements
= false, lexeme_type::type terminator
= lexeme_type::non_terminating_placeholder
, bool allow_empty_statements
= false);
59 void process_offset_atomic_statement(parse_tree_node
& output
, std::size_t offset
= 0);
60 void process_composite_term(parse_tree_node
& output
);
62 bool is_if_statement();
64 bool process_if(executable_unit
& output
);
65 bool process_while(executable_unit
& output
);
66 bool process_for(executable_unit
& output
);
67 bool process_return(executable_unit
& output
);
70 bool process_function(function
* output
= 0);
71 void process_statement(executable_unit
& output
);
72 bool process_line(executable_unit
* output
= 0);
74 bool translate_data(module
& target_module
, std::string
const & data
, std::string
const & module_name
, std::string
& error_message_output
);
76 lexeme_container
& get_lexemes();
78 void error(std::string
const & message
);
79 void single_lexeme_error(std::string
const & message
, std::size_t offset
);
80 void double_lexeme_error(std::string
const & message
, std::size_t offset
);
82 void process_node_group(parse_tree_nodes
& arguments
, parse_tree_nodes
& output
);
83 void operator_resolution(parse_tree_nodes
& input
, parse_tree_node
& output
);
88 void lexeme_to_argument_node(lexeme
& input
, parse_tree_node
& output
);
89 void lexeme_to_unary_operator_node(lexeme
& input
, parse_tree_node
& output
);
90 void lexeme_to_binary_operator_node(lexeme
& input
, parse_tree_node
& output
);
92 word
get_unary_operator_precedence(unary_operator_type::type input
);
93 word
get_binary_operator_precedence(binary_operator_type::type input
);
94 bool get_parse_tree_node_precedence(parse_tree_node
& input
, word
& output
);
96 bool is_right_to_left_operator(parse_tree_node
& input
);
98 bool is_unary_post_fix_operator(lexeme_type::type input
);