Class CallDetailsFactory
java.lang.Object
org.ek9lang.compiler.phase7.support.CallDetailsFactory
Static factories for the recurring
CallDetails shapes in IR generation.
CallDetails is a ten-argument record; the overwhelming majority of call sites
build a non-virtual, non-trait, non-explicit-trait-default call (the trailing
false, false, false). Constructor calls additionally repeat the type name three
times (target object, target type and return type are all the constructed type) with the
IRConstants.INIT_METHOD method. These factories single-source those shapes so the
boolean tail and the type-name repetition are written once.
Sites that genuinely need a virtual / trait / explicit-trait-default call keep the explicit
new CallDetails(...) so the non-default flags stay visible at the call site.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CallDetailscall(String targetObject, String targetTypeName, String methodName, List<String> parameterTypes, String returnTypeName, List<String> arguments, CallMetaDataDetails metaData) A non-virtual, non-trait call tomethodNameontargetObject.static CallDetailsconstructorCall(String typeName, List<String> parameterTypes, List<String> arguments, CallMetaDataDetails metaData) A constructor call ontypeName: target object, target type and return type are alltypeNameand the method isIRConstants.INIT_METHOD.static CallDetailsdefaultConstructorCall(String typeName, CallMetaDataDetails metaData) The no-argument default constructor call ontypeName.
-
Method Details
-
call
public static CallDetails call(String targetObject, String targetTypeName, String methodName, List<String> parameterTypes, String returnTypeName, List<String> arguments, CallMetaDataDetails metaData) A non-virtual, non-trait call tomethodNameontargetObject.- Parameters:
targetObject- the receiver variable (ornullfor a static/free call)targetTypeName- the type that defines the methodmethodName- the (mangled) method nameparameterTypes- the declared parameter typesreturnTypeName- the declared return typearguments- the argument variablesmetaData- purity / complexity / side-effect metadata
-
constructorCall
public static CallDetails constructorCall(String typeName, List<String> parameterTypes, List<String> arguments, CallMetaDataDetails metaData) A constructor call ontypeName: target object, target type and return type are alltypeNameand the method isIRConstants.INIT_METHOD. -
defaultConstructorCall
The no-argument default constructor call ontypeName.
-