#include <mim/ast/lexer.h>
Public Member Functions | |
| Lexer (Driver &driver, const fe::Src &src, std::ostream *md=nullptr) | |
| Creates a lexer to read *.mim files (see Lexical Structure). | |
| Lexer (Driver &driver, std::string_view buf, std::ostream *md=nullptr) | |
| As above, but the Locations of the Toks produced have no fe::Src to resolve against. | |
| Driver & | driver () |
| fe::Lexer's default diagnostics go to its Driver::error. | |
| Tok | lex () |
Static Public Member Functions | |
| static bool | is_id (std::string_view str) |
Does str match the id production - the same rule Lexer::lex_id applies to the input? | |
| static std::string | escape (std::string_view str) |
Inverse of Lexer::lex_char: renders str as the body of a Mim string literal. | |
Friends | |
| class | fe::Lexer< 3, Lexer > |
|
inline |
Creates a lexer to read *.mim files (see Lexical Structure).
If md is not nullptr, a Markdown output will be generated.
Definition at line 19 of file lexer.h.
References driver(), and Lexer().
Referenced by fe::Lexer< 3, Lexer >, mim::ast::Parser::import(), Lexer(), and Lexer().
|
inline |
|
inline |
|
static |
Inverse of Lexer::lex_char: renders str as the body of a Mim string literal.
Definition at line 199 of file lexer.cpp.
References escape().
Referenced by mim::World::dump(), escape(), and mim::ast::UseDecl::stream().
|
static |
| Tok mim::ast::Lexer::lex | ( | ) |
|
friend |