Class OperatorPositionMap
java.lang.Object
org.ek9lang.compiler.common.OperatorPositionMap
Maps EK9 operators to their syntactic position (prefix vs suffix/postfix).
Used to detect when operators are used in the wrong position and provide helpful error messages.
In EK9:
- PREFIX operators come BEFORE the expression:
#< list,$ value,~ number - SUFFIX operators come AFTER the expression:
value?
Common mistakes this helps detect:
list#<instead of#< listvalue$instead of$value?valueinstead ofvalue?
No statics (Steve, 2026-10-28): hold an instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisPositionSensitiveOperator(String operator) Check if this is a position-sensitive operator (either prefix or suffix).booleanisPrefixOperator(String operator) Check if an operator is a prefix operator (must come BEFORE expression).booleanisSuffixOperator(String operator) Check if an operator is a suffix operator (must come AFTER expression).
-
Constructor Details
-
OperatorPositionMap
public OperatorPositionMap()
-
-
Method Details
-
isPrefixOperator
Check if an operator is a prefix operator (must come BEFORE expression). -
isSuffixOperator
Check if an operator is a suffix operator (must come AFTER expression). -
isPositionSensitiveOperator
Check if this is a position-sensitive operator (either prefix or suffix).
-