Doing some sketching on the scope structure
[fridhskrift.git] / main.cpp
blobd0155038df32e2a725c68b3fda8253c8fe31d1dc
1 #include <iostream>
2 #include <string>
3 #include <vector>
4 #include <frith/lexer.hpp>
5 #include <ail/file.hpp>
7 int main(int argc, char ** argv)
9 if(argc != 3)
11 std::cout << argv[0] << " <input> <output>" << std::endl;
12 return 1;
15 std::string code;
16 if(!ail::read_file(argv[1], code))
18 std::cout << "Unable to read input" << std::endl;
19 return 1;
22 std::vector<frith::line_of_code> lines;
23 std::string error;
24 frith::lexer lexer(code, lines, error);
25 if(!lexer.parse(lines))
27 std::cout << "Error: " << error << std::endl;
28 std::cin.get();
29 return 1;
32 ail::write_file(argv[2], frith::visualise_lexemes(lines));
34 return 0;