summaryrefslogtreecommitdiff
path: root/lc.c
blob: 651ed95dc2ef3217d693f6b03629295b650f4721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}