Lines Matching refs:bc
116 static bool p_ere_exp(struct parse *p, struct branchc *bc);
118 static int p_branch_eat_delim(struct parse *p, struct branchc *bc);
119 static void p_branch_ins_offset(struct parse *p, struct branchc *bc);
120 static void p_branch_fix_tail(struct parse *p, struct branchc *bc);
121 static bool p_branch_empty(struct parse *p, struct branchc *bc);
122 static bool p_branch_do(struct parse *p, struct branchc *bc);
123 static void p_bre_pre_parse(struct parse *p, struct branchc *bc);
124 static void p_bre_post_parse(struct parse *p, struct branchc *bc);
126 static bool p_simp_re(struct parse *p, struct branchc *bc);
360 p_ere_exp(struct parse *p, struct branchc *bc) in p_ere_exp() argument
370 (void)bc; in p_ere_exp()
537 p_branch_eat_delim(struct parse *p, struct branchc *bc) in p_branch_eat_delim() argument
541 (void)bc; in p_branch_eat_delim()
553 p_branch_ins_offset(struct parse *p, struct branchc *bc) in p_branch_ins_offset() argument
556 if (bc->nbranch == 0) { in p_branch_ins_offset()
557 INSERT(OCH_, bc->start); /* offset is wrong */ in p_branch_ins_offset()
558 bc->fwd = bc->start; in p_branch_ins_offset()
559 bc->back = bc->start; in p_branch_ins_offset()
562 ASTERN(OOR1, bc->back); in p_branch_ins_offset()
563 bc->back = THERE(); in p_branch_ins_offset()
564 AHEAD(bc->fwd); /* fix previous offset */ in p_branch_ins_offset()
565 bc->fwd = HERE(); in p_branch_ins_offset()
567 ++bc->nbranch; in p_branch_ins_offset()
575 p_branch_fix_tail(struct parse *p, struct branchc *bc) in p_branch_fix_tail() argument
579 if (bc->nbranch > 0) { in p_branch_fix_tail()
580 AHEAD(bc->fwd); in p_branch_fix_tail()
581 ASTERN(O_CH, bc->back); in p_branch_fix_tail()
592 p_branch_empty(struct parse *p, struct branchc *bc) in p_branch_empty() argument
595 (void)bc; in p_branch_empty()
606 p_branch_do(struct parse *p, struct branchc *bc) in p_branch_do() argument
610 ate = p_branch_eat_delim(p, bc); in p_branch_do()
613 else if ((ate > 1 || (bc->outer && !MORE())) && !p_branch_empty(p, bc)) in p_branch_do()
620 p_branch_ins_offset(p, bc); in p_branch_do()
626 p_bre_pre_parse(struct parse *p, struct branchc *bc) in p_bre_pre_parse() argument
629 (void) bc; in p_bre_pre_parse()
643 p_bre_post_parse(struct parse *p, struct branchc *bc) in p_bre_post_parse() argument
647 if (bc->terminate) { in p_bre_post_parse()
669 struct branchc bc; in p_re() local
671 bc.nbranch = 0; in p_re()
673 bc.outer = true; in p_re()
675 bc.outer = false; in p_re()
678 bc.start = HERE(); in p_re()
679 bc.nchain = 0; in p_re()
680 bc.terminate = false; in p_re()
682 p->pre_parse(p, &bc); in p_re()
684 bc.terminate = p->parse_expr(p, &bc); in p_re()
685 ++bc.nchain; in p_re()
688 p->post_parse(p, &bc); in p_re()
689 (void) REQUIRE(HERE() != bc.start, REG_EMPTY); in p_re()
699 if (!p_branch_do(p, &bc)) in p_re()
704 p_branch_fix_tail(p, &bc); in p_re()
713 p_simp_re(struct parse *p, struct branchc *bc) in p_simp_re() argument
799 (void)REQUIRE(bc->nchain == 0, REG_BADRPT); in p_simp_re()