Record Class PipelineVarPlan

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.generator.PipelineVarPlan

record PipelineVarPlan(List<String> varAt, List<ISymbol> typeAt) extends Record
Per-stage-boundary item variable plan. varAt[k]/typeAt[k] describe the pipeline item entering stage k; index stages.size() is what the terminal consumes.

A single fixed-type item variable cannot be reused across a type-changing stage (e.g. flatten: List of T -> T, or map when input != output type) — storing the produced type back into a variable declared at the consumed type confuses the JVM verifier at loop/merge points (and miscompiles in LLVM). Each type-changing stage therefore writes a fresh variable declared at its produced type; type-preserving stages reuse the same variable (no IR churn).

  • Constructor Details

    • PipelineVarPlan

      PipelineVarPlan(List<String> varAt, List<ISymbol> typeAt)
      Creates an instance of a PipelineVarPlan record class.
      Parameters:
      varAt - the value for the varAt record component
      typeAt - the value for the typeAt record component
  • Method Details

    • finalVar

      String finalVar()
    • finalType

      ISymbol finalType()
    • inVar

      String inVar(int stageIndex)
    • outVar

      String outVar(int stageIndex)
    • inType

      ISymbol inType(int stageIndex)
    • single

      static PipelineVarPlan single(String var, ISymbol type, int stageCount)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • varAt

      public List<String> varAt()
      Returns the value of the varAt record component.
      Returns:
      the value of the varAt record component
    • typeAt

      public List<ISymbol> typeAt()
      Returns the value of the typeAt record component.
      Returns:
      the value of the typeAt record component