42 lines
656 B
C
42 lines
656 B
C
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "token.h"
|
|
|
|
/* placeholder testing function before I setup test suite */
|
|
static void
|
|
test(void)
|
|
{
|
|
struct tokenstate ts;
|
|
ts.tokensz = 8;
|
|
ts.tokens = malloc(8 * sizeof(struct token *));
|
|
if (ts.tokens == NULL) {
|
|
perror("main test");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
ts.tokens[0] = malloc(1024 * sizeof(struct token));
|
|
if (ts.tokens[0] == NULL) {
|
|
perror("main test");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
|
|
ts.filename = "<input>";
|
|
ts.fh = stdin;
|
|
|
|
ts.tokenblk = 0;
|
|
ts.tokenind = 0;
|
|
|
|
ts.col = 0;
|
|
ts.line = 1;
|
|
ts.pos = 0;
|
|
|
|
tokenize(&ts);
|
|
}
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
test();
|
|
return 0;
|
|
}
|