2025-12-26 12:28:45 +11:00
|
|
|
#include "lexer.h"
|
|
|
|
|
#include <stdio.h>
|
2025-12-26 18:56:51 +11:00
|
|
|
#include "../utils/file_utils.h"
|
|
|
|
|
#include "../utils/ansii.h"
|
2025-12-26 12:28:45 +11:00
|
|
|
|
|
|
|
|
int main() {
|
2025-12-26 18:56:51 +11:00
|
|
|
Lexer lexer = initLexer("123 456.789 + - * / % ^ ()");
|
|
|
|
|
|
|
|
|
|
while (lexer.currentChar != 0)
|
|
|
|
|
{
|
|
|
|
|
Token next = nextToken(&lexer);
|
|
|
|
|
printf("%s: %s\n", tokenTypeToCString(next.type), next.literal);
|
|
|
|
|
}
|
2025-12-26 12:28:45 +11:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|