-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (44 loc) · 951 Bytes
/
main.cpp
File metadata and controls
46 lines (44 loc) · 951 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <string>
#include "sin_analyzer.h"
using namespace std;
int main(int argc, char **argv) {
if (argc < 2) {
cerr << "Not enough arguments" << endl;
return 1;
}
try{
/*
Lex_analyzer SA(argv[1]);
Lex current = SA.analyze();
while (current.get_type() != LEX_FIN) {
cerr << current;
current = SA.analyze();
}
cerr << current;
*/
Sin_analyzer sin(argv[1]);
sin.sin_analyze();
}
catch (const Lex &ex) {
cerr << ex << endl;
return 1;
}
catch (const Rational_number_exception &ex) {
cerr << ex.get_message() << endl;
return 1;
}
catch (const Vector_exception &ex) {
cerr << ex.get_message() << endl;
return 1;
}
catch (const Matrix_exception &ex) {
cerr << ex.get_message() << endl;
return 1;
}
catch (...) {
cerr << "unexpected error" << endl;
return 1;
}
return 0;
}