pub struct HighLevelILTokenEmitter { /* private fields */ }
Implementations§
source§impl HighLevelILTokenEmitter
impl HighLevelILTokenEmitter
sourcepub fn current_tokens(&self) -> Array<InstructionTextToken>
pub fn current_tokens(&self) -> Array<InstructionTextToken>
Returns the list of InstructionTextToken
on the current line.
sourcepub fn lines(&self) -> Array<DisassemblyTextLine>
pub fn lines(&self) -> Array<DisassemblyTextLine>
Returns the list of DisassemblyTextLine
in the output.
pub fn prepend_collapse_blank_indicator(&self)
pub fn prepend_collapse_indicator( &self, context: InstructionTextTokenContext, hash: u64, )
pub fn has_collapsible_regions(&self) -> bool
pub fn set_has_collapsible_regions(&self, state: bool)
pub fn append(&self, token: InstructionTextToken)
sourcepub fn increase_indent(&self)
pub fn increase_indent(&self)
Increases the indentation level by one.
sourcepub fn decrease_indent(&self)
pub fn decrease_indent(&self)
Decreases the indentation level by one.
sourcepub fn scope_separator(&self)
pub fn scope_separator(&self)
Indicates that visual separation of scopes is desirable at the current position.
By default, this will insert a blank line, but this can be configured by the user.
sourcepub fn begin_scope(&self, ty: ScopeType)
pub fn begin_scope(&self, ty: ScopeType)
Begins a new scope. Insertion of newlines and braces will be handled using the current settings.
sourcepub fn end_scope(&self, ty: ScopeType)
pub fn end_scope(&self, ty: ScopeType)
Ends the current scope.
The type ty
should be equal to what was passed to HighLevelILTokenEmitter::begin_scope
.
sourcepub fn scope_continuation(&self, force_same_line: bool)
pub fn scope_continuation(&self, force_same_line: bool)
Continues the previous scope with a new associated scope. This is most commonly used for else statements.
If force_same_line
is true, the continuation will always be placed on the same line as the previous scope.
sourcepub fn finalize_scope(&self)
pub fn finalize_scope(&self)
Finalizes the previous scope, indicating that there are no more associated scopes.
sourcepub fn no_indent_for_this_line(&self)
pub fn no_indent_for_this_line(&self)
Forces there to be no indentation for the next line.
sourcepub fn begin_force_zero_confidence(&self)
pub fn begin_force_zero_confidence(&self)
Begins a region of tokens that always have zero confidence.
sourcepub fn end_force_zero_confidence(&self)
pub fn end_force_zero_confidence(&self)
Ends a region of tokens that always have zero confidence.
sourcepub fn set_current_expr(
&self,
expr: TokenEmitterExpr,
) -> CurrentTokenEmitterExpr
pub fn set_current_expr( &self, expr: TokenEmitterExpr, ) -> CurrentTokenEmitterExpr
Sets the current expression. Returning the CurrentTokenEmitterExpr
which when dropped
will restore the previously active TokenEmitterExpr
.
sourcepub fn append_open_paren(&self)
pub fn append_open_paren(&self)
Appends (
.
sourcepub fn append_close_paren(&self)
pub fn append_close_paren(&self)
Appends )
.
sourcepub fn append_open_bracket(&self)
pub fn append_open_bracket(&self)
Appends [
.
sourcepub fn append_close_bracket(&self)
pub fn append_close_bracket(&self)
Appends ]
.
sourcepub fn append_open_brace(&self)
pub fn append_open_brace(&self)
Appends {
.
sourcepub fn append_close_brace(&self)
pub fn append_close_brace(&self)
Appends }
.
sourcepub fn append_semicolon(&self)
pub fn append_semicolon(&self)
Appends ;
.
sourcepub fn set_brace_requirement(&self, required: BraceRequirement)
pub fn set_brace_requirement(&self, required: BraceRequirement)
Sets the requirement for insertion of braces around scopes in the output.
sourcepub fn set_braces_around_switch_cases(&self, braces: bool)
pub fn set_braces_around_switch_cases(&self, braces: bool)
Sets whether cases within switch statements should always have braces around them.
sourcepub fn set_default_braces_on_same_line(&self, same_line: bool)
pub fn set_default_braces_on_same_line(&self, same_line: bool)
Sets whether braces should default to being on the same line as the statement that begins the scope.
If the user has explicitly set a preference, this setting will be ignored and the user’s preference will be used instead.
sourcepub fn set_simple_scope_allowed(&self, allowed: bool)
pub fn set_simple_scope_allowed(&self, allowed: bool)
Sets whether omitting braces around single-line scopes is allowed.
pub fn brace_requirement(&self) -> BraceRequirement
pub fn has_braces_around_switch_cases(&self) -> bool
pub fn default_braces_on_same_line(&self) -> bool
pub fn is_simple_scope_allowed(&self) -> bool
sourcepub fn append_size_token(&self, size: usize, ty: InstructionTextTokenType)
pub fn append_size_token(&self, size: usize, ty: InstructionTextTokenType)
Appends a size token for the given size in the High Level IL syntax.
sourcepub fn append_float_size_token(&self, size: usize, ty: InstructionTextTokenType)
pub fn append_float_size_token(&self, size: usize, ty: InstructionTextTokenType)
Appends a floating point size token for the given size in the High Level IL syntax.
sourcepub fn append_var_text_token(
&self,
func: &HighLevelILFunction,
var: Variable,
expr_index: usize,
size: usize,
)
pub fn append_var_text_token( &self, func: &HighLevelILFunction, var: Variable, expr_index: usize, size: usize, )
Appends tokens for access to a variable.
sourcepub fn append_integer_text_token(
&self,
func: &HighLevelILFunction,
expr_index: usize,
val: i64,
size: usize,
)
pub fn append_integer_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, )
Appends tokens for a constant integer value.
sourcepub fn append_array_index_token(
&self,
func: &HighLevelILFunction,
expr_index: usize,
val: i64,
size: usize,
address: Option<u64>,
)
pub fn append_array_index_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, address: Option<u64>, )
Appends tokens for accessing an array by constant index.
sourcepub fn append_pointer_text_token(
&self,
func: &HighLevelILFunction,
expr_index: usize,
val: i64,
settings: &DisassemblySettings,
symbol_display: SymbolDisplayType,
precedence: OperatorPrecedence,
allow_short_string: bool,
) -> SymbolDisplayResult
pub fn append_pointer_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, settings: &DisassemblySettings, symbol_display: SymbolDisplayType, precedence: OperatorPrecedence, allow_short_string: bool, ) -> SymbolDisplayResult
Appends tokens for displaying a constant pointer value.
If allow_short_string
is true, then a string will be shown even if it is “short”.
sourcepub fn append_constant_text_token(
&self,
func: &HighLevelILFunction,
expr_index: usize,
val: i64,
size: usize,
settings: &DisassemblySettings,
precedence: OperatorPrecedence,
)
pub fn append_constant_text_token( &self, func: &HighLevelILFunction, expr_index: usize, val: i64, size: usize, settings: &DisassemblySettings, precedence: OperatorPrecedence, )
Appends tokens for a constant value.