Share via


SyntaxFactory.ParseTokens Method

Definition

Parse tokens in the input. Since this API does not create a SyntaxNode that owns all produced tokens, the GetLocation() API may yield surprising results for the produced tokens and its behavior is generally unspecified.

public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory+VB$StateMachine_1128_ParseTokens))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory+VB$StateMachine_1130_ParseTokens))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions options = default);
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory+VB$StateMachine_1128_ParseTokens))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory+VB$StateMachine_1130_ParseTokens))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
Public Shared Iterator Function ParseTokens (text As String, Optional offset As Integer = 0, Optional initialTokenPosition As Integer = 0, Optional options As VisualBasicParseOptions = Nothing) As IEnumerable(Of SyntaxToken)

Parameters

text
String

The input string

offset
Int32

The starting offset in the string

initialTokenPosition
Int32

The position of the first token

Returns

Attributes

Applies to