8#ifndef SEN_CORE_LANG_STL_SCANNER_H
9#define SEN_CORE_LANG_STL_SCANNER_H
53 void error(
const std::string& message)
const;
54 void string(
char endingChar);
57 void number(Sign sign);
61 [[nodiscard]]
bool isAtEnd()
const;
62 [[nodiscard]]
char advance();
63 [[nodiscard]]
bool match(
char expected);
64 [[nodiscard]]
char peek()
const;
65 [[nodiscard]]
char peekNext()
const;
66 [[nodiscard]]
StlToken identifierToken()
const;
67 [[nodiscard]]
static std::string formatNumber(
const std::string& lexeme);
70 const std::string& program_;
72 std::size_t start_ = 0U;
Here we define a set of template meta-programming helpers to let the compiler take some decisions bas...
StlScanner(const std::string &program)
The string is stored for eventual scanning.
const StlTokenList & scanTokens()
Scans the string. Throws in case of error.
std::vector< StlToken > StlTokenList
Definition stl_token.h:121
StlTokenType
Supported tokens.
Definition stl_token.h:28
Location of a character in a program.
Definition code_location.h:21
Definition code_location.h:14
Can hold any supported value type. Wraps std::variant to allow recursion and implements some helpers.
Definition var.h:119
Definition stl_token.h:98