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
,
74 anonymous_function_declaration
,
83 lexeme_type::type type
;
87 types::signed_integer signed_integer
;
88 types::unsigned_integer unsigned_integer
;
89 types::floating_point_value floating_point_value
;
94 lexeme(lexeme_type::type type
);
95 explicit lexeme(types::boolean boolean
);
96 explicit lexeme(types::signed_integer signed_integer
);
97 explicit lexeme(types::unsigned_integer unsigned_integer
);
98 explicit lexeme(types::floating_point_value floating_point_value
);
99 explicit lexeme(lexeme_type::type type
, std::string
const & string
);
100 std::string
to_string() const;
106 uword indentation_level
;
107 std::vector
<lexeme
> lexemes
;
112 struct operator_lexeme
114 lexeme_type::type lexeme
;
117 operator_lexeme(lexeme_type::type lexeme
, std::string
const & string
);
118 bool operator<(operator_lexeme
const & other
) const;
124 lexer(std::string
const & input
, std::vector
<line_of_code
> & lines
, std::string
& error
);
129 std::string
const & input
;
130 std::vector
<line_of_code
> & lines
;
138 line_of_code current_line
;
140 bool parse_operator(line_of_code
& output
);
141 bool parse_string(line_of_code
& output
, std::string
& error_message
, std::string error_prefix
= "");
142 bool parse_number(line_of_code
& output
, bool & error_occured
);
143 void parse_name(line_of_code
& output
);
144 bool parse_comment(std::string
& error_message
);
146 std::string
lexer_error(std::string
const & message
, uword error_line
= 0);
147 std::string
number_parsing_error(std::string
const & message
, bool & error_occured
);
149 bool is_name_char(char input
);
150 bool string_match(std::string
const & target
);
151 void process_newline();
154 std::string
visualise_lexemes(std::vector
<line_of_code
> & lines
);
156 void initialise_tables();
158 extern boost::mutex table_mutex
;
159 extern std::vector
<operator_lexeme
> operator_lexeme_data
;