Struct panopticon_core::disassembler::State [] [src]

pub struct State<A: Architecture> {
    pub address: u64,
    pub tokens: Vec<A::Token>,
    pub groups: Vec<(String, u64)>,
    pub mnemonics: Vec<Mnemonic>,
    pub jumps: Vec<(u64, Rvalue, Guard)>,
    pub configuration: A::Configuration,
    // some fields omitted

Disassembler state. This struct passes data about matched tokes from the Disassembler to the semantic function. The function also uses the type to pass back recognized mnemonics and jumps. See [Disassembler].


Start of the token sequence

Matched tokens

Extracted capture groups

Mnemonics recognized in the token sequence

Jumps/branches originating from the recognized mnemonics

Current CPU state


impl<A: Architecture> State<A>


Create a new State for a token sequence starting at a.


Returns the value of capture group n.


Panics if no such capture group was defined.


Returns true if capture group n was defined.


Append a new mnemonic. The mnemonic starts after the end of the last, or the start of the matched token sequence if it is the first. The new mnemonic n will be len bytes in size. Arguments for the mnemonic are given in ops and formatted according to fmt. The function f is called with the current CPU state and expected to return the IL statementes that implement the mnemonic.


Append a new mnemonic Same a mnemonic but with f returning the mnemonic IL and the arguments.


Append a jump/branch from the end of the last mnemonic to v, guarded by g.


Append a jump/branch from origin to v, guarded by g.

Trait Implementations

impl<A: Architecture> From<State<A>> for Match<A>


Performs the conversion.

impl<A: Debug + Architecture> Debug for State<A> where
    A::Token: Debug,
    A::Configuration: Debug


Formats the value using the given formatter. Read more

impl<A: Clone + Architecture> Clone for State<A> where
    A::Token: Clone,
    A::Configuration: Clone


Returns a copy of the value. Read more


Performs copy-assignment from source. Read more