Class AggregateSymbol

All Implemented Interfaces:
Serializable, IAggregateSymbol, ICanBeGeneric, ICanCaptureVariables, IScope, IScopedSymbol, ISymbol, ISymbolNature, ITokenReference
Direct Known Subclasses:
AggregateWithTraitsSymbol, AnyTypeSymbol

public class AggregateSymbol extends PossibleGenericSymbol implements IAggregateSymbol, Serializable
This is typically a 'class' or an interface type where it can include the definitions of new properties. These can then be made accessible via the symbol table to its methods. But note there is also a single super 'AggregateSymbol' that maps to a super class so here the resolve can access variables in the super class. i.e. we only support single inheritance - but see AggregateWithTraitsSymbol for 'traits' support. I've also added in a mechanism to parameterize the aggregate like Java generics. In general the resolution would be able to resolve variables in the enclosing scope because that will be module level in EK9, there are new global types and global constants that can appear to exist in the package (module) level scope. So for example it is possible to reference a 'constant' or a 'type' that is defined in the same module or if another module is drawn in through 'references'. In reality (when creating the Java code) the constants and types can just be public statics on a class. For example module "the.mod" that defines Constants could have a class called the.mod._Constants with public final statics defined. So there are two ways to resolve references first is module scope and second is super class type scope.
See Also:
  • Constructor Details

    • AggregateSymbol

      public AggregateSymbol(String name, IScope enclosingScope)
      A simple straight forward aggregate type, like a class or record.
    • AggregateSymbol

      public AggregateSymbol(String name, Optional<ISymbol> type, IScope enclosingScope)
      A simple straight forward aggregate type, like a class or record.
    • AggregateSymbol

      public AggregateSymbol(String name, IScope enclosingScope, List<ISymbol> typeParameterOrArguments)
      An aggregate that can be parameterised, i.e. like a 'List of T' So the name would be 'List' and the parameterTypes would be a single aggregate of a conceptual T.
  • Method Details