SyntaxFactory.Token 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Token(SyntaxKind) |
创建与语法类型对应的标记。 此方法可用于标记语法类型,其文本可以单独由类型推断。 |
Token(SyntaxTriviaList, SyntaxKind, SyntaxTriviaList) |
创建与语法类型对应的标记。 此方法可用于标记语法类型,其文本可以单独由类型推断。 |
Token(SyntaxTriviaList, SyntaxKind, String, String, SyntaxTriviaList) |
创建与语法类型对应的标记。 此方法提供对标记 Text 和 ValueText 的控制。 例如,请考虑文本“<see cref=”operator +“/>”。 若要为运算符符号 (+) 的值创建令牌,可调用 Token (default (SyntaxTriviaList) 、SyntaxKind.PlusToken、“+”、“+”、default (SyntaxTriviaList) ) 。 |
Token(SyntaxKind)
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
创建与语法类型对应的标记。 此方法可用于标记语法类型,其文本可以单独由类型推断。
public:
static Microsoft::CodeAnalysis::SyntaxToken Token(Microsoft::CodeAnalysis::CSharp::SyntaxKind kind);
public static Microsoft.CodeAnalysis.SyntaxToken Token (Microsoft.CodeAnalysis.CSharp.SyntaxKind kind);
static member Token : Microsoft.CodeAnalysis.CSharp.SyntaxKind -> Microsoft.CodeAnalysis.SyntaxToken
Public Shared Function Token (kind As SyntaxKind) As SyntaxToken
参数
- kind
- SyntaxKind
标记的语法类型值。 它们具有后缀 Token 或 Keyword。
返回
适用于
Token(SyntaxTriviaList, SyntaxKind, SyntaxTriviaList)
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
创建与语法类型对应的标记。 此方法可用于标记语法类型,其文本可以单独由类型推断。
public:
static Microsoft::CodeAnalysis::SyntaxToken Token(Microsoft::CodeAnalysis::SyntaxTriviaList leading, Microsoft::CodeAnalysis::CSharp::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxTriviaList trailing);
public static Microsoft.CodeAnalysis.SyntaxToken Token (Microsoft.CodeAnalysis.SyntaxTriviaList leading, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxTriviaList trailing);
static member Token : Microsoft.CodeAnalysis.SyntaxTriviaList * Microsoft.CodeAnalysis.CSharp.SyntaxKind * Microsoft.CodeAnalysis.SyntaxTriviaList -> Microsoft.CodeAnalysis.SyntaxToken
Public Shared Function Token (leading As SyntaxTriviaList, kind As SyntaxKind, trailing As SyntaxTriviaList) As SyntaxToken
参数
- leading
- SyntaxTriviaList
紧挨着令牌前面的琐事列表。
- kind
- SyntaxKind
标记的语法类型值。 它们具有后缀 Token 或 Keyword。
- trailing
- SyntaxTriviaList
紧跟令牌后面的琐事列表。
返回
适用于
Token(SyntaxTriviaList, SyntaxKind, String, String, SyntaxTriviaList)
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
- Source:
- SyntaxFactory.cs
创建与语法类型对应的标记。 此方法提供对标记 Text 和 ValueText 的控制。
例如,请考虑文本“<see cref=”operator +“/>”。 若要为运算符符号 (+) 的值创建令牌,可调用 Token (default (SyntaxTriviaList) 、SyntaxKind.PlusToken、“+”、“+”、default (SyntaxTriviaList) ) 。
public:
static Microsoft::CodeAnalysis::SyntaxToken Token(Microsoft::CodeAnalysis::SyntaxTriviaList leading, Microsoft::CodeAnalysis::CSharp::SyntaxKind kind, System::String ^ text, System::String ^ valueText, Microsoft::CodeAnalysis::SyntaxTriviaList trailing);
public static Microsoft.CodeAnalysis.SyntaxToken Token (Microsoft.CodeAnalysis.SyntaxTriviaList leading, Microsoft.CodeAnalysis.CSharp.SyntaxKind kind, string text, string valueText, Microsoft.CodeAnalysis.SyntaxTriviaList trailing);
static member Token : Microsoft.CodeAnalysis.SyntaxTriviaList * Microsoft.CodeAnalysis.CSharp.SyntaxKind * string * string * Microsoft.CodeAnalysis.SyntaxTriviaList -> Microsoft.CodeAnalysis.SyntaxToken
Public Shared Function Token (leading As SyntaxTriviaList, kind As SyntaxKind, text As String, valueText As String, trailing As SyntaxTriviaList) As SyntaxToken
参数
- leading
- SyntaxTriviaList
紧挨着令牌前面的琐事列表。
- kind
- SyntaxKind
标记的语法类型值。 它们具有后缀 Token 或 Keyword。
- text
- String
从中创建此令牌的文本 (例如,用词法) 。
- valueText
- String
C# 应如何解释此令牌的文本。
- trailing
- SyntaxTriviaList
紧跟令牌后面的琐事列表。