Skip to main content

SyntaxKind

Enum SyntaxKind 

Source
#[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

Source

pub const ALL: &'static [Self]

Every declared token and node kind in discriminant order.

Source

pub const fn from_raw(raw: u16) -> Option<Self>

Return the kind for a raw discriminant, if it is declared.

Source

pub const fn to_raw(self) -> u16

Return the 16-bit discriminant for this kind.

Source

pub const fn category(self) -> SyntaxCategory

Return this kind’s broad syntax category.

Source

pub const fn keyword_category(self) -> Option<KeywordCategory>

Return this kind’s keyword category, or None for non-keywords.

Source

pub const fn is_token(self) -> bool

Return whether this kind is emitted by the lexer.

Source

pub const fn is_node(self) -> bool

Return whether this kind represents a syntax-tree node.

Source

pub const fn is_trivia(self) -> bool

Return whether this kind is whitespace or comment trivia.

Source

pub const fn is_identifier(self) -> bool

Return whether this kind is an uppercase or lowercase identifier.

Source

pub const fn is_literal(self) -> bool

Return whether this kind is a numeric or string literal.

Source

pub const fn is_punctuation(self) -> bool

Return whether this kind is fixed punctuation or an operator.

Source

pub const fn is_keyword(self) -> bool

Return whether this kind is any recognized keyword.

Source

pub const fn is_structural_keyword(self) -> bool

Return whether this is a structural keyword.

Source

pub const fn is_clause_keyword(self) -> bool

Return whether this is a clause keyword.

Source

pub const fn is_macro_keyword(self) -> bool

Return whether this is an SMI macro invocation keyword.

Source

pub const fn is_type_keyword(self) -> bool

Return whether this is a built-in SMI type keyword.

Source

pub const fn is_tag_keyword(self) -> bool

Return whether this is an ASN.1 tag keyword.

Source

pub const fn is_status_access_keyword(self) -> bool

Return whether this is a status or access value keyword.

Source

pub const fn fixed_text(self) -> Option<&'static str>

Return fixed source text for punctuation and canonical keywords.

Source

pub const fn keyword_spellings(self) -> &'static [&'static str]

Return every accepted spelling for a keyword kind.

Source

pub fn from_keyword(text: &str) -> Option<Self>

Look up a recognized keyword using case-sensitive source spelling.

Source

pub fn from_fixed_text(text: &str) -> Option<Self>

Look up fixed punctuation or a canonical keyword spelling.

Source

pub const fn from_punctuation_byte(byte: u8) -> Option<Self>

Look up a single-byte punctuation kind.

Source

pub const fn display_name(self) -> &'static str

Return a human-readable name suitable for parser diagnostics.

Source

pub const fn libsmi_name(self) -> &'static str

Return the libsmi-compatible uppercase kind name.

Trait Implementations§

Source§

impl Clone for SyntaxKind

Source§

fn clone(&self) -> SyntaxKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SyntaxKind

Source§

impl Debug for SyntaxKind

Source§

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

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

impl Display for SyntaxKind

Source§

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

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

impl Eq for SyntaxKind

Source§

impl Hash for SyntaxKind

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 SyntaxKind

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · 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 SyntaxKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for SyntaxKind

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 StructuralPartialEq for SyntaxKind

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<N> NodeTrait for N
where N: Copy + Ord + Hash,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more