Exemplo n.º 1
0
 /// <summary>
 /// Sets the current iterator position to a previous position returned by GetCurrentPosition.
 /// After a call to this method, GetNextToken returns the token FOLLOWING the current position.
 /// </summary>
 public void SeekToPosition(object iteratorPosition)
 {
     currentPosition = (TokensLineIteratorPosition)iteratorPosition;
     if (currentPosition.LineIndex >= 0 && currentPosition.LineIndex < tokensLines.Count)
     {
         currentLine = tokensLines[currentPosition.LineIndex];
     }
     else
     {
         currentLine = null;
     }
     if (currentPosition.TokenIndexInLine >= 0 && currentLine != null)
     {
         currentToken = currentLine.SourceTokens[currentPosition.TokenIndexInLine];
     }
     else
     {
         currentToken = null;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the current iterator position to a previous position returned by GetCurrentPosition.
 /// After a call to this method, GetNextToken returns the token FOLLOWING the current position.
 /// </summary>
 public void SeekToPosition(object iteratorPosition)
 {
     currentPosition = (TokensLineIteratorPosition)iteratorPosition;
     if (currentPosition.LineIndex >= 0 && currentPosition.LineIndex < tokensLines.Count)
     {
         currentLine = tokensLines[currentPosition.LineIndex];
     }
     else
     {
         currentLine = null;
     }
     if (currentPosition.TokenIndexInLine >= 0 && currentLine != null)
     {
         currentToken = currentLine.SourceTokens[currentPosition.TokenIndexInLine];
     }
     else
     {
         currentToken = null;
     }
 }