Sdílet prostřednictvím


SyntaxFactory.ParseTokens(String, Int32, Int32, CSharpParseOptions) Method

Definition

Parse a sequence of C# language tokens. 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.

[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__699))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__701))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__212))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__220))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__698))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__739))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__762))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__778))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__224))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__228))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
[System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__229))]
public static System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> ParseTokens (string text, int offset = 0, int initialTokenPosition = 0, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? options = default);
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__699))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__701))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__212))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__220))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__698))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__739))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__762))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__778))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__224))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__228))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> seq<Microsoft.CodeAnalysis.SyntaxToken>
[<System.Runtime.CompilerServices.IteratorStateMachine(typeof(Microsoft.CodeAnalysis.CSharp.SyntaxFactory+<ParseTokens>d__229))>]
static member ParseTokens : string * int * int * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions -> 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 CSharpParseOptions = Nothing) As IEnumerable(Of SyntaxToken)

Parameters

text
String

The text of all the tokens.

offset
Int32

Optional offset into text.

initialTokenPosition
Int32

An integer to use as the starting position of the first token.

options
CSharpParseOptions

Parse options.

Returns

Attributes

Applies to