Avail Loader
An AvailLoader is responsible for orchestrating module-level side-effects, such as those caused by adding method, abstract, and forward definitions. Also macros, A_Lexers, A_SemanticRestrictions, A_GrammaticalRestrictions, and method seals.
Author
Todd L Smith
Mark van Gulik
Constructors
Types
A class that tracks all visible A_Lexers while compiling a module.
The macro-state of the loader. During compilation from a file, a loader will ratchet between COMPILING while parsing a top-level statement, and EXECUTING_FOR_COMPILE while executing the compiled statement. Similarly, when loading from a file, the loader's phase alternates between LOADING and EXECUTING_FOR_LOAD.
Functions
Add the abstract method signature. A class is considered abstract if there are any abstract methods that haven't been overridden with definitions for it.
This is a forward declaration of a method. Insert an appropriately stubbed definition in the module's method dictionary, and add it to the list of methods needing to be declared later in this module.
The modularity scheme should prevent all inter-modular method conflicts. Precedence is specified as an array of message sets that are not allowed to be messages generating the arguments of this message. For example, <{"_+_"}, {"_+_", "_*_"}> for the "_*_" operator makes * bind tighter than +, and also groups multiple *'s left-to-right.
Add the macro definition. The precedence rules can not change after the first definition is encountered, so set them to 'no restrictions' if they're not set already.
Add the method definition. The precedence rules can change at any time.
Add a semantic restriction to its associated method.
Answer the LexicalScanner used for creating tokens from source code for this AvailLoader.
Look up the given A_String in the current module's namespace. Answer the atom associated with the string, creating the true name if necessary. A local true name always hides other true names. If isExplicitSubclassAtom is true and we're creating a new atom, add the SpecialAtom.EXPLICIT_SUBCLASSING_KEY property.
Get the current loading Phase.
Set up the rootBundleTree and lexicalScanner for compiling the body of the module.
Clear the rootBundleTree and lexicalScanner in preparation for loading (not compiling) the body of the module.
Answer the list of LoadingEffects.
Record a LoadingEffect to ensure it will be replayed when the module which is currently being compiled is later loaded.
Unbind the specified method definition from this loader and runtime.
Unbind the specified macro definition from this loader and runtime.
Answer the message bundle tree that this AvailLoader is using to parse its module. It must not be null.
Set the current loading Phase.
Set a flag that indicates we are determining if the effects of running a function can be summarized, and if so into what LoadingEffects.
Answer whether the current statement can be summarized into a sequence of LoadingEffects.
Replace the boolean that indicates whether the current statement can be summarized into a sequence of LoadingEffects. It is set to true before executing a top-level statement, and set to false if an activity is performed that cannot be summarized.
Clear the flag that indicates whether we are determining if the effects of running a function can be summarized into LoadingEffects.
Properties
A stream on which to serialize each ModuleManifestEntry when the definition actually occurs during compilation. After compilation, the bytes of this stream are written to a record whose index is captured in the A_Module's ModuleDescriptor.ObjectSlots.ALL_MANIFEST_ENTRIES, and fetched from the repository and decoded into a pojo array when needed.
The text interface for any fibers started by this AvailLoader.