-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasm.cpp
More file actions
32 lines (22 loc) · 709 Bytes
/
basm.cpp
File metadata and controls
32 lines (22 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "System.h"
#include "Lexer.h"
#include "Parser.h"
void test_lexer() {
Lexer lexer(System::source_name);
Lexer::Token cur = Lexer::tok_undefined;
while (cur != Lexer::tok_eof) {
cur = lexer.get_token();
System::logger.log_error(lexer.get_token_loc(), lexer.get_word().size(),
Lexer::token_to_string(cur) + " : \"" + lexer.get_word() + "\"");
}
}
int main(int argc, char **argv) {
std::ios_base::sync_with_stdio(false);
System::parse_arg(argc, argv);
Parser parser(System::source_name);
parser.parse_top_level();
// parser.show_code();
parser.write_output();
System::basm_shutdown();
return 0;
}