Parse variable declarations
This commit is contained in:
35
include/elna/source/driver.hpp
Normal file
35
include/elna/source/driver.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <list>
|
||||
#include "elna/source/ast.hpp"
|
||||
#include "location.hh"
|
||||
|
||||
namespace elna::source
|
||||
{
|
||||
position make_position(const yy::location& location);
|
||||
|
||||
class syntax_error final : public error
|
||||
{
|
||||
std::string message;
|
||||
|
||||
public:
|
||||
syntax_error(const std::string& message,
|
||||
const std::filesystem::path& input_file, const yy::location& location);
|
||||
|
||||
virtual std::string what() const override;
|
||||
};
|
||||
|
||||
class driver
|
||||
{
|
||||
std::list<std::unique_ptr<struct error>> m_errors;
|
||||
const std::filesystem::path input_file;
|
||||
|
||||
public:
|
||||
std::unique_ptr<program> tree;
|
||||
|
||||
driver(const std::filesystem::path& input_file);
|
||||
|
||||
void error(const yy::location& loc, const std::string& message);
|
||||
const std::list<std::unique_ptr<struct error>>& errors() const noexcept;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user