| 673 | |
| 674 | |
| 675 | void output_table() |
| 676 | { |
| 677 | register int i; |
| 678 | register int j; |
| 679 | |
| 680 | ++outline; |
| 681 | |
| 682 | fprintf(stderr, "YYTABLESIZE: %d\n", high); |
| 683 | if(high >= MAXSHORT) { |
| 684 | fprintf(stderr, "Table is longer than %d elements. It's not gonna fly.\n", MAXSHORT); |
| 685 | exit(1); |
| 686 | } |
| 687 | |
| 688 | fprintf(code_file, "#define YYTABLESIZE %d\n", high); |
| 689 | if (!rflag) |
| 690 | fprintf(output_file, "static "); |
| 691 | fprintf(output_file, "int yytable[] = {%40d,", table[0]); |
| 692 | |
| 693 | j = 10; |
| 694 | for (i = 1; i <= high; i++) |
| 695 | { |
| 696 | if (j >= 10) |
| 697 | { |
| 698 | if (!rflag) ++outline; |
| 699 | putc('\n', output_file); |
| 700 | j = 1; |
| 701 | } |
| 702 | else |
| 703 | ++j; |
| 704 | |
| 705 | fprintf(output_file, "%5d,", table[i]); |
| 706 | } |
| 707 | |
| 708 | if (!rflag) outline += 2; |
| 709 | fprintf(output_file, "\n};\n"); |
| 710 | FREE(table); |
| 711 | } |
| 712 | |
| 713 | |
| 714 |
no test coverage detected