Skip to content

Consider adding type erased any_parser (was: Combining parsers at runtime) #218

Open
@rafal-c

Description

@rafal-c

Hi, I couldn't find any examples or documentation regarding combining parsers at runtime. Specifically, in the following scenario:

auto parsers = std::vector {bp::string("A"), bp::string("vector"), bp::string("of"), bp::string("parsers.")};

auto sequence_parser = parsers[0] >> parsers[1] >> parsers[2] >> parsers[3];  // <---- how to do this in general case?

I suspect it might be impossible, given that the sequence elements are part of the template type. In that case, what is the preferred solution here? Calling bp::prefix_parse with each parser in turn?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions