Lines Matching refs:production
352 struct production { struct
378 const struct production *production) in add_production() argument
397 for (lhs_pos = 0; lhs_pos < production->len; lhs_pos++) { in add_production()
398 while (production->lhs[lhs_pos] != node->keysym) { in add_production()
400 uint32_t next = add_node(table, production->lhs[lhs_pos]); in add_production()
410 if (lhs_pos + 1 == production->len) in add_production()
422 uint32_t successor = add_node(table, production->lhs[lhs_pos + 1]); in add_production()
441 production->string) && in add_production()
442 node->u.leaf.keysym == production->keysym) { in add_production()
449 if (production->has_string) { in add_production()
451 darray_append_items(table->utf8, production->string, in add_production()
452 strlen(production->string) + 1); in add_production()
454 if (production->has_keysym) { in add_production()
455 node->u.leaf.keysym = production->keysym; in add_production()
536 struct production production; in parse() local
541 production.len = 0; in parse()
542 production.has_keysym = false; in parse()
543 production.has_string = false; in parse()
544 production.mods = 0; in parse()
545 production.modmask = 0; in parse()
584 if (production.len <= 0) { in parse()
594 production.mods = 0; in parse()
596 production.modmask = 0xff; in parse()
615 if (production.len + 1 > MAX_LHS_LEN) { in parse()
620 production.lhs[production.len++] = keysym; in parse()
621 production.mods = 0; in parse()
622 production.modmask = 0; in parse()
639 if (tilde || production.modmask == 0) in parse()
651 production.modmask |= 1 << mod; in parse()
653 production.mods &= ~(1 << mod); in parse()
655 production.mods |= 1 << mod; in parse()
663 if (production.has_string) { in parse()
671 if (val.string.len >= sizeof(production.string)) { in parse()
675 strcpy(production.string, val.string.str); in parse()
676 production.has_string = true; in parse()
685 if (production.has_keysym) { in parse()
689 production.keysym = keysym; in parse()
690 production.has_keysym = true; in parse()
692 if (!production.has_string && !production.has_keysym) { in parse()
696 add_production(table, s, &production); in parse()