Package org.ek9lang.compiler.symbols
Interface ISymbolNature
- All Known Subinterfaces:
IAggregateSymbol
,ICanBeGeneric
,IScopedSymbol
,ISymbol
- All Known Implementing Classes:
AggregateSymbol
,AggregateWithTraitsSymbol
,CallSymbol
,CaptureScopedSymbol
,ConstantSymbol
,ControlSymbol
,ExpressionSymbol
,ForSymbol
,FunctionSymbol
,MethodSymbol
,ParamExpressionSymbol
,PossibleGenericSymbol
,ScopedSymbol
,ServiceOperationSymbol
,StackConsistencyScope
,StreamCallSymbol
,StreamPipeLineSymbol
,SwitchSymbol
,Symbol
,TrySymbol
,VariableSymbol
,WhileSymbol
public interface ISymbolNature
Defines helpful and require methods to assist in the definition of the nature of a symbol.
This includes the category, genus, but also whether it is generic or a template.
Symbol is really a chameleon, it can be a variable a type, etc.
-
Method Summary
Modifier and TypeMethodDescriptiongetGenus()
default boolean
Is the symbol an application of some sort.default boolean
Some symbols are simulated as generic type parameters like T and S and U for example When they are constructed as AggregateTypes this will be set to true in those classes.default boolean
default boolean
boolean
Is this a core thing from EK9.default boolean
default boolean
Is this symbol a type that is generic in nature i.e.default boolean
isMethod()
default boolean
So just to add to the confusion.default boolean
Is the symbol a core primitive type.default boolean
default boolean
default boolean
isType()
default boolean
void
setGenus
(SymbolGenus genus)
-
Method Details
-
getGenus
SymbolGenus getGenus() -
setGenus
-
getCategory
SymbolCategory getCategory() -
isTemplateType
default boolean isTemplateType() -
isTemplateFunction
default boolean isTemplateFunction() -
isType
default boolean isType() -
isVariable
default boolean isVariable() -
isEk9Core
boolean isEk9Core()Is this a core thing from EK9. -
isParameterisedType
default boolean isParameterisedType()So just to add to the confusion. A type that has been used with a type that is generic in nature with some parameters. So this would normally result in a type that is now concrete. i.e. List (generic in nature) and String (concrete) so this resulting type 'List of String' isAParameterisedType=true and isGenericInNature=false. But if List were parameterised with another generic parameter it would still be of a generic nature. For example, consider List T and Iterator I when we defined List T and use the Iterator with it; we parameterise Iterator with 'T'. But they are still both 'isGenericTypeParameter' it only when we use List (and by implication Iterator) with String do they both stop being generic in nature.- Returns:
- true if a parameterised type (note parameterised not just of a generic nature).
-
isGenericInNature
default boolean isGenericInNature()Is this symbol a type that is generic in nature i.e. can it be parameterised with types. Aggregate Symbols can be defined to accept one or more parameters ie S and T. -
isConceptualTypeParameter
default boolean isConceptualTypeParameter()Some symbols are simulated as generic type parameters like T and S and U for example When they are constructed as AggregateTypes this will be set to true in those classes. In general this is useful when working with Generic classes and needing types like S and T But they can never really be generated. -
isPrimitiveType
default boolean isPrimitiveType()Is the symbol a core primitive type. -
isApplication
default boolean isApplication()Is the symbol an application of some sort. -
isMethod
default boolean isMethod() -
isFunction
default boolean isFunction() -
isControl
default boolean isControl() -
isConstant
default boolean isConstant()
-