/*
Copyright (C) 2018 de4dot@gmail.com
This file is part of Iced.
Iced is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Iced is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Iced. If not, see .
*/
#if (!NO_GAS_FORMATTER || !NO_INTEL_FORMATTER || !NO_MASM_FORMATTER || !NO_NASM_FORMATTER) && !NO_FORMATTER
namespace Iced.Intel {
///
/// Formats decoded instructions
///
public abstract class Formatter {
///
/// Gets the formatter options
///
public abstract FormatterOptions Options { get; }
///
/// Formats the mnemonic and any prefixes
///
/// Instruction
/// Output
public abstract void FormatMnemonic(ref Instruction instruction, FormatterOutput output);
///
/// Gets the number of operands that will be formatted. A formatter can add and remove operands
///
/// Instruction
///
public abstract int GetOperandCount(ref Instruction instruction);
///
/// Formats an operand. This is a formatter operand and not necessarily a real instruction operand.
/// A formatter can add and remove operands.
///
/// Instruction
/// Output
/// Operand number, 0-based. This is a formatter operand and isn't necessarily the same as an instruction operand.
/// See
public abstract void FormatOperand(ref Instruction instruction, FormatterOutput output, int operand);
///
/// Formats an operand separator
///
/// Instruction
/// Output
public abstract void FormatOperandSeparator(ref Instruction instruction, FormatterOutput output);
///
/// Formats all operands
///
/// Instruction
/// Output
public abstract void FormatAllOperands(ref Instruction instruction, FormatterOutput output);
///
/// Formats the whole instruction: prefixes, mnemonic, operands
///
/// Instruction
/// Output
public abstract void Format(ref Instruction instruction, FormatterOutput output);
///
/// Formats the whole instruction: prefixes, mnemonic, operands
///
/// Instruction
/// Output
public void Format(Instruction instruction, FormatterOutput output) => Format(ref instruction, output);
}
}
#endif