#[repr(u16)]pub enum SyntaxKind {
Show 175 variants
ErrorToken = 0,
EofToken = 1,
ForbiddenKeyword = 2,
OpaqueText = 3,
Whitespace = 4,
Comment = 5,
UppercaseIdent = 6,
LowercaseIdent = 7,
Number = 8,
NegativeNumber = 9,
QuotedString = 10,
HexString = 11,
BinString = 12,
LBracket = 13,
RBracket = 14,
LBrace = 15,
RBrace = 16,
LParen = 17,
RParen = 18,
Colon = 19,
Semicolon = 20,
Comma = 21,
Dot = 22,
Pipe = 23,
Minus = 24,
DotDot = 25,
ColonColonEqual = 26,
KwDefinitions = 27,
KwBegin = 28,
KwEnd = 29,
KwImports = 30,
KwExports = 31,
KwFrom = 32,
KwObject = 33,
KwIdentifier = 34,
KwSequence = 35,
KwOf = 36,
KwChoice = 37,
KwMacro = 38,
KwSyntax = 39,
KwMaxAccess = 40,
KwMinAccess = 41,
KwAccess = 42,
KwStatus = 43,
KwDescription = 44,
KwReference = 45,
KwIndex = 46,
KwDefval = 47,
KwAugments = 48,
KwUnits = 49,
KwDisplayHint = 50,
KwObjects = 51,
KwNotifications = 52,
KwModule = 53,
KwMandatoryGroups = 54,
KwGroup = 55,
KwWriteSyntax = 56,
KwProductRelease = 57,
KwSupports = 58,
KwIncludes = 59,
KwVariation = 60,
KwCreationRequires = 61,
KwRevision = 62,
KwLastUpdated = 63,
KwOrganization = 64,
KwContactInfo = 65,
KwImplied = 66,
KwSize = 67,
KwEnterprise = 68,
KwVariables = 69,
KwModuleIdentity = 70,
KwModuleCompliance = 71,
KwObjectGroup = 72,
KwNotificationGroup = 73,
KwAgentCapabilities = 74,
KwObjectType = 75,
KwObjectIdentity = 76,
KwNotificationType = 77,
KwTextualConvention = 78,
KwTrapType = 79,
KwInteger = 80,
KwUnsigned32 = 81,
KwCounter32 = 82,
KwCounter64 = 83,
KwGauge32 = 84,
KwIpAddress = 85,
KwOpaque = 86,
KwTimeTicks = 87,
KwBits = 88,
KwOctet = 89,
KwString = 90,
KwCounter = 91,
KwGauge = 92,
KwNetworkAddress = 93,
KwApplication = 94,
KwImplicit = 95,
KwUniversal = 96,
KwCurrent = 97,
KwDeprecated = 98,
KwObsolete = 99,
KwMandatory = 100,
KwOptional = 101,
KwReadOnly = 102,
KwReadWrite = 103,
KwReadCreate = 104,
KwWriteOnly = 105,
KwNotAccessible = 106,
KwAccessibleForNotify = 107,
KwNotImplemented = 108,
SourceFile = 109,
Module = 110,
ModuleHeader = 111,
Imports = 112,
ImportGroup = 113,
UnparsedRegion = 114,
ValueAssignment = 115,
TypeAssignment = 116,
TextualConventionDefinition = 117,
ObjectTypeDefinition = 118,
ModuleIdentityDefinition = 119,
ObjectIdentityDefinition = 120,
NotificationTypeDefinition = 121,
TrapTypeDefinition = 122,
MacroDefinition = 123,
ObjectGroupDefinition = 124,
NotificationGroupDefinition = 125,
ModuleComplianceDefinition = 126,
AgentCapabilitiesDefinition = 127,
ComplianceModule = 128,
MandatoryGroupsClause = 129,
ComplianceGroup = 130,
ComplianceObject = 131,
WriteSyntaxClause = 132,
SupportsModule = 133,
IncludesClause = 134,
VariationClause = 135,
CreationRequiresClause = 136,
SyntaxClause = 137,
AccessClause = 138,
StatusClause = 139,
DescriptionClause = 140,
ReferenceClause = 141,
UnitsClause = 142,
DisplayHintClause = 143,
IndexClause = 144,
IndexItem = 145,
AugmentsClause = 146,
DefvalClause = 147,
DefvalContent = 148,
ObjectsClause = 149,
NotificationsClause = 150,
RevisionClause = 151,
LastUpdatedClause = 152,
OrganizationClause = 153,
ContactInfoClause = 154,
EnterpriseClause = 155,
VariablesClause = 156,
ProductReleaseClause = 157,
OidAssignment = 158,
OidComponent = 159,
TypeRefSyntax = 160,
IntegerEnumSyntax = 161,
BitsSyntax = 162,
ConstrainedSyntax = 163,
Constraint = 164,
Range = 165,
NamedNumber = 166,
SequenceOfSyntax = 167,
SequenceSyntax = 168,
SequenceField = 169,
ChoiceSyntax = 170,
TaggedSyntax = 171,
OctetStringSyntax = 172,
ObjectIdentifierSyntax = 173,
Error = 174,
}Expand description
Kind of a lexical token or lossless syntax-tree node.
Values are stable within a crate release and use a 16-bit representation so the vocabulary can grow with CST node kinds.
Variants§
ErrorToken = 0
<error>
EofToken = 1
end of file
ForbiddenKeyword = 2
reserved keyword
OpaqueText = 3
opaque text
Whitespace = 4
whitespace
Comment = 5
comment
UppercaseIdent = 6
identifier
LowercaseIdent = 7
identifier
Number = 8
number
NegativeNumber = 9
negative number
QuotedString = 10
quoted string
HexString = 11
hex string
BinString = 12
binary string
LBracket = 13
‘[’
RBracket = 14
‘]’
LBrace = 15
‘{’
RBrace = 16
‘}’
LParen = 17
‘(’
RParen = 18
‘)’
Colon = 19
‘:’
Semicolon = 20
‘;’
Comma = 21
‘,’
Dot = 22
‘.’
Pipe = 23
‘|’
Minus = 24
‘-’
DotDot = 25
‘..’
ColonColonEqual = 26
‘::=’
KwDefinitions = 27
DEFINITIONS
KwBegin = 28
BEGIN
KwEnd = 29
END
KwImports = 30
IMPORTS
KwExports = 31
EXPORTS
KwFrom = 32
FROM
KwObject = 33
OBJECT
KwIdentifier = 34
IDENTIFIER
KwSequence = 35
SEQUENCE
KwOf = 36
OF
KwChoice = 37
CHOICE
KwMacro = 38
MACRO
KwSyntax = 39
SYNTAX
KwMaxAccess = 40
MAX-ACCESS
KwMinAccess = 41
MIN-ACCESS
KwAccess = 42
ACCESS
KwStatus = 43
STATUS
KwDescription = 44
DESCRIPTION
KwReference = 45
REFERENCE
KwIndex = 46
INDEX
KwDefval = 47
DEFVAL
KwAugments = 48
AUGMENTS
KwUnits = 49
UNITS
KwDisplayHint = 50
DISPLAY-HINT
KwObjects = 51
OBJECTS
KwNotifications = 52
NOTIFICATIONS
KwModule = 53
MODULE
KwMandatoryGroups = 54
MANDATORY-GROUPS
KwGroup = 55
GROUP
KwWriteSyntax = 56
WRITE-SYNTAX
KwProductRelease = 57
PRODUCT-RELEASE
KwSupports = 58
SUPPORTS
KwIncludes = 59
INCLUDES
KwVariation = 60
VARIATION
KwCreationRequires = 61
CREATION-REQUIRES
KwRevision = 62
REVISION
KwLastUpdated = 63
LAST-UPDATED
KwOrganization = 64
ORGANIZATION
KwContactInfo = 65
CONTACT-INFO
KwImplied = 66
IMPLIED
KwSize = 67
SIZE
KwEnterprise = 68
ENTERPRISE
KwVariables = 69
VARIABLES
KwModuleIdentity = 70
MODULE-IDENTITY
KwModuleCompliance = 71
MODULE-COMPLIANCE
KwObjectGroup = 72
OBJECT-GROUP
KwNotificationGroup = 73
NOTIFICATION-GROUP
KwAgentCapabilities = 74
AGENT-CAPABILITIES
KwObjectType = 75
OBJECT-TYPE
KwObjectIdentity = 76
OBJECT-IDENTITY
KwNotificationType = 77
NOTIFICATION-TYPE
KwTextualConvention = 78
TEXTUAL-CONVENTION
KwTrapType = 79
TRAP-TYPE
KwInteger = 80
INTEGER
KwUnsigned32 = 81
Unsigned32
KwCounter32 = 82
Counter32
KwCounter64 = 83
Counter64
KwGauge32 = 84
Gauge32
KwIpAddress = 85
IpAddress
KwOpaque = 86
Opaque
KwTimeTicks = 87
TimeTicks
KwBits = 88
BITS
KwOctet = 89
OCTET
KwString = 90
STRING
KwCounter = 91
Counter
KwGauge = 92
Gauge
KwNetworkAddress = 93
NetworkAddress
KwApplication = 94
APPLICATION
KwImplicit = 95
IMPLICIT
KwUniversal = 96
UNIVERSAL
KwCurrent = 97
current
KwDeprecated = 98
deprecated
KwObsolete = 99
obsolete
KwMandatory = 100
mandatory
KwOptional = 101
optional
KwReadOnly = 102
read-only
KwReadWrite = 103
read-write
KwReadCreate = 104
read-create
KwWriteOnly = 105
write-only
KwNotAccessible = 106
not-accessible
KwAccessibleForNotify = 107
accessible-for-notify
KwNotImplemented = 108
not-implemented
SourceFile = 109
source file
Module = 110
module
ModuleHeader = 111
module header
Imports = 112
imports
ImportGroup = 113
import group
UnparsedRegion = 114
unparsed region
ValueAssignment = 115
value assignment
TypeAssignment = 116
type assignment
TextualConventionDefinition = 117
TEXTUAL-CONVENTION definition
ObjectTypeDefinition = 118
OBJECT-TYPE definition
ModuleIdentityDefinition = 119
MODULE-IDENTITY definition
ObjectIdentityDefinition = 120
OBJECT-IDENTITY definition
NotificationTypeDefinition = 121
NOTIFICATION-TYPE definition
TrapTypeDefinition = 122
TRAP-TYPE definition
MacroDefinition = 123
MACRO definition
ObjectGroupDefinition = 124
OBJECT-GROUP definition
NotificationGroupDefinition = 125
NOTIFICATION-GROUP definition
ModuleComplianceDefinition = 126
MODULE-COMPLIANCE definition
AgentCapabilitiesDefinition = 127
AGENT-CAPABILITIES definition
ComplianceModule = 128
MODULE compliance section
MandatoryGroupsClause = 129
MANDATORY-GROUPS clause
ComplianceGroup = 130
GROUP compliance refinement
ComplianceObject = 131
OBJECT compliance refinement
WriteSyntaxClause = 132
WRITE-SYNTAX clause
SupportsModule = 133
SUPPORTS capability section
IncludesClause = 134
INCLUDES clause
VariationClause = 135
VARIATION clause
CreationRequiresClause = 136
CREATION-REQUIRES clause
SyntaxClause = 137
SYNTAX clause
AccessClause = 138
access clause
StatusClause = 139
STATUS clause
DescriptionClause = 140
DESCRIPTION clause
ReferenceClause = 141
REFERENCE clause
UnitsClause = 142
UNITS clause
DisplayHintClause = 143
DISPLAY-HINT clause
IndexClause = 144
INDEX clause
IndexItem = 145
index item
AugmentsClause = 146
AUGMENTS clause
DefvalClause = 147
DEFVAL clause
DefvalContent = 148
DEFVAL content
ObjectsClause = 149
OBJECTS clause
NotificationsClause = 150
NOTIFICATIONS clause
RevisionClause = 151
REVISION clause
LastUpdatedClause = 152
LAST-UPDATED clause
OrganizationClause = 153
ORGANIZATION clause
ContactInfoClause = 154
CONTACT-INFO clause
EnterpriseClause = 155
ENTERPRISE clause
VariablesClause = 156
VARIABLES clause
ProductReleaseClause = 157
PRODUCT-RELEASE clause
OidAssignment = 158
OID assignment
OidComponent = 159
OID component
TypeRefSyntax = 160
type reference syntax
IntegerEnumSyntax = 161
integer enumeration syntax
BitsSyntax = 162
BITS syntax
ConstrainedSyntax = 163
constrained type syntax
Constraint = 164
constraint
Range = 165
constraint range
NamedNumber = 166
named number
SequenceOfSyntax = 167
SEQUENCE OF syntax
SequenceSyntax = 168
SEQUENCE syntax
SequenceField = 169
SEQUENCE or CHOICE field
ChoiceSyntax = 170
CHOICE syntax
TaggedSyntax = 171
tagged syntax
OctetStringSyntax = 172
OCTET STRING syntax
ObjectIdentifierSyntax = 173
OBJECT IDENTIFIER syntax
Error = 174
error node
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub const fn from_raw(raw: u16) -> Option<Self>
pub const fn from_raw(raw: u16) -> Option<Self>
Return the kind for a raw discriminant, if it is declared.
Sourcepub const fn category(self) -> SyntaxCategory
pub const fn category(self) -> SyntaxCategory
Return this kind’s broad syntax category.
Sourcepub const fn keyword_category(self) -> Option<KeywordCategory>
pub const fn keyword_category(self) -> Option<KeywordCategory>
Return this kind’s keyword category, or None for non-keywords.
Sourcepub const fn is_identifier(self) -> bool
pub const fn is_identifier(self) -> bool
Return whether this kind is an uppercase or lowercase identifier.
Sourcepub const fn is_literal(self) -> bool
pub const fn is_literal(self) -> bool
Return whether this kind is a numeric or string literal.
Sourcepub const fn is_punctuation(self) -> bool
pub const fn is_punctuation(self) -> bool
Return whether this kind is fixed punctuation or an operator.
Sourcepub const fn is_keyword(self) -> bool
pub const fn is_keyword(self) -> bool
Return whether this kind is any recognized keyword.
Sourcepub const fn is_structural_keyword(self) -> bool
pub const fn is_structural_keyword(self) -> bool
Return whether this is a structural keyword.
Sourcepub const fn is_clause_keyword(self) -> bool
pub const fn is_clause_keyword(self) -> bool
Return whether this is a clause keyword.
Sourcepub const fn is_macro_keyword(self) -> bool
pub const fn is_macro_keyword(self) -> bool
Return whether this is an SMI macro invocation keyword.
Sourcepub const fn is_type_keyword(self) -> bool
pub const fn is_type_keyword(self) -> bool
Return whether this is a built-in SMI type keyword.
Sourcepub const fn is_tag_keyword(self) -> bool
pub const fn is_tag_keyword(self) -> bool
Return whether this is an ASN.1 tag keyword.
Sourcepub const fn is_status_access_keyword(self) -> bool
pub const fn is_status_access_keyword(self) -> bool
Return whether this is a status or access value keyword.
Sourcepub const fn fixed_text(self) -> Option<&'static str>
pub const fn fixed_text(self) -> Option<&'static str>
Return fixed source text for punctuation and canonical keywords.
Sourcepub const fn keyword_spellings(self) -> &'static [&'static str]
pub const fn keyword_spellings(self) -> &'static [&'static str]
Return every accepted spelling for a keyword kind.
Sourcepub fn from_keyword(text: &str) -> Option<Self>
pub fn from_keyword(text: &str) -> Option<Self>
Look up a recognized keyword using case-sensitive source spelling.
Sourcepub fn from_fixed_text(text: &str) -> Option<Self>
pub fn from_fixed_text(text: &str) -> Option<Self>
Look up fixed punctuation or a canonical keyword spelling.
Sourcepub const fn from_punctuation_byte(byte: u8) -> Option<Self>
pub const fn from_punctuation_byte(byte: u8) -> Option<Self>
Look up a single-byte punctuation kind.
Sourcepub const fn display_name(self) -> &'static str
pub const fn display_name(self) -> &'static str
Return a human-readable name suitable for parser diagnostics.
Sourcepub const fn libsmi_name(self) -> &'static str
pub const fn libsmi_name(self) -> &'static str
Return the libsmi-compatible uppercase kind name.
Trait Implementations§
Source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SyntaxKind
Source§impl Debug for SyntaxKind
impl Debug for SyntaxKind
Source§impl Display for SyntaxKind
impl Display for SyntaxKind
impl Eq for SyntaxKind
Source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
Source§impl Ord for SyntaxKind
impl Ord for SyntaxKind
Source§fn cmp(&self, other: &SyntaxKind) -> Ordering
fn cmp(&self, other: &SyntaxKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
Source§impl PartialOrd for SyntaxKind
impl PartialOrd for SyntaxKind
impl StructuralPartialEq for SyntaxKind
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnsafeUnpin for SyntaxKind
impl UnwindSafe for SyntaxKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.