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

public abstract class WrapIdentifier<T> extends Transformation<T>
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.
  • 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 identifier
      wrappingInjector - 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

      public abstract String 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