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