ROSE  0.11.98.0
Unparser/M68k.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_M68k_H
2 #define ROSE_BinaryAnalysis_Unparser_M68k_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Unparser/Base.h>
6 
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 namespace Unparser {
12 
13 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
14 std::string unparseM68kExpression(SgAsmExpression*, const LabelMap*, RegisterDictionaryPtr);
15 
16 struct M68kSettings: public Settings {};
17 
18 class M68k: public Base {
19  M68kSettings settings_;
20 
21 protected:
22  explicit M68k(const M68kSettings &settings)
23  : settings_(settings) {}
24 
25 public:
26  static Ptr instance(const M68kSettings &settings = M68kSettings()) {
27  return Ptr(new M68k(settings));
28  }
29 
30  Ptr copy() const override {
31  return instance(settings());
32  }
33 
34  const M68kSettings& settings() const override { return settings_; }
35  M68kSettings& settings() override { return settings_; }
36 
37 protected:
38  void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
39  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
40 
41 private:
42  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
43 };
44 
45 } // namespace
46 } // namespace
47 } // namespace
48 
49 #endif
50 #endif
Base class for machine instructions.
Main namespace for the ROSE library.
Settings that control unparsing.
Base class for expressions.
Binary analysis.