docs: document parser
This commit is contained in:
@@ -10,18 +10,50 @@
|
|||||||
namespace furc {
|
namespace furc {
|
||||||
namespace front {
|
namespace front {
|
||||||
|
|
||||||
class parser {
|
/**
|
||||||
|
* @brief Parser.
|
||||||
|
*
|
||||||
|
* Furlang's parser.
|
||||||
|
*/
|
||||||
|
class parser final {
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* @brief Construct a new parser from content.
|
||||||
|
*
|
||||||
|
* @param filename Filename for debugging.
|
||||||
|
* @param content Content.
|
||||||
|
*/
|
||||||
parser(std::string_view filename, std::string_view content);
|
parser(std::string_view filename, std::string_view content);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Construct a new parser from file.
|
||||||
|
*
|
||||||
|
* Constructs a lexer with content read from file passed through \p filename.
|
||||||
|
*
|
||||||
|
* @param filename Name of the file.
|
||||||
|
*/
|
||||||
parser(std::string_view filename);
|
parser(std::string_view filename);
|
||||||
~parser() = default;
|
~parser() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Move constructor.
|
||||||
|
*/
|
||||||
parser(parser&&) = default;
|
parser(parser&&) = default;
|
||||||
|
|
||||||
parser(const parser&) = delete;
|
parser(const parser&) = delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Move constructor.
|
||||||
|
*/
|
||||||
parser& operator=(parser&&) = default;
|
parser& operator=(parser&&) = default;
|
||||||
|
|
||||||
parser& operator=(const parser&) = delete;
|
parser& operator=(const parser&) = delete;
|
||||||
public:
|
public:
|
||||||
// parser owns the arena :3c
|
/**
|
||||||
|
* @brief Returns a parsed program.
|
||||||
|
*
|
||||||
|
* @return Handle to an AST node of the program.
|
||||||
|
*/
|
||||||
ast::program_node_h parse() &;
|
ast::program_node_h parse() &;
|
||||||
private:
|
private:
|
||||||
ast::declaration_node_h parse_declaration();
|
ast::declaration_node_h parse_declaration();
|
||||||
|
|||||||
Reference in New Issue
Block a user