Thorin 1.9.0
The Higher ORder INtermediate representation
|
Parses Thorin code into the provided World. More...
#include <thorin/fe/parser.h>
Public Member Functions | |
Parser (World &world) | |
World & | world () |
Driver & | driver () |
void | import (std::string_view sv) |
void | import (Sym, std::ostream *md=nullptr) |
void | import (std::istream &, const fs::path *=nullptr, std::ostream *md=nullptr) |
void | plugin (Sym) |
void | plugin (const char *name) |
const Scopes & | scopes () const |
Parses Thorin code into the provided World.
The logic behind the various parse methods is as follows:
The parse_*
method does not have a std::string_view ctxt
parameter:
It's the caller's responsibility to first make appropriate FIRST/FOLLOW checks. Otherwise, an assertion will be triggered in the case of a syntax error.
The parse_*
method does have a std::string_view ctxt
parameter:
The called method checks this and spits out an appropriate error message using ctxt
in the case of a syntax error.
parse_*
method does have a std::string_view ctxt = {}
parameter with default argument:
|
inline |
void thorin::Parser::import | ( | std::istream & | is, |
const fs::path * | path = nullptr , |
||
std::ostream * | md = nullptr |
||
) |
Definition at line 60 of file parser.cpp.
References thorin::error(), and world().
|
inline |
void thorin::Parser::import | ( | Sym | name, |
std::ostream * | md = nullptr |
||
) |
Definition at line 39 of file parser.cpp.
References thorin::Driver::add_import(), driver(), thorin::Driver::search_paths(), and world().
|
inline |
void thorin::Parser::plugin | ( | Sym | name | ) |
Definition at line 72 of file parser.cpp.
References thorin::bootstrap(), driver(), and thorin::Driver::load().
|
inline |