Skip to main content

HlslElementType

Enum HlslElementType 

Source
#[repr(u8)]
pub enum HlslElementType {
Show 192 variants Whitespace = 0, Newline = 1, Comment = 2, StringLiteral = 3, NumberLiteral = 4, BooleanLiteral = 5, Identifier = 6, Bool = 7, Int = 8, Uint = 9, Half = 10, Float = 11, Double = 12, Min16float = 13, Min10float = 14, Min16int = 15, Min12int = 16, Min16uint = 17, Bool2 = 18, Bool3 = 19, Bool4 = 20, Int2 = 21, Int3 = 22, Int4 = 23, Uint2 = 24, Uint3 = 25, Uint4 = 26, Half2 = 27, Half3 = 28, Half4 = 29, Float2 = 30, Float3 = 31, Float4 = 32, Double2 = 33, Double3 = 34, Double4 = 35, Float2x2 = 36, Float2x3 = 37, Float2x4 = 38, Float3x2 = 39, Float3x3 = 40, Float3x4 = 41, Float4x2 = 42, Float4x3 = 43, Float4x4 = 44, Double2x2 = 45, Double2x3 = 46, Double2x4 = 47, Double3x2 = 48, Double3x3 = 49, Double3x4 = 50, Double4x2 = 51, Double4x3 = 52, Double4x4 = 53, Texture1D = 54, Texture2D = 55, Texture3D = 56, TextureCube = 57, Texture1DArray = 58, Texture2DArray = 59, TextureCubeArray = 60, Texture2DMS = 61, Texture2DMSArray = 62, Sampler = 63, SamplerState = 64, SamplerComparisonState = 65, Buffer = 66, StructuredBuffer = 67, ByteAddressBuffer = 68, RWBuffer = 69, RWStructuredBuffer = 70, RWByteAddressBuffer = 71, AppendStructuredBuffer = 72, ConsumeStructuredBuffer = 73, If = 74, Else = 75, For = 76, While = 77, Do = 78, Switch = 79, Case = 80, Default = 81, Break = 82, Continue = 83, Return = 84, Discard = 85, Static = 86, Const = 87, Uniform = 88, Varying = 89, In = 90, Out = 91, Inout = 92, Inline = 93, Extern = 94, Shared = 95, Groupshared = 96, Volatile = 97, Precise = 98, Nointerpolation = 99, Linear = 100, Centroid = 101, Sample = 102, Noperspective = 103, Target = 104, Register = 105, Packoffset = 106, Struct = 107, Cbuffer = 108, Tbuffer = 109, Technique = 110, Pass = 111, Interface = 112, Class = 113, Namespace = 114, Typedef = 115, Template = 116, Typename = 117, Using = 118, Sizeof = 119, Undef = 120, Include = 121, Define = 122, If_ = 123, Ifdef = 124, Ifndef = 125, Else_ = 126, Elif = 127, Endif = 128, Line = 129, Pragma = 130, Plus = 131, Minus = 132, Multiply = 133, Divide = 134, Modulo = 135, Assign = 136, PlusAssign = 137, MinusAssign = 138, MultiplyAssign = 139, DivideAssign = 140, ModuloAssign = 141, Equal = 142, NotEqual = 143, Less = 144, Greater = 145, LessEqual = 146, GreaterEqual = 147, LogicalAnd = 148, LogicalOr = 149, LogicalNot = 150, BitwiseAnd = 151, BitwiseOr = 152, BitwiseXor = 153, BitwiseNot = 154, LeftShift = 155, RightShift = 156, LeftShiftAssign = 157, RightShiftAssign = 158, BitwiseAndAssign = 159, BitwiseOrAssign = 160, BitwiseXorAssign = 161, Increment = 162, Decrement = 163, Dot = 164, Arrow = 165, Conditional = 166, LeftParen = 167, RightParen = 168, LeftBracket = 169, RightBracket = 170, LeftBrace = 171, RightBrace = 172, Semicolon = 173, Comma = 174, Colon = 175, DoubleColon = 176, Question = 177, Hash = 178, At = 179, Backslash = 180, Eof = 181, Root = 182, FunctionDeclaration = 183, StructDeclaration = 184, VariableDeclaration = 185, ParameterList = 186, Parameter = 187, Block = 188, Statement = 189, Expression = 190, Error = 191,
}
Expand description

Element types for the HLSL (High-Level Shading Language) parser.

This enum represents all possible element types in HLSL, including data types, texture types, control flow keywords, operators, and AST nodes.

Variants§

§

Whitespace = 0

Whitespace token.

§

Newline = 1

Newline token.

§

Comment = 2

Comment token.

§

StringLiteral = 3

String literal token.

§

NumberLiteral = 4

Number literal token.

§

BooleanLiteral = 5

Boolean literal token.

§

Identifier = 6

Identifier token.

§

Bool = 7

Boolean data type bool.

§

Int = 8

Integer data type int.

§

Uint = 9

Unsigned integer data type uint.

§

Half = 10

Half-precision floating-point data type half.

§

Float = 11

Single-precision floating-point data type float.

§

Double = 12

Double-precision floating-point data type double.

§

Min16float = 13

Minimum 16-bit float data type min16float.

§

Min10float = 14

Minimum 10-bit float data type min10float.

§

Min16int = 15

Minimum 16-bit integer data type min16int.

§

Min12int = 16

Minimum 12-bit integer data type min12int.

§

Min16uint = 17

Minimum 16-bit unsigned integer data type min16uint.

§

Bool2 = 18

2-component boolean vector bool2.

§

Bool3 = 19

3-component boolean vector bool3.

§

Bool4 = 20

4-component boolean vector bool4.

§

Int2 = 21

2-component integer vector int2.

§

Int3 = 22

3-component integer vector int3.

§

Int4 = 23

4-component integer vector int4.

§

Uint2 = 24

2-component unsigned integer vector uint2.

§

Uint3 = 25

3-component unsigned integer vector uint3.

§

Uint4 = 26

4-component unsigned integer vector uint4.

§

Half2 = 27

2-component half-precision vector half2.

§

Half3 = 28

3-component half-precision vector half3.

§

Half4 = 29

4-component half-precision vector half4.

§

Float2 = 30

2-component float vector float2.

§

Float3 = 31

3-component float vector float3.

§

Float4 = 32

4-component float vector float4.

§

Double2 = 33

2-component double vector double2.

§

Double3 = 34

3-component double vector double3.

§

Double4 = 35

4-component double vector double4.

§

Float2x2 = 36

2x2 float matrix float2x2.

§

Float2x3 = 37

2x3 float matrix float2x3.

§

Float2x4 = 38

2x4 float matrix float2x4.

§

Float3x2 = 39

3x2 float matrix float3x2.

§

Float3x3 = 40

3x3 float matrix float3x3.

§

Float3x4 = 41

3x4 float matrix float3x4.

§

Float4x2 = 42

4x2 float matrix float4x2.

§

Float4x3 = 43

4x3 float matrix float4x3.

§

Float4x4 = 44

4x4 float matrix float4x4.

§

Double2x2 = 45

2x2 double matrix double2x2.

§

Double2x3 = 46

2x3 double matrix double2x3.

§

Double2x4 = 47

2x4 double matrix double2x4.

§

Double3x2 = 48

3x2 double matrix double3x2.

§

Double3x3 = 49

3x3 double matrix double3x3.

§

Double3x4 = 50

3x4 double matrix double3x4.

§

Double4x2 = 51

4x2 double matrix double4x2.

§

Double4x3 = 52

4x3 double matrix double4x3.

§

Double4x4 = 53

4x4 double matrix double4x4.

§

Texture1D = 54

1D texture type Texture1D.

§

Texture2D = 55

2D texture type Texture2D.

§

Texture3D = 56

3D texture type Texture3D.

§

TextureCube = 57

Cubemap texture type TextureCube.

§

Texture1DArray = 58

1D texture array type Texture1DArray.

§

Texture2DArray = 59

2D texture array type Texture2DArray.

§

TextureCubeArray = 60

Cubemap array type TextureCubeArray.

§

Texture2DMS = 61

Multisampled 2D texture type Texture2DMS.

§

Texture2DMSArray = 62

Multisampled 2D texture array type Texture2DMSArray.

§

Sampler = 63

Sampler type.

§

SamplerState = 64

Sampler state type SamplerState.

§

SamplerComparisonState = 65

Comparison sampler state type SamplerComparisonState.

§

Buffer = 66

Buffer type.

§

StructuredBuffer = 67

Structured buffer type StructuredBuffer.

§

ByteAddressBuffer = 68

Byte address buffer type ByteAddressBuffer.

§

RWBuffer = 69

Read-write buffer type RWBuffer.

§

RWStructuredBuffer = 70

Read-write structured buffer type RWStructuredBuffer.

§

RWByteAddressBuffer = 71

Read-write byte address buffer type RWByteAddressBuffer.

§

AppendStructuredBuffer = 72

Append structured buffer type AppendStructuredBuffer.

§

ConsumeStructuredBuffer = 73

Consume structured buffer type ConsumeStructuredBuffer.

§

If = 74

If keyword if.

§

Else = 75

Else keyword else.

§

For = 76

For keyword for.

§

While = 77

While keyword while.

§

Do = 78

Do keyword do.

§

Switch = 79

Switch keyword switch.

§

Case = 80

Case keyword case.

§

Default = 81

Default keyword default.

§

Break = 82

Break keyword break.

§

Continue = 83

Continue keyword continue.

§

Return = 84

Return keyword return.

§

Discard = 85

Discard keyword discard.

§

Static = 86

Static modifier static.

§

Const = 87

Const modifier const.

§

Uniform = 88

Uniform modifier uniform.

§

Varying = 89

Varying modifier varying.

§

In = 90

Input parameter modifier in.

§

Out = 91

Output parameter modifier out.

§

Inout = 92

Input-output parameter modifier inout.

§

Inline = 93

Inline modifier inline.

§

Extern = 94

Extern modifier extern.

§

Shared = 95

Shared modifier shared.

§

Groupshared = 96

Group-shared modifier groupshared.

§

Volatile = 97

Volatile modifier volatile.

§

Precise = 98

Precise modifier precise.

§

Nointerpolation = 99

No interpolation modifier nointerpolation.

§

Linear = 100

Linear interpolation modifier linear.

§

Centroid = 101

Centroid interpolation modifier centroid.

§

Sample = 102

Sample interpolation modifier sample.

§

Noperspective = 103

No perspective modifier noperspective.

§

Target = 104

Target modifier target.

§

Register = 105

Register semantic modifier register.

§

Packoffset = 106

Pack offset modifier packoffset.

§

Struct = 107

Struct keyword struct.

§

Cbuffer = 108

Constant buffer keyword cbuffer.

§

Tbuffer = 109

Texture buffer keyword tbuffer.

§

Technique = 110

Technique keyword technique.

§

Pass = 111

Pass keyword pass.

§

Interface = 112

Interface keyword interface.

§

Class = 113

Class keyword class.

§

Namespace = 114

Namespace keyword namespace.

§

Typedef = 115

Typedef keyword typedef.

§

Template = 116

Template keyword template.

§

Typename = 117

Typename keyword typename.

§

Using = 118

Using keyword using.

§

Sizeof = 119

Sizeof keyword sizeof.

§

Undef = 120

Undef keyword undef.

§

Include = 121

Include preprocessor directive #include.

§

Define = 122

Define preprocessor directive #define.

§

If_ = 123

If preprocessor directive #if.

§

Ifdef = 124

Ifdef preprocessor directive #ifdef.

§

Ifndef = 125

Ifndef preprocessor directive #ifndef.

§

Else_ = 126

Else preprocessor directive #else.

§

Elif = 127

Elif preprocessor directive #elif.

§

Endif = 128

Endif preprocessor directive #endif.

§

Line = 129

Line preprocessor directive #line.

§

Pragma = 130

Pragma preprocessor directive #pragma.

§

Plus = 131

Plus operator +.

§

Minus = 132

Minus operator -.

§

Multiply = 133

Multiply operator *.

§

Divide = 134

Divide operator /.

§

Modulo = 135

Modulo operator %.

§

Assign = 136

Assignment operator =.

§

PlusAssign = 137

Plus assignment operator +=.

§

MinusAssign = 138

Minus assignment operator -=.

§

MultiplyAssign = 139

Multiply assignment operator *=.

§

DivideAssign = 140

Divide assignment operator /=.

§

ModuloAssign = 141

Modulo assignment operator %=.

§

Equal = 142

Equality operator ==.

§

NotEqual = 143

Inequality operator !=.

§

Less = 144

Less than operator <.

§

Greater = 145

Greater than operator >.

§

LessEqual = 146

Less than or equal operator <=.

§

GreaterEqual = 147

Greater than or equal operator >=.

§

LogicalAnd = 148

Logical and operator &&.

§

LogicalOr = 149

Logical or operator ||.

§

LogicalNot = 150

Logical not operator !.

§

BitwiseAnd = 151

Bitwise and operator &.

§

BitwiseOr = 152

Bitwise or operator |.

§

BitwiseXor = 153

Bitwise xor operator ^.

§

BitwiseNot = 154

Bitwise not operator ~.

§

LeftShift = 155

Left shift operator <<.

§

RightShift = 156

Right shift operator >>.

§

LeftShiftAssign = 157

Left shift assignment operator <<=.

§

RightShiftAssign = 158

Right shift assignment operator >>=.

§

BitwiseAndAssign = 159

Bitwise and assignment operator &=.

§

BitwiseOrAssign = 160

Bitwise or assignment operator |=.

§

BitwiseXorAssign = 161

Bitwise xor assignment operator ^=.

§

Increment = 162

Increment operator ++.

§

Decrement = 163

Decrement operator --.

§

Dot = 164

Dot operator ..

§

Arrow = 165

Arrow operator ->.

§

Conditional = 166

Conditional ternary operator ?:.

§

LeftParen = 167

Left parenthesis (.

§

RightParen = 168

Right parenthesis ).

§

LeftBracket = 169

Left bracket [.

§

RightBracket = 170

Right bracket ].

§

LeftBrace = 171

Left brace {.

§

RightBrace = 172

Right brace }.

§

Semicolon = 173

Semicolon ;.

§

Comma = 174

Comma ,.

§

Colon = 175

Colon :.

§

DoubleColon = 176

Double colon ::.

§

Question = 177

Question mark ?.

§

Hash = 178

Hash symbol #.

§

At = 179

At symbol @.

§

Backslash = 180

Backslash symbol \.

§

Eof = 181

End of file marker.

§

Root = 182

Root node of the AST.

§

FunctionDeclaration = 183

Function declaration node.

§

StructDeclaration = 184

Struct declaration node.

§

VariableDeclaration = 185

Variable declaration node.

§

ParameterList = 186

Parameter list node.

§

Parameter = 187

Parameter node.

§

Block = 188

Code block node.

§

Statement = 189

Statement node.

§

Expression = 190

Expression node.

§

Error = 191

Error node.

Trait Implementations§

Source§

impl Clone for HlslElementType

Source§

fn clone(&self) -> HlslElementType

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 HlslElementType

Source§

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

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

impl<'de> Deserialize<'de> for HlslElementType

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 ElementType for HlslElementType

Source§

type Role = UniversalElementRole

The associated role type for this element kind.
Source§

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

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

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

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

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

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

fn is_root(&self) -> bool

Returns true if this element represents the root of the parsed tree.
Source§

fn is_error(&self) -> bool

Returns true if this element represents an error condition.
Source§

impl From<HlslTokenType> for HlslElementType

Source§

fn from(token: HlslTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for HlslElementType

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 PartialEq for HlslElementType

Source§

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

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 Copy for HlslElementType

Source§

impl Eq for HlslElementType

Source§

impl StructuralPartialEq for HlslElementType

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> 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,