Package org.ek9lang.compiler.phase3
package org.ek9lang.compiler.phase3
G - Full Symbol Resolution can now take place.
If the EK9 developer has defined all the necessary symbols then this whole phase should be able to resolve them. This includes Parameterized Generic/Template types.
SymbolResolution
is the main entry point for this phase. Most of the
processing is delegated to ResolveDefineInferredTypeListener
.
This now follows the same pattern as most of the other Listeners, using
SymbolAndScopeManagement
for handling scope traversals and locating recorded
symbols and scopes.
This is the phase that is 'in progress' and is quite complex because it involves processing 'calls' and 'expressions'. There are also lot's more rules that can now be applied, because all 'types' are present.
...
-
ClassDescriptionJust gets the left and right hand side of values in an expression.Used to decouple checks from the grammar contexts.Designed to add in methods on the aggregate where the 'traits' use is 'traits by'.The ek9 develop does not need to redeclare incoming or returning parameters for dynamic functions.Check that a symbol can be accessed issues error if not possible.Checks that all the text bodies that are on the super are also present in the language variant.Checks the assignments for operator : := = and :=? that's all.Checks that methods from a super and one or more traits do not conflict.Just checks that an expression used in a control for if/while etc is a Boolean type.Checks that operators that have been 'defaulted' could actually be implemented.Checks that the symbol passed has a type and that the type is compatible with an EK9 Exception.Given a symbol, this check that the type that the symbol has can support the '<=>' operation.Checks if a dynamic function body is needed and provided.To be used with operators on aggregates (except for the is-set ? operator, that has to deal with functions).Checks if a function extends another function and if it is abstract.Checks that the function correctly overrides the signature if it has a super.Checks the possible operation variable, literal or function for suitability for use with 'head', 'tail' and 'skip'.Gets the abstract methods and then resolves each to see what the resulting method would be.Checks that variable only and variable declarations have symbols that have been referenced.Given an aggregate and a symbol, this predicate checks if the symbol is a property/field of that aggregate.Given a symbol, this check that the type that the symbol has can support the '?' operation.Checks the left hand side and the right hand side for assignment compatibility.Check overrides on methods.Checks if a symbol can be mutated, this is nothing to do with a pure context.Typically used when a direct call is being bad on the symbol.Used where traits are implemented 'by' a variable.Checks the number and types of the two sets of parameter list match exactly.As it is possible to have a variable that is a delegate 'function', it means that to call that function, the ek9 developer would use variable-name(parameters).As all properties on records are public, it is necessary to check they do not get duplicated.Just check that with in the current 'context' - available from 'TypedSymbolAccess'.Checks if the pure modifier has been used correctly on methods and functions.Checks if a symbol has been referenced or not (can be null - no error).Checks the use of registering a service is valid and then ensures that the 'Application' is altered from being a general application to a service application.Checks that the arguments in the function are compatible with the current pipeline type.Ensures that a switch is used correctly in or out of an expression.Used when checking access to fields/properties and methods.Checks that the throw statement actually throws and Exception type.Checks the covariance compatibility of two variables, this will traverse them to get their types.Check that the types of two symbol ar compatible with each other.Designed to deal with this following part of the EK9 grammar.Ensures that 'expression' is now resolved and 'typed' or a not resolved error.Check is the data passed in enabled a delegate function to be resolved and if so return that Function.Validates that the statement is OK and emits errors if this is not the case.Checks on the assignment during a declaration.Focus on checking a variable only declaration, now that types are all known.Used for checking covariance based on a variable.To be used when checking if a variable Symbol is a function delegate and can accept a set of call arguments.Resolves the variables to be captured and defines new variable symbols against the appropriate scopes.Attempts to locate an Enumeration by name.This listener just deals with expressions and the types that result from expressions.Useful in expressions to contain the left and right hand symbols.To be used when checking if a function can accept a set of call arguments.Given a 'type' (the IAggregateSymbol passed in), see it would be possible to iterator over it with some other type.Create a MethodSearch symbol for an operation that could have a single expression or two expressions.Provides a common set of operations for checking operators.Returns the appropriate operator text symbol for the expression.Used for checking parameter list types match.Creates/Updates an ek9 Dict (Dictionary/Map) of a specific types if the expressions are typed correctly.Creates/Updates an ek9 list of a specific type if the expressions are typed correctly.Just really pulls up the appropriate symbol from the expression into this context.Used in the full resolution phase to check assignments.Just checks and records the appropriate type for the case expression, based on how it is used.Creates/Updates an enumerated type adding methods as appropriate.Used for resolving and recoding of fields on specific types.Deals with the for loop for phase 3, which is basically working out the type of the variable being iterated over and ensuring that the expression is something that can be iterated over.Pulls the type from the 'range' into the loop variable, so it is correctly typed.Deals with checking the 'for' statement/expression.Checks that the guard expression is valid.Deals with the checking and setting initialised of the identifier (as appropriate).Used for pure identifier resolution and recording.Checks the IfStatement is valid or emits errors.This is the second part of the method/function chaining resolution and can be recursive via objectAccess.Processes the Object Access start, this is the start of chained method/function calls.Used for resolving operation calls on aggregates, which can include properties that are delegates to functions.Process the stream pipeline part, ensuring that it can be resolved.Checks the Range and ensures that there a Symbol recorded against that context.Processes/updates and checks that a stream assembly is actually viable in terms of types.Deals with working out what the type being 'catted' is.Now does the check/processing of the whole stream pipeline.Process and ensure that the stream termination can function correctly.Deals with working out what the type being "for'd" is.Now does the check/processing of the whole stream pipeline.Process and ensure that the stream termination can function correctly.Deals with checking if the switch can be used as an expression and whether the variable being switched on has the appropriate operators to meet the case criteria.Just focus on resolving 'this' or 'super' in respect to a 'call'.Deals with checking the try statement/expression.Checks that any recursive type constraints on a type are valid.Ensures that 'identifierReference' is now resolved and hangs together and 'typed' or emit "not resolved" error.Ensures that 'primary' is now resolved and 'typed' or a not resolved error.Checks and assigns type a 'this' or 'super' symbol, but only if it valid.Deals with checking the 'while' or 'do/while control variable in the statement/expression.Deals with checking the 'while' or 'do/while statement/expression.For doing pure checks on method and functions.Used where traits are implemented 'by' a variable.This is a really critical point, because this attempts to ensure that ANY expression results in a symbol that has been 'typed'.Used for resolving a function (by just name) or a variable that is a function delegate.Check for valid function parameters.Locate a possible call to an identifierReference, so some sort of call.Given a search for a method from an aggregate - and include supers/traits etc, this function will try and locate the method.Accesses the aggregate and gets just the 'default' operators defined on that aggregate (not any hierarchy).Looks at the returning param (if not null) and sets the symbol type as appropriate.Used in Stream assembly processing to check aggregate use validity.The construct for a Stream statement/expression.Used in Stream assembly processing to check function validity.Returns the appropriate symbol from the symbol and scope management component.MULTI THREADED Now try check that all symbols used have a type.Just extracts the ISymbols from the expression contexts and issues not resolved errors if any are not present.Provides the PossibleGenericSymbol type of the symbol if it has been typed, or empty.TO be used when checking the left hand side and the right hand side with specific operators.