Struct gimli::StateMachine
[−]
[src]
pub struct StateMachine<'input, 'header, Endian> where Endian: 'header + Endianity, 'input: 'header {
// some fields omitted
}
Executes a LineNumberProgram
to recreate the matrix mapping to and from
instructions to source locations.
"The hypothetical machine used by a consumer of the line number information to expand the byte-coded instruction stream into a matrix of line number information." -- Section 6.2.1
Methods
impl<'input, 'header, Endian> StateMachine<'input, 'header, Endian> where Endian: Endianity
[src]
fn new(header: &'header LineNumberProgramHeader<'input, Endian>) -> Self
Construct a new StateMachine
for executing line programs and
generating the line information matrix.
fn execute(&mut self, opcode: Opcode<'input>) -> Option<LineNumberRow<'input, 'header, Endian>>
Execute the given opcode, if a new row in the line number matrix is generated, return it.
Unknown opcodes are treated as no-ops.
impl<'input, 'header, Endian> StateMachine<'input, 'header, Endian> where Endian: 'header + Endianity, 'input: 'header
[src]
fn next_row(&mut self) -> ParseResult<Option<LineNumberRow<'input, 'header, Endian>>>
Parse and execute the next opcodes in the line number program until another row in the line number matrix is computed.
The freshly computed row is returned as Ok(Some(row))
. If the matrix
is complete, and there are no more new rows in the line number matrix,
then Ok(None)
is returned. If there was an error parsing an opcode,
then Err(e)
is returned.