Class ApplyAllowingOnlyOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase2.ApplyAllowingOnlyOrError
- All Implemented Interfaces:
BiConsumer<EK9Parser.AllowingOnlyContext, AggregateWithTraitsSymbol>
final class ApplyAllowingOnlyOrError
extends RuleSupport
implements BiConsumer<EK9Parser.AllowingOnlyContext, AggregateWithTraitsSymbol>
Resolves each class in an 'allowingOnly' list (checking it is a suitable CLASS genus) and registers it
as an allowed extender of the supplied aggregate. A concrete (non-abstract) class is required - an
abstract class triggers ABSTRACT_IN_ALLOW_ONLY. A null allowingOnly is tolerated (nothing to add).
Centralises the resolve-each-allowed-class loop shared by trait declarations and (sealed) class declarations. The class-only SEALED_CLASS_MUST_BE_OPEN precondition stays at its caller.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionApplyAllowingOnlyOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(EK9Parser.AllowingOnlyContext allowingOnly, 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
-
ApplyAllowingOnlyOrError
ApplyAllowingOnlyOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<EK9Parser.AllowingOnlyContext, AggregateWithTraitsSymbol>
-