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;
32 bool allow_preprocess;
33 bool suppress_line_advance;
34 std::string last_token;
35 std::deque<std::string> next_tokens;
40 void begin(const std::string &, const std::string &);
41 const std::string &peek_token(unsigned = 0);
42 const std::string &parse_token();
43 void expect(const std::string &);
44 void set_location(const Location &);
45 const Location &get_location() const { return location; }
47 std::string parse_token_();
49 std::string parse_identifier();
50 std::string parse_number();
51 std::string parse_string();
52 std::string parse_other();
53 void skip_comment_and_whitespace();