Lines Matching +full:num +full:- +full:cs
44 #define type(v) v->nobj
45 #define left(v) v->narg[0]
46 #define right(v) v->narg[1]
47 #define parent(v) v->nnext
189 if (c == '-' && i > 0) { in cclenter()
295 return (-1); in first()
345 int /* is cs thru ce in s? */
346 ccl_member(int ns, wchar_t cs, int ne, wchar_t ce, ccl_chars_t *s) in ccl_member() argument
349 * The specified range(cs, ce) must be beside the range between in ccl_member()
350 * s->cc_start and s->cc_end to determine member. in ccl_member()
352 while (s->cc_cs || s->cc_ce) { in ccl_member()
353 if (MLCMPLE(s->cc_ns, s->cc_cs, ns, cs) && in ccl_member()
354 MLCMPLE(ne, ce, s->cc_ne, s->cc_ce)) in ccl_member()
362 static int /* is cs thru ce in s? */
363 ccln_member(int ns, wchar_t cs, int ne, wchar_t ce, ccl_chars_t *s, int n) in ccln_member() argument
366 * The specified range(cs, ce) must be beside the range between in ccln_member()
367 * s->cc_start and s->cc_end to determine member. in ccln_member()
369 while (n-- > 0) { in ccln_member()
370 if (MLCMPLE(s->cc_ns, s->cc_cs, ns, cs) && in ccln_member()
371 MLCMPLE(ne, ce, s->cc_ne, s->cc_ce)) in ccln_member()
432 wchar_t cs, ce; in cgotofn() local
437 int curpos, num, prev; in cgotofn() local
496 cs = WC_VERY_SMALL; in cgotofn()
498 ce = HAT - 1; in cgotofn()
500 if (! ccln_member(ns, cs, ne, ce, in cgotofn()
503 ns, cs, ne, ce); in cgotofn()
505 ssyms[ssmax].cc_cs = cs; in cgotofn()
509 cs = HAT + 1; in cgotofn()
513 if (! ccln_member(ns, cs, ne, ce, in cgotofn()
516 ns, cs, ne, ce); in cgotofn()
518 ssyms[ssmax].cc_cs = cs; in cgotofn()
524 cs = HAT; in cgotofn()
527 p->cc_cs; p++) { in cgotofn()
528 if ((p->cc_ns != ns ||\ in cgotofn()
529 p->cc_cs != cs) &&\ in cgotofn()
530 !ccln_member(p->cc_ns, p->cc_cs, in cgotofn()
531 p->cc_ne, p->cc_ce, isyms, ismax)) { in cgotofn()
533 ismax, p->cc_ns, p->cc_cs, p->cc_ne, p->cc_ce); in cgotofn()
540 cs = WC_VERY_SMALL; in cgotofn()
542 p->cc_cs; p++) { in cgotofn()
543 if ((ns != hatcn || p->cc_cs != HAT) && in cgotofn()
544 ! ccln_member(ns, cs, in cgotofn()
545 p->cc_ns, p->cc_cs-1, in cgotofn()
549 ns, cs, in cgotofn()
550 p->cc_ns, in cgotofn()
551 p->cc_cs-1); in cgotofn()
554 ssyms[ssmax].cc_cs = cs; in cgotofn()
555 ssyms[ssmax].cc_ne = p->cc_ns; in cgotofn()
556 ssyms[ssmax++].cc_ce = p->cc_cs-1; in cgotofn()
557 if (p->cc_ce == (wchar_t)0x0) { in cgotofn()
558 ns = p->cc_ns; in cgotofn()
559 cs = p->cc_cs + 1; in cgotofn()
562 ns = p->cc_ne; in cgotofn()
563 cs = p->cc_ce + 1; in cgotofn()
566 if ((ns != hatcn || cs != HAT) && in cgotofn()
567 ! ccln_member(ns, cs, in cgotofn()
571 ns, cs, MAX_CODESET, in cgotofn()
575 ssyms[ssmax].cc_cs = cs; in cgotofn()
596 num = *ptr; in cgotofn()
597 for (i = 0; i < num; i++) { in cgotofn()
623 cs = WC_VERY_SMALL; in cgotofn()
625 ce = HAT - 1; in cgotofn()
627 if (! ccln_member(ns, cs, ne, ce, in cgotofn()
629 ! ccln_member(ns, cs, ne, ce, in cgotofn()
633 ns, cs, in cgotofn()
636 ssyms[ssmax].cc_cs = cs; in cgotofn()
640 cs = HAT + 1; in cgotofn()
644 if (! ccln_member(ns, cs, ne, ce, in cgotofn()
646 ! ccln_member(ns, cs, ne, ce, in cgotofn()
650 ns, cs, in cgotofn()
653 ssyms[ssmax].cc_cs = cs; in cgotofn()
659 cs = HAT; in cgotofn()
662 p->cc_cs; p++) { in cgotofn()
663 if ((p->cc_ns != ns || in cgotofn()
664 p->cc_cs != cs) && in cgotofn()
665 ! ccln_member(p->cc_ns, in cgotofn()
666 p->cc_cs, p->cc_ne, in cgotofn()
667 p->cc_ce, isyms, ismax) && in cgotofn()
668 !ccln_member(p->cc_ns, p->cc_cs, in cgotofn()
669 p->cc_ne, p->cc_ce, symbol, in cgotofn()
672 symbol, symax, p->cc_ns, in cgotofn()
673 p->cc_cs, p->cc_ne, p->cc_ce); in cgotofn()
680 cs = WC_VERY_SMALL; in cgotofn()
681 for (p = (ccl_chars_t *)right(cp); p->cc_cs; p++) { in cgotofn()
682 if ((p->cc_ns != hatcn || p->cc_cs != HAT) && in cgotofn()
683 ! ccln_member(ns, cs, p->cc_ns, in cgotofn()
684 p->cc_cs-1, isyms, ismax) && in cgotofn()
685 ! ccln_member(ns, cs, p->cc_ns, in cgotofn()
686 p->cc_cs-1, symbol, symax)) { in cgotofn()
688 symax, ns, cs, p->cc_ns, p->cc_cs-1); in cgotofn()
691 ssyms[ssmax].cc_cs = cs; in cgotofn()
692 ssyms[ssmax].cc_ne = p->cc_ns; in cgotofn()
694 = p->cc_cs-1; in cgotofn()
695 if (p->cc_ce == (wchar_t)0x0) { in cgotofn()
696 ns = p->cc_ns; in cgotofn()
697 cs = p->cc_cs + 1; in cgotofn()
700 ns = p->cc_ne; in cgotofn()
701 cs = p->cc_ce + 1; in cgotofn()
704 if ((ns != hatcn || cs != HAT) && ! ccln_member(ns, cs, in cgotofn()
706 ! ccln_member(ns, cs, MAX_CODESET, in cgotofn()
708 symax = insert_table(symbol, symax, ns, cs, in cgotofn()
713 ssyms[ssmax].cc_cs = cs; in cgotofn()
721 cs = ssyms[j].cc_cs; in cgotofn()
724 dprintf("j = %d, cs = %o, ce = %o\n", j, cs, ce); in cgotofn()
725 symax = delete_table(symbol, symax, ns, cs, ne, ce); in cgotofn()
732 if (k == CHAR && ns == ne && cs == ce && in cgotofn()
733 cs == (int)right(cp) || in cgotofn()
735 ccl_member(ns, cs, ne, ce, in cgotofn()
738 !ccl_member(ns, cs, ne, ce, in cgotofn()
741 num = *ptr; in cgotofn()
742 for (k = 0; k < num; k++) { in cgotofn()
753 if (n >= NSTATES - 1) { in cgotofn()
759 s, cs, ce); in cgotofn()
762 fatab[ind].cc.cc_cs = cs; in cgotofn()
770 s, cs, ce); in cgotofn()
774 fatab[ind].cc.cc_cs = cs; in cgotofn()
788 pfa->cc.h = -1; /* s is a final state */ in cgotofn()
790 pfa->cc.h = numtrans; in cgotofn()
791 pfa->st = 0; in cgotofn()
793 pfa->cc.s = fatab[i].cc; in cgotofn()
794 pfa->st = (struct fa *)fatab[i].n; in cgotofn()
801 pfa->st = where[0]; in cgotofn()
804 pfa->cc.h, pfa->st, NULL); in cgotofn()
805 for (k = 1; k <= pfa->cc.h; k++) { in cgotofn()
806 (pfa+k)->st = where[(int)(pfa+k)->st]; in cgotofn()
808 (pfa+k)->cc.s.cc_cs, (pfa+k)->cc.s.cc_ce, in cgotofn()
809 (pfa+k)->st); in cgotofn()
813 if ((num = pfa->cc.h) < 0) in cgotofn()
815 for (pfa += num; num; num--, pfa--) in cgotofn()
816 if (pfa->cc.s.cc_ns == hatcn && pfa->cc.s.cc_cs == HAT) { in cgotofn()
817 return (pfa->st); in cgotofn()
827 insert_table(ccl_chars_t *table_base, int table_size, int ns, wchar_t cs, in insert_table() argument
840 dprintf("Inserting {%o, %o} to table %o\n", cs, ce, table_base); in insert_table()
845 tns = table->cc_ns; in insert_table()
846 tcs = table->cc_cs; in insert_table()
847 tne = table->cc_ne; in insert_table()
848 tce = table->cc_ce; in insert_table()
849 if (MLCMPLT(ne, ce, tns, (tcs - 1))) { in insert_table()
856 tns = table->cc_ns; in insert_table()
857 tcs = table->cc_cs; in insert_table()
858 tne = table->cc_ne; in insert_table()
859 tce = table->cc_ce; in insert_table()
860 table->cc_ns = ns; in insert_table()
861 table->cc_cs = cs; in insert_table()
862 table->cc_ne = ne; in insert_table()
863 table->cc_ce = ce; in insert_table()
865 cs = tcs; in insert_table()
870 } else if (MLCMPLE(tns, (tcs - 1), ns, cs) && in insert_table()
871 MLCMPLE(ns, cs, tne, (tce + 1))) { in insert_table()
875 if (MLCMPGT(tns, tcs, ns, cs)) { in insert_table()
876 table->cc_ns = ns; in insert_table()
877 table->cc_cs = cs; in insert_table()
890 table->cc_ns = ns; in insert_table()
891 table->cc_cs = cs; in insert_table()
892 table->cc_ne = ne; in insert_table()
893 table->cc_ce = ce; in insert_table()
907 table->cc_ne = ne; in insert_table()
908 table->cc_ce = ce; in insert_table()
921 if (MLCMPLT(ne, ce, table->cc_ns, (table->cc_cs - 1))) { in insert_table()
924 if (MLCMPLE(table->cc_ns, (table->cc_cs - 1), ne, ce) && in insert_table()
925 MLCMPLE(ne, ce, table->cc_ne, (table->cc_ce + 1))) { in insert_table()
929 if (MLCMPLT(ne, ce, table->cc_ne, table->cc_ce)) { in insert_table()
930 ne = table->cc_ne; in insert_table()
931 ce = table->cc_ce; in insert_table()
940 saved_table->cc_ne = ne; in insert_table()
941 saved_table->cc_ce = ce; in insert_table()
942 saved_i = table_size - (i - saved_i - 1); in insert_table()
965 delete_table(ccl_chars_t *table_base, int table_size, int ns, wchar_t cs, in delete_table() argument
981 tns = table->cc_ns; in delete_table()
982 tcs = table->cc_cs; in delete_table()
983 tne = table->cc_ne; in delete_table()
984 tce = table->cc_ce; in delete_table()
988 if (MLCMPLE(ns, cs, tns, tcs)) { in delete_table()
992 table->cc_ns = ne; in delete_table()
993 table->cc_cs = ce + 1; in delete_table()
1000 table->cc_ns = ne; in delete_table()
1001 table->cc_cs = ce + 1; in delete_table()
1003 tce = cs - 1; in delete_table()
1006 ns = table->cc_ns; in delete_table()
1007 cs = table->cc_cs; in delete_table()
1008 ne = table->cc_ne; in delete_table()
1009 ce = table->cc_ce; in delete_table()
1010 table->cc_ns = tns; in delete_table()
1011 table->cc_cs = tcs; in delete_table()
1012 table->cc_ne = tne; in delete_table()
1013 table->cc_ce = tce; in delete_table()
1015 tcs = cs; in delete_table()
1022 } else if (MLCMPLE(ns, cs, tne, tce)) { in delete_table()
1023 if (MLCMPGT(ns, cs, tns, tcs)) { in delete_table()
1027 table->cc_ne = ns; in delete_table()
1028 table->cc_ce = cs - 1; in delete_table()
1039 table->cc_ns, table->cc_cs)) { in delete_table()
1045 } else if (MLCMPGT(table->cc_ne, table->cc_ce, in delete_table()
1050 table->cc_ns = ne; in delete_table()
1051 table->cc_cs = ce + 1; in delete_table()
1060 saved_i = table_size - (i - saved_i); in delete_table()
1085 printf("{%3o, %3o}, ", table->cc_cs, table->cc_ce); in dump_table()
1098 wchar_t c, cs, ce; in match() local
1103 if (pfa->cc.h == 1) { /* fast test for first character, if possible */ in match()
1104 ns = (++pfa)->cc.s.cc_ns; in match()
1105 cs = (pfa)->cc.s.cc_cs; in match()
1106 ne = (pfa)->cc.s.cc_ne; in match()
1107 ce = (pfa)->cc.s.cc_ce; in match()
1111 if (MLCMPLE(ns, cs, n, c) && in match()
1114 pfa = pfa->st; in match()
1120 adv: if ((count = pfa->cc.h) < 0) in match()
1125 for (pfa += count; count; count--, pfa--) { in match()
1126 ns = (pfa)->cc.s.cc_ns; in match()
1127 cs = (pfa)->cc.s.cc_cs; in match()
1128 ne = (pfa)->cc.s.cc_ne; in match()
1129 ce = (pfa)->cc.s.cc_ce; in match()
1130 if (MLCMPLE(ns, cs, n, c) && MLCMPLE(n, c, ne, ce)) in match()
1133 pfa = pfa->st; in match()
1134 if ((count = pfa->cc.h) < 0) in match()