Declaration

data class Declaration(val alias: NameInModule?, val phraseIndex: Int)

A declaration of a name. Note that there may be multiple positions involved, such as the Names section of the header, the first mention of the name, or an Alias statement that connects it to another name.

Constructors

Link copied to clipboard
constructor(binaryStream: DataInputStream, moduleNames: List<String>, atomNames: List<String>)

Reconstruct a Declaration from a stream, using the already constructed lists of module names and atom names.

constructor(alias: NameInModule?, phraseIndex: Int)

Properties

Link copied to clipboard

The existing name, if any, that the new name aliases.

Link copied to clipboard

An index into the canonically ordered PhraseNodes in the PhrasePathRecord for this module compilation. That PhraseNode is enough information to identify a region of the module to highlight or select to identify the declaration of the name.

Functions

Link copied to clipboard
fun write(binaryStream: DataOutputStream, moduleNumbering: Map<String, Int>, nameNumbering: Map<String, Int>)

Write this Declaration onto the given DataOutputStream. Use the maps from module name to index and atom name to index for compression. The same maps will be provided in inverse form (as Lists of Strings) during subsequent decoding (via the Declaration constructor taking a DataInputStream and the two lists).