Class ConstructorCall

Direct Known Subclasses:
ConstructorArray, ConstructorArrayCast, ConstructorCompound, ConstructorCompoundCast, ConstructorDiagonalMatrix, ConstructorMatrixResize, ConstructorScalarCast, ConstructorStruct, ConstructorVectorSplat

public abstract class ConstructorCall extends Expression
Base class representing a constructor call: type_name( args, ... ).
See Also:
  • Constructor Details

    • ConstructorCall

      protected ConstructorCall(int position, Type type, Expression[] arguments)
  • Method Details

    • convert

      @Nullable public static Expression convert(@Nonnull Context context, int pos, @Nonnull Type type, @Nonnull List<Expression> args)
    • accept

      public boolean accept(@Nonnull TreeVisitor visitor)
      Description copied from class: Node
      Visit this AST with a given visitor.
      Specified by:
      accept in class Node
      Returns:
      true to stop recursion and propagate true up the stack, false to continue
    • isConstructorCall

      public final boolean isConstructorCall()
      Overrides:
      isConstructorCall in class Expression
    • getComponentType

      public final Type getComponentType()
    • getArgument

      public final Expression getArgument()
    • getArguments

      public final @Unmodifiable Expression[] getArguments()
    • getConstantValue

      public OptionalDouble getConstantValue(int i)
      Description copied from class: Expression
      Returns the i'th compile-time constant value within a literal or constructor. Indices which do not contain compile-time constant values will return empty. `vec4(1, vec2(2), 3)` contains four compile-time constants: (1, 2, 2, 3) `mat2(f)` contains four slots, and two are constant: (empty, 0, 0, empty)
      Overrides:
      getConstantValue in class Expression
    • toString

      @Nonnull public String toString(int parentPrecedence)
      Specified by:
      toString in class Expression