X-Git-Url: https://jxself.org/git/?p=a56.git;a=blobdiff_plain;f=src%2Ftok.awk;fp=src%2Ftok.awk;h=44e02aaa082e40a930e716b7d65abd2136061d66;hp=0000000000000000000000000000000000000000;hb=34923afb4a618598083726717bf2f20d310f4f6e;hpb=c6db6f4c5cb82f5e09472163bf11be0c165965ee diff --git a/src/tok.awk b/src/tok.awk new file mode 100644 index 0000000..44e02aa --- /dev/null +++ b/src/tok.awk @@ -0,0 +1,4 @@ +BEGIN {printf("struct {int n; char *name;} tok_tab[] = {\n");} +/#define/ {printf(" {%d, \"%s\"},\n", $3, $2);} +/# define/ {printf(" {%d, \"%s\"},\n", $4, $3);} +END {printf("};\n#define N_TOK (sizeof tok_tab / sizeof tok_tab[0])\nint n_tok = N_TOK;\n");}