Class ApplyTraitsOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase2.ApplyTraitsOrError
- All Implemented Interfaces:
BiConsumer<EK9Parser.TraitsListContext, AggregateWithTraitsSymbol>
final class ApplyTraitsOrError
extends RuleSupport
implements BiConsumer<EK9Parser.TraitsListContext, AggregateWithTraitsSymbol>
Resolves each trait in a 'traitsList' (checking it is a suitable CLASS_TRAIT to extend) and adds it
to the supplied aggregate. A null traitsList is tolerated (nothing to add).
Centralises the resolve-each-trait-and-add loop that was otherwise repeated verbatim by every construct that can have traits (trait declarations, dynamic classes, class declarations).
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionApplyTraitsOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(EK9Parser.TraitsListContext traitsList, AggregateWithTraitsSymbol target) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Constructor Details
-
ApplyTraitsOrError
ApplyTraitsOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<EK9Parser.TraitsListContext, AggregateWithTraitsSymbol>
-