Commit f5109d55 authored by Dominik Charousset's avatar Dominik Charousset

Add invoke_fsm utility to FSM DSL

parent 840073d9
...@@ -100,5 +100,19 @@ ...@@ -100,5 +100,19 @@
ps.code = error_code; \ ps.code = error_code; \
return; return;
// Makes an unconditional epsiolon transition into another state.
#define epsilon(target) goto e_##target; #define epsilon(target) goto e_##target;
// Makes an epsiolon transition into another state if the `statement` is true.
#define checked_epsilon(statement, target) \
if (statement) \
goto e_##target;
// Transitions into the `target` FSM.
#define invoke_fsm(fsm_call, target) \
fsm_call; \
if (ps.code > ec::trailing_character) \
return; \
ch = ps.current(); \
goto s_##target;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment