pub enum CSharpSyntaxKind {
Show 427 variants
Whitespace,
Comment,
Identifier,
Number,
String,
Character,
VerbatimString,
InterpolatedString,
NumberLiteral,
StringLiteral,
CharLiteral,
Abstract,
As,
Base,
Bool,
Break,
Byte,
Case,
Catch,
Char,
Checked,
Class,
Const,
Continue,
Decimal,
Default,
Delegate,
Do,
Double,
Else,
Enum,
Event,
Explicit,
Extern,
False,
Finally,
Fixed,
Float,
For,
Foreach,
Goto,
If,
Implicit,
In,
Int,
Interface,
Internal,
Is,
Lock,
Long,
Namespace,
New,
Null,
Object,
Operator,
Out,
Override,
Params,
Private,
Protected,
Public,
Readonly,
Ref,
Return,
Sbyte,
Sealed,
Short,
Sizeof,
Stackalloc,
Static,
Struct,
Switch,
This,
Throw,
True,
Try,
Typeof,
Uint,
Ulong,
Unchecked,
Unsafe,
Ushort,
Using,
Virtual,
Void,
Volatile,
While,
AbstractKeyword,
AsKeyword,
BaseKeyword,
BoolKeyword,
BreakKeyword,
ByteKeyword,
CaseKeyword,
CatchKeyword,
CharKeyword,
CheckedKeyword,
ClassKeyword,
ConstKeyword,
ContinueKeyword,
DecimalKeyword,
DefaultKeyword,
DelegateKeyword,
DoKeyword,
DoubleKeyword,
ElseKeyword,
EnumKeyword,
EventKeyword,
ExplicitKeyword,
ExternKeyword,
FalseKeyword,
FinallyKeyword,
FixedKeyword,
FloatKeyword,
ForKeyword,
ForeachKeyword,
GotoKeyword,
IfKeyword,
ImplicitKeyword,
InKeyword,
IntKeyword,
InterfaceKeyword,
InternalKeyword,
IsKeyword,
LockKeyword,
LongKeyword,
NamespaceKeyword,
NewKeyword,
NullKeyword,
ObjectKeyword,
OperatorKeyword,
OutKeyword,
OverrideKeyword,
ParamsKeyword,
PrivateKeyword,
ProtectedKeyword,
PublicKeyword,
ReadonlyKeyword,
RefKeyword,
ReturnKeyword,
SbyteKeyword,
SealedKeyword,
ShortKeyword,
SizeofKeyword,
StackallocKeyword,
StaticKeyword,
StringKeyword,
StructKeyword,
SwitchKeyword,
ThisKeyword,
ThrowKeyword,
TrueKeyword,
TryKeyword,
TypeofKeyword,
UintKeyword,
UlongKeyword,
UncheckedKeyword,
UnsafeKeyword,
UshortKeyword,
UsingKeyword,
VirtualKeyword,
VoidKeyword,
VolatileKeyword,
WhileKeyword,
AddKeyword,
AliasKeyword,
AscendingKeyword,
ByKeyword,
DescendingKeyword,
FromKeyword,
GetKeyword,
GlobalKeyword,
GroupKeyword,
IntoKeyword,
JoinKeyword,
LetKeyword,
OrderbyKeyword,
PartialKeyword,
RemoveKeyword,
SelectKeyword,
SetKeyword,
ValueKeyword,
VarKeyword,
WhereKeyword,
YieldKeyword,
Plus,
Minus,
Star,
Slash,
Percent,
Ampersand,
Pipe,
Caret,
Tilde,
BitAnd,
BitOr,
BitXor,
BitNot,
LeftShift,
RightShift,
Equal,
NotEqual,
Less,
LessEqual,
Greater,
GreaterEqual,
LogicalAnd,
LogicalOr,
LogicalNot,
Question,
QuestionQuestion,
Increment,
Decrement,
Arrow,
Lambda,
Assign,
PlusAssign,
MinusAssign,
StarAssign,
SlashAssign,
PercentAssign,
AmpersandAssign,
PipeAssign,
CaretAssign,
LeftShiftAssign,
RightShiftAssign,
QuestionQuestionAssign,
AndAssign,
OrAssign,
XorAssign,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
LeftBrace,
RightBrace,
Comma,
Semicolon,
Colon,
ColonColon,
Dot,
QuestionDot,
At,
Hash,
Dollar,
Newline,
Eof,
Error,
Root,
CompilationUnit,
NamespaceDeclaration,
UsingDirective,
ClassDeclaration,
StructDeclaration,
InterfaceDeclaration,
EnumDeclaration,
DelegateDeclaration,
MethodDeclaration,
PropertyDeclaration,
FieldDeclaration,
EventDeclaration,
IndexerDeclaration,
ConstructorDeclaration,
DestructorDeclaration,
OperatorDeclaration,
ConversionOperatorDeclaration,
Parameter,
TypeParameter,
Constraint,
Attribute,
AttributeList,
Block,
ExpressionStatement,
IfStatement,
SwitchStatement,
WhileStatement,
ForStatement,
ForeachStatement,
DoStatement,
TryStatement,
CatchClause,
FinallyClause,
ThrowStatement,
ReturnStatement,
BreakStatement,
ContinueStatement,
GotoStatement,
LabeledStatement,
LockStatement,
UsingStatement,
FixedStatement,
UnsafeStatement,
CheckedStatement,
UncheckedStatement,
YieldStatement,
LocalDeclarationStatement,
BinaryExpression,
UnaryExpression,
AssignmentExpression,
ConditionalExpression,
InvocationExpression,
MemberAccessExpression,
ElementAccessExpression,
CastExpression,
AsExpression,
IsExpression,
TypeOfExpression,
SizeOfExpression,
DefaultExpression,
LiteralExpression,
ThisExpression,
BaseExpression,
IdentifierName,
QualifiedName,
GenericName,
AliasQualifiedName,
PredefinedType,
ArrayType,
PointerType,
NullableType,
TupleType,
RefType,
ArrayCreationExpression,
ImplicitArrayCreationExpression,
StackAllocArrayCreationExpression,
ObjectCreationExpression,
AnonymousObjectCreationExpression,
ArrayInitializerExpression,
CollectionInitializerExpression,
ComplexElementInitializerExpression,
ObjectInitializerExpression,
MemberInitializerExpression,
LambdaExpression,
AnonymousMethodExpression,
QueryExpression,
QueryBody,
FromClause,
LetClause,
WhereClause,
JoinClause,
JoinIntoClause,
OrderByClause,
Ordering,
SelectClause,
GroupClause,
QueryContinuation,
OmittedArraySizeExpression,
InterpolatedStringExpression,
InterpolatedStringText,
Interpolation,
InterpolationAlignmentClause,
InterpolationFormatClause,
GlobalStatement,
SimpleLambdaExpression,
ParenthesizedLambdaExpression,
InitializerExpression,
ImplicitElementAccess,
PostfixUnaryExpression,
PrefixUnaryExpression,
AwaitExpression,
NameColon,
DeclarationExpression,
TupleExpression,
TupleElement,
SingleVariableDesignation,
ParenthesizedVariableDesignation,
DiscardDesignation,
RefExpression,
RefTypeExpression,
RefValueExpression,
MakeRefExpression,
CheckedExpression,
UncheckedExpression,
DefaultLiteralExpression,
ConditionalAccessExpression,
MemberBindingExpression,
ElementBindingExpression,
ImplicitStackAllocArrayCreationExpression,
IsPatternExpression,
ThrowExpression,
WhenClause,
ConstantPattern,
DeclarationPattern,
VarPattern,
RecursivePattern,
PositionalPatternClause,
PropertyPatternClause,
Subpattern,
SwitchExpression,
SwitchExpressionArm,
CasePatternSwitchLabel,
CaseSwitchLabel,
DiscardPattern,
TuplePattern,
ParenthesizedPattern,
RelationalPattern,
TypePattern,
BinaryPattern,
UnaryPattern,
SlicePattern,
RangeExpression,
IndexExpression,
WithExpression,
AnonymousObjectMemberDeclarator,
ArgumentList,
BracketedArgumentList,
Argument,
NameEquals,
TypeArgumentList,
TypeParameterList,
TypeParameterConstraintClause,
ConstructorConstraint,
ClassOrStructConstraint,
TypeConstraint,
BaseList,
SimpleBaseType,
PrimaryConstructorBaseType,
AccessorList,
AccessorDeclaration,
ParameterList,
BracketedParameterList,
ArrowExpressionClause,
EqualsValueClause,
VariableDeclaration,
VariableDeclarator,
SeparatedSyntaxList,
SyntaxList,
}Expand description
Represents all possible syntax kinds in the C# programming language.
This enum defines the fundamental building blocks of C# syntax, including trivia, literals, identifiers, keywords, operators, delimiters, and composite syntax nodes.
Variants§
Whitespace
Whitespace characters (spaces, tabs)
Comment
Comments (both single-line and multi-line)
Identifier
Identifiers (variable names, function names, etc.)
Number
Number literals (integer and floating-point)
String
String literals (e.g., “hello”)
Character
Character literals (e.g., ‘a’)
VerbatimString
Verbatim string literals (e.g., @“hello”)
InterpolatedString
Interpolated string literals (e.g., $“hello {name}”)
NumberLiteral
Number literals
StringLiteral
String literals
CharLiteral
Character literals
Abstract
Abstract keyword
As
As keyword
Base
Base keyword
Bool
Bool keyword
Break
Break keyword
Byte
Byte keyword
Case
Case keyword
Catch
Catch keyword
Char
Char keyword
Checked
Checked keyword
Class
Class keyword
Const
Const keyword
Continue
Continue keyword
Decimal
Decimal keyword
Default
Default keyword
Delegate
Delegate keyword
Do
Do keyword
Double
Double keyword
Else
Else keyword
Enum
Enum keyword
Event
Event keyword
Explicit
Explicit keyword
Extern
Extern keyword
False
False keyword
Finally
Finally keyword
Fixed
Fixed keyword
Float
Float keyword
For
For keyword
Foreach
Foreach keyword
Goto
Goto keyword
If
If keyword
Implicit
Implicit keyword
In
In keyword
Int
Int keyword
Interface
Interface keyword
Internal
Internal keyword
Is
Is keyword
Lock
Lock keyword
Long
Long keyword
Namespace
Namespace keyword
New
New keyword
Null
Null keyword
Object
Object keyword
Operator
Operator keyword
Out
Out keyword
Override
Override keyword
Params
Params keyword
Private
Private keyword
Protected
Protected keyword
Public
Public keyword
Readonly
Readonly keyword
Ref
Ref keyword
Return
Return keyword
Sbyte
Sbyte keyword
Sealed
Sealed keyword
Short
Short keyword
Sizeof
Sizeof keyword
Stackalloc
Stackalloc keyword
Static
Static keyword
Struct
Struct keyword
Switch
Switch keyword
This
This keyword
Throw
Throw keyword
True
True keyword
Try
Try keyword
Typeof
Typeof keyword
Uint
Uint keyword
Ulong
Ulong keyword
Unchecked
Unchecked keyword
Unsafe
Unsafe keyword
Ushort
Ushort keyword
Using
Using keyword
Virtual
Virtual keyword
Void
Void keyword
Volatile
Volatile keyword
While
While keyword
AbstractKeyword
Abstract keyword
AsKeyword
As keyword
BaseKeyword
Base keyword
BoolKeyword
Bool keyword
BreakKeyword
Break keyword
ByteKeyword
Byte keyword
CaseKeyword
Case keyword
CatchKeyword
Catch keyword
CharKeyword
Char keyword
CheckedKeyword
Checked keyword
ClassKeyword
Class keyword
ConstKeyword
Const keyword
ContinueKeyword
Continue keyword
DecimalKeyword
Decimal keyword
DefaultKeyword
Default keyword
DelegateKeyword
Delegate keyword
DoKeyword
Do keyword
DoubleKeyword
Double keyword
ElseKeyword
Else keyword
EnumKeyword
Enum keyword
EventKeyword
Event keyword
ExplicitKeyword
Explicit keyword
ExternKeyword
Extern keyword
FalseKeyword
False keyword
FinallyKeyword
Finally keyword
FixedKeyword
Fixed keyword
FloatKeyword
Float keyword
ForKeyword
For keyword
ForeachKeyword
Foreach keyword
GotoKeyword
Goto keyword
IfKeyword
If keyword
ImplicitKeyword
Implicit keyword
InKeyword
In keyword
IntKeyword
Int keyword
InterfaceKeyword
Interface keyword
InternalKeyword
Internal keyword
IsKeyword
Is keyword
LockKeyword
Lock keyword
LongKeyword
Long keyword
NamespaceKeyword
Namespace keyword
NewKeyword
New keyword
NullKeyword
Null keyword
ObjectKeyword
Object keyword
OperatorKeyword
Operator keyword
OutKeyword
Out keyword
OverrideKeyword
Override keyword
ParamsKeyword
Params keyword
PrivateKeyword
Private keyword
ProtectedKeyword
Protected keyword
PublicKeyword
Public keyword
ReadonlyKeyword
Readonly keyword
RefKeyword
Ref keyword
ReturnKeyword
Return keyword
SbyteKeyword
Sbyte keyword
SealedKeyword
Sealed keyword
ShortKeyword
Short keyword
SizeofKeyword
Sizeof keyword
StackallocKeyword
Stackalloc keyword
StaticKeyword
Static keyword
StringKeyword
String keyword
StructKeyword
Struct keyword
SwitchKeyword
Switch keyword
ThisKeyword
This keyword
ThrowKeyword
Throw keyword
TrueKeyword
True keyword
TryKeyword
Try keyword
TypeofKeyword
Typeof keyword
UintKeyword
Uint keyword
UlongKeyword
Ulong keyword
UncheckedKeyword
Unchecked keyword
UnsafeKeyword
Unsafe keyword
UshortKeyword
Ushort keyword
UsingKeyword
Using keyword
VirtualKeyword
Virtual keyword
VoidKeyword
Void keyword
VolatileKeyword
Volatile keyword
WhileKeyword
While keyword
AddKeyword
Add keyword
AliasKeyword
Alias keyword
AscendingKeyword
Ascending keyword
ByKeyword
By keyword
DescendingKeyword
Descending keyword
FromKeyword
From keyword
GetKeyword
Get keyword
GlobalKeyword
Global keyword
GroupKeyword
Group keyword
IntoKeyword
Into keyword
JoinKeyword
Join keyword
LetKeyword
Let keyword
OrderbyKeyword
Orderby keyword
PartialKeyword
Partial keyword
RemoveKeyword
Remove keyword
SelectKeyword
Select keyword
SetKeyword
Set keyword
ValueKeyword
Value keyword
VarKeyword
Var keyword
WhereKeyword
Where keyword
YieldKeyword
Yield keyword
Plus
Plus operator: +
Minus
Minus operator: -
Star
Multiplication operator: *
Slash
Division operator: /
Percent
Modulo operator: %
Ampersand
Ampersand operator: &
Pipe
Bitwise OR operator: |
Caret
Bitwise XOR operator: ^
Tilde
Bitwise NOT operator: ~
BitAnd
Bitwise AND operator: &
BitOr
Bitwise OR operator: |
BitXor
Bitwise XOR operator: ^
BitNot
Bitwise NOT operator: ~
LeftShift
Left shift operator: <<
RightShift
Right shift operator: >>
Equal
Equality operator: ==
NotEqual
Inequality operator: !=
Less
Less-than operator: <
LessEqual
Less-than-or-equal operator: <=
Greater
Greater-than operator: >
GreaterEqual
Greater-than-or-equal operator: >=
LogicalAnd
Logical AND operator: &&
LogicalOr
Logical OR operator: ||
LogicalNot
Logical NOT operator: !
Question
Ternary operator: ?
QuestionQuestion
Null-coalescing operator: ??
Increment
Increment operator: ++
Decrement
Decrement operator: –
Arrow
Arrow operator: ->
Lambda
Lambda operator: =>
Assign
Assignment operator: =
PlusAssign
Plus-assignment operator: +=
MinusAssign
Minus-assignment operator: -=
StarAssign
Multiply-assignment operator: *=
SlashAssign
Divide-assignment operator: /=
PercentAssign
Modulo-assignment operator: %=
AmpersandAssign
AND-assignment operator: &=
PipeAssign
OR-assignment operator: |=
CaretAssign
XOR-assignment operator: ^=
LeftShiftAssign
Left shift-assignment operator: <<=
RightShiftAssign
Right shift-assignment operator: >>=
QuestionQuestionAssign
Null-coalescing-assignment operator: ??=
AndAssign
AND-assignment operator: &=
OrAssign
OR-assignment operator: |=
XorAssign
XOR-assignment operator: ^=
LeftParen
Left parenthesis: (
RightParen
Right parenthesis: )
LeftBracket
Left bracket: [
RightBracket
Right bracket: ]
LeftBrace
Left brace: {
RightBrace
Right brace: }
Comma
Comma: ,
Semicolon
Semicolon: ;
Colon
Colon: :
ColonColon
Double colon: ::
Dot
Dot operator: .
QuestionDot
Null-conditional operator: ?.
At
At symbol: @
Hash
Hash symbol: #
Dollar
Dollar symbol: $
Newline
Newline characters
Eof
End of file marker
Error
Error token
Root
Root node of the syntax tree
CompilationUnit
Compilation unit (source file)
NamespaceDeclaration
Namespace declaration
UsingDirective
Using directive
ClassDeclaration
Class declaration
StructDeclaration
Struct declaration
InterfaceDeclaration
Interface declaration
EnumDeclaration
Enum declaration
DelegateDeclaration
Delegate declaration
MethodDeclaration
Method declaration
PropertyDeclaration
Property declaration
FieldDeclaration
Field declaration
EventDeclaration
Event declaration
IndexerDeclaration
Indexer declaration
ConstructorDeclaration
Constructor declaration
DestructorDeclaration
Destructor declaration
OperatorDeclaration
Operator declaration
ConversionOperatorDeclaration
Conversion operator declaration
Parameter
Parameter
TypeParameter
Type parameter
Constraint
Constraint
Attribute
Attribute
AttributeList
Attribute list
Block
Block statement
ExpressionStatement
Expression statement
IfStatement
If statement
SwitchStatement
Switch statement
WhileStatement
While statement
ForStatement
For statement
ForeachStatement
Foreach statement
DoStatement
Do-while statement
TryStatement
Try statement
CatchClause
Catch clause
FinallyClause
Finally clause
ThrowStatement
Throw statement
ReturnStatement
Return statement
BreakStatement
Break statement
ContinueStatement
Continue statement
GotoStatement
Goto statement
LabeledStatement
Labeled statement
LockStatement
Lock statement
UsingStatement
Using statement
FixedStatement
Fixed statement
UnsafeStatement
Unsafe statement
CheckedStatement
Checked statement
UncheckedStatement
Unchecked statement
YieldStatement
Yield statement
LocalDeclarationStatement
Local declaration statement
BinaryExpression
Binary expression
UnaryExpression
Unary expression
AssignmentExpression
Assignment expression
ConditionalExpression
Conditional expression (ternary)
InvocationExpression
Method invocation expression
MemberAccessExpression
Member access expression
ElementAccessExpression
Element access expression
CastExpression
Cast expression
AsExpression
As expression
IsExpression
Is expression
TypeOfExpression
Typeof expression
SizeOfExpression
Sizeof expression
DefaultExpression
Default value expression
LiteralExpression
Literal expression
ThisExpression
This expression
BaseExpression
Base expression
IdentifierName
Identifier name
QualifiedName
Qualified name
GenericName
Generic name
AliasQualifiedName
Alias qualified name
PredefinedType
Predefined type
ArrayType
Array type
PointerType
Pointer type
NullableType
Nullable type
TupleType
Tuple type
RefType
Ref type
ArrayCreationExpression
Array creation expression
ImplicitArrayCreationExpression
Implicit array creation expression
StackAllocArrayCreationExpression
Stack alloc array creation expression
ObjectCreationExpression
Object creation expression
AnonymousObjectCreationExpression
Anonymous object creation expression
ArrayInitializerExpression
Array initializer expression
CollectionInitializerExpression
Collection initializer expression
ComplexElementInitializerExpression
Complex element initializer expression
ObjectInitializerExpression
Object initializer expression
MemberInitializerExpression
Member initializer expression
LambdaExpression
Lambda expression
AnonymousMethodExpression
Anonymous method expression
QueryExpression
Query expression
QueryBody
Query body
FromClause
From clause
LetClause
Let clause
WhereClause
Where clause
JoinClause
Join clause
JoinIntoClause
Join into clause
OrderByClause
Order by clause
Ordering
Ordering
SelectClause
Select clause
GroupClause
Group clause
QueryContinuation
Query continuation
OmittedArraySizeExpression
Omitted array size expression
InterpolatedStringExpression
Interpolated string expression
InterpolatedStringText
Interpolated string text
Interpolation
Interpolation
InterpolationAlignmentClause
Interpolation alignment clause
InterpolationFormatClause
Interpolation format clause
GlobalStatement
Global statement
SimpleLambdaExpression
Simple lambda expression
ParenthesizedLambdaExpression
Parenthesized lambda expression
InitializerExpression
Initializer expression
ImplicitElementAccess
Implicit element access
PostfixUnaryExpression
Postfix unary expression
PrefixUnaryExpression
Prefix unary expression
AwaitExpression
Await expression
NameColon
Name colon
DeclarationExpression
Declaration expression
TupleExpression
Tuple expression
TupleElement
Tuple element
SingleVariableDesignation
Single variable designation
ParenthesizedVariableDesignation
Parenthesized variable designation
DiscardDesignation
Discard designation
RefExpression
Ref expression
RefTypeExpression
Ref type expression
RefValueExpression
Ref value expression
MakeRefExpression
Make ref expression
CheckedExpression
Checked expression
UncheckedExpression
Unchecked expression
DefaultLiteralExpression
Default literal expression
ConditionalAccessExpression
Conditional access expression
MemberBindingExpression
Member binding expression
ElementBindingExpression
Element binding expression
ImplicitStackAllocArrayCreationExpression
IsPatternExpression
ThrowExpression
WhenClause
ConstantPattern
DeclarationPattern
VarPattern
RecursivePattern
PositionalPatternClause
PropertyPatternClause
Subpattern
SwitchExpression
Switch expression
SwitchExpressionArm
Switch expression arm
CasePatternSwitchLabel
Case pattern switch label
CaseSwitchLabel
Case switch label
DiscardPattern
Discard pattern
TuplePattern
Tuple pattern
ParenthesizedPattern
Parenthesized pattern
RelationalPattern
Relational pattern
TypePattern
Type pattern
BinaryPattern
Binary pattern
UnaryPattern
Unary pattern
SlicePattern
Slice pattern
RangeExpression
Range expression
IndexExpression
Index expression
WithExpression
With expression
AnonymousObjectMemberDeclarator
Anonymous object member declarator
ArgumentList
Argument list
BracketedArgumentList
Bracketed argument list
Argument
Argument
NameEquals
Name equals
TypeArgumentList
Type argument list
TypeParameterList
Type parameter list
TypeParameterConstraintClause
Type parameter constraint clause
ConstructorConstraint
Constructor constraint
ClassOrStructConstraint
Class or struct constraint
TypeConstraint
Type constraint
BaseList
Base list
SimpleBaseType
Simple base type
PrimaryConstructorBaseType
Primary constructor base type
AccessorList
Accessor list
AccessorDeclaration
Accessor declaration
ParameterList
Parameter list
BracketedParameterList
Bracketed parameter list
ArrowExpressionClause
Arrow expression clause
EqualsValueClause
Equals value clause
VariableDeclaration
Variable declaration
VariableDeclarator
Variable declarator
SeparatedSyntaxList
Separated syntax list
SyntaxList
Syntax list
Trait Implementations§
Source§impl Clone for CSharpSyntaxKind
impl Clone for CSharpSyntaxKind
Source§fn clone(&self) -> CSharpSyntaxKind
fn clone(&self) -> CSharpSyntaxKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more