Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
dae40f2a
Commit
dae40f2a
authored
Jul 05, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add transition_if and unstable_state to FSM DSL
parent
fec1f77c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
libcaf_core/caf/detail/parser/fsm.hpp
libcaf_core/caf/detail/parser/fsm.hpp
+15
-0
libcaf_core/caf/detail/parser/fsm_undef.hpp
libcaf_core/caf/detail/parser/fsm_undef.hpp
+4
-0
No files found.
libcaf_core/caf/detail/parser/fsm.hpp
View file @
dae40f2a
...
@@ -61,6 +61,15 @@
...
@@ -61,6 +61,15 @@
goto s_fin; \
goto s_fin; \
e_##name :
e_##name :
/// Defines a state in the FSM that doesn't check for end-of-input. Unstable
/// states are supposed to contain epsilon transitions only.
#define unstable_state(name) \
CAF_FSM_EVAL_MISMATCH_EC \
} \
{ \
static constexpr auto mismatch_ec = caf::pec::trailing_character; \
s_##name : \
e_##name :
/// Ends the definition of an FSM.
/// Ends the definition of an FSM.
#define fin() \
#define fin() \
...
@@ -238,6 +247,12 @@
...
@@ -238,6 +247,12 @@
#endif // CAF_MSVC
#endif // CAF_MSVC
// Makes a transition into another state if the `statement` is true.
#define transition_if(statement, ...) \
if (statement) { \
transition(__VA_ARGS__) \
}
// Makes an epsiolon transition into another state if the `statement` is true.
// Makes an epsiolon transition into another state if the `statement` is true.
#define epsilon_if(statement, ...) \
#define epsilon_if(statement, ...) \
if (statement) { \
if (statement) { \
...
...
libcaf_core/caf/detail/parser/fsm_undef.hpp
View file @
dae40f2a
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
#undef term_state
#undef term_state
#undef unstable_state
#undef fin
#undef fin
#undef CAF_TRANSITION_IMPL1
#undef CAF_TRANSITION_IMPL1
...
@@ -74,6 +76,8 @@
...
@@ -74,6 +76,8 @@
#undef fsm_epsilon
#undef fsm_epsilon
#undef transition_if
#undef epsilon_if
#undef epsilon_if
#undef fsm_transition_if
#undef fsm_transition_if
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment