made slight changes

This commit is contained in:
avinal
2020-08-21 17:54:14 +05:30
parent 1a8a9d38ac
commit c59bd2122c
2 changed files with 16 additions and 1 deletions

View File

@@ -75,4 +75,19 @@ void parser::parse()
std::vector<vmcommand> parser::get_commands()
{
return this->parsed;
}
bool parser::change_file(std::string name)
{
this->parsed.clear();
this->input_file = name;
if (this->parsed.size() == 0 && input_file == name)
{
return true;
}
else
{
return false;
}
}

View File

@@ -27,7 +27,7 @@ private:
std::vector<vmcommand> parsed;
public:
parser(std::string file) : input_file(file) {}
bool change_file(std::string name);
std::vector<vmcommand> get_commands();
c_type command_type(std::string com);
void parse();