Please provide an example for parsing a file

Open Beginner friendly
#329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
documentation

Research direction

Start by reviewing the existing boost::parser documentation and compare it with the Boost.Spirit X3 file-parsing example shown in the issue. Add a documentation example covering file input, iterator setup, parsing, and the parsed result; done means users can follow the example to parse a file with boost::parser.

Written by the indexing model from the issue text.

Description

In spirit x3 we could use

#include <boost/spirit/include/support_istream_iterator.hpp>

typedef boost::spirit::istream_iterator iterator_t;

std::ifstream stream(file);
iterator_t iterator(stream);

const bool ok = x3::phrase_parse
(
	iterator, iterator_t(),
	<rule>,
	<skipper>,
	<object_to_parse_into>
);

What is your design to do this job in boost::parser now?
The solution should be part of the documentation.

Thanks!

Dominant language
C++
Stars
182
Forks
28
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/parser

All issues in boostorg/parser

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.