-
Notifications
You must be signed in to change notification settings - Fork 0
/
pp_main.cpp
44 lines (36 loc) · 936 Bytes
/
pp_main.cpp
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
#include <iostream>
#include <boost/filesystem.hpp>
#include "source_manager.h"
#include "preprocessor.h"
int main(int argc, char* argv[])
{
if (argc == 1)
{
std::cerr << argv[0] << ": no input files\n";
return EXIT_FAILURE;
}
try
{
source_manager src_man;
for (int i = 1; i != argc; ++i)
{
auto abs_path = boost::filesystem::canonical(argv[i]);
std::cout << abs_path << "\n";
file_record* file_rec = src_man.load_file(abs_path.string());
xxx pp(file_rec);
for (;;)
{
token_type tt = pp.tt();
std::cout << tt << '\n';
if (tt == token_type::eof)
break;
pp.next();
}
}
}
catch (std::exception const& e)
{
std::cerr << e.what() << std::endl;
}
return EXIT_SUCCESS;
}