ROSE  0.11.31.0
BinaryUnparserX86.h
1 #ifndef ROSE_BinaryAnalysis_UnparserX86_H
2 #define ROSE_BinaryAnalysis_UnparserX86_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 X86Settings: public Settings {};
13 
14 class X86: public Base {
15  X86Settings settings_;
16 
17 protected:
18  explicit X86(const X86Settings &settings)
19  : settings_(settings) {}
20 
21 public:
22  static Ptr instance(const X86Settings &settings = X86Settings()) {
23  return Ptr(new X86(settings));
24  }
25 
26  Ptr copy() const ROSE_OVERRIDE {
27  return instance(settings());
28  }
29 
30  const X86Settings& settings() const ROSE_OVERRIDE { return settings_; }
31  X86Settings& settings() ROSE_OVERRIDE { return settings_; }
32 
33 protected:
34  void emitInstructionMnemonic(std::ostream&, SgAsmInstruction*, State&) const ROSE_OVERRIDE;
35  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const ROSE_OVERRIDE;
36  void emitTypeName(std::ostream&, SgAsmType*, State&) const ROSE_OVERRIDE;
37 
38 private:
39  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
40 };
41 
42 } // namespace
43 } // namespace
44 } // namespace
45 
46 #endif
47 #endif
Base class for machine instructions.
Main namespace for the ROSE library.
Settings that control unparsing.
Base class for expressions.
Base class for binary types.