pub enum Ident {
Named(LocalVarId),
Register(RegisterId),
BitRange(BitRangeFieldId),
Field(FieldId),
Table(TableId),
Global(Box<str>),
}Expand description
A named thing a p-code expression refers to.
Everything but Ident::Global is fully resolved: by the time an
instruction’s AST reaches a consumer, a name has become an index into the
compiled specification. Look identifiers up through the producer’s
specification table — its register table for a RegisterId, bit-range
table for a bit-range field, and so on.
Variants§
Named(LocalVarId)
A temporary declared inside a constructor or macro body — local x:4,
or an assignment to a name that was never declared. Unique within one
decoded instruction; see LocalVarId.
Register(RegisterId)
A machine register, as named by define register.
BitRange(BitRangeFieldId)
A named sub-range of a register, as named by define bitrange.
The producer’s bit-range table gives the parent register and byte
window.
Field(FieldId)
A token, context or global field. In an emitted instruction this is normally already folded to a constant; one surviving here means the decode could not supply a value for it.
Table(TableId)
A sub-table operand. One surviving in an emitted instruction means its sub-constructor exported nothing.
Global(Box<str>)
An identifier absent from the symbol table during Phase 2 parsing. Resolved to the appropriate variant by the Phase 3 resolve pass.