Class ProgramCodeSites

java.lang.Object
org.ek9lang.compiler.phase5.ProgramCodeSites

final class ProgramCodeSites extends Object
THE places in source where code of the program's own may run (D66) - what is not pure and not a concrete built-in - and what each can reach (Reach). Use this; never a second list of such places. The walk asks it node by node (of(ParseTree), from PreIRListener); a look-ahead over a region not yet walked asks it for the whole region (in(ParseTree, int, int), from ContainerChangedBetween), so the two can never see different places.

The places: a call, an operation call and a stream stage given a function (each a call: the names it is given are their own occurrences); a for ... in loop and a stream's cat over a value whose iteration protocol is the program's own; a for range whose counter type's copy constructor or stepping operators are; an in-place write by an operator of the program's own type (counter += 1, this :=: other). The last three change the names they are given in place (ProgramCodeSites.Site.changesNamedInPlace).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static final record 
    One place where code of the program's own may run: what it reaches, and whether it changes the names it is given in place (an in-place write, an iteration) rather than handing them to a call.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProgramCodeSites(SymbolsAndScopes symbolsAndScopes, ObjectSharing objectSharing)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) List<ProgramCodeSites.Site>
    in(org.antlr.v4.runtime.tree.ParseTree region, int afterToken, int beforeToken)
    Every place in region that starts strictly after token afterToken and strictly before token beforeToken - a region read ahead of the walk.
    (package private) List<ProgramCodeSites.Site>
    of(org.antlr.v4.runtime.tree.ParseTree node)
    The program code that this one node runs, when it is one of the places (none for any other node).
    (package private) Optional<ProgramCodeSites.Site>
    The in-place write one use of an identifier's occurrence makes, when that use is an in-place write by an operator of the program's own (counter += 1 with Counter's own +=).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait