SyntaxFactory.ParseTokens(String, Int32, Int32, CSharpParseOptions) 方法

定义

分析 C# 语言令牌序列。 由于此 API 不创建拥有所有生成的令牌的 SyntaxNode 令牌, GetLocation() 因此 API 可能会为生成的令牌产生令人惊讶的结果,并且其行为通常未指定。

[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);
[<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)

参数

text
String

所有令牌的文本。

offset
Int32

文本的可选偏移量。

initialTokenPosition
Int32

用作第一个标记的起始位置的整数。

options
CSharpParseOptions

分析选项

返回

属性

适用于