diff options
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; +} |
