Class TokenNavigator
Helper class for reading and modifying tokens compiled by the TokenizerContext
Inheritance
System.Object
TokenNavigator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OfficeOpenXml.FormulaParsing.LexicalAnalysis.PostProcessing
Assembly: EPPlus.dll
Syntax
public class TokenNavigator
Constructors
TokenNavigator(IList<Token>)
Declaration
public TokenNavigator(IList<Token> tokens)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Token> | tokens |
Properties
CurrentToken
The current token.
Declaration
public Token CurrentToken { get; }
Property Value
Type | Description |
---|---|
Token |
Index
The index of the current token.
Declaration
public int Index { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NbrOfRemainingTokens
Remaining number of tokens
Declaration
public int NbrOfRemainingTokens { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
NextToken
Declaration
public Token NextToken { get; }
Property Value
Type | Description |
---|---|
Token |
PreviousToken
The token before the current token. If current token is the first token, null will be returned.
Declaration
public Token? PreviousToken { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Token> |
Methods
GetTokenAtRelativePosition(Int32)
Returns a token using a relative position (offset) of the current token.
Declaration
public Token GetTokenAtRelativePosition(int relativePosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | relativePosition | Offset, can be positive or negative |
Returns
Type | Description |
---|---|
Token | The Token of the requested position |
HasNext()
Returns true if there is a next token relative to the current token.
Declaration
public bool HasNext()
Returns
Type | Description |
---|---|
System.Boolean |
HasPrev()
Returns true if there is a previous token relative to the current token.
Declaration
public bool HasPrev()
Returns
Type | Description |
---|---|
System.Boolean |
MoveIndex(Int32)
Moves to a position relative to current token
Declaration
public void MoveIndex(int relativePosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | relativePosition | The requested position relative to current |
MoveNext()
Moves to the next token
Declaration
public void MoveNext()