aas-core3
1.0.1
Manipulate, verify and de/serialize asset administration shells in C++.
Toggle main menu visibility
Loading...
Searching...
No Matches
include
aas_core
aas_3_0
revm.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2023 aas-core3.0-cpp AUTHORS
2
//
3
// SPDX-License-Identifier: MIT
4
5
#ifndef AAS_CORE_AAS_3_0_REVM_GUARD_
6
#define AAS_CORE_AAS_3_0_REVM_GUARD_
7
8
// This code has been automatically generated by aas-core-codegen.
9
// Do NOT edit or append.
10
11
#pragma warning(push, 0)
12
#include <cstdint>
13
#include <memory>
14
#include <string>
15
#include <vector>
16
#pragma warning(pop)
17
18
namespace
aas_core
{
19
namespace
aas_3_0
{
20
40
namespace
revm
{
41
42
enum class
InstructionKind
: std::uint8_t {
43
Char
,
44
Set
,
45
NotSet
,
46
Any
,
47
Match
,
48
Jump
,
49
Split
,
50
End
51
};
52
56
struct
Instruction
{
57
// NOTE (mristin):
58
// We avoid RTTI for performance reasons, and use our own enumerator instead.
59
virtual
InstructionKind
kind
()
const
= 0;
60
61
virtual
~Instruction
() =
default
;
62
};
63
71
struct
InstructionChar
:
Instruction
{
72
wchar_t
character
;
73
74
explicit
InstructionChar
(
wchar_t
a_character);
75
InstructionKind
kind
()
const override
;
76
~InstructionChar
()
override
=
default
;
77
};
78
79
std::string
to_string
(
const
InstructionChar
& instruction);
80
84
struct
Range
{
85
wchar_t
first
;
86
wchar_t
last
;
87
88
Range
(
wchar_t
a_first,
wchar_t
a_last);
89
};
90
91
std::string
to_string
(
const
Range
& range);
92
98
bool
CharacterInRanges
(
99
const
std::vector<Range>& ranges,
100
wchar_t
character
101
);
102
110
struct
InstructionSet
:
Instruction
{
111
std::vector<Range>
ranges
;
112
113
explicit
InstructionSet
(std::vector<Range> a_ranges);
114
InstructionKind
kind
()
const override
;
115
~InstructionSet
()
override
=
default
;
116
};
117
118
std::string
to_string
(
const
InstructionSet
& instruction);
119
127
struct
InstructionNotSet
:
Instruction
{
128
std::vector<Range>
ranges
;
129
130
explicit
InstructionNotSet
(std::vector<Range> a_ranges);
131
InstructionKind
kind
()
const override
;
132
~InstructionNotSet
()
override
=
default
;
133
};
134
135
std::string
to_string
(
const
InstructionNotSet
& instruction);
136
140
struct
InstructionAny
:
Instruction
{
141
InstructionKind
kind
()
const override
;
142
~InstructionAny
()
override
=
default
;
143
};
144
145
std::string
to_string
(
const
InstructionAny
&);
146
150
struct
InstructionMatch
:
Instruction
{
151
InstructionKind
kind
()
const override
;
152
~InstructionMatch
()
override
=
default
;
153
};
154
155
std::string
to_string
(
const
InstructionMatch
&);
156
160
struct
InstructionJump
:
Instruction
{
161
size_t
target
;
162
163
explicit
InstructionJump
(
size_t
a_target);
164
InstructionKind
kind
()
const override
;
165
~InstructionJump
()
override
=
default
;
166
};
167
168
std::string
to_string
(
const
InstructionJump
& instruction);
169
174
struct
InstructionSplit
:
Instruction
{
175
size_t
first_target
;
176
size_t
second_target
;
177
178
explicit
InstructionSplit
(
size_t
a_first_target,
size_t
a_second_target);
179
InstructionKind
kind
()
const override
;
180
~InstructionSplit
()
override
=
default
;
181
};
182
183
std::string
to_string
(
const
InstructionSplit
& instruction);
184
188
struct
InstructionEnd
:
Instruction
{
189
InstructionKind
kind
()
const override
;
190
~InstructionEnd
()
override
=
default
;
191
};
192
193
std::string
to_string
(
const
InstructionEnd
&);
194
195
std::string
to_string
(
const
Instruction
& instruction);
196
197
std::string
to_string
(
198
const
std::vector<std::unique_ptr<Instruction> >& instructions
199
);
200
205
bool
Match
(
206
const
std::vector<std::unique_ptr<Instruction> >& program,
207
const
std::wstring& text
208
);
209
210
}
// namespace revm
211
212
213
}
// namespace aas_3_0
214
}
// namespace aas_core
215
216
// This code has been automatically generated by aas-core-codegen.
217
// Do NOT edit or append.
218
219
#endif
// AAS_CORE_AAS_3_0_REVM_GUARD_
aas_core::aas_3_0::revm
Definition
revm.hpp:40
aas_core::aas_3_0::revm::Match
bool Match(const std::vector< std::unique_ptr< Instruction > > &program, const std::wstring &text)
aas_core::aas_3_0::revm::CharacterInRanges
bool CharacterInRanges(const std::vector< Range > &ranges, wchar_t character)
aas_core::aas_3_0::revm::InstructionKind
InstructionKind
Definition
revm.hpp:42
aas_core::aas_3_0::revm::InstructionKind::Jump
@ Jump
Definition
revm.hpp:48
aas_core::aas_3_0::revm::InstructionKind::Set
@ Set
Definition
revm.hpp:44
aas_core::aas_3_0::revm::InstructionKind::End
@ End
Definition
revm.hpp:50
aas_core::aas_3_0::revm::InstructionKind::Split
@ Split
Definition
revm.hpp:49
aas_core::aas_3_0::revm::InstructionKind::Char
@ Char
Definition
revm.hpp:43
aas_core::aas_3_0::revm::InstructionKind::Any
@ Any
Definition
revm.hpp:46
aas_core::aas_3_0::revm::InstructionKind::NotSet
@ NotSet
Definition
revm.hpp:45
aas_core::aas_3_0::revm::to_string
std::string to_string(const InstructionChar &instruction)
aas_core::aas_3_0
Definition
common.hpp:51
aas_core
Definition
common.hpp:50
aas_core::aas_3_0::revm::InstructionAny
Definition
revm.hpp:140
aas_core::aas_3_0::revm::InstructionAny::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionAny::~InstructionAny
~InstructionAny() override=default
aas_core::aas_3_0::revm::InstructionChar
Definition
revm.hpp:71
aas_core::aas_3_0::revm::InstructionChar::character
wchar_t character
Definition
revm.hpp:72
aas_core::aas_3_0::revm::InstructionChar::~InstructionChar
~InstructionChar() override=default
aas_core::aas_3_0::revm::InstructionChar::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionChar::InstructionChar
InstructionChar(wchar_t a_character)
aas_core::aas_3_0::revm::InstructionEnd
Definition
revm.hpp:188
aas_core::aas_3_0::revm::InstructionEnd::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionEnd::~InstructionEnd
~InstructionEnd() override=default
aas_core::aas_3_0::revm::InstructionJump
Definition
revm.hpp:160
aas_core::aas_3_0::revm::InstructionJump::target
size_t target
Definition
revm.hpp:161
aas_core::aas_3_0::revm::InstructionJump::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionJump::~InstructionJump
~InstructionJump() override=default
aas_core::aas_3_0::revm::InstructionJump::InstructionJump
InstructionJump(size_t a_target)
aas_core::aas_3_0::revm::InstructionMatch
Definition
revm.hpp:150
aas_core::aas_3_0::revm::InstructionMatch::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionMatch::~InstructionMatch
~InstructionMatch() override=default
aas_core::aas_3_0::revm::InstructionNotSet
Definition
revm.hpp:127
aas_core::aas_3_0::revm::InstructionNotSet::ranges
std::vector< Range > ranges
Definition
revm.hpp:128
aas_core::aas_3_0::revm::InstructionNotSet::InstructionNotSet
InstructionNotSet(std::vector< Range > a_ranges)
aas_core::aas_3_0::revm::InstructionNotSet::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionNotSet::~InstructionNotSet
~InstructionNotSet() override=default
aas_core::aas_3_0::revm::InstructionSet
Definition
revm.hpp:110
aas_core::aas_3_0::revm::InstructionSet::ranges
std::vector< Range > ranges
Definition
revm.hpp:111
aas_core::aas_3_0::revm::InstructionSet::~InstructionSet
~InstructionSet() override=default
aas_core::aas_3_0::revm::InstructionSet::InstructionSet
InstructionSet(std::vector< Range > a_ranges)
aas_core::aas_3_0::revm::InstructionSet::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionSplit
Definition
revm.hpp:174
aas_core::aas_3_0::revm::InstructionSplit::first_target
size_t first_target
Definition
revm.hpp:175
aas_core::aas_3_0::revm::InstructionSplit::InstructionSplit
InstructionSplit(size_t a_first_target, size_t a_second_target)
aas_core::aas_3_0::revm::InstructionSplit::second_target
size_t second_target
Definition
revm.hpp:176
aas_core::aas_3_0::revm::InstructionSplit::kind
InstructionKind kind() const override
aas_core::aas_3_0::revm::InstructionSplit::~InstructionSplit
~InstructionSplit() override=default
aas_core::aas_3_0::revm::Instruction
Definition
revm.hpp:56
aas_core::aas_3_0::revm::Instruction::kind
virtual InstructionKind kind() const =0
aas_core::aas_3_0::revm::Instruction::~Instruction
virtual ~Instruction()=default
aas_core::aas_3_0::revm::Range
Definition
revm.hpp:84
aas_core::aas_3_0::revm::Range::Range
Range(wchar_t a_first, wchar_t a_last)
aas_core::aas_3_0::revm::Range::first
wchar_t first
Definition
revm.hpp:85
aas_core::aas_3_0::revm::Range::last
wchar_t last
Definition
revm.hpp:86
Generated by
1.18.0