ROSE 0.11.145.147
Tag.h
1#ifndef ROSE_BinaryAnalysis_ModelChecker_Tag_H
2#define ROSE_BinaryAnalysis_ModelChecker_Tag_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_MODEL_CHECKER
5
6#include <Rose/BinaryAnalysis/ModelChecker/BasicTypes.h>
7#include <Rose/Sarif/BasicTypes.h>
8
9namespace Rose {
10namespace BinaryAnalysis {
11namespace ModelChecker {
12
14// Base class
16
23class Tag: public std::enable_shared_from_this<Tag> {
24public:
26 using Ptr = TagPtr;
27
28private:
29 const size_t nodeStep_; // index of the step of the node to which this tag applies
30
31protected:
32 Tag(size_t nodeStep);
33public:
34 virtual ~Tag();
35
36public:
43 size_t nodeStep() const;
44
51 virtual std::string name() const = 0;
52
59 virtual std::string printableName() const = 0;
60
68 virtual void print(std::ostream&, const std::string &prefix) const = 0;
69
76 virtual void toYaml(std::ostream&, const std::string &prefix) const = 0;
77
81 virtual Sarif::ResultPtr toSarif(const Sarif::AnalysisPtr&) const = 0;
82};
83
85// ThrowableTag
87
89struct ThrownTag {
90 Tag::Ptr tag;
91};
92
94// NameTag
96
100class NameTag: public Tag {
101public:
102 using Ptr = NameTagPtr;
103
104protected:
105 const std::string name_;
106
107protected:
108 explicit NameTag(size_t nodeStep, const std::string &name);
109
110public:
114 static Ptr instance(size_t nodeStep, const std::string &name);
115
116public:
117 virtual std::string name() const override;
118 virtual std::string printableName() const override;
119 virtual void print(std::ostream&, const std::string &prefix) const override;
120 virtual void toYaml(std::ostream&, const std::string &prefix) const override;
121 virtual Sarif::ResultPtr toSarif(const Sarif::AnalysisPtr&) const override;
122};
123
124} // namespace
125} // namespace
126} // namespace
127
128#endif
129#endif
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
void print(const StackVariables &, const Partitioner2::PartitionerConstPtr &, std::ostream &out, const std::string &prefix="")
Print info about multiple local variables.
The ROSE library.