orga-comp/main.cpp

21 lines
514 B
C++
Raw Normal View History

2021-10-01 14:20:03 +00:00
#include "orga-comp.h"
#include <iostream>
int
main(){
// lex -> parse -> analisis semantico
// realizar un interprete
// interpretar a = 2 + 2
interpreter inter;
2021-10-01 14:20:03 +00:00
lexer lex;
2021-10-26 02:01:27 +00:00
translator tran;
std::vector<struct token*> lexed = lex.lex_file("tst.cfran");
parser parser(lexed);
struct token *end = parser.parse_tokens();
2021-10-01 14:20:03 +00:00
std::cout << "\n-----------------------\n";
std::cout << "EVALUATING RESULTING TREE:\n";
2021-10-26 02:01:27 +00:00
std::cout << str_token(*end) << '\n';
inter.evalSTM(*end);
2021-10-26 02:01:27 +00:00
tran.translate(end);
2021-10-01 14:20:03 +00:00
return 1;
}