Package-level declarations
Types
Pop an argument from the parse stack of the current potential message send. Pop a list from the parse stack. Append the argument to the list. Push the resultant list onto the parse stack.
ArityOneParsingOperation is a ParsingOperation that takes a single operand.
An AvailAcceptedParseException is thrown by primitive P_AcceptParsing to indicate the fiber running a semantic restriction has accepted the argument types and does not need to restrict the proposed expression's type.
An AvailCodeGenerator is used to convert a phrase into the corresponding raw function.
The compiler for Avail code.
An AvailCompilerBipartiteRendezvous comes at parsing from both sides to maximize the freedom of implementation of the parser. It uses dynamic programming to avoid parsing the same subexpression multiple times. When a new continuation needs to run against all possible subexpressions, it looks up the current parser state in a map to get the bipartite rendezvous. That contains the list of subexpressions that have been parsed so far. They are all run against the new continuation. The continuation is then added to the bipartite rendezvous's list of actions. When a new complete subexpression is found it is run against all waiting actions and added to the list of subexpressions.
An AvailCompilerException is thrown by the Avail compiler when compilation fails for any reason.
An AvailCompilerFragmentCache implements a memoization mechanism for a compiler. The purpose is to ensure that the effort to parse a subexpression starting at a specific token is reused when backtracking.
An AvailRejectedParseException is thrown by primitive P_RejectParsing to indicate the fiber running a semantic restriction (or macro body or prefix function) has rejected the argument types or phrases for the reason specified in the exception's constructor.
Branch to the specified instruction, which must be after the current instruction. Attempt to continue parsing at both the next instruction and the specified instruction.
Apply grammatical restrictions to the operandth leaf argument (underscore/ellipsis) of the current message, which is on the stack.
Check that the list phrase on the top of the stack has at least the specified size. Proceed to the next instruction only if this is the case.
Check that the list phrase on the top of the stack has at most the specified size. Proceed to the next instruction only if this is the case.
A CompilationContext lasts for a module's entire compilation activity.
The compiler notifies a CompilerProgressReporter whenever a top-level statement is parsed unambiguously.
The arguments are
the module name,
the module size in bytes,
the current parse position in bytes within the module,
the line number, or Int.MAX_VALUE if completed, and
a function that fetches the compiled top-level statement, or
nullif no phrase is available.
Concatenate the two lists that have been pushed previously.
Pop an argument from the parse stack and apply the conversion rule specified by operand.
Pop the top marker off the mark stack.
Push a new list that contains an empty tuple of phrases onto the parse stack.
Pop the top marker off the mark stack and compare it to the current parse position. If they're the same, abort the current parse, otherwise push the current parse position onto the mark stack in place of the old marker and continue parsing.
Throw a FiberTerminationException indicate that a fiber has suicided.
Check whether we are positioned immediately after a newline and whitespace. If the current indentation string is a proper extension of the initial whitespace, report a weak error and abandon this parse theory, otherwise continue parsing. In other words, permit indent that matches or decreases the initial indentation.
The compiler notifies a GlobalProgressReporter whenever a top-level statement is parsed unambiguously.
The arguments are:
the current number of bytes that have been compiled and executed
the total number of bytes of source being compiled.
Check whether we are positioned immediately after a newline and whitespace that contains as a prefix the whitespace on which the first token of this phrase or its leading argument occurred. If the current indentation string is a proper extension of the initial whitespace, continue parsing, otherwise report a weak error and abandon this parse theory.
Jump to instruction specified instruction, which must be before the current instruction. Attempt to continue parsing only at the specified instruction.
Jump to the specified instruction, which must be after the current instruction. Attempt to continue parsing only at the specified instruction.
JumpParsingOperation is a ParsingOperation that performs a branch or jump.
Check whether we are positioned immediately after a newline and whitespace that matches the line on which the first token of this phrase or its leading argument occurred. If the indentation string (i.e., spaces and tabs) agrees, continue parsing, otherwise report a weak error and abandon this parse theory.
A module's header information.
Information that a ModuleHeader uses to keep track of a module import, whether from an Extends clause or a Uses clause, as specified by the SpecialMethodAtom.MODULE_HEADER.
A ModuleManifestEntry is a short summary of an interesting definition created by some module. This includes atoms, method definitions, semantic restrictions, lexers, module variables/constants, etc.
Ensure we are not positioned at a series of whitespace and comments that include a line break. This test is specifically to support "⇥⁇" and "↹⁇". Without this filter instruction, the normal token processing would allow the "didn't look for indent" path to consume any whitespace at all, including a wrong indent, making the construct pointless.
Parse any raw token, leaving it on the parse stack. In particular, push a literal phrase whose token is a synthetic literal token whose value is the actual token that was parsed.
Parse an ordinary argument of a message send, pushing the expression onto the parse stack.
Parse an argument of a message send, using the outermost (module) scope. Leave it on the parse stack.
Parse the operandth message part of the current message. This will be a specific token. It should be matched case sensitively against the source token.
Parse the operandth message part of the current message. This will be a specific token. It should be matched case insensitively against the source token.
ParserState instances are immutable and keep track of a current lexingState and clientDataMap during parsing.
Parse an expression, even one whose expressionType is ⊤, then push a literal phrase wrapping this expression onto the parse stack.
Parse a raw token. It should correspond to a variable that is in scope. Push a variable reference onto the parse stack.
A ParsingConversionRule describes how to convert the argument at the top of the parsing stack from one phrase to another.
ParsingOperation describes the operations available for parsing Avail message names.
The statistics for ParsingOperation.
Permute the elements of the list phrase on the top of the stack via the specified permutation. The list phrase must be the same size as the permutation.
Placeholder for use by an InstructionGenerator. Must not survive beyond code generation.
These are the tokens that are understood directly by the Avail compiler.
A macro has been parsed up to a section checkpoint (§). Make a copy of the parse stack, then perform the equivalent of an AppendArgument on the copy, the specified number of times minus one (because zero is not a legal operand). Make it into a single list phrase and push it onto the original parse stack. It will be consumed by a subsequent RunPrefixFunction.
Push a literal phrase containing the specified constant. The operand is automatically made shared.
Reverse the operand top elements of the stack. The new stack has the same depth as the old stack.
A macro has been parsed up to a section checkpoint (§), and a copy of the cleaned up parse stack has been pushed, so invoke the operandth prefix function associated with the macro. Consume the previously pushed copy of the parse stack. The current ParserState's client data map is stashed in the new fiber's globals map and retrieved afterward, so the prefix function and macros can alter the scope or communicate with each other by manipulating this map. This technique prevents chatter between separate fibers (i.e., parsing can still be done in parallel) and between separate linguistic abstractions (the keys are atoms and are therefore modular).
Push the current parse position onto the mark stack.
The kinds of manifest entries that can be recorded. If this changes in a way other than adding enum values at the end, you must rebuild your repository files.
Use the type of the argument just parsed to select among successor message bundle trees. Those message bundle trees are filtered by the allowable leaf argument type. This test is precise, and requires repeated groups to be unrolled for the tuple type specific to that argument slot of that definition, or at least until the A_Type.defaultType of the tuple type has been reached.