Class IsSetGenerator
java.lang.Object
org.ek9lang.compiler.phase7.synthesis.AbstractSyntheticGenerator
org.ek9lang.compiler.phase7.synthesis.IsSetGenerator
Generates synthetic IR for the _isSet (?) operator.
The generated code follows this pattern:
Boolean _isSet(): // For each field in properties: // result = this.field._isSet() // if !result._true() -> return false return true // All fields are set
Key semantic requirements:
- Returns true only if ALL fields are set
- Returns false if ANY field is unset (short-circuit)
- No parameter checking needed (no "other" parameter)
- Super's _isSet is not called - each class handles its own fields
-
Field Summary
Fields inherited from class AbstractSyntheticGenerator
stackContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate(MethodSymbol methodSymbol, AggregateSymbol aggregateSymbol) Generate the _isSet operator IR for the given aggregate.Methods inherited from class AbstractSyntheticGenerator
createDebugInfo, generateBooleanReturnBlock, generateConstructorCall, generateFieldLoad, generateIsSetGuard, generateLabelName, generateMethodCall, generateTempName, generateThisIsSetGuard, generateUnsetReturnBlock, getBooleanTypeName, getIntegerTypeName, getStringTypeName, getSuperTypeName, getSyntheticFields, getTypeName, getVoidTypeName, isAnyType, superHasOperator
-
Constructor Details
-
IsSetGenerator
IsSetGenerator(IRGenerationContext stackContext)
-
-
Method Details
-
generate
Generate the _isSet operator IR for the given aggregate.- Parameters:
methodSymbol- The _isSet method symbolaggregateSymbol- The aggregate containing the method- Returns:
- List of IR instructions implementing the method
-