Skip to main content

GsglElementType

Enum GsglElementType 

Source
pub enum GsglElementType {
Show 141 variants Root, SourceFile, FunctionDefinition, VariableDeclaration, StructDefinition, Block, IfStatement, ForStatement, WhileStatement, ReturnStatement, Shader, Vertex, Fragment, Geometry, Compute, Uniform, Attribute, Varying, In, Out, Inout, Const, Struct, If, Else, For, While, Do, Break, Continue, Return, Discard, True, False, Float, Int, Bool, Vec2, Vec3, Vec4, Mat2, Mat3, Mat4, Sampler2D, SamplerCube, Void, Identifier, Number, String, Plus, Minus, Star, Slash, Percent, Assign, PlusAssign, MinusAssign, StarAssign, SlashAssign, Eq, Ne, Lt, Le, Gt, Ge, And, Or, Not, BitAnd, BitOr, BitXor, BitNot, LeftShift, RightShift, LeftParen, RightParen, LeftBrace, RightBrace, LeftBracket, RightBracket, Semicolon, Comma, Dot, Colon, Question, Hash, At, Preprocessor, Include, Define, Ifdef, Ifndef, Endif, Version, Sin, Cos, Tan, Sqrt, Pow, Exp, Log, Abs, Sign, Floor, Ceil, Fract, Mod, Min, Max, Clamp, Mix, Step, Smoothstep, Length, Distance, DotProduct, Cross, Normalize, Faceforward, Reflect, Refract, Whitespace, Comment, Newline, Eof, Error, FunctionDecl, VariableDecl, StructDecl, Statement, Expression, Parameter, Argument, FieldAccess, ArrayAccess, FunctionCall, BinaryExpr, UnaryExpr, AssignmentExpr, ConditionalExpr, Literal,
}
Expand description

Element types for the GSGL (Game Shader Graphics Language) language.

Variants§

§

Root

Root node of the AST.

§

SourceFile

A source file.

§

FunctionDefinition

A function definition.

§

VariableDeclaration

A variable declaration.

§

StructDefinition

A struct definition.

§

Block

A block of code.

§

IfStatement

An if statement.

§

ForStatement

A for statement.

§

WhileStatement

A while statement.

§

ReturnStatement

A return statement.

§

Shader

shader keyword.

§

Vertex

vertex keyword.

§

Fragment

fragment keyword.

§

Geometry

geometry keyword.

§

Compute

compute keyword.

§

Uniform

uniform keyword.

§

Attribute

attribute keyword.

§

Varying

varying keyword.

§

In

in keyword.

§

Out

out keyword.

§

Inout

inout keyword.

§

Const

const keyword.

§

Struct

struct keyword.

§

If

if keyword.

§

Else

else keyword.

§

For

for keyword.

§

While

while keyword.

§

Do

do keyword.

§

Break

break keyword.

§

Continue

continue keyword.

§

Return

return keyword.

§

Discard

discard keyword.

§

True

true keyword.

§

False

false keyword.

§

Float

float type.

§

Int

int type.

§

Bool

bool type.

§

Vec2

vec2 type.

§

Vec3

vec3 type.

§

Vec4

vec4 type.

§

Mat2

mat2 type.

§

Mat3

mat3 type.

§

Mat4

mat4 type.

§

Sampler2D

sampler2D type.

§

SamplerCube

samplerCube type.

§

Void

void type.

§

Identifier

An identifier.

§

Number

A number literal.

§

String

A string literal.

§

Plus

+.

§

Minus

-.

§

Star

*.

§

Slash

/.

§

Percent

%.

§

Assign

=.

§

PlusAssign

+=.

§

MinusAssign

-=.

§

StarAssign

*=.

§

SlashAssign

/=.

§

Eq

==.

§

Ne

!=.

§

Lt

<.

§

Le

<=.

§

Gt

>.

§

Ge

>=.

§

And

&&.

§

Or

||.

§

Not

!.

§

BitAnd

&.

§

BitOr

|.

§

BitXor

^.

§

BitNot

~.

§

LeftShift

<<.

§

RightShift

>>.

§

LeftParen

(.

§

RightParen

).

§

LeftBrace

{.

§

RightBrace

}.

§

LeftBracket

[.

§

RightBracket

].

§

Semicolon

;.

§

Comma

,.

§

Dot

..

§

Colon

:.

§

Question

?.

§

Hash

#.

§

At

@.

§

Preprocessor

Preprocessor directive.

§

Include

#include.

§

Define

#define.

§

Ifdef

#ifdef.

§

Ifndef

#ifndef.

§

Endif

#endif.

§

Version

#version.

§

Sin

sin function.

§

Cos

cos function.

§

Tan

tan function.

§

Sqrt

sqrt function.

§

Pow

pow function.

§

Exp

exp function.

§

Log

log function.

§

Abs

abs function.

§

Sign

sign function.

§

Floor

floor function.

§

Ceil

ceil function.

§

Fract

fract function.

§

Mod

mod function.

§

Min

min function.

§

Max

max function.

§

Clamp

clamp function.

§

Mix

mix function.

§

Step

step function.

§

Smoothstep

smoothstep function.

§

Length

length function.

§

Distance

distance function.

§

DotProduct

dot function.

§

Cross

cross function.

§

Normalize

normalize function.

§

Faceforward

faceforward function.

§

Reflect

reflect function.

§

Refract

refract function.

§

Whitespace

Whitespace.

§

Comment

A comment.

§

Newline

A newline.

§

Eof

End of stream.

§

Error

An error token.

§

FunctionDecl

A function declaration.

§

VariableDecl

A variable declaration.

§

StructDecl

A struct declaration.

§

Statement

A statement.

§

Expression

An expression.

§

Parameter

A parameter.

§

Argument

An argument.

§

FieldAccess

A field access.

§

ArrayAccess

An array access.

§

FunctionCall

A function call.

§

BinaryExpr

A binary expression.

§

UnaryExpr

A unary expression.

§

AssignmentExpr

An assignment expression.

§

ConditionalExpr

A conditional expression.

§

Literal

A literal.

Implementations§

Source§

impl GsglElementType

Source

pub fn is_keyword(self) -> bool

Checks if the kind is a keyword.

Source

pub fn is_type(self) -> bool

Checks if the kind is a data type.

Source

pub fn is_operator(self) -> bool

Checks if the kind is an operator.

Trait Implementations§

Source§

impl Clone for GsglElementType

Source§

fn clone(&self) -> GsglElementType

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 GsglElementType

Source§

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

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

impl<'de> Deserialize<'de> for GsglElementType

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 Display for GsglElementType

Source§

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

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

impl ElementType for GsglElementType

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<GsglTokenType> for GsglElementType

Source§

fn from(token: GsglTokenType) -> Self

Converts to this type from the input type.
Source§

impl Hash for GsglElementType

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 GsglElementType

Source§

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

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 GsglElementType

Source§

impl Eq for GsglElementType

Source§

impl StructuralPartialEq for GsglElementType

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> 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<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>,