Class FunctionMemberSymbols

java.lang.Object
org.ek9lang.compiler.phase7.support.FunctionMemberSymbols

public final class FunctionMemberSymbols extends Object
THE member symbols of a function construct (IR tidy W3.3, DFN-5/MONO-4): a function - named, dynamic or a Scenario-3 parameterisation - is generated as a class with a constructor, a _call method and a ? operator, and these are the symbols of those three. Hold one and use it, never another private builder: there were three copies of each, in FunctionDfnGenerator, DynamicFunctionDfnGenerator and Scenario 3's function half.

Every member is public, synthetic and owned by the function, with the function's source token (a debugger goes to the function's definition).

  • Constructor Details

    • FunctionMemberSymbols

      public FunctionMemberSymbols()
  • Method Details

    • isSet

      public MethodSymbol isSet(FunctionSymbol function, ISymbol booleanType)
      The function's ? operator: pure, returning Boolean rtn - a function is always set. The operator's name is the EK9 symbol ?; the back end maps it to _isSet through OperatorMap.
    • constructor

      public MethodSymbol constructor(FunctionSymbol function, boolean pure, List<ISymbol> parameters)
      The function's constructor, returning the function's own type.
      Parameters:
      pure - whether the constructor is marked pure - a named function's and a parameterisation's follow the function, a dynamic function's is not marked (the difference the three copies had, kept)
      parameters - what it takes - a dynamic function's captured variables, otherwise none (a function's own parameters are its _call's)
    • call

      public MethodSymbol call(FunctionSymbol function, IFunctionSymbol signature)
      The function's _call method: pure and abstract as the function is, with the parameters and the return of signature - the function itself, or a dynamic function's super function.