but it just gives me an endless supply of inputs
Well, what is happening here is that you have an infinite loop, because of
if (File.str().empty())
{
break;
}
will never terminate unless your file never ever hand any content in it.
Instead, you should probably check if you've reached the end of the stream. With these changes, your last two functions would look something like this:
void lexer(std::string content)
{
//Super basic lexer, going to add more later...
std::string token;
std::stringstream stringStream(content);
while (!stringStream.eof())
{
stringStream >> token;
tokens.push_back(token);
}
}
void execute()
{
for (int i = 0; i < tokens.size(); i++)
{
std::cout << tokens[i];
}
}