Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 582493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:41:33+00:00 2026-05-13T14:41:33+00:00

I have figured out how to use spirit — i.e., I have written a

  • 0

I have figured out how to use spirit — i.e., I have written a moderately complex grammar. I always take the approach of growing a program — one subsystem at a time. I’ve written the data structures for a complex model which has 4 types at the highest level.

I would like to use the grammar composed from rules approach to parse the top level types one type at a time — i.e., I want to write 4 grammars with one top level grammar. If this is possible (which I am beginning to doubt), could someone please post a snippet or a reference to a project that does this.

One top level grammar with 50+ (possible a lot more) rules (for proper error handling) does not sound like fun (TMP code is volatile / slow to compile, and provides useless error messages).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:41:34+00:00Added an answer on May 13, 2026 at 2:41 pm

    simplified from an actual program, Qi should work the same as Karma.

    template<class Iter>
    struct subgrammar_1
    : karma::grammar<Iter, ...>
    {
        ...
    }
    
    template<class Iter>
    struct top_level_grammar
    : karma::grammar<Iter, ...>
    {
        top_level_grammar() : top_level_grammar::base_type(start)
        {
            start %= r1 | r2;
        }
        karma::rule<Iter, ...> r1;
        subgrammar_1<Iter> r2;
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have figured out that I can use hibernate to get the sum of
New to magento here, I have figured out how to use my local.xml to
Thanks to the answers I have figured out that I am unable to use
I have finally figured out how to use the apple Reachability files, which is
I am fairly new to databases and have just figured out how to use
I have figured out that I must use ioctl. There are similar questions here:
I am new to powershell and have figured out how to use it to
I use node.js with the express framework and I have figured out how the
I have been trying to figure out why and how to use performSelector. I
I'm trying to figure out why I would use a grid system. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.