Readonly
associatedA node from the language might be associated with the current type, e.g. the declaration node in the AST (e.g. a FunctionDeclarationNode is associated with the corresponding FunctionType) This language node is not used for managing the lifecycles of this type, since it should be usable for any domain-specific purpose. Therefore, the use and update of this feature is under the responsibility of the user of Typir.
Protected
Readonly
edgesProtected
Readonly
edgesReadonly
functionProtected
identifierProtected
initializationReadonly
inputReadonly
kindProtected
onProtected
onProtected
onReadonly
outputProtected
stateProtected
waitProtected
waitProtected
waitAnalyzes, whether there is a sub type-relationship between two types. The difference between sub type-relationships and super type-relationships are only switched types. If both types are the same, no problems will be reported, since a type is considered as sub-type of itself (by definition).
the super type, while the current type is the sub type
an empty array, if the relationship exists, otherwise some problems which might point to violations of the investigated relationship. These problems are presented to users in order to support them with useful information about the result of this analysis.
Analyzes, whether there is a super type-relationship between two types. The difference between sub type-relationships and super type-relationships are only switched types. If both types are the same, no problems will be reported, since a type is considered as sub-type of itself (by definition).
the sub type, while the current type is super type
an empty array, if the relationship exists, otherwise some problems which might point to violations of the investigated relationship. These problems are presented to users in order to support them with useful information about the result of this analysis.
Protected
analyzeAnalyzes, whether two types are equal.
to be compared with the current type
an empty array, if both types are equal, otherwise some problems which might point to found differences/conflicts between the two types. These problems are presented to users in order to support them with useful information about the result of this analysis.
Protected
assertProtected
assertProtected
assertProtected
defineUse this method to specify, how THIS new type should be initialized.
This method has(!) to be called at the end(!) of the constructor of each specific Type implementation, even if nothing has to be specified, since calling this method starts the initialization process! If you forget the call this method, the new type remains invalid and invisible for Typir and you will not be informed about this problem!
all possible options for the initialization process
Optional
onCompleted?: () => voidtypical use cases: do some internal checks for the completed properties
Optional
onIdentifiable?: () => voidtypical use cases: calculate the identifier, register inference rules for the type object already now!
Optional
onInvalidated?: () => voidOptional
preconditionsForCompleted?: PreconditionsForInitializationStateContains only those TypeReferences which are required to do the completion. TypeReferences which are required only for the initialization, but not for the completion, don't need to be repeated here, since the completion is done only after the initialization.
Optional
preconditionsForIdentifiable?: PreconditionsForInitializationStateContains only those TypeReferences which are required to do the initialization.
Optional
referencesRelevantForInvalidation?: TypeReference<Type>[]Must contain all(!) TypeReferences of a type.
Returns a string value containing a short representation of the type to be shown to users of the type-checked language nodes. This value don't need to be unique for all types. This name should be quite short. Services should not call this function directly, but typir.printer.printTypeName(...) instead.
a short string value to show to the user
Calculates a string value which might be shown to users of the type-checked language nodes. This value don't need to be unique for all types. This representation might be longer and show lots of details of the type. Services should not call this function directly, but typir.printer.printTypeUserRepresentation(...) instead.
a longer string value to show to the user
This is an internal method to ignore some types during the initialization process in order to prevent dependency cycles. Usually there is no need to call this method on your own.
the new types to ignore during
Protected
switchProtected
switchProtected
switch
Design decisions: