summaryrefslogtreecommitdiff
path: root/lc.c
diff options
context:
space:
mode:
authorLorenzo Torres <lorenzotorres@outlook.it>2026-06-09 08:45:29 +0200
committerLorenzo Torres <lorenzotorres@outlook.it>2026-06-09 08:45:29 +0200
commit13d591df4ae3dc07f3be8477f7bcbed296d7bc40 (patch)
tree77a0f78763bff3c03c6282d961ea2c777fe133c9 /lc.c
feat: first commit
Diffstat (limited to 'lc.c')
-rw-r--r--lc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lc.c b/lc.c
new file mode 100644
index 0000000..651ed95
--- /dev/null
+++ b/lc.c
@@ -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;
+}