SyntaxFactory.ParseTokens 方法

定义

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

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)

参数

text
String

输入字符串

offset
Int32

字符串中的起始偏移量

initialTokenPosition
Int32

第一个令牌的位置

返回

属性

适用于