I’m newbie in boost. I have string delimeted with tab ( ‘\t’ ).
How can i parse it with boost::spirit?
I’m newbie in boost. I have string delimeted with tab ( ‘\t’ ). How
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The boost sample code isn’t the same as the actual boost sample, which was comma delimited, so presumably there are your modifications?
The ascii::space parser will handle the tabs for you as delimiters, so something like:
Should work (minus the ‘
lit('\t')‘). But, this will also parse other spacing characters (e.g. space, tab).If you actually need there to explicitly be single tabs ONLY between the terms, then leave in the
lit('\t')and wrap it in alexeme[]to disable skipping by the skip parser.