Codebase list a56 / 7600334b-55b9-4e08-b77d-40bf3ebaa862/upstream tok.awk
7600334b-55b9-4e08-b77d-40bf3ebaa862/upstream

Tree @7600334b-55b9-4e08-b77d-40bf3ebaa862/upstream (Download .tar.gz)

tok.awk @7600334b-55b9-4e08-b77d-40bf3ebaa862/upstreamraw · history · blame

1
2
3
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");}