Package org.ek9lang.compiler.symbols
Interface ISymbol
- All Superinterfaces:
ISymbolNature
,ITokenReference
,Serializable
- All Known Subinterfaces:
IAggregateSymbol
,ICanBeGeneric
,IScopedSymbol
- 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
Represents the concept of what functionality a Symbol should have.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clone the symbol and re-parent if this symbol like a method should have a parent.double
double
Provide the name an end user would need to see on the screen.Provide the internal fully qualified name of this symbol.getName()
Provide the internal name of this symbol - not fully qualified in terms of the module it is in.getType()
double
boolean
boolean
default boolean
Only use on symbols, to see if they are directly defined as a constant.boolean
boolean
isExactSameType
(ISymbol symbolType) If is the symbol is an exact match.default boolean
While this aggregate itself might not able been marked as injectable Does this extend an aggregate that is marked as injectable.default boolean
default boolean
default boolean
default boolean
Some classes generated can be injected and others not.boolean
boolean
default boolean
default boolean
boolean
This symbol itself can be marked as pure - i.e.boolean
Even constants can be mutable until set.boolean
default boolean
boolean
For some symbols we might support the _promote method via coercion.default boolean
default boolean
default boolean
isPublic()
boolean
default boolean
void
putSquirrelledData
(CommonValues key, String value) void
setInitialisedBy
(IToken initialisedBy) void
setInjectionExpected
(boolean injectionExpected) void
void
void
setNullAllowed
(boolean nullAllowed) void
setParsedModule
(Optional<Module> parsedModule) For some symbols you may wish to specify the parsed module they were defined in.void
setReferenced
(boolean referenced) default ISymbol
Methods inherited from interface org.ek9lang.compiler.symbols.ISymbolNature
getCategory, getGenus, isApplication, isConceptualTypeParameter, isConstant, isControl, isEk9Core, isFunction, isGenericInNature, isMethod, isParameterisedType, isPrimitiveType, isTemplateFunction, isTemplateType, isType, isVariable, setGenus
Methods inherited from interface org.ek9lang.compiler.symbols.ITokenReference
setSourceToken
-
Field Details
-
NOT_ASSIGNABLE
static final double NOT_ASSIGNABLE- See Also:
-
-
Method Details
-
isNullAllowed
boolean isNullAllowed() -
setNullAllowed
void setNullAllowed(boolean nullAllowed) -
isInjectionExpected
boolean isInjectionExpected() -
setInjectionExpected
void setInjectionExpected(boolean injectionExpected) -
isReferenced
boolean isReferenced() -
setReferenced
void setReferenced(boolean referenced) -
putSquirrelledData
-
getSquirrelledData
-
getParsedModule
-
setParsedModule
For some symbols you may wish to specify the parsed module they were defined in.- Parameters:
parsedModule
- The parsedModule the symbol was defined in.
-
isDevSource
boolean isDevSource() -
isLibSource
boolean isLibSource() -
clone
Clone the symbol and re-parent if this symbol like a method should have a parent. Other symbols like VariableSymbols are un-parented -
isMarkedPure
boolean isMarkedPure()This symbol itself can be marked as pure - i.e. an operator with no side effects.- Returns:
- true if pure, false otherwise. By default, false - lets assume the worst.
-
isMutable
boolean isMutable()Even constants can be mutable until set. then they change to being none mutable. Likewise in 'pure' scopes a variable can be mutable until it is first set then none mutable.- Returns:
- If this symbol is mutable or not.
-
setNotMutable
void setNotMutable() -
getSourceToken
IToken getSourceToken()- Specified by:
getSourceToken
in interfaceITokenReference
-
getInitialisedBy
IToken getInitialisedBy() -
setInitialisedBy
-
clearInitialisedBy
void clearInitialisedBy() -
isInitialised
default boolean isInitialised() -
isPrivate
default boolean isPrivate() -
isProtected
default boolean isProtected() -
isPublic
default boolean isPublic() -
isLoopVariable
default boolean isLoopVariable() -
isIncomingParameter
default boolean isIncomingParameter() -
isReturningParameter
default boolean isReturningParameter() -
isPropertyField
default boolean isPropertyField() -
isDeclaredAsConstant
default boolean isDeclaredAsConstant()Only use on symbols, to see if they are directly defined as a constant. -
isFromLiteral
default boolean isFromLiteral() -
isMarkedAbstract
default boolean isMarkedAbstract() -
isInjectable
default boolean isInjectable()Some classes generated can be injected and others not.- Returns:
- true if this can be injected, false if not.
-
isExtensionOfInjectable
default boolean isExtensionOfInjectable()While this aggregate itself might not able been marked as injectable Does this extend an aggregate that is marked as injectable.- Returns:
- true if this is injectable or any of its supers area
-
isExactSameType
If is the symbol is an exact match. -
isPromotionSupported
For some symbols we might support the _promote method via coercion. i.e. Long -> Float for example But with class structures and traits/interfaces there is a time when objects are assignable because of base and super classes/types but don't need coercion. The isAssignable deals with mingling both coercion and super/trait type compatibility. But we need to know when it comes to IR generation whether to include a PromoteNode or whether the code generated will just work because of class inheritance/interface implementation. -
isAssignableTo
-
isAssignableTo
-
getAssignableWeightTo
-
getAssignableWeightTo
-
getUnCoercedAssignableWeightTo
-
getFullyQualifiedName
String getFullyQualifiedName()Provide the internal fully qualified name of this symbol. Defaults to just the name unless overridden. -Useful for generating output where you want to ensure fully qualified names are used. -
getFriendlyName
String getFriendlyName()Provide the name an end user would need to see on the screen. Normally this is just 'getName' but in the case of Templates We use a very nasty internal naming for List of SomeClass - which will probably be something like _List_hashed_version_of_ComeClass and the end user needs to see 'List of SomeClass' for it to be meaningful.- Returns:
- a user presentable of the symbol name.
-
getName
String getName()Provide the internal name of this symbol - not fully qualified in terms of the module it is in.- Returns:
- The basic internal name we'd use to resolve the symbol
-
setName
-
getType
-
setType
-
setType
-