CppSyntaxKind

Enum CppSyntaxKind 

Source
#[repr(u16)]
pub enum CppSyntaxKind {
Show 60 variants Whitespace = 0, Newline = 1, Comment = 2, StringLiteral = 3, CharacterLiteral = 4, IntegerLiteral = 5, FloatLiteral = 6, BooleanLiteral = 7, Identifier = 8, Keyword = 9, Plus = 10, Minus = 11, Star = 12, Slash = 13, Percent = 14, Assign = 15, PlusAssign = 16, MinusAssign = 17, StarAssign = 18, SlashAssign = 19, PercentAssign = 20, Equal = 21, NotEqual = 22, Less = 23, Greater = 24, LessEqual = 25, GreaterEqual = 26, LogicalAnd = 27, LogicalOr = 28, LogicalNot = 29, BitAnd = 30, BitOr = 31, BitXor = 32, BitNot = 33, LeftShift = 34, RightShift = 35, AndAssign = 36, OrAssign = 37, XorAssign = 38, LeftShiftAssign = 39, RightShiftAssign = 40, Increment = 41, Decrement = 42, Arrow = 43, Dot = 44, Question = 45, Colon = 46, Scope = 47, LeftParen = 48, RightParen = 49, LeftBracket = 50, RightBracket = 51, LeftBrace = 52, RightBrace = 53, Comma = 54, Semicolon = 55, Preprocessor = 56, SourceFile = 57, Error = 58, Eof = 59,
}
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, preprocessor directives, and composite nodes.

Variants§

§

Whitespace = 0

Whitespace characters (spaces, tabs)

§

Newline = 1

Newline characters

§

Comment = 2

Comments (both single-line and multi-line)

§

StringLiteral = 3

String literals (e.g., “hello”)

§

CharacterLiteral = 4

Character literals (e.g., ‘a’)

§

IntegerLiteral = 5

Integer literals (e.g., 42, 0xFF)

§

FloatLiteral = 6

Floating-point literals (e.g., 3.14, 2.5e10)

§

BooleanLiteral = 7

Boolean literals (true, false)

§

Identifier = 8

Identifiers (variable names, function names, etc.)

§

Keyword = 9

Keywords (language reserved words)

§

Plus = 10

Plus operator: +

§

Minus = 11

Minus operator: -

§

Star = 12

Multiplication operator: *

§

Slash = 13

Division operator: /

§

Percent = 14

Modulo operator: %

§

Assign = 15

Assignment operator: =

§

PlusAssign = 16

Plus-assignment operator: +=

§

MinusAssign = 17

Minus-assignment operator: -=

§

StarAssign = 18

Multiply-assignment operator: *=

§

SlashAssign = 19

Divide-assignment operator: /=

§

PercentAssign = 20

Modulo-assignment operator: %=

§

Equal = 21

Equality operator: ==

§

NotEqual = 22

Inequality operator: !=

§

Less = 23

Less-than operator: <

§

Greater = 24

Greater-than operator: >

§

LessEqual = 25

Less-than-or-equal operator: <=

§

GreaterEqual = 26

Greater-than-or-equal operator: >=

§

LogicalAnd = 27

Logical AND operator: &&

§

LogicalOr = 28

Logical OR operator: ||

§

LogicalNot = 29

Logical NOT operator: !

§

BitAnd = 30

Bitwise AND operator: &

§

BitOr = 31

Bitwise OR operator: |

§

BitXor = 32

Bitwise XOR operator: ^

§

BitNot = 33

Bitwise NOT operator: ~

§

LeftShift = 34

Left shift operator: <<

§

RightShift = 35

Right shift operator: >>

§

AndAssign = 36

AND-assignment operator: &=

§

OrAssign = 37

OR-assignment operator: |=

§

XorAssign = 38

XOR-assignment operator: ^=

§

LeftShiftAssign = 39

Left shift-assignment operator: <<=

§

RightShiftAssign = 40

Right shift-assignment operator: >>=

§

Increment = 41

Increment operator: ++

§

Decrement = 42

Decrement operator: –

§

Arrow = 43

Arrow operator: ->

§

Dot = 44

Dot operator: .

§

Question = 45

Ternary operator: ?

§

Colon = 46

Colon operator: :

§

Scope = 47

Scope resolution operator: ::

§

LeftParen = 48

Left parenthesis: (

§

RightParen = 49

Right parenthesis: )

§

LeftBracket = 50

Left bracket: [

§

RightBracket = 51

Right bracket: ]

§

LeftBrace = 52

Left brace: {

§

RightBrace = 53

Right brace: }

§

Comma = 54

Comma: ,

§

Semicolon = 55

Semicolon: ;

§

Preprocessor = 56

Preprocessor directives (e.g., #include, #define)

§

SourceFile = 57

Root node of the source file

§

Error = 58

Error token

§

Eof = 59

End of file marker

Trait Implementations§

Source§

impl Clone for CppSyntaxKind

Source§

fn clone(&self) -> CppSyntaxKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CppSyntaxKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for CppSyntaxKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for CppSyntaxKind

Source§

fn cmp(&self, other: &CppSyntaxKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for CppSyntaxKind

Source§

fn eq(&self, other: &CppSyntaxKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for CppSyntaxKind

Source§

fn partial_cmp(&self, other: &CppSyntaxKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl SyntaxKind for CppSyntaxKind

Source§

fn is_trivia(&self) -> bool

Returns true if this kind represents trivia (whitespace, comments, etc.). Read more
Source§

fn is_comment(&self) -> bool

Returns true if this kind represents a comment. Read more
Source§

fn is_whitespace(&self) -> bool

Returns true if this kind represents whitespace.
Source§

fn is_token_type(&self) -> bool

Returns true if this kind represents a token type. Read more
Source§

fn is_element_type(&self) -> bool

Returns true if this kind represents an element type. Read more
Source§

impl Copy for CppSyntaxKind

Source§

impl Eq for CppSyntaxKind

Source§

impl StructuralPartialEq for CppSyntaxKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,