X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ftokenizer.h;h=20ea756a9099ea192368f60750f791e0238624c3;hb=7f29c6d2a4eee36538d7ccf24980e749592e2444;hp=a7329182df53fcf5c8d7fd0cc844eb206c4f408f;hpb=d3ceb2186dc79130508093b3d0c944771a53534f;p=libs%2Fgl.git diff --git a/source/glsl/tokenizer.h b/source/glsl/tokenizer.h index a7329182..20ea756a 100644 --- a/source/glsl/tokenizer.h +++ b/source/glsl/tokenizer.h @@ -15,6 +15,9 @@ struct Location { std::string name; unsigned line; + + Location(): line(0) { } + Location(const std::string &n, unsigned l): name(n), line(l) { } }; class Tokenizer @@ -27,6 +30,7 @@ private: std::string::const_iterator source_end; Location location; bool allow_preprocess; + bool suppress_line_advance; std::string last_token; std::deque next_tokens; @@ -37,12 +41,14 @@ public: const std::string &peek_token(unsigned = 0); const std::string &parse_token(); void expect(const std::string &); + void set_location(const Location &); const Location &get_location() const { return location; } private: std::string parse_token_(); void preprocess(); std::string parse_identifier(); std::string parse_number(); + std::string parse_string(); std::string parse_other(); void skip_comment_and_whitespace(); };