File: tok.awk

package info (click to toggle)
a56 1.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 352 kB
  • sloc: ansic: 3,471; yacc: 1,888; makefile: 120; awk: 4
file content (4 lines) | stat: -rwxr-xr-x 262 bytes parent folder | download | duplicates (3)
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");}