Enum Class TransformationPhase.InjectionPoint
java.lang.Object
java.lang.Enum<TransformationPhase.InjectionPoint>
io.github.douira.glsl_transformer.transform.TransformationPhase.InjectionPoint
- All Implemented Interfaces:
Serializable,Comparable<TransformationPhase.InjectionPoint>,Constable
- Enclosing class:
- TransformationPhase<T extends JobParameters>
public static enum TransformationPhase.InjectionPoint
extends Enum<TransformationPhase.InjectionPoint>
Shader code is expected to be roughly structured as follows:
version, extensions, other directives (#define, #pragma etc.), declarations
(layout etc.), functions (void main etc.).
These injection points can be used to insert nodes into the translation
unit's child list. An injection will happen before the syntax feature it
describes and any that follow it in the list.
- Implementation Note:
- AFTER versions of these points would be the same as the next BEFORE point in the list.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBefore declarations like layout and struct, before function definitionsBefore non-extension parsed #-directives such as #pragma, before declarations and function definitions.Before the end of the file, basically the last possible locationBefore the #extension statement, before other directives, declarations and function definitionsBefore function definitionsBefore the #version statement (and all other syntax features by necessity) -
Field Summary
FieldsModifier and TypeFieldDescriptionA set of the rule contexts that can make up an external declaration that each injection point needs to inject before. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckChildRelevant(Class<?> childClass) Checks if the given class of the child of an external declaration makes the external declaration one that should be injected before.Returns the enum constant of this class with the specified name.static TransformationPhase.InjectionPoint[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BEFORE_VERSION
Before the #version statement (and all other syntax features by necessity) -
BEFORE_EXTENSIONS
Before the #extension statement, before other directives, declarations and function definitions -
BEFORE_DIRECTIVES
Before non-extension parsed #-directives such as #pragma, before declarations and function definitions. (after extension statements if they aren't mixed with other directives and directly follow the #version) TODO: describe what happens to unparsed tokens that are in the stream -
BEFORE_DECLARATIONS
Before declarations like layout and struct, before function definitions -
BEFORE_FUNCTIONS
Before function definitions -
BEFORE_EOF
Before the end of the file, basically the last possible location
-
-
Field Details
-
EDBeforeTypes
A set of the rule contexts that can make up an external declaration that each injection point needs to inject before.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
checkChildRelevant
Checks if the given class of the child of an external declaration makes the external declaration one that should be injected before. When this method returns true, the injection happens right before the external declaration that has the child that was found to be relevant.- Parameters:
childClass- The class of the only child node of the external declaration being tested for being a node before which the injection has to happen- Returns:
trueif the class means the injection should happen before this external declaration according to the implementing injection location
-