Boost spirit lex write token value back to input stream
问题 I'm wondering if there's a way in boost::spirit::lex to write a token value back to the input stream (possibly after editing) and rescanning again. What I'm basically looking for is a functionality like that offered by unput() in Flex. Thanks! 回答1: Sounds like you just want to accept tokens in different orders but with the same meaning. Without further ado, here is a complete sample that shows how this would be done, exposing the identifier regardless of input order. Output: Input 'abc('