Компилятор и вм милана

This commit is contained in:
2025-05-22 15:19:31 +03:00
parent 9cad2ede63
commit 6da094ebbf
48 changed files with 6789 additions and 0 deletions

32
lab4/cmilan/src/main.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include "parser.h"
#include <iostream>
#include <cstdlib>
using namespace std;
void printHelp()
{
cout << "Usage: cmilan input_file" << endl;
}
int main(int argc, char** argv)
{
if(argc < 2) {
printHelp();
return EXIT_FAILURE;
}
ifstream input;
input.open(argv[1]);
if(input) {
Parser p(argv[1], input);
p.parse();
return EXIT_SUCCESS;
}
else {
cerr << "File '" << argv[1] << "' not found" << endl;
return EXIT_FAILURE;
}
}