• Home
  • Raw
  • Download

Lines Matching refs:cs

627 	cset *cs;  in p_bracket()  local
642 if ((cs = allocset(p)) == NULL) { in p_bracket()
650 CHadd(cs, ']'); in p_bracket()
652 CHadd(cs, '-'); in p_bracket()
654 p_b_term(p, cs); in p_bracket()
656 CHadd(cs, '-'); in p_bracket()
660 freeset(p, cs); in p_bracket()
669 if (CHIN(cs, i) && isalpha(i)) { in p_bracket()
672 CHadd(cs, ci); in p_bracket()
674 if (cs->multis != NULL) in p_bracket()
675 mccase(p, cs); in p_bracket()
681 if (CHIN(cs, i)) in p_bracket()
682 CHsub(cs, i); in p_bracket()
684 CHadd(cs, i); in p_bracket()
686 CHsub(cs, '\n'); in p_bracket()
687 if (cs->multis != NULL) in p_bracket()
688 mcinvert(p, cs); in p_bracket()
691 assert(cs->multis == NULL); /* xxx */ in p_bracket()
693 if (nch(p, cs) == 1) { /* optimize singleton sets */ in p_bracket()
694 ordinary(p, firstch(p, cs)); in p_bracket()
695 freeset(p, cs); in p_bracket()
697 EMIT(OANYOF, freezeset(p, cs)); in p_bracket()
704 p_b_term(struct parse *p, cset *cs) in p_b_term() argument
730 p_b_cclass(p, cs); in p_b_term()
739 p_b_eclass(p, cs); in p_b_term()
758 CHadd(cs, i); in p_b_term()
767 p_b_cclass(struct parse *p, cset *cs) in p_b_cclass() argument
789 CHadd(cs, c); in p_b_cclass()
791 MCadd(p, cs, u); in p_b_cclass()
800 p_b_eclass(struct parse *p, cset *cs) in p_b_eclass() argument
805 CHadd(cs, c); in p_b_eclass()
1027 cset *cs; in allocset() local
1058 cs = &p->g->sets[no]; in allocset()
1059 cs->ptr = p->g->setbits + css*((no)/CHAR_BIT); in allocset()
1060 cs->mask = 1 << ((no) % CHAR_BIT); in allocset()
1061 cs->hash = 0; in allocset()
1062 cs->smultis = 0; in allocset()
1063 cs->multis = NULL; in allocset()
1065 return(cs); in allocset()
1081 freeset(struct parse *p, cset *cs) in freeset() argument
1088 CHsub(cs, i); in freeset()
1089 if (cs == top-1) /* recover only the easy case */ in freeset()
1103 freezeset(struct parse *p, cset *cs) in freezeset() argument
1105 uch h = cs->hash; in freezeset()
1113 if (cs2->hash == h && cs2 != cs) { in freezeset()
1116 if (!!CHIN(cs2, i) != !!CHIN(cs, i)) in freezeset()
1123 freeset(p, cs); in freezeset()
1124 cs = cs2; in freezeset()
1127 return((int)(cs - p->g->sets)); in freezeset()
1134 firstch(struct parse *p, cset *cs) in firstch() argument
1140 if (CHIN(cs, i)) in firstch()
1150 nch(struct parse *p, cset *cs) in nch() argument
1157 if (CHIN(cs, i)) in nch()
1166 mcadd( struct parse *p, cset *cs, char *cp) in mcadd() argument
1168 size_t oldend = cs->smultis; in mcadd()
1171 cs->smultis += strlen(cp) + 1; in mcadd()
1172 np = realloc(cs->multis, cs->smultis); in mcadd()
1174 if (cs->multis) in mcadd()
1175 free(cs->multis); in mcadd()
1176 cs->multis = NULL; in mcadd()
1180 cs->multis = (char*)np; in mcadd()
1182 strncpy(cs->multis + oldend - 1, cp, cs->smultis - oldend + 1); in mcadd()
1193 mcinvert(struct parse *p, cset *cs) in mcinvert() argument
1195 assert(cs->multis == NULL); /* xxx */ in mcinvert()
1206 mccase(struct parse *p, cset *cs) in mccase() argument
1208 assert(cs->multis == NULL); /* xxx */ in mccase()