Class CallArguments

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.CallArguments

public final class CallArguments extends AbstractGenerator
THE evaluation of a call's arguments (EXPR-1): each argument expression is evaluated into its own managed temporary (retained and scope registered by VariableMemoryManagement), in source order, and the temporary's name and resolved type are collected. Constructor, function, method, delegating-constructor and dynamic-construct capture calls all use it - never write another argument loop.

The only observable difference between the call sites that once each had their own loop is whether the argument temporaries carry debug info, so that is the one thing a caller chooses (CallArguments.DebugInfoPolicy).

  • Constructor Details

  • Method Details

    • evaluate

      public ArgumentDetails evaluate(EK9Parser.ParamExpressionContext paramExpression, CallArguments.DebugInfoPolicy debugInfoPolicy, Function<ExprProcessingDetails, List<IRInstr>> exprProcessor, List<IRInstr> instructions)
      Evaluate every argument of the parameter expression (which may be null) into the instructions.
      Parameters:
      paramExpression - The argument list of the call, or null for none.
      debugInfoPolicy - Whether each argument temporary carries debug info.
      exprProcessor - Evaluates an argument expression into its result variable.
      instructions - Receives the evaluation and its memory management, argument by argument.
      Returns:
      The argument temporaries and the resolved types of the arguments, in order.