A_Phrase
An A_Phrase is generally produced when the AvailCompiler parses source code of an A_Module. Avail defines a variety of phrases, which are implemented by the subclasses of PhraseDescriptor. A_Phrase is a sub-interface of A_BasicObject, and defines the operations that phrases implement.
Author
Mark van Gulik
Types
Functions
Turn the receiver into an indirection to the specified object.
Utility method for decomposing this object in the debugger.
Retrieve the object's {@linkplain AbstractDescriptor descriptor}.
Answer whether the receiver and the argument, both A_BasicObjects, are equal in value.
{@inheritDoc}
Answer whether the receiver, an object, and the argument, a byte string, are equal in value.
Answer whether the receiver, an object, and the argument, a byte tuple, are equal in value.
Answer whether the arguments, an object and a compiled code, are equal.
Answer whether the receiver equals the argument.
Answer whether the receiver equals the argument.
Determine whether the receiver is an enumeration with the given set of instances.
Answer whether the receiver, an object, and the argument, a fiber type, are equal in value.
Answer whether the receiver, an object, and the argument, a function type, are equal.
Answer whether the receiver equals the argument.
Answer whether this value equals the given list phrase type.
Answer whether the receiver equals the argument.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer whether the receiver equals the argument.
Extract a field from an object.
Extract a field from an object, using a one-based index into the field slots. This requires knowledge of the ObjectLayoutVariant, since the same field is at different indices in different variants.
Extract a field from an object, or answer null if it's not present.
Add or replace a field of an object.
Extract a field type from an object type.
Extract a field type from an object type, using the given field index, which is specific to an ObjectLayoutVariant.
Extract a field type from an object type, or null if it's not present.
Dispatch to the descriptor.
Answer the number of integer slots. All variable integer slots occur following the last fixed integer slot.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
The receiver is marked with an IMMUTABLE descriptor, but its subobjects have not yet been made immutable. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
The receiver is marked with a SHARED descriptor, but its subobjects have not yet been made shared. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer a name suitable for labeling a field containing this object.
Answer the number of object slots in this AvailObject. All variable object slots occur following the last fixed object slot.
Recursively print the receiver to the builder unless it is already present in the recursionMap. Printing will begin at the specified indent level, measured in horizontal tab characters.
Dispatch to the descriptor.
Answer whether the objects occupy the same memory addresses.
Dispatch to the descriptor.
Replace the object's {@linkplain AbstractDescriptor descriptor}.
Dispatch to the descriptor.
Replace my descriptor field with a FillerDescriptor. This blows up for most messages, catching incorrect (all, by definition) further accidental uses of this object.
Answer whether to show value-specific content in the file name for the debugger.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden immutable->mutable references. Only used during makeImmutable.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden shared->unshared references. Only used during makeShared.
Answer the number of variable integer slots in this object. This does not include the fixed integer slots.
Answer the number of variable object slots in this AvailObject. This does not include the fixed object slots.
Properties
Is the receiver an Avail extended integer?
Is the receiver an Avail IntTupleDescriptor? This is conservative, in that some object tuples may only contain ints but not be reported as being int tuples.
Is the receiver an Avail LongTupleDescriptor? This is conservative, in that some object tuples may only contain longs but not be reported as being long tuples.
Is the receiver an Avail two-byte string?
Is the receiver an Avail unsigned byte?
Inheritors
Extensions
Answer the list phrase that provides arguments to this send phrase. If this is a macro invocation, these are the arguments supplied to the macro's output, which must be a send phrase.
Perform the given action for each child phrase of this phrase.
Perform the given transformation for each child phrase of this phrase, writing the result of the transformation back into this phrase. This phrase must be mutable.
Create a new list phrase with the elements of the given list phrase appended to the ones in the receiver.
If the receiver is mutable, make its subobjects immutable and return it. Otherwise, make a mutable copy of the receiver and return it.
Answer the declaration phrase referenced by this variable use phrase. If this phrase is a macro invocation, answer the declaration referenced by the variable use produced by the macro.
Answer the type of the variable, constant, or argument declared by this declaration phrase.
Emit code to push each value produced by the expressions of a list phrase or permuted list phrase.
Emit code to perform the effect of this phrase, leaving the operand stack the same as before these instructions.
Emit code to perform this phrase, leaving its result on the stack.
If this phrase is an assignment, answer the expression that produces the value to assign. If this phrase is an expression-as-statement, answer the expression to treat as a statement. If this phrase is a super-cast, answer the expression that produces the actual value to send. If this phrase is a macro, use the above rules on the output of the macro.
Answer the number of expressions in this list phrase.
Answer the tuple of expressions in this list phrase.
If this phrase is a sequence, take any statements within it that are also sequences, and flatten them all into one sequence, returning the List of statements. Handle first-of-sequence phrases correctly, allowing the resulting structure to be up to two layers deep.
Compile this block phrase into a raw function, recording within it that it was compiled within the given module.
This is an expression acting as an argument, a recursive list phrase of arguments (perhaps permuted), or a super-cast. Answer whether it either is or contains within the recursive list structure a super-cast phrase.
Answer the phrase producing the value to be assigned during initialization of a variabledeclaration. If there is no initialization expression, answer nil.
Answer whether this variable use is the chronologically last time its variable will be used within this block.
Answer whether this phrase is a macro substitution phrase.
Extract the last expression of this [listListPhraseDescriptor phrase. The client must ensure there is at least one, and that this is a list phrase.
This module constant's actual value, or this module variable's actual variable.
Answer a marker phrase's marker value, which can be any AvailObject.
The tuple of declaration phrases accessed by this block phrase. This value is set during code generation, even if the block phrase is immutable. It should not be made visible to the Avail language.
The phrase that this macro phrase generated to use as its replacement.
Answer the permutation from a permutation list phrase. The permutation is a tuple of integers between 1 and the number of elements, where each value occurs exactly once, and the tuple is not in ascending order.
Return the phrase's expression type, which is the type of object that will be produced by this phrase.
Answer this phrase's PhraseKind.
Test whether this phrase has a PhraseKind that is equal to or a subkind of the given PhraseKind.
Answer this block phrase's starting line number in the source.
If this is a super cast phrase, then answer the type by which this argument should be looked up. If it is not and does not contain a super cast phrase in its recursive list phrase structure, then answer bottom. Otherwise create a (recursive) tuple type where elements that are supercasts provide their lookup types and the rest provide bottom.
Answer the token which was used in the construction of a variable use phrase, a declaration phrase, a literal, or a macro that resolves to one of those.
Validate this phrase without also visiting its subphrases.
Answer the variable use phrase that is used by this reference or assignment.