Package org.ek9lang.compiler.phase3
Class AugmentAggregateWithTraitMethods
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.AugmentAggregateWithTraitMethods
- All Implemented Interfaces:
BiConsumer<EK9Parser.TraitsListContext,
AggregateWithTraitsSymbol>
final class AugmentAggregateWithTraitMethods
extends TypedSymbolAccess
implements BiConsumer<EK9Parser.TraitsListContext,AggregateWithTraitsSymbol>
Designed to add in methods on the aggregate where the 'traits' use is 'traits by'.
What this means is any abstract methods in the trait (and its supers not implemented) must
have been implemented in the 'by {reference}'. Otherwise, there would have been errors when creating the
{reference}.
So what this means is that these same abstract methods must be 'overridden' in this aggregate, either by the
ek9 developer - or we have to add in a synthetic non-abstract method.
When it actually comes to actually implementing this code generated will actually add a real method in but delegate
the call to the {reference} object.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.common.RuleSupport
errorListener, symbolsAndScopes
-
Constructor Summary
ConstructorDescriptionAugmentAggregateWithTraitMethods
(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EK9Parser.TraitsListContext traitsListContext, AggregateWithTraitsSymbol aggregate) Methods inherited from class org.ek9lang.compiler.common.TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.BiConsumer
andThen
-
Constructor Details
-
AugmentAggregateWithTraitMethods
AugmentAggregateWithTraitMethods(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
public void accept(EK9Parser.TraitsListContext traitsListContext, AggregateWithTraitsSymbol aggregate) - Specified by:
accept
in interfaceBiConsumer<EK9Parser.TraitsListContext,
AggregateWithTraitsSymbol>
-