1 #ifndef MSP_GL_SL_TOKENIZER_H_
2 #define MSP_GL_SL_TOKENIZER_H_
6 #include <sigc++/signal.h>
19 Location(): line(0) { }
20 Location(const std::string &n, unsigned l): name(n), line(l) { }
26 sigc::signal<void> signal_preprocess;
29 std::string::const_iterator iter;
30 std::string::const_iterator source_end;
33 bool allow_preprocess;
34 bool suppress_line_advance;
35 std::string last_token;
36 std::deque<std::string> next_tokens;
41 void begin(const std::string &, const std::string &);
42 const std::string &peek_token(unsigned = 0);
43 const std::string &parse_token();
44 const std::string &get_last_token() const { return last_token; }
45 void expect(const std::string &);
46 void set_location(const Location &);
47 void clear_progress_mark() { progress_mark = false; }
48 bool get_progress_mark() const { return progress_mark; }
49 const Location &get_location() const { return location; }
51 std::string parse_token_();
53 std::string parse_identifier();
54 std::string parse_number();
55 std::string parse_string();
56 std::string parse_other();
57 void skip_comment_and_whitespace();