Files
BlitzLLVM/code_compiler/source/parser.hpp
T

29 lines
725 B
C++
Raw Normal View History

2024-06-25 18:59:15 +02:00
/// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2017-2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
2024-06-26 00:31:06 +02:00
#include <filesystem>
2025-01-25 16:27:50 +01:00
#include <memory>
2024-06-06 13:37:13 +02:00
#include "ast/ast.hpp"
2024-06-26 00:31:06 +02:00
#include "lexer.hpp"
namespace blitz {
class parser {
2025-01-25 16:27:50 +01:00
std::filesystem::path _file;
std::shared_ptr<blitz::lexer> _lexer;
2024-06-26 00:31:06 +02:00
2025-01-25 16:27:50 +01:00
std::shared_ptr<blitz::ast::node> _expr;
public:
2024-06-06 14:04:34 +02:00
~parser();
2025-01-25 16:27:50 +01:00
parser(std::filesystem::path file);
2025-01-25 16:27:50 +01:00
std::shared_ptr<blitz::ast::node> current();
std::shared_ptr<blitz::ast::node> next();
private:
2025-01-25 16:27:50 +01:00
std::shared_ptr<blitz::ast::node> try_parse(blitz::token token);
std::shared_ptr<blitz::ast::node> try_parse_variable();
};
2025-01-25 16:27:50 +01:00
} // namespace blitz