diff options
| author | Lorenzo Torres <lorenzotorres@outlook.it> | 2026-06-09 08:45:29 +0200 |
|---|---|---|
| committer | Lorenzo Torres <lorenzotorres@outlook.it> | 2026-06-09 08:45:29 +0200 |
| commit | 13d591df4ae3dc07f3be8477f7bcbed296d7bc40 (patch) | |
| tree | 77a0f78763bff3c03c6282d961ea2c777fe133c9 /lc.c | |
feat: first commit
Diffstat (limited to 'lc.c')
| -rw-r--r-- | lc.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#include <stdio.h> +#include <stdlib.h> +#include "lexer.h" + +int main(void) +{ + char *src = "12.3"; + token *head = lexer_parse(src); + + if (!head) { + printf("Parsing error!\n"); + exit(1); + } + while (head->next) { + head = head->next; + printf("%d -> %.*s\n", head->type, head->length, head->lexeme); + free(head->prev); + } + return 0; +} |
