3 ms·
Well, an alternative approach might to not to couple parsing and state manipulation :) PEGTL does this. Approximately, you have a template parameter MyAction<>
by nly 10y ago
Well, an alternative approach might to not to couple parsing and state manipulation :)
PEGTL does this. Approximately, you have a template parameter MyAction<> on the Parser<> template which in turn calls "MyAction<Rule>::apply (state)" when parsing of each rule is complete.
It's a fantastic library. I highly recommend giving it a whirl.
[0] https://github.com/ColinH/PEGTL/blob/master/doc/Actions-and-States.md https://github.com/ColinH/PEGTL/blob/master/doc/Actions-and-...