Skip to main content

CppTokenType

Enum CppTokenType 

Source
#[repr(u16)]
pub enum CppTokenType {
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, Text = 57, Error = 58, Eof = 59,
}

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)

§

Text = 57

§

Error = 58

§

Eof = 59

Trait Implementations§

Source§

impl Clone for CppTokenType

Source§

fn clone(&self) -> CppTokenType

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 CppTokenType

Source§

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

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

impl<'de> Deserialize<'de> for CppTokenType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<CppTokenType> for CppElementType

Source§

fn from(token: CppTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for CppTokenType

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 CppTokenType

Source§

fn cmp(&self, other: &CppTokenType) -> 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 CppTokenType

Source§

fn eq(&self, other: &CppTokenType) -> 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 CppTokenType

Source§

fn partial_cmp(&self, other: &CppTokenType) -> 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 Serialize for CppTokenType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TokenType for CppTokenType

Source§

const END_OF_STREAM: Self = Self::Eof

A constant representing the end of the input stream. Read more
Source§

type Role = UniversalTokenRole

The associated role type for this token kind.
Source§

fn is_comment(&self) -> bool

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

fn is_whitespace(&self) -> bool

Returns true if this token represents whitespace. Read more
Source§

fn role(&self) -> Self::Role

Returns the general syntactic role of this token. Read more
Source§

fn is_role(&self, role: Self::Role) -> bool

Returns true if this token matches the specified language-specific role.
Source§

fn is_universal(&self, role: UniversalTokenRole) -> bool

Returns true if this token matches the specified universal role.
Source§

fn is_error(&self) -> bool

Returns true if this token represents an error condition. Read more
Source§

fn is_ignored(&self) -> bool

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

fn is_end_of_stream(&self) -> bool

Returns true if this token represents the end of the input stream. Read more
Source§

impl Copy for CppTokenType

Source§

impl Eq for CppTokenType

Source§

impl StructuralPartialEq for CppTokenType

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,