ROSE 2.15.0
Loading...
Searching...
No Matches
DescriptorParser.h
1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_DescriptorParser_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_DescriptorParser_H
3
4#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/BasicTypes.h>
5#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics/SValue.h>
6
7#include <cstddef>
8#include <string>
9#include <vector>
10
11namespace Rose {
12namespace BinaryAnalysis {
13namespace InstructionSemantics {
14
16
23 ValueKind kind = ValueKind::Invalid;
24 std::string descriptor;
25
26 bool isVoid() const {
27 return kind == ValueKind::Invalid && descriptor == "V";
28 }
29
30 bool isReference() const {
31 return kind == ValueKind::ObjectReference ||
32 kind == ValueKind::ArrayReference;
33 }
34
35 bool isCategory2() const {
36 return kind == ValueKind::Integer64 ||
37 kind == ValueKind::Float64;
38 }
39};
40
43 std::vector<DescriptorType> arguments;
44 DescriptorType returnType;
45
50 size_t argumentSlotCount() const;
51};
52
55public:
57 static DescriptorType parseFieldDescriptor(const std::string&);
58
60 static MethodDescriptor parseMethodDescriptor(const std::string&);
61
62private:
64 static DescriptorType parseType(const std::string&, size_t &pos, bool allowVoid);
65};
66
67} // namespace InstructionSemantics
68} // namespace BinaryAnalysis
69} // namespace Rose
70
71#endif
Parser for JVM field and method descriptors.
static DescriptorType parseFieldDescriptor(const std::string &)
Parse one complete JVM field descriptor.
static MethodDescriptor parseMethodDescriptor(const std::string &)
Parse one complete JVM method descriptor.
ValueKind
Kind of an SValue for emulating JVM and CIL instructions.
Definition SValue.h:28
The ROSE library.
size_t argumentSlotCount() const
Number of local-variable slots occupied by explicit arguments.