Files
BlitzLLVM/code_compiler/source/parser.hpp
T
Michael Fabian 'Xaymar' Dirks dfe3e88dbd Lexer done for now, moving on to ast
2024-06-26 00:31:45 +02:00

55 lines
1.2 KiB
C++

/// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2017-2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include <filesystem>
#include "ast/ast.hpp"
#include "lexer.hpp"
namespace blitz {
class parser {
std::filesystem::path _file;
public:
~parser();
parser(std::filesystem::path file);
};
} // namespace blitz
/*
#include <fstream>
#include <map>
#include <memory>
#include <stack>
#include <string>
#include "ast/value.hpp"
#include "lexer.hpp"
namespace blitz {
class parser {
public:
parser(std::string file);
~parser();
std::unique_ptr<ast::expression> parse();
protected:
void log(const char* msg, ...);
void log_error(const char* msg, ...);
private:
std::pair<blitz::lexer::tokentype, std::string> next();
private:
std::unique_ptr<ast::expression> parse_expression();
std::unique_ptr<ast::NumberExpression> parse_number(blitz::lexer::tokentype token, std::string value);
std::unique_ptr<ast::DecimalExpression> parse_decimal(blitz::lexer::tokentype token, std::string value);
private:
lexer m_lexer;
std::stack<std::pair<std::string, std::shared_ptr<std::istream>>> m_files;
};
}
*/