aas-core3.1 0.0.1-alpha.1
Manipulate, verify and de/serialize asset administration shells V3.1 in C++.
Loading...
Searching...
No Matches
revm.hpp
Go to the documentation of this file.
1#ifndef AAS_CORE_AAS_3_1_REVM_GUARD_
2#define AAS_CORE_AAS_3_1_REVM_GUARD_
3
4// This code has been automatically generated by aas-core-codegen.
5// Do NOT edit or append.
6
7#pragma warning(push, 0)
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12#pragma warning(pop)
13
14namespace aas_core {
15namespace aas_3_1 {
16
36namespace revm {
37
38enum class InstructionKind : std::uint8_t {
39 Char,
40 Set,
41 NotSet,
42 Any,
43 Match,
44 Jump,
45 Split,
46 End
47};
48
53 // NOTE (mristin):
54 // We avoid RTTI for performance reasons, and use our own enumerator instead.
55 virtual InstructionKind kind() const = 0;
56
57 virtual ~Instruction() = default;
58};
59
68 wchar_t character;
69
70 explicit InstructionChar(wchar_t a_character);
71 InstructionKind kind() const override;
72 ~InstructionChar() override = default;
73};
74
75std::string to_string(const InstructionChar& instruction);
76
80struct Range {
81 wchar_t first;
82 wchar_t last;
83
84 Range(wchar_t a_first, wchar_t a_last);
85};
86
87std::string to_string(const Range& range);
88
95 const std::vector<Range>& ranges,
96 wchar_t character
97);
98
107 std::vector<Range> ranges;
108
109 explicit InstructionSet(std::vector<Range> a_ranges);
110 InstructionKind kind() const override;
111 ~InstructionSet() override = default;
112};
113
114std::string to_string(const InstructionSet& instruction);
115
124 std::vector<Range> ranges;
125
126 explicit InstructionNotSet(std::vector<Range> a_ranges);
127 InstructionKind kind() const override;
128 ~InstructionNotSet() override = default;
129};
130
131std::string to_string(const InstructionNotSet& instruction);
132
137 InstructionKind kind() const override;
138 ~InstructionAny() override = default;
139};
140
141std::string to_string(const InstructionAny&);
142
147 InstructionKind kind() const override;
148 ~InstructionMatch() override = default;
149};
150
151std::string to_string(const InstructionMatch&);
152
157 size_t target;
158
159 explicit InstructionJump(size_t a_target);
160 InstructionKind kind() const override;
161 ~InstructionJump() override = default;
162};
163
164std::string to_string(const InstructionJump& instruction);
165
173
174 explicit InstructionSplit(size_t a_first_target, size_t a_second_target);
175 InstructionKind kind() const override;
176 ~InstructionSplit() override = default;
177};
178
179std::string to_string(const InstructionSplit& instruction);
180
185 InstructionKind kind() const override;
186 ~InstructionEnd() override = default;
187};
188
189std::string to_string(const InstructionEnd&);
190
191std::string to_string(const Instruction& instruction);
192
193std::string to_string(
194 const std::vector<std::unique_ptr<Instruction> >& instructions
195);
196
201bool Match(
202 const std::vector<std::unique_ptr<Instruction> >& program,
203 const std::wstring& text
204);
205
206} // namespace revm
209} // namespace aas_3_1
210} // namespace aas_core
211
212// This code has been automatically generated by aas-core-codegen.
213// Do NOT edit or append.
214
215#endif // AAS_CORE_AAS_3_1_REVM_GUARD_
InstructionKind
Definition revm.hpp:38
std::string to_string(const InstructionChar &instruction)
bool CharacterInRanges(const std::vector< Range > &ranges, wchar_t character)
Definition common.hpp:50
InstructionKind kind() const override
InstructionKind kind() const override
wchar_t character
Definition revm.hpp:68
InstructionKind kind() const override
InstructionKind kind() const override
size_t target
Definition revm.hpp:157
InstructionKind kind() const override
InstructionNotSet(std::vector< Range > a_ranges)
InstructionKind kind() const override
std::vector< Range > ranges
Definition revm.hpp:124
std::vector< Range > ranges
Definition revm.hpp:107
InstructionKind kind() const override
InstructionSet(std::vector< Range > a_ranges)
size_t second_target
Definition revm.hpp:172
size_t first_target
Definition revm.hpp:171
InstructionKind kind() const override
InstructionSplit(size_t a_first_target, size_t a_second_target)
virtual InstructionKind kind() const =0
Definition revm.hpp:80
wchar_t last
Definition revm.hpp:82
wchar_t first
Definition revm.hpp:81
Range(wchar_t a_first, wchar_t a_last)