Class OperatorMap
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 TypeMethodDescriptionbooleancheckBackward(String methodName) Check if method name maps to operator (backward compatibility).booleancheckForward(String ek9Operator) Check if EK9 operator exists (backward compatibility).booleanexpectsParameter(String ek9Operator) For operators that require a single parameter.booleanexpectsZeroParameters(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).getForward(String ek9Operator, int argumentCount) THE single source of truth for the arity-aware operator glyph -> method name mapping.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).booleanCheck if a method name maps to an operator.booleanhasOperator(String ek9Operator) Check if an EK9 operator exists.resolvedMethodName(MethodSymbol methodSymbol) THE canonical resolver from an operatorMethodSymbolto its backend method name, arity-aware (splits"-"into_negate/_subby the symbol's own parameter count — seegetForward(String, int)).
-
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
-
getForward
THE single source of truth for the arity-aware operator glyph -> method name mapping."-"is the ONLY operator glyph overloaded by arity: the ARG-LESS unary-(negate) maps to_negate, while the ARG-BEARING binary-(subtract) maps to_sub. This mirrors the runtime (e.g.Integer._negate()vsInteger._sub(arg)) and the arity split enforced byValidOperatorOrError.minusOperatorOrError:_negateis ALWAYS zero-arg,_subALWAYS takes an argument. Every DEFINITION-side name derivation (the IROperationInstrstamp, both backends, trait vtable slot naming, constrained-type delegation) MUST use this — never the arity-blindgetForward(String), which unconditionally yields_subfor"-"and so defines an arg-lessoperator -as_sub()while its call resolves to_negate()(native eager-link failure / JVM latent NoSuchMethodError).- Parameters:
ek9Operator- the EK9 operator glyphargumentCount- the number of parameters the operator method takes (excludes the receiver)- Returns:
- the arity-correct runtime method name
-
resolvedMethodName
THE canonical resolver from an operatorMethodSymbolto its backend method name, arity-aware (splits"-"into_negate/_subby the symbol's own parameter count — seegetForward(String, int)). Returns the plain name for non-operators or operators not in the map. Use this at every definition/layout site that derives a name from an operator symbol rather than anOperationInstr.- Parameters:
methodSymbol- the operator (or plain) method symbol- Returns:
- the resolved runtime method name
-
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. -
getSideEffects
-
getSideEffectsByMethod
-
getForwardKeys
-
getBackwardKeys
-