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
,
85 namespace lexeme_group
97 typedef std::vector
<lexeme
> lexeme_container
;
101 lexeme_type::type type
;
105 types::signed_integer signed_integer
;
106 types::unsigned_integer unsigned_integer
;
107 types::floating_point_value floating_point_value
;
108 std::string
* string
;
112 lexeme(lexeme_type::type type
);
113 explicit lexeme(types::boolean boolean
);
114 explicit lexeme(types::signed_integer signed_integer
);
115 explicit lexeme(types::unsigned_integer unsigned_integer
);
116 explicit lexeme(types::floating_point_value floating_point_value
);
117 explicit lexeme(lexeme_type::type type
, std::string
const & string
);
118 std::string
to_string() const;
124 uword indentation_level
;
125 lexeme_container lexemes
;
130 struct operator_lexeme
132 lexeme_type::type lexeme
;
135 operator_lexeme(lexeme_type::type lexeme
, std::string
const & string
);
136 bool operator<(operator_lexeme
const & other
) const;
142 lexer(std::string
const & input
, std::vector
<line_of_code
> & lines
, std::string
& error
);
147 std::string
const & input
;
148 std::vector
<line_of_code
> & lines
;
156 line_of_code current_line
;
157 bool is_call_bracket
;
159 bool parse_operator(line_of_code
& output
);
160 bool parse_string(line_of_code
& output
, std::string
& error_message
, std::string error_prefix
= "");
161 bool parse_number(line_of_code
& output
, bool & error_occured
);
162 void parse_name(line_of_code
& output
);
163 bool parse_comment(std::string
& error_message
);
165 std::string
lexer_error(std::string
const & message
, uword error_line
= 0);
166 std::string
number_parsing_error(std::string
const & message
, bool & error_occured
);
168 bool is_name_char(char input
);
169 bool string_match(std::string
const & target
);
170 void process_newline();
173 std::string
visualise_lexemes(std::vector
<line_of_code
> & lines
);
175 void initialise_tables();
177 bool get_lexeme_group(lexeme_type::type input
, lexeme_group::type
& output
);
179 extern boost::mutex table_mutex
;
180 extern std::vector
<operator_lexeme
> operator_lexeme_data
;