Perform a pre-order traversal non-recursive style.

@param pos Start node for traversal

@throws TransformerException
486166
public void traverse(int pos) throws org.xml.sax.SAXException
  {
    m_dtm = m_transformer.getXPathContext().getDTM(pos);
    m_startNode = pos;

    super.traverse(pos);
  }
417325
private void add(String pos, String s) {
		if(s.length()>maxLen)
			return;
		if(pos.length()==0)
			return;
		posSet.add(pos);
		if(dict.containsKey(s)){
			TreeSet<String> sett = dict.get(s);
			sett.add(pos);
		}else{
			TreeSet<String> sett  = new TreeSet<String>();
			sett.add(pos);
			dict.put(s, sett);
		}
	}
92958
function sequence ( parserSyntax ) {
				var i, res,
					originalPos = pos,
					result = [];

				for ( i = 0; i < parserSyntax.length; i++ ) {
					res = parserSyntax[i]();

					if ( res === null ) {
						pos = originalPos;

						return null;
					}

					result.push( res );
				}

				return result;
			}
744545
public void setPosition(Long pos) {
        Interval interval = getInterval();
        if (interval != null) {
            resetInterval(pos, interval.getStartGranularity());
        } else {
            resetInterval(pos, null);
        }
    }
483089
protected static MethodHandle addTransformer(MethodHandle handle, int pos, Object arg, Class parameter) {
        MethodHandle transformer=null;
        if (arg instanceof GString) {
            transformer = TO_STRING;
        } else if (arg instanceof Closure) {
            transformer = createSAMTransform(arg, parameter);
        } else if (Number.class.isAssignableFrom(parameter)) {
            transformer = selectNumberTransformer(parameter, arg);
        } else if (parameter.isArray()) {
            transformer =  MethodHandles.insertArguments(AS_ARRAY, 1, parameter);
        }
        if (transformer==null) throw new GroovyBugError("Unknown transformation for argument "+arg+" at position "+pos+" with "+arg.getClass()+" for parameter of type "+parameter);
        return applyUnsharpFilter(handle, pos, transformer);
    }
1081018
public void prepareForEnumeration() {
        if (isPreparer()) {
            for (NodeT node : nodeTable.values()) {
                // Prepare each node for traversal
                node.initialize();
                if (!this.isRootNode(node)) {
                    // Mark other sub-DAGs as non-preparer
                    node.setPreparer(false);
                }
            }
            initializeDependentKeys();
            initializeQueue();
        }
    }
713593
protected final void setElement(PriorityQueueNode node, int pos)
  {
//    if (tc.isEntryEnabled())
//      SibTr.entry(tc, "setElement", new Object[] { node, new Integer(pos)});

    elements[pos] = node;
    node.pos      = pos;

//    if (tc.isEntryEnabled())
//      SibTr.exit(tc, "setElement");
  }
167037
public void insertNode(int n, int pos)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    insertElementAt(n, pos);
  }
1287538
@Override
    protected void handleTransliterate(Replaceable text,
                                       Position pos, boolean incremental) {
        int start = pos.start;
        int limit = pos.limit;

        StringBuilder buf = new StringBuilder(prefix);
        int prefixLen = prefix.length();
        boolean redoPrefix = false;

        while (start < limit) {
            int c = grokSupplementals ? text.char32At(start) : text.charAt(start);
            int charLen = grokSupplementals ? UTF16.getCharCount(c) : 1;

            if ((c & 0xFFFF0000) != 0 && supplementalHandler != null) {
                buf.setLength(0);
                buf.append(supplementalHandler.prefix);
                Utility.appendNumber(buf, c, supplementalHandler.radix,
                                     supplementalHandler.minDigits);
                buf.append(supplementalHandler.suffix);
                redoPrefix = true;
            } else {
                if (redoPrefix) {
                    buf.setLength(0);
                    buf.append(prefix);
                    redoPrefix = false;
                } else {
                    buf.setLength(prefixLen);
                }
                Utility.appendNumber(buf, c, radix, minDigits);
                buf.append(suffix);
            }

            text.replace(start, start + charLen, buf.toString());
            start += buf.length();
            limit += buf.length() - charLen;
        }

        pos.contextLimit += limit - pos.limit;
        pos.limit = limit;
        pos.start = start;
    }
398251
function saveAfter(pos) {
        if (self.history.textAfter(pos.node).length > pos.offset) {
          self.line = pos.node;
          self.offset = pos.offset + 1;
        }
        else {
          self.line = self.history.nodeAfter(pos.node);
          self.offset = 0;
        }
      }
88484
protected void onPreTransform(View view, float position) {
        final float width = view.getWidth();

        ViewHelper.setRotationX(view,0);
        ViewHelper.setRotationY(view,0);
        ViewHelper.setRotation(view,0);
        ViewHelper.setScaleX(view,1);
        ViewHelper.setScaleY(view,1);
        ViewHelper.setPivotX(view,0);
        ViewHelper.setPivotY(view,0);
        ViewHelper.setTranslationY(view,0);
        ViewHelper.setTranslationX(view,isPagingEnabled() ? 0f : -width * position);

        if (hideOffscreenPages()) {
            ViewHelper.setAlpha(view,position <= -1f || position >= 1f ? 0f : 1f);
        } else {
            ViewHelper.setAlpha(view,1f);
        }
        if(mCustomAnimationInterface != null){
            if(h.containsKey(view) == false || h.get(view).size() == 1){
                if(position > -1 && position < 1){
                    if(h.get(view) == null){
                        h.put(view,new ArrayList<Float>());
                    }
                    h.get(view).add(position);
                    if(h.get(view).size() == 2){
                        float zero = h.get(view).get(0);
                        float cha = h.get(view).get(1) - h.get(view).get(0);
                        if(zero > 0){
                            if(cha > -1 && cha < 0){
                                //in
                                mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                            }else{
                                //out
                                mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                            }
                        }else{
                            if(cha > -1 && cha < 0){
                                //out
                                mCustomAnimationInterface.onPrepareCurrentItemLeaveScreen(view);
                            }else{
                                //in
                                mCustomAnimationInterface.onPrepareNextItemShowInScreen(view);
                            }
                        }
                    }
                }
            }
        }
    }
680293
public void updateSequenceElement(int[] sequence, int pos, int oldVal) {
    if(models != null){
      for(int i = 0; i < models.length; i++)
        models[i].updateSequenceElement(sequence, pos, oldVal);
      return; 
    }
    model1.updateSequenceElement(sequence, pos, 0);
    model2.updateSequenceElement(sequence, pos, 0);
  }
4760
private void apply(HyphenationPattern pattern, int pos) {

    int internalOffset = pos - 2;
    HyphenationPatternPosition[] positions = pattern.getHyphenationPositions();
    for (HyphenationPatternPosition hyphenationPosition : positions) {
      int i = hyphenationPosition.index + internalOffset;
      if ((i >= 0) && (i < this.rankings.length) && (hyphenationPosition.ranking > this.rankings[i])) {
        this.rankings[i] = hyphenationPosition.ranking;
      }
    }
  }
68628
private void setCurrentPosition(long pos) {
        if (pos == Long.MAX_VALUE) {
            pos = file.length();
        }
        if (!useLoadBuf) {
            in.position((int) pos);
            return;
        }
        try {
            if (pos >= (channel.position() - in.limit()) && pos < channel.position()) {
                in.position((int) (pos - (channel.position() - in.limit())));
            } else {
                channel.position(pos);
                fillBuffer(bufferSize, true);
            }
        } catch (Exception e) {
            log.error("Error setCurrentPosition", e);
        }

    }
771716
public static void premain(String args, Instrumentation inst) {
        GagTransformer transformer = new GagTransformer();
        if (args == null || args.length() == 0) {
            transformer.addAllGenerators();
        } else {
            for (String key : args.split(",")) {
                transformer.addGeneratorForKey(key);
            }
        }
        inst.addTransformer(transformer);
    }
982025
private void percolateDown(int pos) {
    int p = pos;
    int y = this.heap.get(p);
    while (left(p) < this.heap.size()) {
      int child = right(p) < this.heap.size() && this.s.lt(this.heap.get(right(p)), this.heap.get(left(p))) ? right(p) : left(p);
      if (!this.s.lt(this.heap.get(child), y))
        break;
      this.heap.set(p, this.heap.get(child));
      this.indices.set(this.heap.get(p), p);
      p = child;
    }
    this.heap.set(p, y);
    this.indices.set(y, p);
  }
413107
def set_position(self, decl_pos):
        """"""
        if decl_pos["typehint"] == "LineSourcePosition":
            self.editor.set_cursor(decl_pos['line'], 0)
        else:  # OffsetSourcePosition
            point = decl_pos["offset"]
            row, col = self.editor.point2pos(point + 1)
            self.editor.set_cursor(row, col)