Lines Matching refs:pos

87         private int pos;
101 state.pos=pos_;
118 pos_=state.pos;
133 int pos=pos_;
134 if(pos<0) {
138 return (remainingMatchLength_<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
178 int pos=pos_;
179 if(pos<0) {
185 if(inUnit==chars_.charAt(pos++)) {
187 pos_=pos;
189 return (length<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
196 return nextImpl(pos, inUnit);
235 int pos=pos_;
236 if(pos<0) {
247 pos_=pos;
249 return (length<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
257 if(inUnit!=chars_.charAt(pos)) {
261 ++pos;
264 int node=chars_.charAt(pos++);
267 Result result=branchNext(pos, node, inUnit);
281 pos=pos_; // branchNext() advanced pos and wrote it to pos_ .
282 node=chars_.charAt(pos++);
286 if(inUnit!=chars_.charAt(pos)) {
290 ++pos;
299 pos=skipNodeValue(pos, node);
316 int pos=pos_;
317 int leadUnit=chars_.charAt(pos++);
320 readValue(chars_, pos, leadUnit&0x7fff) : readNodeValue(chars_, pos, leadUnit);
332 int pos=pos_;
333 if(pos<0) {
337 long uniqueValue=findUniqueValue(chars_, pos+remainingMatchLength_+1, 0);
351 int pos=pos_;
352 if(pos<0) {
356 append(out, chars_.charAt(pos)); // Next unit of a pending linear-match node.
359 int node=chars_.charAt(pos++);
364 pos=skipNodeValue(pos, node);
370 node=chars_.charAt(pos++);
372 getNextBranchChars(chars_, pos, ++node, out);
376 append(out, chars_.charAt(pos));
495 int pos=pos_;
496 if(pos<0) {
504 pos=(int)(top>>32);
508 pos=branchNext(pos, length);
509 if(pos<0) {
513 str_.append(chars_.charAt(pos++));
522 int node=chars_.charAt(pos++);
525 pos=skipNodeValue(pos, node);
532 entry_.value=readValue(chars_, pos, node&0x7fff);
534 entry_.value=readNodeValue(chars_, pos, node);
543 pos_=pos-1;
555 node=chars_.charAt(pos++);
557 pos=branchNext(pos, node+1);
558 if(pos<0) {
565 str_.append(chars_, pos, pos+maxLength_-str_.length());
568 str_.append(chars_, pos, pos+length);
569 pos+=length;
592 private int branchNext(int pos, int length) {
594 ++pos; // ignore the comparison unit
596 stack_.add(((long)skipDelta(chars_, pos)<<32)|((length-(length>>1))<<16)|str_.length());
599 pos=jumpByDelta(chars_, pos);
603 char trieUnit=chars_.charAt(pos++);
604 int node=chars_.charAt(pos++);
606 int value=readValue(chars_, pos, node&=0x7fff);
607 pos=skipValue(pos, node);
608 stack_.add(((long)pos<<32)|((length-1)<<16)|str_.length());
616 return pos+value;
646 // pos is already after the leadUnit, and the lead unit has bit 15 reset.
647 private static int readValue(CharSequence chars, int pos, int leadUnit) {
652 value=((leadUnit-kMinTwoUnitValueLead)<<16)|chars.charAt(pos);
654 value=(chars.charAt(pos)<<16)|chars.charAt(pos+1);
658 private static int skipValue(int pos, int leadUnit) {
661 ++pos;
663 pos+=2;
666 return pos;
668 private static int skipValue(CharSequence chars, int pos) {
669 int leadUnit=chars.charAt(pos++);
670 return skipValue(pos, leadUnit&0x7fff);
673 private static int readNodeValue(CharSequence chars, int pos, int leadUnit) {
679 value=(((leadUnit&0x7fc0)-kMinTwoUnitNodeValueLead)<<10)|chars.charAt(pos);
681 value=(chars.charAt(pos)<<16)|chars.charAt(pos+1);
685 private static int skipNodeValue(int pos, int leadUnit) {
689 ++pos;
691 pos+=2;
694 return pos;
697 private static int jumpByDelta(CharSequence chars, int pos) {
698 int delta=chars.charAt(pos++);
701 delta=(chars.charAt(pos)<<16)|chars.charAt(pos+1);
702 pos+=2;
704 delta=((delta-kMinTwoUnitDeltaLead)<<16)|chars.charAt(pos++);
707 return pos+delta;
710 private static int skipDelta(CharSequence chars, int pos) {
711 int delta=chars.charAt(pos++);
714 pos+=2;
716 ++pos;
719 return pos;
725 private Result branchNext(int pos, int length, int inUnit) {
728 length=chars_.charAt(pos++);
734 if(inUnit<chars_.charAt(pos++)) {
736 pos=jumpByDelta(chars_, pos);
739 pos=skipDelta(chars_, pos);
746 if(inUnit==chars_.charAt(pos++)) {
748 int node=chars_.charAt(pos);
754 ++pos;
755 // int delta=readValue(pos, node);
760 delta=((node-kMinTwoUnitValueLead)<<16)|chars_.charAt(pos++);
762 delta=(chars_.charAt(pos)<<16)|chars_.charAt(pos+1);
763 pos+=2;
766 pos+=delta;
767 node=chars_.charAt(pos);
770 pos_=pos;
774 pos=skipValue(chars_, pos);
776 if(inUnit==chars_.charAt(pos++)) {
777 pos_=pos;
778 int node=chars_.charAt(pos);
787 private Result nextImpl(int pos, int inUnit) {
788 int node=chars_.charAt(pos++);
791 return branchNext(pos, node, inUnit);
795 if(inUnit==chars_.charAt(pos++)) {
797 pos_=pos;
798 return (length<0 && (node=chars_.charAt(pos))>=kMinValueLead) ?
809 pos=skipNodeValue(pos, node);
821 // On return, if not 0, then bits 63..33 contain the updated non-negative pos.
822 private static long findUniqueValueFromBranch(CharSequence chars, int pos, int length,
825 ++pos; // ignore the comparison unit
826 uniqueValue=findUniqueValueFromBranch(chars, jumpByDelta(chars, pos), length>>1, uniqueValue);
831 pos=skipDelta(chars, pos);
834 ++pos; // ignore a comparison unit
836 int node=chars.charAt(pos++);
839 int value=readValue(chars, pos, node);
840 pos=skipValue(pos, node);
850 uniqueValue=findUniqueValue(chars, pos+value, uniqueValue);
857 return ((long)(pos+1)<<33)|(uniqueValue&0x1ffffffffL);
863 private static long findUniqueValue(CharSequence chars, int pos, long uniqueValue) {
864 int node=chars.charAt(pos++);
868 node=chars.charAt(pos++);
870 uniqueValue=findUniqueValueFromBranch(chars, pos, node+1, uniqueValue);
874 pos=(int)(uniqueValue>>>33);
875 node=chars.charAt(pos++);
878 pos+=node-kMinLinearMatch+1; // Ignore the match units.
879 node=chars.charAt(pos++);
884 value=readValue(chars, pos, node&0x7fff);
886 value=readNodeValue(chars, pos, node);
898 pos=skipNodeValue(pos, node);
905 // getNextChars() when pos is on a branch node.
906 private static void getNextBranchChars(CharSequence chars, int pos, int length, Appendable out) {
908 ++pos; // ignore the comparison unit
909 getNextBranchChars(chars, jumpByDelta(chars, pos), length>>1, out);
911 pos=skipDelta(chars, pos);
914 append(out, chars.charAt(pos++));
915 pos=skipValue(chars, pos);
917 append(out, chars.charAt(pos));