Lines Matching refs:gototab
98 gototab entries to compute the next state. Unicode is a lot
99 bigger, so the gototab entries are now structs with a character
106 alpha-omega. The size of a gototab array is still about 256.
156 p = (gtt *) realloc(f->gototab, new_count * sizeof(gtt));
159 f->gototab = p;
172 f->gototab[i].entries = (gtte *) calloc(NCHARS, sizeof(gtte));
173 if (f->gototab[i].entries == NULL)
175 f->gototab[i].allocated = NCHARS;
176 f->gototab[i].inuse = 0;
614 size_t new_size = f->gototab[state].allocated * 2;
615 gtte *p = (gtte *) realloc(f->gototab[state].entries, new_size * sizeof(gtte));
620 size_t orig_size = f->gototab[state].allocated; // 2nd half of new mem is this size
623 f->gototab[state].allocated = new_size; // update gototab info
624 f->gototab[state].entries = p;
627 static int get_gototab(fa *f, int state, int ch) /* hide gototab implementation */
634 item = (gtte *) bsearch(& key, f->gototab[state].entries,
635 f->gototab[state].inuse, sizeof(gtte),
654 static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab implementation */
656 if (f->gototab[state].inuse == 0) {
657 f->gototab[state].entries[0].ch = ch;
658 f->gototab[state].entries[0].state = val;
659 f->gototab[state].inuse++;
661 } else if ((unsigned)ch > f->gototab[state].entries[f->gototab[state].inuse-1].ch) {
663 gtt *tab = & f->gototab[state];
667 f->gototab[state].entries[f->gototab[state].inuse].ch = ch;
668 f->gototab[state].entries[f->gototab[state].inuse].state = val;
669 f->gototab[state].inuse++;
678 item = (gtte *) bsearch(& key, f->gototab[state].entries,
679 f->gototab[state].inuse, sizeof(gtte),
690 gtt *tab = & f->gototab[state];
693 f->gototab[state].entries[tab->inuse].ch = ch;
694 f->gototab[state].entries[tab->inuse].state = val;
697 qsort(f->gototab[state].entries,
698 f->gototab[state].inuse, sizeof(gtte), entry_cmp);
705 memset(f->gototab[state].entries, 0,
706 f->gototab[state].allocated * sizeof(gtte));
707 f->gototab[state].inuse = 0;
1500 /* compute positions of gototab[s,c] into setvec */
1573 xfree(f->gototab[i].entries);
1574 xfree(f->gototab);
1585 xfree(f->gototab);