#[repr(u16)]pub enum CTokenType {
Show 101 variants
LeftParen = 0,
RightParen = 1,
LeftBracket = 2,
RightBracket = 3,
LeftBrace = 4,
RightBrace = 5,
Comma = 6,
Semicolon = 7,
Colon = 8,
Dot = 9,
Question = 10,
Plus = 11,
Minus = 12,
Star = 13,
Slash = 14,
Percent = 15,
Assign = 16,
PlusAssign = 17,
MinusAssign = 18,
StarAssign = 19,
SlashAssign = 20,
PercentAssign = 21,
Equal = 22,
NotEqual = 23,
Less = 24,
Greater = 25,
LessEqual = 26,
GreaterEqual = 27,
LogicalAnd = 28,
LogicalOr = 29,
LogicalNot = 30,
BitAnd = 31,
BitOr = 32,
BitXor = 33,
BitNot = 34,
LeftShift = 35,
RightShift = 36,
AndAssign = 37,
OrAssign = 38,
XorAssign = 39,
LeftShiftAssign = 40,
RightShiftAssign = 41,
Increment = 42,
Decrement = 43,
Arrow = 44,
Auto = 45,
Break = 46,
Case = 47,
Char = 48,
Const = 49,
Continue = 50,
Default = 51,
Do = 52,
Double = 53,
Else = 54,
Enum = 55,
Extern = 56,
Float = 57,
For = 58,
Goto = 59,
If = 60,
Inline = 61,
Int = 62,
Long = 63,
Register = 64,
Restrict = 65,
Return = 66,
Short = 67,
Signed = 68,
Sizeof = 69,
Static = 70,
Struct = 71,
Switch = 72,
Typedef = 73,
Union = 74,
Unsigned = 75,
Void = 76,
Volatile = 77,
While = 78,
Alignas = 79,
Alignof = 80,
Atomic = 81,
Bool = 82,
Complex = 83,
Generic = 84,
Imaginary = 85,
Noreturn = 86,
StaticAssert = 87,
ThreadLocal = 88,
Identifier = 89,
StringLiteral = 90,
CharConstant = 91,
IntConstant = 92,
FloatConstant = 93,
Whitespace = 94,
LineComment = 95,
BlockComment = 96,
Preprocessor = 97,
Text = 98,
Error = 99,
Eof = 100,
}Expand description
Represents different types of tokens in the C language.
Variants§
LeftParen = 0
Left parenthesis: (
RightParen = 1
Right parenthesis: )
LeftBracket = 2
Left bracket: [
RightBracket = 3
Right bracket: ]
LeftBrace = 4
Left brace: {
RightBrace = 5
Right brace: }
Comma = 6
Comma: ,
Semicolon = 7
Semicolon: ;
Colon = 8
Colon: :
Dot = 9
Dot: .
Question = 10
Question mark: ?
Plus = 11
Addition operator: +
Minus = 12
Subtraction operator: -
Star = 13
Multiplication operator: *
Slash = 14
Division operator: /
Percent = 15
Modulo operator: %
Assign = 16
Assignment operator: =
PlusAssign = 17
Addition assignment: +=
MinusAssign = 18
Subtraction assignment: -=
StarAssign = 19
Multiplication assignment: *=
SlashAssign = 20
Division assignment: /=
PercentAssign = 21
Modulo assignment: %=
Equal = 22
Equality comparison: ==
NotEqual = 23
Inequality comparison: !=
Less = 24
Less than: <
Greater = 25
Greater than: >
LessEqual = 26
Less than or equal: <=
GreaterEqual = 27
Greater than or equal: >=
LogicalAnd = 28
Logical AND: &&
LogicalOr = 29
Logical OR: ||
LogicalNot = 30
Logical NOT: !
BitAnd = 31
Bitwise AND: &
BitOr = 32
Bitwise OR: |
BitXor = 33
Bitwise XOR: ^
BitNot = 34
Bitwise NOT: ~
LeftShift = 35
Left shift: <<
RightShift = 36
Right shift: >>
AndAssign = 37
Bitwise AND assignment: &=
OrAssign = 38
Bitwise OR assignment: |=
XorAssign = 39
Bitwise XOR assignment: ^=
LeftShiftAssign = 40
Left shift assignment: <<=
RightShiftAssign = 41
Right shift assignment: >>=
Increment = 42
Increment: ++
Decrement = 43
Decrement: --
Arrow = 44
Arrow operator: ->
Auto = 45
auto keyword
Break = 46
break keyword
Case = 47
case keyword
Char = 48
char keyword
Const = 49
const keyword
Continue = 50
continue keyword
Default = 51
default keyword
Do = 52
do keyword
Double = 53
double keyword
Else = 54
else keyword
Enum = 55
enum keyword
Extern = 56
extern keyword
Float = 57
float keyword
For = 58
for keyword
Goto = 59
goto keyword
If = 60
if keyword
Inline = 61
inline keyword
Int = 62
int keyword
Long = 63
long keyword
Register = 64
register keyword
Restrict = 65
restrict keyword
Return = 66
return keyword
Short = 67
short keyword
Signed = 68
signed keyword
Sizeof = 69
sizeof keyword
Static = 70
static keyword
Struct = 71
struct keyword
Switch = 72
switch keyword
Typedef = 73
typedef keyword
Union = 74
union keyword
Unsigned = 75
unsigned keyword
Void = 76
void keyword
Volatile = 77
volatile keyword
While = 78
while keyword
Alignas = 79
_Alignas keyword
Alignof = 80
_Alignof keyword
Atomic = 81
_Atomic keyword
Bool = 82
_Bool keyword
Complex = 83
_Complex keyword
Generic = 84
_Generic keyword
Imaginary = 85
_Imaginary keyword
Noreturn = 86
_Noreturn keyword
StaticAssert = 87
_Static_assert keyword
ThreadLocal = 88
_Thread_local keyword
Identifier = 89
Identifier
StringLiteral = 90
String literal
CharConstant = 91
Character constant
IntConstant = 92
Integer constant
FloatConstant = 93
Floating-point constant
Whitespace = 94
Whitespace
LineComment = 95
Single-line comment
BlockComment = 96
Multi-line comment
Preprocessor = 97
Preprocessor directive
Text = 98
Raw text or unrecognized sequence
Error = 99
Invalid token
Eof = 100
End of stream
Implementations§
Source§impl CTokenType
impl CTokenType
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Returns true if the token is a keyword.
Trait Implementations§
Source§impl Clone for CTokenType
impl Clone for CTokenType
Source§fn clone(&self) -> CTokenType
fn clone(&self) -> CTokenType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CTokenType
impl Debug for CTokenType
Source§impl Default for CTokenType
impl Default for CTokenType
Source§fn default() -> CTokenType
fn default() -> CTokenType
Source§impl<'de> Deserialize<'de> for CTokenType
impl<'de> Deserialize<'de> for CTokenType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<CTokenType> for CElementType
impl From<CTokenType> for CElementType
Source§fn from(token: CTokenType) -> Self
fn from(token: CTokenType) -> Self
Source§impl Hash for CTokenType
impl Hash for CTokenType
Source§impl Ord for CTokenType
impl Ord for CTokenType
Source§fn cmp(&self, other: &CTokenType) -> Ordering
fn cmp(&self, other: &CTokenType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CTokenType
impl PartialEq for CTokenType
Source§impl PartialOrd for CTokenType
impl PartialOrd for CTokenType
Source§impl Serialize for CTokenType
impl Serialize for CTokenType
Source§impl TokenType for CTokenType
impl TokenType for CTokenType
Source§const END_OF_STREAM: Self = Self::Eof
const END_OF_STREAM: Self = Self::Eof
The end of stream token.
Source§type Role = UniversalTokenRole
type Role = UniversalTokenRole
The token role type.
Source§fn is_ignored(&self) -> bool
fn is_ignored(&self) -> bool
Returns true if the token should be ignored during parsing.
Source§fn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Returns true if the token is a comment.
Source§fn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if the token is whitespace.