Files
helmetc/libxtools/galexer_test.c
Олег Бородин 9abd8a5e19 import
2025-10-01 11:21:05 +02:00

33 lines
599 B
C

/*
*
* Copyright 2023 Oleg Borodin <borodin@unix7.org>
*
*/
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include <galexer.h>
int main(int argc, char **argv) {
(void)argc;
(void)argv;
char* arg = "--qwerty=-num-12345";
galexer_t lex;
galexer_init(&lex, arg);
char token[1024];
int toktype = TOKEN_NULL;
int i = 0;
while (toktype != TOKEN_ENDF) {
toktype = galexer_gettok(&lex, token);
printf("%d: %d [%s]\n", i, toktype, token);
i++;
}
return 0;
}