Package org.ek9lang.compiler.symbols


package org.ek9lang.compiler.symbols

This is the main source of EK9 Symbols used within the compiler. There is some degree of complexity here, start with 'ISymbol' and look at the type hierarchy.

Just about everything the the ek9 developer adds to an ek9 source file becomes one or more symbols.

For complex aggregates like classes, their is also a resolution hierarchy that resolves in enclosing scopes. But even in flow constructs the resolution flows upwards and back to the very top level 'CompilableProgram'.

  • Class
    Description
    This is typically a 'class' or an interface type where it can include the definitions of new properties.
    An aggregate, but one that can have zero or more traits (like interfaces).
    Just re-uses the bulk of method symbol for when we want to make a symbol that is a call to an actual method.
    Used to actually hold the captured symbols.
    Just focuses on the ability to possible capture variables from an enclosing scope.
    A very simple type that holds a single distinct value.
    EK9 switch/try control type symbol - this can effectively return a value if it is configured with returning part.
    Used to cache built in types as they are so frequently used.
    While we don't add these in the scoped structures when compiling.
    EK9 'for' type symbol - we need a scope because we declare a new variable as the loop variable.
    Scope for functions that are part of a module.
    Interface for an aggregate, typically a class or something like that.
    Really a Marker interface for generic classes and generic functions.
    Interface for dynamic functions and classes so that dynamic variables can be captured.
    Used by functions and methods as they may return a symbol (variable).
    Concept of a scope where functions, methods and variables can be declared.
    The main type of scope in use a block is just like a set of instruction inside an if block or a while block whereas a non-block is as the whole class/function/component level.
    For symbols that are both a pure symbol but can also define a scope.
    Represents the concept of what functionality a Symbol should have.
    Typically used on symbols; so we know their broad use and type.
    Typically, used on aggregates because we might use a AggregateSymbol But when coming to process it we need to ensure other aggregate symbols that extend it are of compatible genus i.e a class can only extend a base class not a style but one style could extend another style.
    Used in various ways to hold a token from the parse, so we can reference back to source code.
    Used in many ways via composition.
    Represents some type of method that exists on an aggregate type scope.
    This is a very special scope, because the same 'module name' can be defined in multiple files.
    While we don't add these in the scoped structures when compiling.
    Added as a common symbol type for both Functions and Aggregates that could possibly be generic in nature and also be a parameterised type.
    Represents a symbol that also has a scope.
    Scope for callable methods (operations) that are part of a Service.
    Used when duplicate symbols are found, where we need to add a placeholder.
    Just re-uses the bulk of method symbol.
    Intended to model the pipeline flow in a streaming of cat or for loop though | and map etc.
    EK9 switch statement - this can effectively return a value if it is configured with returning part.
    A bit of a beast.
    We need to support simple things like classes which are unique per symbol table Or the fully qualified class names like 'com.some.A and com.other.A' so they won't collide.
    EK9 try statement - this can effectively return a value if it is configured with returning part.
    Models a variable.
    EK9 'while' or 'do/while' type symbol - we need a scope because we can declare new variables as part of the pre-flow semantics.