ROSE  0.11.145.0
Rose/BinaryAnalysis/Unparser/Jvm.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_Jvm_H
2 #define ROSE_BinaryAnalysis_Unparser_Jvm_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/Unparser/Base.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace Unparser {
11 
12 std::string unparseJvmMnemonic(SgAsmJvmInstruction*);
13 std::string unparseJvmExpression(SgAsmExpression*, const LabelMap*, RegisterDictionaryPtr);
14 
16 struct JvmSettings: public Settings {};
17 
19 class Jvm: public Base {
20  JvmSettings settings_;
21 
22 protected:
23  explicit Jvm(const JvmSettings &settings)
24  : settings_(settings) {}
25 
26 public:
27  ~Jvm() {}
28 
29  static Ptr instance(const JvmSettings &settings = JvmSettings()) {
30  return Ptr(new Jvm(settings));
31  }
32 
33  Ptr copy() const override {
34  return instance(settings());
35  }
36 
37  const JvmSettings& settings() const override { return settings_; }
38  JvmSettings& settings() override { return settings_; }
39 
40 protected:
41  void emitInstructionMnemonic(std::ostream&, SgAsmInstruction*, State&) const override;
42  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
43 
44 private:
45  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
46 };
47 
48 } // namespace
49 } // namespace
50 } // namespace
51 
52 #endif
53 #endif
Base class for machine instructions.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Represents one JVS machine instruction.
Main namespace for the ROSE library.
Settings that control unparsing.
Base class for expressions.