Files
BlitzLLVM/code_compiler/source/parser.hpp
T
2025-01-25 19:26:49 +01:00

29 lines
725 B
C++

/// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2017-2025 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include <filesystem>
#include <memory>
#include "ast/ast.hpp"
#include "lexer.hpp"
namespace blitz {
class parser {
std::filesystem::path _file;
std::shared_ptr<blitz::lexer> _lexer;
std::shared_ptr<blitz::ast::node> _expr;
public:
~parser();
parser(std::filesystem::path file);
std::shared_ptr<blitz::ast::node> current();
std::shared_ptr<blitz::ast::node> next();
private:
std::shared_ptr<blitz::ast::node> try_parse(blitz::token token);
std::shared_ptr<blitz::ast::node> try_parse_variable();
};
} // namespace blitz