Basic parser

Signed-off-by: CHatingPython <chatingpython@gmail.com>
This commit is contained in:
CHatingPython
2026-05-25 07:45:24 +02:00
committed by CHatingPython
parent 28f6deaba5
commit 7df35fc075
11 changed files with 687 additions and 36 deletions
+3 -8
View File
@@ -1,15 +1,10 @@
#include "furc/front/lexer.hpp"
#include "furc/front/parser.hpp"
#include <iostream>
int main(void) {
furc::front::lexer lexer("<TEMP>", "func main() {\n return 0;\n}");
furc::front::token token = {};
while (!furc::front::is_token_type_empty((token = lexer.next_token()).type)) {
std::cout << token << '\n';
}
if (token.type == furc::front::token_t::Error) std::cout << token << '\n';
furc::front::parser parser("<TEMP>", "func main() {\n return;\n}");
std::cout << parser.parse() << '\n';
return 0;
}