SyntaxFactory.ParseTokens(String, Int32, Int32, CSharpParseOptions) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
[<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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.