Home | History | Annotate | Download | only in yarr

Lines Matching refs:BACKTRACK

72     static inline void appendParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack, ParenthesesDisjunctionContext* context)
74 context->next = backTrack->lastContext;
75 backTrack->lastContext = context;
76 ++backTrack->matchAmount;
79 static inline void popParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack)
81 ASSERT(backTrack->matchAmount);
82 ASSERT(backTrack->lastContext);
83 backTrack->lastContext = backTrack->lastContext->next;
84 --backTrack->matchAmount;
376 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
383 if (backTrack->matchAmount) {
384 --backTrack->matchAmount;
391 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
392 ++backTrack->matchAmount;
396 input.uncheckInput(backTrack->matchAmount);
405 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
412 if (backTrack->matchAmount) {
413 --backTrack->matchAmount;
420 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
421 ++backTrack->matchAmount;
425 input.uncheckInput(backTrack->matchAmount);
435 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
455 backTrack->matchAmount = matchAmount;
461 backTrack->matchAmount = 0;
472 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
479 if (backTrack->matchAmount) {
480 --backTrack->matchAmount;
487 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
488 ++backTrack->matchAmount;
492 input.uncheckInput(backTrack->matchAmount);
502 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);
514 backTrack
517 input.setPos(backTrack->begin);
528 backTrack->matchAmount = matchAmount;
533 backTrack->begin = input.getPos();
534 backTrack->matchAmount = 0;
545 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);
558 input.setPos(backTrack->begin);
562 if (backTrack->matchAmount) {
563 --backTrack->matchAmount;
570 if ((backTrack->matchAmount < term.atom.quantityCount) && tryConsumeBackReference(matchBegin, matchEnd, term.inputPosition)) {
571 ++backTrack->matchAmount;
574 input.setPos(backTrack->begin);
602 bool parenthesesDoBacktrack(ByteTerm& term, BackTrackInfoParentheses* backTrack)
604 while (backTrack->matchAmount) {
605 ParenthesesDisjunctionContext* context = backTrack->lastContext;
611 popParenthesesDisjunctionContext(backTrack);
623 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
628 backTrack->inParentheses = 1;
632 backTrack->inParentheses = 0;
665 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
675 // if we backtrack to this point, there is another chance - try matching nothing.
676 ASSERT(backTrack->inParentheses);
677 backTrack->inParentheses = 0;
681 ASSERT(backTrack->inParentheses);
694 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
698 if (!backTrack->inParentheses) {
703 if (!backTrack->inParentheses) {
705 backTrack->inParentheses = 1;
725 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
727 backTrack->begin = input.getPos();
736 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
738 input.setPos(backTrack->begin);
768 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
770 input.setPos(backTrack->begin);
780 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
785 backTrack->prevBegin = output[(subpatternId << 1)];
786 backTrack->prevEnd = output[(subpatternId << 1) + 1];
788 backTrack->matchAmount = 0;
789 backTrack->lastContext = 0;
794 while (backTrack->matchAmount < term.atom.quantityCount) {
798 appendParenthesesDisjunctionContext(backTrack, context);
803 if (!parenthesesDoBacktrack(term, backTrack))
808 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
809 ParenthesesDisjunctionContext* context = backTrack->lastContext;
815 while (backTrack->matchAmount < term.atom.quantityCount) {
818 appendParenthesesDisjunctionContext(backTrack, context);
826 if (backTrack->matchAmount) {
827 ParenthesesDisjunctionContext* context = backTrack->lastContext;
844 // the 'more' cases. Always backtrack, at least a leetle bit. However cases where
845 // you backtrack an item off the list needs checking, since we'll never have matched
855 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
859 output[(subpatternId << 1)] = backTrack->prevBegin;
860 output[(subpatternId << 1) + 1] = backTrack->prevEnd;
867 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
871 if (!parenthesesDoBacktrack(term, backTrack))
875 while (backTrack->matchAmount < term.atom.quantityCount) {
879 appendParenthesesDisjunctionContext(backTrack, context);
884 if (!parenthesesDoBacktrack(term, backTrack))
889 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
890 context = backTrack->lastContext;
896 if (!backTrack->matchAmount)
899 ParenthesesDisjunctionContext* context = backTrack->lastContext;
901 while (backTrack->matchAmount < term.atom.quantityCount) {
904 appendParenthesesDisjunctionContext(backTrack, context);
913 popParenthesesDisjunctionContext(backTrack);
917 if (backTrack->matchAmount) {
918 ParenthesesDisjunctionContext* context = backTrack->lastContext;
926 if (backTrack->matchAmount < term.atom.quantityCount) {
929 appendParenthesesDisjunctionContext(backTrack, context);
938 // Nope - okay backtrack looking for an alternative.
939 while (backTrack->matchAmount) {
940 ParenthesesDisjunctionContext* context = backTrack->lastContext;
942 // successful backtrack! we're back in the game!
943 if (backTrack->matchAmount) {
944 context = backTrack->lastContext;
952 popParenthesesDisjunctionContext(backTrack);
965 #define BACKTRACK() { --context->term; goto backtrack; }
970 BACKTRACK();
997 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + currentTerm().frameLocation);
998 backTrack->offset = offset;
1006 BACKTRACK();
1010 BACKTRACK();
1014 BACKTRACK();
1020 BACKTRACK();
1025 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1034 backTrack->matchAmount = matchAmount;
1039 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1040 backTrack->matchAmount = 0;
1048 BACKTRACK();
1053 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1062 backTrack->matchAmount = matchAmount;
1067 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1068 backTrack->matchAmount = 0;
1075 BACKTRACK();
1079 BACKTRACK();
1083 BACKTRACK();
1087 BACKTRACK();
1091 BACKTRACK();
1095 BACKTRACK();
1099 BACKTRACK();
1104 BACKTRACK();
1110 backtrack:
1142 BACKTRACK();
1145 // We should never backtrack back into an alternative of the main body of the regex.
1146 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + currentTerm().frameLocation);
1147 unsigned offset = backTrack->offset;
1149 BACKTRACK();
1155 BACKTRACK();
1163 BACKTRACK();
1170 BACKTRACK();
1174 BACKTRACK();
1178 BACKTRACK();
1182 BACKTRACK();
1186 BACKTRACK();
1190 BACKTRACK();
1194 BACKTRACK();
1198 BACKTRACK();
1202 BACKTRACK();