Class WrapIdentifier<T>
java.lang.Object
io.github.douira.glsl_transformer.transform.Transformation<T>
io.github.douira.glsl_transformer.core.WrapIdentifier<T>
- Direct Known Subclasses:
WrapIdentifierImpl
The wrap identifier transformation wraps the usage of a certain identifier
with new code by replacing its usage with a new expression and inserting code
that takes care of handling the conversion from the new to the old value. It
also checks that the wrapped value isn't already present in the code.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.douira.glsl_transformer.transform.Transformation
Transformation.PhaseEntry<T> -
Field Summary
Fields inherited from class io.github.douira.glsl_transformer.transform.Transformation
DEFAULT_GROUP -
Constructor Summary
ConstructorsConstructorDescriptionWrapIdentifier(TransformationPhase<T> wrappingReplacer, TransformationPhase<T> wrappingInjector) Creates a new wrap identifier transformation. -
Method Summary
Modifier and TypeMethodDescriptionabstract StringReturns the wrap result that will be preset after wrapping.Methods inherited from class io.github.douira.glsl_transformer.transform.Transformation
addConcurrentPhase, addPhase, addPhase, addPhase, addPhase, addPhases, append, getDefaultGroup, merge, resetState
-
Constructor Details
-
WrapIdentifier
public WrapIdentifier(TransformationPhase<T> wrappingReplacer, TransformationPhase<T> wrappingInjector) Creates a new wrap identifier transformation.- Parameters:
wrappingReplacer- The replacer phase that should replace a target identifier with a replacement expression or identifierwrappingInjector- A transformation phase that does the additional code injection, usually providing a definition for the newly inserted identifier in the form of an external declaration of some sort
-
-
Method Details
-
getWrapResult
Returns the wrap result that will be preset after wrapping. This is only used for detection of the identifier prior to wrapping for throwing an error if it's present.- Returns:
- The identifier that's inserted for the wrapping
-