Lexer class, the purpose of which is to take raw source code as its input and produce a list of Tokens that correspond to it as its output.
More...
#include <Lexer.hpp>
|
| Lexer (const Code::Source &source_code, bool initialize_source) |
| Initialize a lexer object.
|
|
std::vector< Token > | operator() () const |
| Process the source code given to the lexer and output its tokenized form.
|
|
void | appendIncludeDirectories (const std::vector< std::string > &new_directories) const |
| Append a list of custom directories to the include paths list.
|
|
|
static bool | isDigit (char c, Token::NumberBase base) |
| Determine whether a character is a digit for a given number system base.
|
|
Lexer class, the purpose of which is to take raw source code as its input and produce a list of Tokens that correspond to it as its output.
◆ Lexer()
linc::Lexer::Lexer |
( |
const Code::Source & | source_code, |
|
|
bool | initialize_source ) |
|
explicit |
Initialize a lexer object.
- Parameters
-
source_code | The actual source code to be tokenized. |
initialize_source | Whether to initialize the source code representation used for reporting errors. To be used for files that directly go through language analysis, i.e. not via include directives. |
◆ appendIncludeDirectories()
void linc::Lexer::appendIncludeDirectories |
( |
const std::vector< std::string > & | new_directories | ) |
const |
|
inline |
Append a list of custom directories to the include paths list.
- Parameters
-
new_directories | The new paths to be appended. |
◆ isDigit()
Determine whether a character is a digit for a given number system base.
- Returns
- Boolean corresponding to the result of the test.
◆ operator()()
auto linc::Lexer::operator() |
( |
| ) |
const |
Process the source code given to the lexer and output its tokenized form.
- Returns
- The list of tokens that correspond to the original source code.
The documentation for this class was generated from the following files:
- lexer/Lexer.hpp
- Lexer.cpp