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
SymbolsAndScopes
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.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.Used to decouple checks from the grammar contexts.Just really pulls up the appropriate symbol from the expression into this context.Checks the assignments for operator : := = and :=? that's all.Used in the full resolution phase to check assignments.Designed to add in methods on the aggregate where the 'traits' use is 'traits by'.The ek9 developer does not need to redeclare incoming or returning parameters for dynamic functions.Designed to deal with this following part of the EK9 grammar.Just checks and records the appropriate type for the case expression, based on how it is used.Checks that methods from a super and one or more traits do not conflict.Given a symbol, this check that the type that the symbol has can support the '<=>' operator.Just checks that an expression used in a control for if/while etc is a Boolean type.Used for checking covariance based on a variable.Given a symbol, this check that the type that the symbol has can support the '--' operator.Checks that operators that have been 'defaulted' could actually be implemented.To be used when checking if a variable Symbol is a function delegate and can accept a set of call arguments.Creates/Updates an ek9 Dict (Dictionary/Map) of a specific types if the expressions are typed correctly.Resolves the variables to be captured and defines new variable symbols against the appropriate scopes.Checks if a dynamic function body is needed and provided.Creates/Updates an enumerated type adding methods as appropriate.Attempts to locate an Enumeration by name.Checks that the symbol passed has a type and that the type is compatible with an EK9 Exception.Ensures that 'expression' is now resolved and 'typed' or a not resolved error.This listener just deals with expressions and the types that result from expressions.Useful in expressions to contain the left and right hand symbols.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 or emits an error.Ensures that a for loop/for range statement/expression is used correctly in or out of an expression.Deals with checking the 'for' statement/expression.To be used when checking if a function can accept a set of call arguments.Check is the data passed in enabled a delegate function to be resolved and if so return that Function.Checks that the function correctly overrides the signature if it has a super.Given a 'type' (the IAggregateSymbol passed in), see it would be possible to iterator over it with some other type.Checks that the guard expression is valid.Given a symbol, this check that the type that the symbol has can support the '#?' operator.Checks the possible operation variable, literal or function for suitability for use with 'head', 'tail' and 'skip'.Deals with the checking and setting initialised of the identifier.Used for pure identifier resolution and recording.Ensures that 'identifierReference' is now resolved and hangs together and is 'typed' or emit "not resolved" error.Checks the IfStatement is valid or emits errors.Given a symbol, this check that the type that the symbol has can support the '++' operator.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.Creates/Updates an ek9 list of a specific type if the expressions are typed correctly.Returns the appropriate operator text symbol for the expression.Check overrides on methods.Create a MethodSearch symbol for an operation that could have a single expression or two expressions.Checks if a symbol can be mutated, this is nothing to do with a pure context.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.Typically used when a direct call is being bad on the symbol.Used where traits are implemented 'by' a variable.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.Provides a common set of operations for checking operators.Used for checking parameter list types match.Checks the number and types of the two sets of parameter list match exactly.Process the stream pipeline part, ensuring that it can be resolved.Checks that the pre-flow expressions are valid.Ensures that 'primary' is now resolved and 'typed' or a not resolved error.Deals with checking the 'while' or 'do/while control variable in the statement/expression.Used for resolving and recoding of fields on specific types.For doing pure checks on method and functions.Checks if the pure modifier has been used correctly on methods and functions.Just check that with in the current 'context' - if pure that the processing call is pure.Checks the Range and ensures that there a Symbol recorded against that context.To be used with operators on aggregates (except for the is-set ? operator, that has to deal with 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).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.Looks at the returning param (if not null) and sets the symbol type as appropriate.Validates that the statement is OK and emits errors if this is not the case.Used in Stream assembly processing to check aggregate use validity.The construct for a Stream statement/expression.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.Checks that the arguments in the function are compatible with the current pipeline type.Used in Stream assembly processing to check function validity.Now does the check/processing of the whole stream pipeline.Process and ensure that the stream termination can function correctly.Ensures that a switch is used correctly in or out of an expression.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.Used when checking access to fields/properties and methods.Returns the appropriate symbol from the symbol and scope management component.Checks if a symbol has been referenced or not (can be null - no error).MULTI THREADED Now try and 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.Just focus on resolving 'this' or 'super' in respect to a 'call'.Checks and assigns type a 'this' or 'super' symbol, but only if it valid.Checks that the throw statement actually throws and Exception type.Gets the abstract methods and then resolves each to see what the resulting method would be.Ensures that a try statement/expression is used correctly in or out of an expression.Deals with checking the try statement/expression.TO be used when checking the left hand side and the right hand side with specific operators.Checks that any recursive type constraints on a type are valid.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.Checks if a function extends another function and if it is abstract.Checks on the assignment during a declaration and emits an error if not valid.Focus on checking a variable only declaration, now that types are all known.Ensures that a while do/while statement/expression is used correctly in or out of an expression.Deals with checking the 'while' or 'do/while statement/expression.