5 #include <ail/types.hpp>
6 #include <frith/symbol.hpp>
7 #include <boost/thread/mutex.hpp>
32 subtraction_assignment
,
33 multiplication_assignment
,
36 exponentiation_assignment
,
44 greater_than_or_equal
,
76 anonymous_function_declaration
,
87 lexeme_type::type type
;
91 types::signed_integer signed_integer
;
92 types::unsigned_integer unsigned_integer
;
93 types::floating_point_value floating_point_value
;
98 lexeme(lexeme_type::type type
);
99 explicit lexeme(types::boolean boolean
);
100 explicit lexeme(types::signed_integer signed_integer
);
101 explicit lexeme(types::unsigned_integer unsigned_integer
);
102 explicit lexeme(types::floating_point_value floating_point_value
);
103 explicit lexeme(lexeme_type::type type
, std::string
const & string
);
104 std::string
to_string() const;
110 uword indentation_level
;
111 std::vector
<lexeme
> lexemes
;
116 struct operator_lexeme
118 lexeme_type::type lexeme
;
121 operator_lexeme(lexeme_type::type lexeme
, std::string
const & string
);
122 bool operator<(operator_lexeme
const & other
) const;
128 lexer(std::string
const & input
, std::vector
<line_of_code
> & lines
, std::string
& error
);
133 std::string
const & input
;
134 std::vector
<line_of_code
> & lines
;
142 line_of_code current_line
;
143 bool is_call_bracket
;
145 bool parse_operator(line_of_code
& output
);
146 bool parse_string(line_of_code
& output
, std::string
& error_message
, std::string error_prefix
= "");
147 bool parse_number(line_of_code
& output
, bool & error_occured
);
148 void parse_name(line_of_code
& output
);
149 bool parse_comment(std::string
& error_message
);
151 std::string
lexer_error(std::string
const & message
, uword error_line
= 0);
152 std::string
number_parsing_error(std::string
const & message
, bool & error_occured
);
154 bool is_name_char(char input
);
155 bool string_match(std::string
const & target
);
156 void process_newline();
159 std::string
visualise_lexemes(std::vector
<line_of_code
> & lines
);
161 void initialise_tables();
163 extern boost::mutex table_mutex
;
164 extern std::vector
<operator_lexeme
> operator_lexeme_data
;