X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ftokenizer.h;h=20ea756a9099ea192368f60750f791e0238624c3;hb=1083ad150c902bd153f88f7fb28660b4f31cf9fe;hp=a7329182df53fcf5c8d7fd0cc844eb206c4f408f;hpb=9d798ac368bfd236a7632a3a15e51bd1112ea63d;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(); };