bl-compiler

compiler for the bl programming language.
Log | Files | Refs | README

lexer.hpp (361B)


      1 #pragma once
      2 
      3 #include "token.hpp"
      4 
      5 #include <vector>
      6 #include <string>
      7 
      8 class Lexer {
      9 public:
     10     explicit Lexer (const std::string& src);
     11 
     12     std::vector<Token> tokenise();
     13 
     14 private:
     15     int line;
     16     int column;
     17     int position;
     18     std::string src;
     19     std::vector<Token> tokens;
     20 
     21     char advance();
     22     void skipWhitespace();
     23     void skipComment();
     24 };