Mon, 01 Sep 2025 00:14:59 +0800
Initial Lexer/Parser
| 0 | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> | |
| 3 | #include <string.h> | |
| 4 | #include <sys/queue.h> | |
| 5 | ||
| 6 | #include "tlvast.h" | |
| 7 | #include "tlvc.tab.h" | |
| 8 | ||
| 9 | struct tlv_list_head g_tlvs; | |
| 10 | ||
| 11 | void yyerror(YYLTYPE *yylloc, const char *s) | |
| 12 | { | |
| 13 | fprintf(stderr, "Synatx error (%d:%d): %s\n", | |
| 14 | yylloc->first_line, yylloc->first_column, s); | |
| 15 | } | |
| 16 | ||
| 17 | int main(int argc, char **argv) | |
| 18 | { | |
| 19 | TAILQ_INIT(&g_tlvs); | |
| 20 | yyparse(); | |
| 21 | return 0; | |
| 22 | } |