Added a lame implementation of the iterator symbol
[fridhskrift.git] / main.cpp
blob2fdd3fc67096419cbd696faf66b0ff7c57b5bc01
1 #include <iostream>
2 #include <string>
3 #include <vector>
4 #include <fridh/lexer.hpp>
5 #include <ail/file.hpp>
6 #include <fridh/interpreter.hpp>
8 int main(int argc, char ** argv)
10 if(argc != 3)
12 std::cout << argv[0] << " <input> <output>" << std::endl;
13 return 1;
16 std::string code;
17 if(!ail::read_file(argv[1], code))
19 std::cout << "Unable to read input" << std::endl;
20 return 1;
23 std::vector<fridh::line_of_code> lines;
24 std::string error;
25 fridh::lexer lexer(code, lines, error);
26 if(!lexer.parse(lines))
28 std::cout << "Error: " << error << std::endl;
29 std::cin.get();
30 return 1;
33 ail::write_file(argv[2], fridh::visualise_lexemes(lines));
35 return 0;