1 char rcsid_burs[] = "$Id$";
7 static void doLeaf ARGS((Operator));
10 doLeaf(leaf) Operator leaf;
17 assert(leaf->arity == 0);
19 ts = newItem_Set(leaf->table->relevant);
21 for (pl = rules; pl; pl = pl->next) {
22 Rule p = (Rule) pl->x;
23 if (p->pat->op == leaf) {
24 if (!ts->virgin[p->lhs->num].rule || p->delta < ts->virgin[p->lhs->num].delta) {
25 ts->virgin[p->lhs->num].rule = p;
26 ASSIGNCOST(ts->virgin[p->lhs->num].delta, p->delta);
33 tmp = encode(globalMap, ts, &new);
36 leaf->table->transition[0] = ts;
39 leaf->table->transition[0] = tmp;
52 globalMap = newMapping(GLOBAL_MAP_SIZE);
55 errorState = encode(globalMap, ts, &new);
56 ts->closed = ts->virgin;
59 foreachList((ListFn) doLeaf, leaves);
61 debug(debugTables, printf("---initial set of states ---\n"));
62 debug(debugTables, dumpMapping(globalMap));
63 debug(debugTables, foreachList((ListFn) dumpItem_Set, globalQ->head));
65 for (ts = popQ(globalQ); ts; ts = popQ(globalQ)) {
66 for (ol = operators; ol; ol = ol->next) {
67 Operator op = (Operator) ol->x;
68 addToTable(op->table, ts);