Class OperatorMap
java.lang.Object
org.ek9lang.compiler.common.OperatorMap
Enhanced mapping of EK9 operators to their metadata and method names.
Provides bidirectional mapping with comprehensive operator details including
purity, argument requirements, return value information, and side effect classification.
Side effect types:
- RETURN_MUTATION: Operations that return non-Void values
- THIS_MUTATION: Operations that mutate the object itself (assignment/mutator operators)
- POSSIBLE_MUTATION: Non-pure operations that may have indirect effects or mutations
- NO_MUTATION: Implied when no mutation side effects are present (empty set)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkBackward
(String methodName) Check if method name maps to operator (backward compatibility).boolean
checkForward
(String ek9Operator) Check if EK9 operator exists (backward compatibility).boolean
expectsParameter
(String ek9Operator) For operators that require a single parameter.boolean
expectsZeroParameters
(String ek9Operator) Used on a class/record not expecting any parameters at all.getBackward
(String methodName) Get EK9 operator for method name (backward compatibility).Get all method names (for testing).getForward
(String ek9Operator) Get method name for EK9 operator (backward compatibility).Get all EK9 operator symbols (for testing).getOperatorDetails
(String ek9Operator) Get operator details by EK9 operator symbol.getOperatorDetailsByMethod
(String methodName) Get operator details by method name.getSideEffects
(String ek9Operator) Get the side effects for an EK9 operator.getSideEffectsByMethod
(String methodName) Get the side effects for a method name (backward lookup).boolean
Check if a method name maps to an operator.boolean
hasOperator
(String ek9Operator) Check if an EK9 operator exists.boolean
Check if an operator has a return value (not Void).boolean
isPureOperator
(String ek9Operator) Check if an operator is marked as pure.
-
Constructor Details
-
OperatorMap
public OperatorMap()
-
-
Method Details
-
getOperatorDetails
Get operator details by EK9 operator symbol. -
getOperatorDetailsByMethod
Get operator details by method name. -
hasOperator
Check if an EK9 operator exists. -
hasMethod
Check if a method name maps to an operator. -
getForward
-
getBackward
-
checkForward
Check if EK9 operator exists (backward compatibility). -
checkBackward
Check if method name maps to operator (backward compatibility). -
expectsParameter
For operators that require a single parameter. Updated to use OperatorDetails metadata. -
expectsZeroParameters
Used on a class/record not expecting any parameters at all. Updated to use OperatorDetails metadata. -
isPureOperator
Check if an operator is marked as pure. -
hasReturn
Check if an operator has a return value (not Void). -
getSideEffects
-
getSideEffectsByMethod
-
getForwardKeys
-
getBackwardKeys
-