-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (25 loc) · 682 Bytes
/
main.cpp
File metadata and controls
26 lines (25 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "./Lexer.hpp"
#include "./Parser.hpp"
#include <iostream>
#include <fstream> // Include the header for file operations
int main(int argc, char *argv[])
{
if (argc < 3)
{ // Modified to require two arguments
std::cerr << "Please provide both input and output file paths as arguments.\n";
return 1;
}
Parser handle(argv[1], argv[2]);
handle.initialize();
handle.program();
if (!handle.lexer_handle.errorStatus)
{
std::cout << "Completed Code Generation" << std::endl;
handle.execute();
}
else
{
std::cout << "Program Parse Failed, Code will not execute" << std::endl;
}
return 0;
};