natural parse api for std::string

classic Classic list List threaded Threaded
1 message Options
MM
Reply | Threaded
Open this post in threaded view
|

natural parse api for std::string

MM
Hello,

I am being passed a std::string, and I implemented a
mygrammar<Iterator,rule_info_t()> to parse it.

Blanks are not skipped.

What's the natural Iterator to instantiate the grammar and parse with?

rule_info_t f( const std::string& rule )
{
  std::string::const_iterator i                = std::begin(rule);
  const std::string::const_iterator end = std::end(rule);
  rule_info_t result;
  mygrammar<std::string::const_iterator> myparser;

  const bool success = qi::parse( i, end, myparser, result );
  /// post processing
}

Is this the natural way to go about it?

Rds,

MM

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general