Flow123d
JS_before_hm-2074-g7860a8b45
|
#include <comment_filter.hh>
Public Member Functions | |
BOOST_IOSTREAMS_FSM (uncommenting_fsm) inline void slash_and_push(char ch) | |
Public Member Functions inherited from boost::iostreams::finite_state_machine< uncommenting_fsm > | |
void | imbue (const std::locale &loc) |
const std::locale & | getloc () const |
Static Public Attributes | |
static const int | no_comment = initial_state |
static const int | one_slash = initial_state + 1 |
static const int | one_line_comment = initial_state + 2 |
static const int | multi_line_comment = initial_state + 3 |
static const int | star_in_comment = initial_state + 4 |
static const int | no_comment_bsl = initial_state + 5 |
static const int | in_quote = initial_state + 6 |
static const int | in_quote_bsl = initial_state + 7 |
Static Public Attributes inherited from boost::iostreams::finite_state_machine_base | |
static const int | initial_state = 0 |
Additional Inherited Members | |
Protected Member Functions inherited from boost::iostreams::finite_state_machine< uncommenting_fsm > | |
finite_state_machine () | |
bool | empty () const |
void | push (char c) |
char_type | pop () |
char_type & | top () |
void | clear () |
void | on_eof () |
void | skip (char_type) |
void | on_any (char_type) |
This structure implements a finite state machine for filtering comments of the input file. The comment starts with '#' at any place save in quotas and after backslash. The comment ends be fors non-backslashed end of line. Backslashed end of line consists of the backslash, any sequence of whitespaces
We assume, that json parser use backslash as an escape character, so we also have to escape any special meaning of the next character, but we keep backslash on the place.
Don't ask me for syntactic bloat. This struct has to define transition_table
of the FSM. Access to the rules is provided by methods derived from io::finite_state_machine
. Then the FSM is used to implement filter.
Definition at line 41 of file comment_filter.hh.
Definition at line 45 of file comment_filter.hh.
Declaration of rules of the FSM.
Definition at line 96 of file comment_filter.hh.
|
inline |
Definition at line 42 of file comment_filter.hh.
|
static |
Definition at line 56 of file comment_filter.hh.
|
static |
Definition at line 57 of file comment_filter.hh.
|
static |
Definition at line 53 of file comment_filter.hh.
|
static |
Declaration of all states of FSM.
Definition at line 50 of file comment_filter.hh.
|
static |
Definition at line 55 of file comment_filter.hh.
|
static |
Definition at line 52 of file comment_filter.hh.
|
static |
Definition at line 51 of file comment_filter.hh.
|
static |
Definition at line 54 of file comment_filter.hh.