Expand description
GLSL abstract syntax tree and grammar.
This module exports all the grammar syntax that defines GLSL. You’ll be handling ASTs representing your GLSL source.
The most external form of a GLSL parsed AST is TranslationUnit
(a shader). Some parts of the
tree are boxed. This is due to two facts:
- Recursion is used, hence we need a way to give our types a static size.
- Because of some very deep variants, runtime size would explode if no indirection weren’t in place.
The types are commented so feel free to inspect each of theme. As a starter, you should read
the documentation of Expr
, FunctionDefinition
, Statement
and TranslationUnit
.
Structs§
- Dimensionality of an array.
- An identifier with an optional array specifier.
- A general purpose block, containing fields and possibly a list of declared identifiers. Semantic is given with the storage qualifier.
- Compound statement (with no new scope).
- Expression statement.
- Unique file identifier
- For init statement.
- Fully specified type.
- Function definition.
- Function parameter declarator.
- Function prototype.
- A generic identifier.
- Init declarator list.
- Layout qualifier.
- A syntax node with span information
- Span information for a node, constructed from a pair of LexerPositions
- An #else preprocessor directive.
- An #error preprocessor directive.
- An #extension preprocessor directive.
- An #if preprocessor directive.
- An #ifdef preprocessor directive.
- A #ifndef preprocessor directive.
- An #include name annotation.
- A #line preprocessor directive.
- A #pragma preprocessor directive. Holds compiler-specific command.
- A #undef preprocessor directive.
- A #version preprocessor directive.
- Selection statement.
- Single declaration.
- A single declaration with implicit, already-defined type.
- A
SmolStr
is a string type that has the following properties: - Struct field specifier. Used to add fields to struct specifiers.
- Struct specifier. Used to create new, user-defined types.
- Switch statement.
- A range in text, represented as a pair of
TextSize
. - A measure of text length. Also, equivalently, an index into text.
- Starting rule.
- Any type name.
- Type qualifier.
- Type specifier.
Enums§
- One array specifier dimension.
- All possible operators for assigning expressions.
- All binary operators that exist in GLSL.
- Case label statement.
- A comment
- Condition.
- A declaration.
- The most general form of an expression.
- External declaration.
- For init statement.
- Function identifier.
- Function parameter declaration.
- Initializer.
- Interpolation qualifier.
- Iteration statement.
- Jump statement.
- Layout qualifier spec.
- A path literal.
- Precision qualifier.
- Some basic preprocessor directives.
- A #define preprocessor directive.
- An #extension behavior annotation.
- An #extension name annotation.
- A #version profile annotation.
- Selection rest statement.
- Statement.
- Storage qualifier.
- Type qualifier spec.
- Type specifier (non-array).
- All unary operators that exist in GLSL.
Traits§
- Trait for AST node contents.
- Trait for displaying a syntax node
Type Aliases§
- Type alias for
Node<ArraySpecifierData>
. - Type alias for
Node<ArraySpecifierDimensionData>
. - Type alias for
Node<ArrayedIdentifierData>
. - Type alias for
Node<AssignmentOpData>
. - Type alias for
Node<BinaryOpData>
. - Type alias for
Node<BlockData>
. - Type alias for
Node<CaseLabelData>
. - Type alias for
Node<CommentData>
. - Type alias for
Node<CompoundStatementData>
. - Type alias for
Node<ConditionData>
. - Type alias for
Node<DeclarationData>
. - Type alias for
Node<ExprData>
. - Type alias for
Node<ExprStatementData>
. - Type alias for
Node<ExternalDeclarationData>
. - Type alias for
Node<ForInitStatementData>
. - Type alias for
Node<ForRestStatementData>
. - Type alias for
Node<FullySpecifiedTypeData>
. - Type alias for
Node<FunIdentifierData>
. - Type alias for
Node<FunctionDefinitionData>
. - Type alias for
Node<FunctionParameterDeclarationData>
. - Type alias for
Node<FunctionParameterDeclaratorData>
. - Type alias for
Node<FunctionPrototypeData>
. - Type alias for
Node<IdentifierData>
. - Type alias for
Node<InitDeclaratorListData>
. - Type alias for
Node<InitializerData>
. - Type alias for
Node<InterpolationQualifierData>
. - Type alias for
Node<IterationStatementData>
. - Type alias for
Node<JumpStatementData>
. - Type alias for
Node<LayoutQualifierData>
. - Type alias for
Node<LayoutQualifierSpecData>
. - Type alias for
Node<PathData>
. - Type alias for
Node<PrecisionQualifierData>
. - Type alias for
Node<PreprocessorData>
. - Type alias for
Node<PreprocessorDefineData>
. - Type alias for
Node<PreprocessorElseIfData>
. - Type alias for
Node<PreprocessorErrorData>
. - Type alias for
Node<PreprocessorExtensionData>
. - Type alias for
Node<PreprocessorExtensionBehaviorData>
. - Type alias for
Node<PreprocessorExtensionNameData>
. - Type alias for
Node<PreprocessorIfData>
. - Type alias for
Node<PreprocessorIfDefData>
. - Type alias for
Node<PreprocessorIfNDefData>
. - Type alias for
Node<PreprocessorIncludeData>
. - Type alias for
Node<PreprocessorLineData>
. - Type alias for
Node<PreprocessorPragmaData>
. - Type alias for
Node<PreprocessorUndefData>
. - Type alias for
Node<PreprocessorVersionData>
. - Type alias for
Node<PreprocessorVersionProfileData>
. - Type alias for
Node<SelectionRestStatementData>
. - Type alias for
Node<SelectionStatementData>
. - Type alias for
Node<SingleDeclarationData>
. - Type alias for
Node<SingleDeclarationNoTypeData>
. - Type alias for
Node<StatementData>
. - Type alias for
Node<StorageQualifierData>
. - Type alias for
Node<StructFieldSpecifierData>
. - Type alias for
Node<StructSpecifierData>
. - Type alias for
Node<SwitchStatementData>
. - Type alias for
Node<TypeNameData>
. - Type alias for
Node<TypeQualifierData>
. - Type alias for
Node<TypeQualifierSpecData>
. - Type alias for
Node<TypeSpecifierData>
. - Type alias for
Node<TypeSpecifierNonArrayData>
. - Type alias for
Node<UnaryOpData>
.
Derive Macros§
- Derives an implementation of
NodeContentDisplay
for the given type.