I believe to have implemented functions... also got the operator precedence the wrong...
[frith-skrift.git] / main.cpp
blob22af48aeb8edb4f52443873b9d430b812f9d70b6
1 #include <iostream>
2 #include <string>
3 #include <vector>
4 #include <frith/lexer.hpp>
5 #include <ail/file.hpp>
6 #include <frith/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<frith::line_of_code> lines;
24 std::string error;
25 frith::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], frith::visualise_lexemes(lines));
35 return 0;