33 lines
594 B
C
33 lines
594 B
C
/*
|
|
* Copyright 2023 Oleg Borodin <borodin@unix7.org>
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
|
|
#include <cllexer.h>
|
|
|
|
int main(void) {
|
|
|
|
char* src = "\\\"---\"\\\"qwer\\1-ty\"=\"a123-45\\\" \\\"5678\"";
|
|
|
|
cllexer_t lexer;
|
|
|
|
cllexer_init(&lexer);
|
|
cllexer_reset(&lexer, src);
|
|
|
|
char token[1024];
|
|
int type = 0;
|
|
|
|
while ((type = cllexer_gettoken(&lexer, token)) != CLLEXTOK_END) {
|
|
printf("[%d]: [%s]\n", type, token);
|
|
}
|
|
printf("[%d]: [%s]\n", type, token);
|
|
|
|
return 0;
|
|
}
|