Tided up Parser project

This commit is contained in:
Pasha Bibko
2025-05-07 20:33:39 +01:00
parent c472cb5fc5
commit 4509250c4e
12 changed files with 142 additions and 95 deletions

33
Parser/inc/ParserInfo.h Normal file
View File

@@ -0,0 +1,33 @@
#pragma once
#include <LX-Common.h>
// Includes Lexer so it can use LX::Token //
#include <Lexer.h>
namespace LX
{
// Local struct so everything can be public //
struct ParserInfo
{
// Passes constructor args to members //
ParserInfo(const std::vector<Token>& _tokens, const std::filesystem::path& path)
: tokens(_tokens), index(0), len(_tokens.size()), scopeDepth(0), file(path)
{}
// The file that the tokens were generated from //
const std::filesystem::path file;
// Tokens created by the lexer //
const std::vector<Token>& tokens;
// Length of the the token vector //
const size_t len;
// Current index within the token vector //
size_t index;
// Current scope depth //
size_t scopeDepth;
};
}