]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Tokenizer.h
added comments (/*…*/ and //…\n)
[l2e.git] / src / loader / Tokenizer.h
index 6dda20fad0b9744fe6578fdb203b5b50be2000b7..dff96fc6167495769ba82d5a56bd57d6dc9f497a 100644 (file)
@@ -18,7 +18,8 @@ namespace loader {
 class Tokenizer {
 
 public:
-       explicit Tokenizer(std::istream &in) : in(in), line(1), isPutback(false) { }
+       explicit Tokenizer(std::istream &in)
+       : in(in), line(1), isPutback(false), skipComments(true) { }
        ~Tokenizer() { }
 private:
        Tokenizer(const Tokenizer &);
@@ -47,6 +48,7 @@ public:
                        KEYWORD_TRUE = 't',
                        IDENTIFIER = 'x',
                        TYPE_NAME = 'n',
+                       COMMENT = 'c'
                };
 
                Token() : type(UNKNOWN), number(0) { }
@@ -81,6 +83,9 @@ private:
        Token ReadString();
        Token ReadIdentifier();
 
+       Token ReadComment();
+       Token ReadMultilineComment();
+
        bool CheckKeyword(Token &);
 
 private:
@@ -88,6 +93,7 @@ private:
        Token putback;
        int line;
        bool isPutback;
+       bool skipComments;
 
 };