Class SuitableGenusOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.SuitableGenusOrError
public final class SuitableGenusOrError
extends RuleSupport
implements Function<org.antlr.v4.runtime.ParserRuleContext, Optional<ISymbol>>
Checks for a type is resolved and is suitable genus and category.
THE genus check for a resolved type: the phase 2 extension, application and registration checks use it, and so
does phase 3's check of the type a 'register' statement constructs (
validOrError(ParserRuleContext, ISymbol)).-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionSuitableGenusOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, List<SymbolGenus> genus, boolean allowTemplates, boolean issueErrorIfNotResolved) Checks that the typedef/identifierReference passed in (when resolved) is suitable genus.SuitableGenusOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, SymbolGenus genus, boolean allowTemplates, boolean issueErrorIfNotResolved) Checks that the typedef/identifierReference passed in (when resolved) is suitable genus. -
Method Summary
Modifier and TypeMethodDescriptionapply(org.antlr.v4.runtime.ParserRuleContext ctx) booleanvalidOrError(org.antlr.v4.runtime.ParserRuleContext ctx, ISymbol symbol) Checks a symbol that is already in hand (for example the type a call constructs), reporting at ctx.
-
Constructor Details
-
SuitableGenusOrError
public SuitableGenusOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, SymbolGenus genus, boolean allowTemplates, boolean issueErrorIfNotResolved) Checks that the typedef/identifierReference passed in (when resolved) is suitable genus. -
SuitableGenusOrError
public SuitableGenusOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, List<SymbolGenus> genus, boolean allowTemplates, boolean issueErrorIfNotResolved) Checks that the typedef/identifierReference passed in (when resolved) is suitable genus. Accepts multiple allowed genus. i.e. FUNCTION and FUNCTION_TRAIT.
-
-
Method Details
-
apply
-
validOrError
Checks a symbol that is already in hand (for example the type a call constructs), reporting at ctx.- Returns:
- true when the symbol is resolved and of a supported genus and category.
-