mirror of
https://github.com/hazemKrimi/jack-vm-translator.git
synced 2026-05-01 18:00:27 +00:00
Complete parser class
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include <parser.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -6,8 +7,15 @@ using namespace std;
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
string path = argv[1];
|
||||
|
||||
if (!regex_match(path, regex("^.+\\.vm"))) {
|
||||
cout << "Wrong file extension!" << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Parser parser(path);
|
||||
|
||||
parser.printFile();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user