ROSE  0.11.98.0
Unparser/Cil.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_Cil_H
2 #define ROSE_BinaryAnalysis_Unparser_Cil_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 unparseCilMnemonic(SgAsmCilInstruction*);
14 std::string unparseCilExpression(SgAsmExpression*, const LabelMap*, RegisterDictionaryPtr);
15 
16 struct CilSettings: public Settings {};
17 
18 class Cil: public Base {
19  CilSettings settings_;
20 
21 protected:
22  explicit Cil(const CilSettings &settings)
23  : settings_(settings) {}
24 
25 public:
26  static Ptr instance(const CilSettings &settings = CilSettings()) {
27  return Ptr(new Cil(settings));
28  }
29 
30  Ptr copy() const override {
31  return instance(settings());
32  }
33 
34  const CilSettings& settings() const override { return settings_; }
35  CilSettings& 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.