Class ProgramCodeSites
java.lang.Object
org.ek9lang.compiler.phase5.ProgramCodeSites
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 ClassesModifier and TypeClassDescription(package private) static final recordOne 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
ConstructorsConstructorDescriptionProgramCodeSites(SymbolsAndScopes symbolsAndScopes, ObjectSharing objectSharing) -
Method Summary
Modifier and TypeMethodDescription(package private) List<ProgramCodeSites.Site> in(org.antlr.v4.runtime.tree.ParseTree region, int afterToken, int beforeToken) Every place inregionthat starts strictly after tokenafterTokenand strictly before tokenbeforeToken- 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> ofInPlaceWrite(EK9Parser.IdentifierContext occurrence, ISymbol symbol, ObjectSharing.Use use) 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 += 1withCounter's own+=).
-
Constructor Details
-
ProgramCodeSites
ProgramCodeSites(SymbolsAndScopes symbolsAndScopes, ObjectSharing objectSharing)
-
-
Method Details
-
of
The program code that this one node runs, when it is one of the places (none for any other node). An identifier is judged on every use of its occurrence; the walk, which has those uses already, asksofInPlaceWrite(EK9Parser.IdentifierContext, ISymbol, ObjectSharing.Use)instead. -
in
List<ProgramCodeSites.Site> in(org.antlr.v4.runtime.tree.ParseTree region, int afterToken, int beforeToken) Every place inregionthat starts strictly after tokenafterTokenand strictly before tokenbeforeToken- a region read ahead of the walk. -
ofInPlaceWrite
Optional<ProgramCodeSites.Site> ofInPlaceWrite(EK9Parser.IdentifierContext occurrence, ISymbol symbol, ObjectSharing.Use use) 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 += 1withCounter's own+=).
-